package com.perforce.p4simulink.ui; /** * Copyright (C) 2014 Perforce Software. All rights reserved. * * Please see LICENSE.txt in top-level folder of this distribution. */ import com.perforce.p4simulink.connection.Config; import javax.swing.JTextArea; import javax.swing.JTextField; import java.util.List; import java.util.ArrayList; public class P4ConnectionPane extends P4Pane { private JTextArea results; private JTextField username; private JTextField server; private JTextField workspace; public P4ConnectionPane(Config config) { if (config == null) { config = new Config(); } username = new JTextField(config.getUser() != null ? config.getUser() : "P4USER"); server = new JTextField(config.getPort() != null ? config.getPort() : "P4PORT"); workspace = new JTextField(config.getClient() != null ? config.getClient() : "P4CLIENT"); results = new JTextArea(""); } public Object[] getFields() { checkNonEmpty(username); checkNonEmpty(server); checkNonEmpty(workspace); List<Object> fields = new ArrayList<>(); fields.add("Server: "); fields.add(server); fields.add("User: "); fields.add(username); fields.add("Workspace: "); fields.add(workspace); if (results.getText() != null && !results.getText().isEmpty()) { fields.add("Results: "); fields.add(results); } return fields.toArray(); } public String getUsername() { return username.getText(); } public String getServer() { return server.getText(); } public String getWorkspace() { return workspace.getText(); } public void setResults(String message) { results.setText(message); } public String toString() { return "USERNAME: " + getUsername() + " HOST: " + getServer() + " CLIENT_ID: " + getWorkspace(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 12023 | Paul Allen | Copying using p4Simulink_dev->main | ||
#6 | 11672 | Paul Allen |
Tidy up formatting and imports. No functional change. |
||
#5 | 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 |
||
#4 | 11652 | Paul Allen |
Added boilerplate to code, fixed build issues (NPEs on plugin load), removed Mathworks classes from plugin jar, fixed delete vs missing issue on remove() call. Transferred from p4://perforce.perforce.com:1666@970498 |
||
#3 | 11648 | Paul Allen |
Final changes after demo with PM, including removal of depot path from the connection dialogue, and fixing of the p4 print issue. Transferred from p4://perforce.perforce.com:1666@958518 |
||
#2 | 11647 | Paul Allen |
New project creation fixes. Transferred from p4://perforce.perforce.com:1666@958305 |
||
#1 | 11645 | Paul Allen |
Refactoring and additional work on UI: Removed Connection class and went with global server/client objects. Implemented panes for connection, depot path and passwords. Passwords are only requested when required. Transferred from p4://perforce.perforce.com:1666@957149 |