@Override public void registerConfig() { ConfigurationGUISetup setup = new ConfigurationGUISetup() { @Override public void proccess(PreferenceManager mger) { PreferenceNode encryption = new PreferenceNode("compressMac", "Encryption", null, CompressMacPreference.class.getCanonicalName()); PreferenceNode blockCipher = new PreferenceNode("blockcipher", "Block Cipher", null, BlockCipherPreferencePage.class.getCanonicalName()); PreferenceNode streamCipher = new PreferenceNode("streamcipher", "Stream Cipher", null, StreamCipherPreferencePage.class.getCanonicalName()); encryption.add(blockCipher); encryption.add(streamCipher); mger.addToRoot(encryption); } }; PreferenceGUIManager.add(setup); }
private void configureWorkspaceSettings() { String preferenceNodeId = this.getPreferenceNodeId(); IPreferencePage preferencePage = newPreferencePage(); final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(preferenceNode); final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager); BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() { @Override public void run() { dialog.create(); dialog.setMessage(preferenceNode.getLabelText()); dialog.open(); } }); }
/** * Returns an array of the secondary preference nodes. */ public PreferenceNode[] getSecondaryPreferenceNodes() { return new PreferenceNode[] { new PreferenceNode("bicsMenuActions", new ActionContainerPage( local.getString("bicsConnector1"), local.getString("bicsConnector2"), RaptorActionContainer.BicsMenu)), new PreferenceNode("bics", new ConnectorMessageBlockPage("bics")), new PreferenceNode("bics", new BicsRightClickChannelMenu()), new PreferenceNode("bics", new BicsRightClickGamesMenu()), new PreferenceNode("bics", new BicsRightClickPersonMenu()), new PreferenceNode("bics", new ConnectorQuadrantsPage("bics")), new PreferenceNode("bics", new ConnectorQuadrantsPage("bics2")) }; }
/** * Returns an array of the secondary preference nodes. */ public PreferenceNode[] getSecondaryPreferenceNodes() { return new PreferenceNode[] { new PreferenceNode("ficsMenuActions", new ActionContainerPage( local.getString("ficsConn3"), local.getString("ficsConn4"), RaptorActionContainer.FicsMenu)), new PreferenceNode("fics", new ConnectorMessageBlockPage("fics")), new PreferenceNode("fics", new FicsRightClickChannelMenu()), new PreferenceNode("fics", new FicsRightClickGamesMenu()), new PreferenceNode("fics", new FicsRightClickPersonMenu()), new PreferenceNode("fics", new ConnectorQuadrantsPage("fics")), new PreferenceNode("fics", new ConnectorQuadrantsPage("fics2")), }; }
/** * Show a single preference pages * * @param id * - the preference page identification * @param page * - the preference page */ protected void showPreferencePage(String id, IPreferencePage page, final IProject project) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); Shell shell = getControl().getShell(); final PreferenceDialog dialog = project == null ? new PreferenceDialog(shell, manager) : new PropertyDialog(shell, manager, new StructuredSelection(project)); BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
protected PreferenceManager createPreferenceManager() { final PreferenceManager manager = new PreferenceManager(); // Pages creation... final Map<IPageDefinition, PreferenceNode> preferenceNodes = new HashMap<IPageDefinition, PreferenceNode>(); for (final IPageDefinition page : pageDefinitions) { final PreferenceNode preferenceNode = new ConfigurationNode(page, preferences, preferencesCallback); if (page.getParent() != null) { preferenceNodes.get(page.getParent()).add(preferenceNode); } else { manager.addToRoot(preferenceNode); } preferenceNodes.put(page, preferenceNode); } return manager; }
/** * This method allows us to open the preference dialog on the specific page, in this case the perspective page * * @param id * the id of pref page to show * @param page * the actual page to show Copied from org.eclipse.debug.internal.ui.SWTUtil */ public static void showPreferencePage(String id, IPreferencePage page) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(UIUtils.getActiveShell(), manager); BusyIndicator.showWhile(getStandardDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
public void registerPreferenceNodes(PreferenceManager preferenceManager) { String className; //System.out.println("BT AVAIL: " + btAvailable + " and asterisk 1.2: " // + asterisk.getVersion().contains("Asterisk 1.2")); //if (asterisk.supportsRedirectMode() && btAvailable) //TODO fix the detection if (btAvailable) { className = BluetoothPreferencePage.class.getName(); } else { className = BluetoothDisabledPreferencePage.class.getName(); } PreferenceNode bluetoothNode = new PreferenceNode("bluetooth", //$NON-NLS-1$ Messages.getString("BluetoothPreferencePage.title"), null, //$NON-NLS-1$ className); preferenceManager.addToRoot(bluetoothNode); }
/** * load all providers. * * This method loads all provider available. */ public static void initModules() { // prepare to load modules modules = new File("modules"); CommonFunctions.initDir(modules); m = new PF4JModuleLoader(); // put system configuration first ConfigurationGUISetup setup = new ConfigurationGUISetup() { @Override public void proccess(PreferenceManager mger) { PreferenceNode system = new PreferenceNode("system", "System", null, SystemPreferencePage.class.getCanonicalName()); mger.addToRoot(system); } }; PreferenceGUIManager.add(setup); // register the providers AuthManagers.INSTANCE.registerAuthProvider(new ViperfishAuthProvider()); EntryDatabases.INSTANCE.registerEntryDatabaseProvider(new ViperfishEntryDatabaseProvider()); Indexers.INSTANCE.registerIndexerProvider(new ViperfishIndexerProvider()); JournalTransformers.INSTANCE.registerTransformerProvider(new ViperfishEncryptionProvider()); // load third party m.loadModules(modules); }
/** * Show a single preference pages * * @param id * - the preference page identification * @param page * - the preference page */ protected void showPreferencePage(String id, IPreferencePage page) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(getControl() .getShell(), manager); BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
/** * Show a single preference pages * @param id - the preference page identification * @param page - the preference page */ protected void showPreferencePage(String id, IPreferencePage page) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager); BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
/** * Show a single preference pages * * @param id * - the preference page identification * @param page * - the preference page */ protected void showPreferencePage(String id, IPreferencePage page) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager); BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
public void registerPreferenceNodes(PreferenceManager preferenceManager) { String className; className = LwrfPreferencePage.class.getName(); PreferenceNode lwrfNode = new PreferenceNode("lwrf", //$NON-NLS-1$ Messages.getString("LwrfPreferencePage.title"), null, //$NON-NLS-1$ className); preferenceManager.addToRoot(lwrfNode); }
protected void showPreferencePage(String id, IPreferencePage page) { final IPreferenceNode targetNode = new PreferenceNode(id, page); PreferenceManager manager = new PreferenceManager(); manager.addToRoot(targetNode); final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager); BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); dialog.open(); } }); }
public Preferences(Shell parent) { PreferenceManager preferenceManager = new PreferenceManager(); PreferenceNode general = new PreferenceNode("General", new PreferencePageGeneral()); preferenceManager.addToRoot(general); PreferenceNode cmd = new PreferenceNode("Command line", new PreferencePageCmd()); preferenceManager.addToRoot(cmd); preferenceDialog = new PreferenceDialog(parent, preferenceManager); preferenceDialog.setPreferenceStore(preferences); }
/** * @see org.eclipse.jface.action.Action#run() */ @Override public void run() { final PasswordSafeJFace app = PasswordSafeJFace.getApp(); // Create the preference manager PreferenceManager mgr = new PreferenceManager(); // Create the nodes PreferenceNode displayPrefs = new PreferenceNode( "display", Messages.getString("OptionsAction.DisplayNode"), null, DisplayPreferences.class.getName()); //$NON-NLS-1$ //$NON-NLS-2$ PreferenceNode securityPrefs = new PreferenceNode( "security", Messages.getString("OptionsAction.SecurityNode"), null, SecurityPreferences.class //$NON-NLS-1$ //$NON-NLS-2$ .getName()); PreferenceNode passwordPolicyPrefs = new PreferenceNode( "policy", Messages.getString("OptionsAction.PolicyNode"), null, //$NON-NLS-1$ //$NON-NLS-2$ PasswordPolicyPreferences.class.getName()); PreferenceNode usernamePrefs = new PreferenceNode( "username", Messages.getString("OptionsAction.UserNameNode"), null, UsernamePreferences.class //$NON-NLS-1$ //$NON-NLS-2$ .getName()); PreferenceNode miscPrefs = new PreferenceNode( "misc", Messages.getString("OptionsAction.MiscNode"), null, MiscPreferences.class.getName()); //$NON-NLS-1$ //$NON-NLS-2$ // Add the nodes mgr.addToRoot(displayPrefs); mgr.addToRoot(securityPrefs); mgr.addToRoot(passwordPolicyPrefs); mgr.addToRoot(usernamePrefs); mgr.addToRoot(miscPrefs); // Create the preferences dialog PreferenceDialog dlg = new PreferenceDialog(app.getShell(), mgr); Window.setDefaultImage(IOUtils.getImage(PasswordSafeJFace.class, "/org/pwsafe/passwordsafeswt/images/clogo.gif")); //$NON-NLS-1$ // Set the preference store dlg.setPreferenceStore(JFacePreferences.getPreferenceStore()); // Open the dialog dlg.open(); try { if (JFacePreferences.getPreferenceStore().needsSaving()) { // Be Paranoid - Save the preferences now UserPreferences.getInstance().savePreferences(); } } catch (IOException e) { e.printStackTrace(); } }
@Override public PreferenceNode[] getSecondaryPreferenceNodes() { // TODO Auto-generated method stub return null; }
protected void initBics2() { bics2 = new BicsConnector(new BicsConnectorContext() { @Override public String getDescription() { return local.getString("bicsConnector19"); } @Override public String getShortName() { return "bics2"; } }) { /** * Override not needed. */ @Override public PreferencePage getRootPreferencePage() { return null; } /** * Override not needed. */ @Override public PreferenceNode[] getSecondaryPreferenceNodes() { return null; } /** * Override not needed. */ @Override protected void createMenuActions() { } /** * Override the initFics2 method to do nothing to avoid the * recursion. */ @Override protected void initBics2() { } }; }
protected void initFics2() { fics2 = new FicsConnector( new IcsConnectorContext(new IcsParser(false)) { @Override public String getDescription() { return local.getString("ficsConn26"); } @Override public String getShortName() { return "fics2"; } }) { /** * Override not needed. */ @Override public PreferencePage getRootPreferencePage() { return null; } /** * Override not needed. */ @Override public PreferenceNode[] getSecondaryPreferenceNodes() { return null; } /** * Override not needed. */ @Override protected void createMenuActions() { } /** * Override the initFics2 method to do nothing to avoid the * recursion. */ @Override protected void initFics2() { } }; fics2.fics1 = this; }
public PreferencesDialog(Shell parentShell, PreferenceManager manager) { super(parentShell, manager); getPreferenceManager().addToRoot(new PreferenceNode("preferences.mkisofs", "ISO options", ImageUtils.getInstance().loadImageDescriptor("iso.png"), MKISOFSPreferencePage.class.getName())); setPreferenceStore(IOUtils.getInstance().getStore()); }
/** * Returns an array of the secondary preference nodes. */ public PreferenceNode[] getSecondaryPreferenceNodes();