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

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

Introduction

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

Prototype

public void setMessage(String newMessage) 

Source Link

Document

Set the message text.

Usage

From source file:org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin.java

License:Open Source License

/**
 * Displays the given preference page.// ww  w .java  2 s.  com
 * 
 * @param id pref page id
 * @param page pref page
 * @deprecated use <code>JDIDebugUIPlugin#showPreferencePage(String pageId)</code>, which uses the <code>PreferenceUtils</code> framework for opening pages.
 */
@Deprecated
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(JDIDebugUIPlugin.getActiveWorkbenchShell(), manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(JDIDebugUIPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
}

From source file:org.eclipse.ocl.common.ui.internal.preferences.AbstractProjectPreferencePage.java

License:Open Source License

/**
 * When the project-specific link is activated, install the project-specific property page.
 */// w ww  . j av  a  2s .  c  o m
final void doLinkActivated(Link link) {
    IPreferencePage page = createClonePage();
    page.setTitle(getTitle());
    final IPreferenceNode targetNode = new PreferenceNode(pluginId, 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:org.eclipse.php.internal.debug.ui.preferences.phps.ShowPHPsPreferences.java

License:Open Source License

protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);

    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);/*from   w  w w.  j a  v  a  2  s .c om*/
    final PreferenceDialog dialog = new PreferenceDialog(PHPDebugUIPlugin.getActiveWorkbenchShell(), manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(PHPDebugUIPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
}

From source file:org.eclipse.php.internal.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// w w  w  . java  2s  .c om
 * 
 * @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(DebugUIPlugin.getShell(), manager);
    BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}

From source file:org.eclipse.ptp.pldt.wizards.wizardPages.AbstractProjectWizardPage.java

License:Open Source License

private void showPreferenceDialog(String type) {
    PreferenceManager mgr = new PreferenceManager();
    IPreferencePage preferencePage = getPreferencePage();
    preferencePage.setTitle(type);//from ww w.  j  av  a 2 s .  c  om
    IPreferenceNode node = new PreferenceNode("1", preferencePage); //$NON-NLS-1$
    mgr.addToRoot(node);
    Shell shell = Display.getCurrent().getActiveShell();
    PreferenceDialog dialog = new PreferenceDialog(shell, mgr);
    dialog.create();
    // must do dialog.create() before setting message
    dialog.setMessage(preferencePage.getTitle());
    dialog.open();
}

From source file:org.eclipse.tcf.internal.debug.ui.launch.setup.WizardLoginPage.java

License:Open Source License

private void openProtocolPreferences(Shell shell, String title) {
    try {//from  w  w  w.jav a2  s  .  co  m
        PreferenceManager mgr = new PreferenceManager();
        IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.ui",
                "preferencePages");
        IExtension[] extensions = point.getExtensions();
        for (int i = 0; i < extensions.length; i++) {
            IConfigurationElement[] e = extensions[i].getConfigurationElements();
            for (int j = 0; j < e.length; j++) {
                String nm = e[j].getName();
                if (nm.equals("page")) { //$NON-NLS-1$
                    String cnm = e[j].getAttribute("class"); //$NON-NLS-1$
                    if (cnm == null)
                        continue;
                    if (!cnm.startsWith("org.eclipse.jsch."))
                        continue;
                    String id = e[j].getAttribute("id"); //$NON-NLS-1$
                    if (id == null)
                        id = cnm;
                    Bundle bundle = Platform.getBundle(extensions[i].getNamespaceIdentifier());
                    Class<?> c = bundle.loadClass(cnm);
                    IPreferencePage page = (IPreferencePage) c.newInstance();
                    String pnm = e[j].getAttribute("name"); //$NON-NLS-1$
                    if (pnm != null)
                        page.setTitle(pnm);
                    mgr.addToRoot(new PreferenceNode(id, page));
                }
            }
        }
        PreferenceDialog dialog = new PreferenceDialog(shell, mgr);
        dialog.create();
        dialog.setMessage(title);
        dialog.open();
    } catch (Throwable err) {
        String msg = err.getLocalizedMessage();
        if (msg == null || msg.length() == 0)
            msg = err.getClass().getName();
        MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
        mb.setText("Error");
        mb.setMessage("Cannot open preferences dialog:\n" + msg);
        mb.open();
    }
}

From source file:org.eclipse.titan.executor.properties.FieldEditorPropertyPage.java

License:Open Source License

protected void showPreferencePage(final String id, final IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);/* www .  ja  v  a2 s  .c o m*/
    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:org.eclipse.wst.xsl.internal.debug.ui.XSLDebugUIPlugin.java

License:Open Source License

/**
 * Convenience method for opening a given preference page.
 * //from w  w w  .  j av  a 2  s. c o  m
 * @param id
 *            the id of the preference page
 * @param page
 *            the preference page to show
 */
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(XSLDebugUIPlugin.getActiveWorkbenchShell(), manager);
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(XSLDebugUIPlugin.getStandardDisplay(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            result[0] = (dialog.open() == Window.OK);
        }
    });
}

From source file:org.entirej.framework.plugin.preferences.EntirejConnectionPreferencePage.java

License:Apache License

public static void openPage(IProject project) {
    EntirejConnectionPreferencePage page = new EntirejConnectionPreferencePage();

    final IPreferenceNode targetNode = new PreferenceNode(page.getPageId(), page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);//w ww.j av a  2  s .  c  om
    page.setElement(project);
    page.setTitle("Connection Settings");
    final PreferenceDialog dialog = new PreferenceDialog(Display.getCurrent().getActiveShell(), manager);
    BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.open();
        }
    });
}

From source file:org.gradle.eclipse.preferences.FieldEditorOverlayPage.java

License:Apache License

protected void showPreferencePage(String id, IPreferencePage page) {
    final IPreferenceNode targetNode = new PreferenceNode(id, page);
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);/*from w  w w  .j  ava 2 s.  c o  m*/
    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();
        }
    });
}