Example usage for org.eclipse.jface.preference PreferenceDialog create

List of usage examples for org.eclipse.jface.preference PreferenceDialog create

Introduction

In this page you can find the example usage for org.eclipse.jface.preference PreferenceDialog create.

Prototype

@Override
    public void create() 

Source Link

Usage

From source file:at.nucle.e4.preferences.example.handler.PreferenceHandler.java

License:Open Source License

@Execute
public void execute(Shell shell, EPreferenceService service) {
    final PreferenceDialog dlg = new PreferenceDialog(shell, service.getPreferenceManager());
    dlg.create();
    dlg.open();//from  ww  w.  jav a2 s. c  o m
}

From source file:at.spardat.xma.guidesign.preferences.AbstractPreferenceAndPropertyPage.java

License:Open Source License

/**
 * Show a single preference pages/*from ww w . jav a 2 s.c om*/
 * 
 * @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();
        }
    });
}

From source file:au.gov.ga.earthsci.application.handlers.ShowPreferencesHandler.java

License:Apache License

@Execute
public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell)
        throws InvocationTargetException, InterruptedException {
    PreferenceManager pm = PreferenceUtil.createLegacyPreferenceManager(context, registry);
    PreferenceDialog dialog = new PreferenceDialog(shell, pm);
    dialog.setPreferenceStore(//w ww  . j a va  2 s  .c  o  m
            new ScopedPreferenceStore(InstanceScope.INSTANCE, PreferenceConstants.QUALIFIER_ID));
    dialog.create();
    dialog.getTreeViewer().setComparator(new ViewerComparator());
    dialog.getTreeViewer().expandAll();
    dialog.open();
}

From source file:com.aliyun.odps.eclipse.create.wizard.NewOdpsProjectWizardPage.java

License:Apache License

public void widgetSelected(SelectionEvent e) {
    if (e.getSource() == linkConfigDefaultConsoleLocation) {
        PreferenceManager manager = new PreferenceManager();
        manager.addToRoot(new PreferenceNode("ODPS Console Directory", new PreferencePageOdpsConsole()));
        PreferenceDialog dialog = new PreferenceDialog(this.getShell(), manager);
        dialog.create();
        dialog.setMessage(CONSOLE_LOCATION_TXT);
        dialog.setBlockOnOpen(true);/*from  w w w .  jav  a  2s  .c o m*/
        dialog.open();
        updateHadoopDirLabelFromPreferences();
    } else if (e.getSource() == btnNewConsoleLocation) {
        DirectoryDialog dialog = new DirectoryDialog(this.getShell());
        dialog.setMessage(CONSOLE_LOCATION_TXT);
        dialog.setText(CONSOLE_LOCATION_TXT);
        String directory = dialog.open();

        if (directory != null) {
            txtNewConsoleLocation.setText(directory);

            if (!validateODPSConoleLocation()) {
                setErrorMessage("No ODPS SDK jar found in specified directory");
            } else {
                setErrorMessage(null);
            }
        }
    } else if (radioNewConsoleLocation.getSelection()) {
        txtNewConsoleLocation.setEnabled(true);
        btnNewConsoleLocation.setEnabled(true);
    } else {
        txtNewConsoleLocation.setEnabled(false);
        btnNewConsoleLocation.setEnabled(false);
    }
    getContainer().updateButtons();
}

From source file:com.aptana.formatter.ui.util.SWTUtil.java

License:Open Source License

/**
 * This method allows us to open the preference dialog on the specific page, in this case the perspective page
 * //from  ww  w .  ja  v  a 2s. com
 * @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();
        }
    });
}

From source file:com.aptana.ide.debug.internal.ui.actions.DetailOptionsActionDelegate.java

License:Open Source License

/**
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 *//*from   w  ww.j  a v a 2  s. c o  m*/
public void run(IAction action) {
    final IPreferenceNode targetNode = new PreferenceNode(
            "com.aptana.ide.debug.ui.preferences.jsDetailFormatters", new JSDetailFormattersPreferencePage()); //$NON-NLS-1$

    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(DebugUiPlugin.getActiveWorkbenchShell(), manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(DebugUiPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
}

From source file:com.aptana.js.debug.ui.internal.actions.DetailOptionsActionDelegate.java

License:Open Source License

/**
 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
 *//* www.  j a va2  s.c  o m*/
public void run(IAction action) {
    final IPreferenceNode targetNode = new PreferenceNode("com.aptana.debug.ui.preferences.jsDetailFormatters", //$NON-NLS-1$
            new JSDetailFormattersPreferencePage());

    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(UIUtils.getActiveShell(), manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(DebugUiPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
}

From source file:com.bdaum.overlayPages.FieldEditorOverlayPage.java

License:Open Source License

/**
 * Show a single preference pages//  w  ww.j a  va2  s . c om
 * 
 * @param id
 *            - the preference page identification
 * @param page
 *            - the preference page
 */
protected void showPreferencePage(final String id, final IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    final PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager);
    BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
        @Override
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}

From source file:com.iw.plugins.spindle.ui.util.UIUtils.java

License:Mozilla Public License

public static boolean showPreferencePage(Shell shell, String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);

    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);/*from   w w  w .  ja  v a  2s .  c o  m*/
    final PreferenceDialog dialog = new PreferenceDialog(shell, manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
    return result[0];
}

From source file:com.liferay.ide.ui.util.SWTUtil.java

License:Open Source License

public static boolean showPreferencePage(String id, Shell shell) {
    PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
    IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage") //$NON-NLS-1$
            .findSubNode(id);/*w  ww  .j  a v a2  s  .c o m*/
    PreferenceManager manager2 = new PreferenceManager();
    manager2.addToRoot(node);
    PreferenceDialog dialog = new PreferenceDialog(shell, manager2);
    dialog.create();
    return (dialog.open() == Window.OK);
}