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:org.eclipse.emf.emfstore.internal.client.ui.handlers.ProjectPropertiesHandler.java

License:Open Source License

@Override
public void handle() {
    PreferenceDialog propertyDialog = PreferencesUtil.createPropertyDialogOn(getShell(),
            requireSelection(ProjectSpace.class).getProject(), null, null, null);
    if (propertyDialog != null) {
        propertyDialog.open();
    }//from  w ww  .  j  av  a  2 s  .  c  o  m
}

From source file:org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdatesPopup.java

License:Open Source License

private void createRemindSection(Composite parent) {
    remindLink = new Link(parent, SWT.MULTI | SWT.WRAP | SWT.RIGHT);
    updateRemindText();/*from   www  .  j a v  a2 s  .c o m*/
    remindLink.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
                    PreferenceConstants.PREF_PAGE_AUTO_UPDATES, null, null);
            dialog.open();

        }
    });
    remindLink.setLayoutData(new GridData(GridData.FILL_BOTH));
}

From source file:org.eclipse.equinox.p2.tests.ui.dialogs.PreferencePagesTest.java

License:Open Source License

public void testGeneralPage() {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, GENERAL, null, null);
    dialog.setBlockOnOpen(false);//from ww  w  . j  ava 2  s.  c o m
    dialog.open();
    try {
        // nothing yet
    } finally {
        dialog.close();
    }
}

From source file:org.eclipse.equinox.p2.tests.ui.dialogs.PreferencePagesTest.java

License:Open Source License

public void testCopyrightPage() {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, SITES, null, null);
    dialog.setBlockOnOpen(false);/*w w w .j av a2  s.  co  m*/
    dialog.open();
    try {
        // nothing yet
    } finally {
        dialog.close();
    }
}

From source file:org.eclipse.equinox.p2.tests.ui.dialogs.PreferencePagesTest.java

License:Open Source License

public void testLicensePage() {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, AUTOUPDATES, null, null);
    dialog.setBlockOnOpen(false);//from   w  w  w  .  j a  v  a 2s .  c o  m
    dialog.open();
    try {
        // nothing yet
    } finally {
        dialog.close();
    }
}

From source file:org.eclipse.equinox.p2.ui.ProvisioningUI.java

License:Open Source License

/**
 * Open a UI that allows the user to manipulate the repositories.
 * @param shell the shell that should parent the UI
 *//* w  w  w  .jav a  2 s  . c  o m*/
public void manipulateRepositories(Shell shell) {
    if (policy.getRepositoryPreferencePageId() != null) {
        PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell,
                policy.getRepositoryPreferencePageId(), null, null);
        dialog.open();
    } else {
        TitleAreaDialog dialog = new TitleAreaDialog(shell) {
            RepositoryManipulationPage page;

            protected Control createDialogArea(Composite parent) {
                page = new RepositoryManipulationPage();
                page.setProvisioningUI(ProvisioningUI.this);
                page.init(PlatformUI.getWorkbench());
                page.createControl(parent);
                this.setTitle(ProvUIMessages.RepositoryManipulationPage_Title);
                this.setMessage(ProvUIMessages.RepositoryManipulationPage_Description);

                Control control = page.getControl();
                control.setLayoutData(new GridData(GridData.FILL_BOTH));
                return page.getControl();
            }

            protected boolean isResizable() {
                return true;
            }

            protected void okPressed() {
                if (page.performOk())
                    super.okPressed();
            }

            protected void cancelPressed() {
                if (page.performCancel())
                    super.cancelPressed();
            }
        };
        dialog.open();
    }
}

From source file:org.eclipse.flux.ui.integration.handlers.ConfigureHandler.java

License:Open Source License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, PREF_PAGE_ID, null, null);
    return dialog.open();
}

From source file:org.eclipse.gmf.runtime.diagram.ui.internal.dialogs.PageSetupSelectionConfigBlock.java

License:Open Source License

/** 
 * Attach selection handling logic to 'Configure workspace settings' button. 
 *//*from   w  w  w. ja v a 2s .com*/
private void addConfigureWorkspaceSettingsListener() {
    fButtonConfigure.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
            // Display Printing preference page allowing the user to configure global printing settings
            IPreferencePage page = new PrintingPreferencePage(fGlobalStore);
            page.setTitle(ILabels.LABEL_PREFERENCE_PAGE_PRINTING);

            IPreferenceNode targetNode = new PreferenceNode(ID_PAGE_SETUP_PREF_PAGE, page);
            PreferenceManager manager = new PreferenceManager();
            manager.addToRoot(targetNode);

            PreferenceDialog dialog = new PreferenceDialog(fShell, manager);

            dialog.create();
            dialog.setMessage(TITLE_PAGE_SETUP_TAB_ITEM);
            dialog.open();
        }

        public void widgetDefaultSelected(SelectionEvent e) {
            // TODO Auto-generated method stub
        }

    });
}

From source file:org.eclipse.help.ui.internal.ShowCapabilitiesPreferenceAction.java

License:Open Source License

public void run() {
    final Display display = PlatformUI.getWorkbench().getDisplay();
    display.syncExec(new Runnable() {
        public void run() {
            Shell windowShell = null;//w  w  w.  j a v  a  2s  .com
            if (!narrow) {
                Shell[] shells = display.getShells();
                for (int i = 0; i < shells.length; i++) {
                    Object data = shells[i].getData();
                    if (data != null && data instanceof IWorkbenchWindow) {
                        windowShell = shells[i];
                        break;
                    }
                }
            }
            if (windowShell != null) {
                windowShell.forceActive();
                if (Platform.getWS().equals(Platform.WS_WIN32)) {
                    // feature in Windows. Without this code,
                    // the window will only flash in the launch bar.
                    windowShell.setVisible(false);
                    windowShell.setMinimized(true);
                    windowShell.setVisible(true);
                    windowShell.setMinimized(false);
                }
            }
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(windowShell,
                    getCapabilityPageId(), null, null);
            dialog.open();
        }
    });
}

From source file:org.eclipse.help.ui.internal.views.ScopeSetDialog.java

License:Open Source License

private void doEdit() {
    IStructuredSelection ssel = (IStructuredSelection) viewer.getSelection();
    ScopeSet set = (ScopeSet) ssel.getFirstElement();
    if (set == null) {
        return;/*from www  .j  a v  a 2s  . com*/
    }
    PreferenceManager manager = new ScopePreferenceManager(descManager, set);

    if (!localOnly) {
        PreferenceDialog dialog = new ScopePreferenceDialog(getShell(), manager, descManager, set.isEditable());
        dialog.setPreferenceStore(set.getPreferenceStore());
        dialog.create();
        dialog.getShell().setText(NLS.bind(Messages.ScopePreferenceDialog_wtitle, set.getName()));
        dialog.open();
    } else {
        LocalScopeDialog localDialog = new LocalScopeDialog(getShell(), manager, descManager, set);
        localDialog.create();
        localDialog.getShell().setText(NLS.bind(Messages.ScopePreferenceDialog_wtitle, set.getName()));
        localDialog.open();
    }
}