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:com.cloudbees.eclipse.ui.internal.action.ConfigureCloudBeesAction.java

License:Open Source License

@Override
public void run() {
    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(null,
            "com.cloudbees.eclipse.ui.preferences.GeneralPreferencePage",
            new String[] { "com.cloudbees.eclipse.ui.preferences.JenkinsInstancesPreferencePage",
                    "com.cloudbees.eclipse.ui.preferences.GeneralPreferencePage" },
            null);//from   ww  w  . j a v a  2 s .  c om
    if (pref != null) {
        pref.open();
    }
}

From source file:com.cloudbees.eclipse.ui.internal.commands.ConfigureAccountHandler.java

License:Open Source License

public Object execute(ExecutionEvent event) throws ExecutionException {
    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(null,
            "com.cloudbees.eclipse.ui.preferences.GeneralPreferencePage",
            new String[] { "com.cloudbees.eclipse.ui.preferences.JenkinsInstancesPreferencePage",
                    "com.cloudbees.eclipse.ui.preferences.GeneralPreferencePage" },
            null);/*from  w w  w  . j ava 2  s.c om*/

    if (pref != null) {
        pref.open();
    }

    return null;
}

From source file:com.cloudbees.eclipse.ui.internal.ConfigureSshKeysAction.java

License:Open Source License

@Override
public void run() {
    PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {

        public void run() {
            MessageDialog.openInformation(CloudBeesUIPlugin.getActiveWindow().getShell(), "Configure SSH keys",
                    "In order to access Git or SVN via SSH you need to configure public-private keys.\n\n"
                            + "In the next step the Eclipse SSH preferences page will open. Also in the browser will be open the corresponding 'User settings' configuration page at CloudBees site.\n\n"
                            + "Either load an existing key or generate a new one on the 'Key Management' tab and then copy-paste the public key to the browser into the CloudBees 'User settings/Public Key' field.");
        }//from w w w  . j a va 2 s. c o  m
    });

    PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
            CloudBeesUIPlugin.getActiveWindow().getShell(), "org.eclipse.jsch.ui.SSHPreferences",
            new String[] { "org.eclipse.ui.net.NetPreferences", "org.eclipse.jsch.ui.SSHPreferences" }, null);

    CloudBeesUIPlugin.getDefault().openWithBrowser(GrandCentralService.GC_BASE_URL + "/account/edit");

    if (pref != null) {
        pref.open();
    }
}

From source file:com.cloudbees.eclipse.ui.internal.preferences.GeneralPreferencePage.java

License:Open Source License

private void createGitAccessLink(Composite parent) {
    final Link link = new Link(parent, SWT.NONE);
    //GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    //gd.horizontalSpan=2;
    //link.setLayoutData(gd);

    link.setText(Messages.git_access_reminder);
    link.addSelectionListener(new SelectionAdapter() {
        @Override/*from w  ww .  j av a  2s .c  om*/
        public void widgetSelected(SelectionEvent e) {
            if (e.text.equals("Eclipse SSH page")) {
                PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(
                        CloudBeesUIPlugin.getActiveWindow().getShell(), "org.eclipse.jsch.ui.SSHPreferences",
                        null, null);

                if (pref != null) {
                    pref.open();
                }
            } else if (e.text.equals("CloudBees web")) {
                CloudBeesUIPlugin.getDefault()
                        .openWithBrowser("https://grandcentral." + GrandCentralService.HOST + "/user/keys");
            }
        }
    });

}

From source file:com.cloudsmith.publish.publisher.actions.ShowReducedPreferencePageHandler.java

License:Open Source License

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

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

    final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(shell, displayedIds[0],
            displayedIds, null);
    dialog.open();

    return null;
}

From source file:com.clustercontrol.etc.action.ShowPreferenceAction.java

License:Open Source License

/**
 * Handler execution/*w w  w.ja va 2  s.  c  o  m*/
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    this.window = HandlerUtil.getActiveWorkbenchWindow(event);
    // In case this action has been disposed
    if (null == this.window || !isEnabled()) {
        return null;
    }

    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, null, null, null);
    dialog.open();

    return null;
}

From source file:com.contrastsecurity.ide.eclipse.ui.internal.model.ConfigurationPage.java

License:Open Source License

public ConfigurationPage(final Composite parent, final int style,
        final VulnerabilitiesView vulnerabilitiesView) {
    super(parent, style, vulnerabilitiesView);
    setLayout(new GridLayout());
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    setLayoutData(gd);//ww  w  .j  av a  2s  .c  o  m
    Composite comboComposite = new Composite(this, SWT.NONE);
    comboComposite.setLayout(new GridLayout(2, false));
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    comboComposite.setLayoutData(gd);

    Label textLabel = new Label(comboComposite, SWT.NONE);
    gd = new GridData(SWT.FILL, SWT.FILL, false, false);
    textLabel.setLayoutData(gd);
    textLabel.setText("Contrast is not configured to report to a Team Server");

    final Label preferencesLink = new Label(comboComposite, SWT.NONE);
    gd = new GridData(SWT.END, SWT.FILL, false, false);
    preferencesLink.setLayoutData(gd);
    preferencesLink.setText("Contrast Preferences");
    preferencesLink.setForeground(Constants.LINK_COLOR);
    preferencesLink.addMouseTrackListener(new MouseTrackListener() {

        @Override
        public void mouseHover(MouseEvent e) {
            //
        }

        @Override
        public void mouseExit(MouseEvent e) {
            preferencesLink.setForeground(Constants.LINK_COLOR);
        }

        @Override
        public void mouseEnter(MouseEvent e) {
            preferencesLink.setForeground(Constants.LINK_COLOR_HOVER);
        }
    });
    preferencesLink.addMouseListener(new MouseListener() {

        @Override
        public void mouseUp(MouseEvent e) {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
                    getVulnerabilitiesView().getSite().getShell(), ContrastPreferencesPage.ID, null, null);
            dialog.open();
            vulnerabilitiesView.refreshSdk();
            vulnerabilitiesView.refreshTraces(true);
        }

        @Override
        public void mouseDown(MouseEvent e) {
        }

        @Override
        public void mouseDoubleClick(MouseEvent e) {
        }
    });
}

