package com.perforce.p4simulink.ui; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; import java.util.Vector; import javax.swing.JComboBox; /** * Copyright (C) 2014 Perforce Software. All rights reserved. * * Please see LICENSE.txt in top-level folder of this distribution. */ public class P4ChangelistSelector extends P4Pane { private JComboBox<String> changelists; /** * Builds a new combo box (drop-down) for picking a changelist out of a list * * @param changelists list of changelist IDs as a vector of strings * @param currentChangelist the currently-selected/used changelist (null or string) */ public P4ChangelistSelector(Vector<String> changelists, String currentChangelist) { changelists = changelists != null ? changelists : new Vector<String>(); changelists.insertElementAt("New", 0); this.changelists = new JComboBox<>(changelists); // if there's a current changelist, pick out the index so we can select it int index = currentChangelist != null ? changelists.indexOf(currentChangelist) : 0; this.changelists.setSelectedIndex(index); } /** * Returns a label and the defined combo box * * @return array of objects that can be added to a JOptionPane */ public Object[] getFields() { List<Object> fields = new ArrayList<>(); fields.add("Changelist ID: "); fields.add(changelists); return fields.toArray(); } /** * Returns the selected changelist. * * @return selected changelist ID as a string */ public String getChangelistId() { return (String) this.changelists.getSelectedItem(); } public boolean selectedNew() { return ((String) this.changelists.getSelectedItem()).equalsIgnoreCase("New"); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#5 | 12023 | Paul Allen | Copying using p4Simulink_dev->main | ||
#4 | 11672 | Paul Allen |
Tidy up formatting and imports. No functional change. |
||
#3 | 11659 | Paul Allen |
Performance improvements, continued: improved performance of getFileState() by replacing the client haveList call with a direct server command. Also improved isLatest by removing fstat calls and replacing with simpler calls to diff and sync. Transferred from p4://perforce.perforce.com:1666@983506 |
||
#2 | 11657 | Paul Allen |
Additional changes from Scania meeting: * Current changelist pane: added description * Started investigation into performance Transferred from p4://perforce.perforce.com:1666@980859 |
||
#1 | 11656 | Paul Allen |
Additional functionality from Scania meeting, including current changelist selector (still needs descriptions added) as well as .p4ignore editor. Transferred from p4://perforce.perforce.com:1666@978388 |