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

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

Introduction

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

Prototype

public int open() 

Source Link

Document

Opens this window, creating it first if it has not yet been created.

Usage

From source file:fr.liglab.adele.cilia.workbench.common.ui.view.repositoryview.RepositoryView.java

License:Apache License

private void onMessageAreaClick() {
    Shell shell = getSite().getShell();//from ww  w  .ja v  a2  s. com
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell, getPreferencePageID(), null,
            null);
    dialog.open();
}

From source file:fr.obeo.dsl.arduino.commands.PreferencesHandler.java

License:Open Source License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    IPreferencePage page = new ArduinoPreferencesPage();
    PreferenceManager manager = new PreferenceManager();
    IPreferenceNode node = new PreferenceNode("0", page);
    manager.addToRoot(node);// ww w  . j av  a  2 s  .  c o  m
    Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(shell, page.getDescription(), null, null);
    if (pref != null)
        pref.open();
    return null;
}

From source file:fr.tpt.aadl.ramses.control.osate.properties.RamsesPropertyPage.java

License:Open Source License

public static boolean openPropertyDialog(IProject project) {
    Shell shell = WorkbenchUtils.getCurrentShell();

    //Instantiate the project propertyPage.
    PreferenceDialog prefDiag = PreferencesUtil.createPropertyDialogOn(shell, project, _PROPERTY_PAGE_ID, null,
            null);//from www. j  a v a 2s.c o m

    // TODO: display the missing informations.

    return prefDiag.open() == Window.OK;
}

From source file:gda.rcp.views.dashboard.actions.DashboardPreferencesAction.java

License:Open Source License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DashboardPreferencePage.ID, null,
            null);//from w w w  . j a  v a  2s.  co m
    if (pref != null)
        pref.open();
    return Boolean.TRUE;
}

From source file:gov.nasa.arc.spife.ui.table.days.preferences.DaysEditorPreferencePageHandler.java

License:Open Source License

@Override
public final Object execute(final ExecutionEvent event) {
    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

    final Shell shell;
    if (activeWorkbenchWindow == null) {
        shell = null;/*  ww w  . j ava 2s . c o  m*/
    } else {
        shell = activeWorkbenchWindow.getShell();
    }

    final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell,
            DaysEditorPreferencePage.PAGE_ID, null, null);
    if (prefDialog != null)
        prefDialog.open();

    return null;
}

From source file:gov.nasa.ensemble.core.plan.editor.merge.action.TableEditorPreferencePageHandler.java

License:Open Source License

@Override
public final Object execute(final ExecutionEvent event) {
    final IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);

    final Shell shell;
    if (activeWorkbenchWindow == null) {
        shell = null;/*from w w  w .jav a  2  s.  c  o  m*/
    } else {
        shell = activeWorkbenchWindow.getShell();
    }

    final PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(shell,
            MergeEditorPreferencePage.PAGE_ID, null, null);
    if (prefDialog != null)
        prefDialog.open();

    return null;
}

From source file:in.cypal.studio.gwt.ui.common.GwtRuntimeComposite.java

License:Apache License

private void addListeners() {
    versionCombo.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            update();//from  w w w . j a v a 2  s. c  o  m
        }
    });

    SelectionAdapter selectionListener = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            update();
        }
    };

    projectSpecificButton.addSelectionListener(selectionListener);
    workspaceDefaultButton.addSelectionListener(selectionListener);

    configureVersionsLink.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
                    new SameShellProvider(versionCombo).getShell(), "gwtVersionsPreferencePage",
                    new String[] { "gwtVersionsPreferencePage", "mainPreferencePage" }, null);
            if (dialog.open() == Window.OK) {
                versionCombo.removeAll();
                initData();
                update();
            }

        }
    });
}

From source file:in.cypal.studio.gwt.ui.wizards.GwtHomeConfirmationPage.java

License:Apache License

public void createControl(Composite parent) {

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(3, false));

    Label locationLabel = new Label(composite, SWT.NONE);
    locationLabel.setText("Location:");

    final Text locationText = new Text(composite, SWT.BORDER);
    locationText.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    locationText.setText(Preferences.getString(Constants.GWT_HOME_PREFERENCE));
    locationText.setEditable(false);// www  .  jav  a 2  s .  c om

    Button setButton = new Button(composite, SWT.PUSH);
    setButton.setText("Set...");
    setButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getContainer().getShell(),
                    "mainPreferencePage", null, null);
            dialog.open();
            locationText.setText(Preferences.getString(Constants.GWT_HOME_PREFERENCE));
            updateStatus();
        }
    });

    setControl(composite);

    if (!Util.isGwtHomeSet())
        setPageComplete(false);
}

From source file:io.sloeber.ui.actions.OpenPreferencesHandler.java

License:Open Source License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    String pageId = event.getParameter(PreferenceUtils.PREFERENCE_PARAMETER1);
    String[] pages = PreferenceUtils.getPreferencePages("io.sloeber"); //$NON-NLS-1$
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell, pageId, pages, null);
    try {// w  ww.java 2  s.c om
        dialog.getTreeViewer().getTree().getItems()[1].setExpanded(true);
    } catch (RuntimeException e) {
        /* swallow */}
    dialog.open();
    return null;
}

From source file:kieker.develop.rl.ui.preferences.AbstractFieldEditorOverlayPage.java

License:Apache License

/**
 * Show a single preference pages./*ww  w  .  ja  va  2s  .co m*/
 *
 * @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(this.getControl().getShell(), manager);
    BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
        @Override
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}