From source file:com.contrastsecurity.ide.eclipse.ui.internal.views.VulnerabilitiesView.java

License:Open Source License

private void makeActions() {
    openPreferencesPage = new Action() {
        public void run() {
            PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getSite().getShell(),
                    ContrastPreferencesPage.ID, null, null);
            String selectedOrganization = ContrastCoreActivator.getSelectedOrganization();
            dialog.open();
            // check if selected organization has been changed in the dialog
            if (!selectedOrganization.equals(ContrastCoreActivator.getSelectedOrganization())) {
                currentOffset = 0;//from  w  ww  .jav a 2  s .co m
                if (currentTraceFilterForm != null) {
                    currentTraceFilterForm.setServerIds(null);
                    currentTraceFilterForm.setAppVersionTags(null);
                    currentTraceFilterForm.setOffset(currentOffset);
                }
                prefs.put(Constants.APPLICATION_ID, Constants.ALL_APPLICATIONS);
                prefs.put(Constants.TRACE_FILTER_TYPE_APP_VERSION_TAGS, "");
                prefs.putInt(Constants.CURRENT_OFFSET, currentOffset);

                sdk = ContrastCoreActivator.getContrastSDK();
                startRefreshJob();
            }
        }
    };
    openPreferencesPage.setText("Contrast Preferences Page");
    openPreferencesPage.setToolTipText("Open Contrast Preferences Page");
    openPreferencesPage.setImageDescriptor(
            PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
    refreshAction = new Action() {
        public void run() {
            startRefreshJob();
        }
    };
    refreshAction.setText("Refresh");
    refreshAction.setToolTipText("Refresh vulnerabilities from server");
    refreshAction.setImageDescriptor(ContrastUIActivator
            .imageDescriptorFromPlugin(ContrastUIActivator.PLUGIN_ID, "/icons/refresh_tab.gif"));
    doubleClickAction = new Action() {
        public void run() {
            ISelection selection = table.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            dblClickAction(obj);
        }
    };
}

From source file:com.drgarbage.bytecode.jdi.dialogs.SelectDebugTargetDialog.java

License:Apache License

protected Control createCustomArea(Composite parent) {
    Composite area = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = layout.marginHeight = 0;
    layout.numColumns = 2;//from   w  w  w.j a va2  s . c om
    layout.makeColumnsEqualWidth = true;
    area.setLayout(layout);
    area.setLayoutData(new GridData(GridData.FILL_BOTH));

    //second row
    createDebugTargetSelectionTable(area);

    //third row
    //only prompt for immediate build if autobuild is off

    Label lbl = new Label(area, SWT.NONE);
    lbl.setText(MessageFormat.format(BytecodeVisualizerMessages.SelectDebugTargetDialog_text_fileSystemFallback,
            new Object[] { BytecodeVisualizerMessages.SelectDebugTargetDialog_act_Filesystem }));
    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 2;
    lbl.setLayoutData(data);

    Link link = new Link(area, SWT.NONE);
    link.setText(BytecodeVisualizerMessages.SelectDebugTargetDialog_link_adjustPreferences);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 2;
    link.setLayoutData(data);
    link.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            PreferenceDialog prefs = PreferencesUtil.createPreferenceDialogOn(null,
                    BytecodeVisualizerPreferenceConstats.BYTECODE_VISUALIZER_GENERAL_PREFERENCE_PAGE_ID, null,
                    null);
            prefs.open();
        }

    });

    return area;
}

From source file:com.dubture.twig.ui.preferences.TwigBasePreferencePage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {

    initializeDialogUnits(parent);//www  .  j av a2  s .c  o m

    Composite result = new Composite(parent, SWT.NONE);
    GridLayout layout = GridLayoutFactory.fillDefaults().numColumns(1).create();
    result.setLayout(layout);

    Link link = new Link(result, SWT.WRAP);
    link.setText(
            "The Twig Editor shares its settings with the PHP formatter options. See the PHP <a>Code Style</a> preference page to configure it.");
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            String id = "org.eclipse.php.ui.preferences.PHPFormatterPreferencePage";
            PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(getShell(), id,
                    new String[] {}, null);
            preferenceDialog.open();
        }
    });

    GridDataFactory.fillDefaults().grab(true, false).hint(400, SWT.DEFAULT).applyTo(link);

    return result;
}