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:at.spardat.xma.guidesign.preferences.AbstractPreferenceAndPropertyPage.java

License:Open Source License

/**
 * Show a single preference pages/*from  ww  w.  j a v  a2 s  .  c  o m*/
 * 
 * @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: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();/*from  w w w  .  j a  v a  2s .  c om*/
        dialog.setMessage(CONSOLE_LOCATION_TXT);
        dialog.setBlockOnOpen(true);
        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 www  . j a v  a2  s . co  m*/
 * @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  va  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)
 *//*  w ww.  j a  v  a 2  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//from  w  w  w.j  a  v a2s.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  . j  ava2 s  .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.nokia.carbide.internal.bugdatacollector.ui.preferences.BugDataCollectorPreferencePage.java

License:Open Source License

/**
 * Shows the preference dialog with only this preference page 
 * available in the tree//from  w  w w.jav  a  2  s .  com
 * @param shell 
 */
public static void showYourself(Shell shell) {
    IPreferencePage page = new BugDataCollectorPreferencePage();
    PreferenceManager mgr = new PreferenceManager();
    IPreferenceNode node = new PreferenceNode("1", page); //$NON-NLS-1$
    mgr.addToRoot(node);
    PreferenceDialog dialog = new PreferenceDialog(shell, mgr);
    dialog.create();
    dialog.setMessage(page.getTitle());
    dialog.open();
}

From source file:com.nokia.s60tools.hticonnection.actions.OpenPreferencePageAction.java

License:Open Source License

/**
 * Open HTI API preferences page preference page
 *//*from ww w  .ja  va 2  s  .c  om*/
private void openPreferencePage() {
    IPreferencePage page = new HtiApiPreferencePage();
    PreferenceManager mgr = new PreferenceManager();
    IPreferenceNode node = new PreferenceNode("1", page);//$NON-NLS-1$
    mgr.addToRoot(node);
    PreferenceDialog dialog = new PreferenceDialog(HtiApiActivator.getCurrentlyActiveWbWindowShell(), mgr);
    dialog.create();
    dialog.setMessage(page.getTitle());
    dialog.open();
}

From source file:com.palantir.typescript.preferences.FieldEditorProjectPreferencePage.java

License:Apache License

private void configureWorkspaceSettings() {
    String preferenceNodeId = this.getPreferenceNodeId();
    IPreferencePage preferencePage = newPreferencePage();
    final IPreferenceNode preferenceNode = new PreferenceNode(preferenceNodeId, preferencePage);

    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(preferenceNode);/*from   w  ww.  j  a v  a 2  s  .  co  m*/

    final PreferenceDialog dialog = new PreferenceDialog(this.getControl().getShell(), manager);
    BusyIndicator.showWhile(this.getControl().getDisplay(), new Runnable() {
        @Override
        public void run() {
            dialog.create();
            dialog.setMessage(preferenceNode.getLabelText());
            dialog.open();
        }
    });
}