public void actionPerformed(ActionEvent arg0) { chooseFolder(); }
public LoginLocalFolderPanel(Frame ownerFrame, HyperlinkActivatedListener hyperlinkListener) { super(new GridBagLayout()); this.ownerFrame = ownerFrame; if (Constants.DEFAULT_PREFERENCES_DIRECTORY.exists()) { this.cockpitHomeFolder = Constants.DEFAULT_PREFERENCES_DIRECTORY; } else { this.cockpitHomeFolder = new File(System.getProperty("user.home")); } this.hyperlinkListener = hyperlinkListener; initGui(); refreshStoredCredentialsTable(); }
loginPassphrasePanel.getPassphrase(), loginPassphrasePanel.getPassword()); } else if (loginMode == LOGIN_MODE_LOCAL_FOLDER) { retrieveCredentialsFromDirectory(loginLocalFolderPanel.getHomeFolder(), loginLocalFolderPanel.getCredentialsFile(), loginLocalFolderPanel.getPassword()); } else if (loginMode == LOGIN_MODE_DIRECT) { String[] inputErrors = loginCredentialsPanel.checkForInputErrors(); } else if (loginMode == LOGIN_MODE_LOCAL_FOLDER) { storeCredentialsInDirectory( loginLocalFolderPanel.getHomeFolder(), loginLocalFolderPanel.getPassword()); } else if (loginMode == LOGIN_MODE_DIRECT) { throw new IllegalStateException("Cannot store credentials from Direct Login panel");
String algorithm = myProperties.getStringProperty("crypto.algorithm", "PBEWithMD5AndDES"); myCredentials.save(password, credentialsFile, algorithm); loginLocalFolderPanel.clearPassword(); loginLocalFolderPanel.refreshStoredCredentialsTable();
private void chooseFolder() { // Prompt user to choose their Cockpit home directory. JFileChooser fileChooser = new JFileChooser(); fileChooser.setAcceptAllFileFilterUsed(true); fileChooser.setDialogTitle("Choose Cockpit Home Folder"); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setApproveButtonText("Choose Folder"); fileChooser.setCurrentDirectory(cockpitHomeFolder); int returnVal = fileChooser.showOpenDialog(ownerFrame); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } else { this.cockpitHomeFolder = fileChooser.getSelectedFile(); this.folderPathTextField.setText(this.cockpitHomeFolder.getAbsolutePath()); refreshStoredCredentialsTable(); } }
add(descriptionLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(folderPathTextField, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); add(browseButton, new GridBagConstraints(1, row++, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); add(accountNicknamesLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(accountNicknamesScrollPane, new GridBagConstraints(0, row++, 2, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(passwordLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); add(passwordPasswordField, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
loginLocalFolderPanel = new LoginLocalFolderPanel(ownerFrame, hyperlinkListener); loginCredentialsPanel = new LoginCredentialsPanel(false, hyperlinkListener);
loginPassphrasePanel.getPassphrase(), loginPassphrasePanel.getPassword()); } else if (loginMode == LOGIN_MODE_LOCAL_FOLDER) { retrieveCredentialsFromDirectory(loginLocalFolderPanel.getHomeFolder(), loginLocalFolderPanel.getCredentialsFile(), loginLocalFolderPanel.getPassword()); } else if (loginMode == LOGIN_MODE_DIRECT) { String[] inputErrors = loginCredentialsPanel.checkForInputErrors(); } else if (loginMode == LOGIN_MODE_LOCAL_FOLDER) { storeCredentialsInDirectory( loginLocalFolderPanel.getHomeFolder(), loginLocalFolderPanel.getPassword()); } else if (loginMode == LOGIN_MODE_DIRECT) { throw new IllegalStateException("Cannot store credentials from Direct Login panel");
String algorithm = myProperties.getStringProperty("crypto.algorithm", "PBEWithMD5AndDES"); myCredentials.save(password, credentialsFile, algorithm); loginLocalFolderPanel.clearPassword(); loginLocalFolderPanel.refreshStoredCredentialsTable();
private void chooseFolder() { // Prompt user to choose their Cockpit home directory. JFileChooser fileChooser = new JFileChooser(); fileChooser.setAcceptAllFileFilterUsed(true); fileChooser.setDialogTitle("Choose Cockpit Home Folder"); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setApproveButtonText("Choose Folder"); fileChooser.setCurrentDirectory(cockpitHomeFolder); int returnVal = fileChooser.showOpenDialog(ownerFrame); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } else { this.cockpitHomeFolder = fileChooser.getSelectedFile(); this.folderPathTextField.setText(this.cockpitHomeFolder.getAbsolutePath()); refreshStoredCredentialsTable(); } }
add(descriptionLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(folderPathTextField, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); add(browseButton, new GridBagConstraints(1, row++, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0)); add(accountNicknamesLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(accountNicknamesScrollPane, new GridBagConstraints(0, row++, 2, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsDefault, 0, 0)); add(passwordLabel, new GridBagConstraints(0, row++, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); add(passwordPasswordField, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
loginLocalFolderPanel = new LoginLocalFolderPanel(ownerFrame, hyperlinkListener); loginCredentialsPanel = new LoginCredentialsPanel(false, hyperlinkListener);
public LoginLocalFolderPanel(Frame ownerFrame, HyperlinkActivatedListener hyperlinkListener) { super(new GridBagLayout()); this.ownerFrame = ownerFrame; if (Constants.DEFAULT_PREFERENCES_DIRECTORY.exists()) { this.cockpitHomeFolder = Constants.DEFAULT_PREFERENCES_DIRECTORY; } else { this.cockpitHomeFolder = new File(System.getProperty("user.home")); } this.hyperlinkListener = hyperlinkListener; initGui(); refreshStoredCredentialsTable(); }
public void actionPerformed(ActionEvent arg0) { chooseFolder(); }