public Object[] getElements(Object parent) { if (defaultPrefs.equals(parent)) return new Object[] {SecurePreferencesFactory.getDefault()}; return new Object[0]; }
public Object[] getElements(Object parent) { if (defaultPrefs.equals(parent)) return new Object[] {SecurePreferencesFactory.getDefault()}; return new Object[0]; }
public void validateSave() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; boolean modified = (root == null) ? false : InternalExchangeUtils.isModified(root); buttonSave.setEnabled(modified); }
public void validateSave() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; boolean modified = (root == null) ? false : InternalExchangeUtils.isModified(root); buttonSave.setEnabled(modified); }
protected void enableButtons() { String moduleID = getSelectedModuleID(); if (moduleID == null) { // nothing selected buttonChangePassword.setEnabled(false); buttonRecoverPassword.setEnabled(false); } else { buttonChangePassword.setEnabled(true); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String path = PASSWORD_RECOVERY_NODE + moduleID; boolean recoveryAvailable = rootNode.nodeExists(path); buttonRecoverPassword.setEnabled(recoveryAvailable); } enableLogout(); }
protected void enableButtons() { String moduleID = getSelectedModuleID(); if (moduleID == null) { // nothing selected buttonChangePassword.setEnabled(false); buttonRecoverPassword.setEnabled(false); } else { buttonChangePassword.setEnabled(true); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String path = PASSWORD_RECOVERY_NODE + moduleID; boolean recoveryAvailable = rootNode.nodeExists(path); buttonRecoverPassword.setEnabled(recoveryAvailable); } enableLogout(); }
/** * Returns location of default storage * @return location of the default storage, might be null */ static public URL defaultStorageLocation() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return null; return ((SecurePreferencesWrapper) defaultStorage).getContainer().getLocation(); }
/** * Returns location of default storage * @return location of the default storage, might be null */ static public URL defaultStorageLocation() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return null; return ((SecurePreferencesWrapper) defaultStorage).getContainer().getLocation(); }
private static ISecurePreferences getSecureServersNode() { return SecurePreferencesFactory.getDefault().node(SonarLintCorePlugin.PLUGIN_ID).node(ServersManager.PREF_SERVERS); }
public void widgetSelected(SelectionEvent e) { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; try { root.flush(); } catch (IOException exception) { Activator.log(IStatus.ERROR, exception.getMessage(), null, exception); } validateSave(); // save could fail so re-check } });
/** * Answer secured preferences which can be used for storing sensitive * information of this tab * * @return default instance of secure preferences for this tab, * <code>null</code> if application was unable to create secure * preferences using default location */ private ISecurePreferences getPreferences(String sectionName) { ISecurePreferences preferences = SecurePreferencesFactory.getDefault(); if (preferences == null) { return null; } return preferences.node(IPDEUIConstants.PLUGIN_ID).node(sectionName); } }
private ISecurePreferences getSecurePreferences() { if (!securePreferencesDisabled.get()) { String serverId = getServerId(); if (serverId != null) { ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault().node( CloudFoundryPlugin.PLUGIN_ID); securePreferences = securePreferences.node(EncodingUtils.encodeSlashes(serverId)); return securePreferences; } } return null; }
private ISecurePreferences getNode() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return null; ISecurePreferences node = root.node(PREFERENCES_CONTEXT); if (getName() != null) return node.node(getName()); return node; }
/** * Closes open default storage, if any, and deletes the actual file. */ static public void defaultStorageDelete() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return; URL location = defaultStorageLocation(); if (location == null) return; // clear the default preferences store from the mapper SecurePreferencesMapper.clearDefault(); // delete the actual file if (StorageUtils.exists(location)) StorageUtils.delete(location); // FUTURE: this is a good place to notify delete listeners }
/** * Closes open default storage, if any, and deletes the actual file. */ static public void defaultStorageDelete() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return; URL location = defaultStorageLocation(); if (location == null) return; // clear the default preferences store from the mapper SecurePreferencesMapper.clearDefault(); // delete the actual file if (StorageUtils.exists(location)) StorageUtils.delete(location); // FUTURE: this is a good place to notify delete listeners }
public void widgetSelected(SelectionEvent e) { String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String[] questions = InternalExchangeUtils.getPasswordRecoveryQuestions(rootNode, moduleID); if (questions.length == 0) return; // no password recovery questions were setup PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID); dialog.open(); enableLogout(); } });
public void widgetSelected(SelectionEvent e) { String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String[] questions = InternalExchangeUtils.getPasswordRecoveryQuestions(rootNode, moduleID); if (questions.length == 0) return; // no password recovery questions were setup PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID); dialog.open(); enableLogout(); } });
public void widgetSelected(SelectionEvent e) { PasswordProviderDescription selectedModule = getSelectedModule(); if (selectedModule == null) return; String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); if (selectedModule.hasHint(InternalExchangeUtils.HINT_PASSWORD_AUTOGEN)) { // do replacement behind the scene without showing the wizard changePassword(rootNode, moduleID, selectedModule.getName(), shell); } else { // show the wizard to provide separate "old" and "new" password entries ChangePasswordWizardDialog dialog = new ChangePasswordWizardDialog(shell, rootNode, moduleID); dialog.open(); } enableLogout(); } });
public void widgetSelected(SelectionEvent e) { PasswordProviderDescription selectedModule = getSelectedModule(); if (selectedModule == null) return; String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); if (selectedModule.hasHint(InternalExchangeUtils.HINT_PASSWORD_AUTOGEN)) { // do replacement behind the scene without showing the wizard changePassword(rootNode, moduleID, selectedModule.getName(), shell); } else { // show the wizard to provide separate "old" and "new" password entries ChangePasswordWizardDialog dialog = new ChangePasswordWizardDialog(shell, rootNode, moduleID); dialog.open(); } enableLogout(); } });
protected void okPressed() { answersText = new String[questionsText.length]; for (int i = 0; i < questionsText.length; i++) { answersText[i] = answers[i].getText(); } String password = InternalExchangeUtils.recoverPassword(answersText, SecurePreferencesFactory.getDefault(), moduleID); if (password == null) { MessageBox prompt = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.YES | SWT.NO); prompt.setText(SecUIMessages.pswdRecoveryTitle); prompt.setMessage(SecUIMessages.pswNotRecoveredMsg); if (prompt.open() == SWT.YES) return; } else { // even in UI case we use digested and encoded password - makes no sense to show it MessageBox prompt = new MessageBox(getShell(), SWT.ICON_INFORMATION | SWT.OK); prompt.setText(SecUIMessages.pswdRecoveryTitle); prompt.setMessage(SecUIMessages.pswRecoveredMsg); prompt.open(); } super.okPressed(); }