Example usage for org.eclipse.jface.util Policy DEBUG_DIALOG_NO_PARENT

List of usage examples for org.eclipse.jface.util Policy DEBUG_DIALOG_NO_PARENT

Introduction

In this page you can find the example usage for org.eclipse.jface.util Policy DEBUG_DIALOG_NO_PARENT.

Prototype

boolean DEBUG_DIALOG_NO_PARENT

To view the source code for org.eclipse.jface.util Policy DEBUG_DIALOG_NO_PARENT.

Click Source Link

Document

A flag to indicate whether unparented dialogs should be checked.

Usage

From source file:org.eclipse.ui.internal.JFaceUtil.java

License:Open Source License

/**
 * Initializes JFace for use by Eclipse.
 *//*from  w  w  w .  j av  a2s. c  o m*/
public static void initializeJFace() {
    // Set the SafeRunner to run all SafeRunnables
    SafeRunnable.setRunner(new ISafeRunnableRunner() {
        public void run(ISafeRunnable code) {
            SafeRunner.run(code);
        }
    });

    // Pass all errors and warnings to the status handling facility
    // and the rest to the main runtime log
    Policy.setLog(new ILogger() {
        public void log(IStatus status) {
            if (status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.ERROR) {
                StatusManager.getManager().handle(status);
            } else {
                WorkbenchPlugin.log(status);
            }
        }
    });

    Policy.setStatusHandler(new StatusHandler() {
        public void show(IStatus status, String title) {
            StatusAdapter statusAdapter = new StatusAdapter(status);
            statusAdapter.setProperty(StatusAdapter.TITLE_PROPERTY, title);
            StatusManager.getManager().handle(statusAdapter, StatusManager.SHOW);
        }
    });

    // Get all debug options from Platform
    if ("true".equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/debug"))) { //$NON-NLS-1$ //$NON-NLS-2$
        Policy.DEBUG_DIALOG_NO_PARENT = "true" //$NON-NLS-1$
                .equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/debug/dialog/noparent")); //$NON-NLS-1$
        Policy.TRACE_ACTIONS = "true" //$NON-NLS-1$
                .equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/trace/actions")); //$NON-NLS-1$
        Policy.TRACE_TOOLBAR = "true" //$NON-NLS-1$
                .equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/trace/toolbarDisposal")); //$NON-NLS-1$
        InternalPolicy.DEBUG_LOG_REENTRANT_VIEWER_CALLS = "true".equalsIgnoreCase( //$NON-NLS-1$
                Platform.getDebugOption(Policy.JFACE + "/debug/viewers/reentrantViewerCalls")); //$NON-NLS-1$
        InternalPolicy.DEBUG_LOG_EQUAL_VIEWER_ELEMENTS = "true" //$NON-NLS-1$
                .equalsIgnoreCase(Platform.getDebugOption(Policy.JFACE + "/debug/viewers/equalElements")); //$NON-NLS-1$
    }
}

From source file:org.eclipse.vtp.desktop.core.dialogs.FramedDialog.java

License:Open Source License

/**
 * Constructs a new FramedDialog with the given shell as its parent window.
 * // w  w w .  j a v a2s. com
 * @param parentShell The parent window of this dialog
 */
public FramedDialog(Shell parentShell) {
    this(new SameShellProvider(parentShell));

    if ((parentShell == null) && Policy.DEBUG_DIALOG_NO_PARENT) {
        Policy.getLog()
                .log(new Status(IStatus.INFO, Policy.JFACE, IStatus.INFO,
                        this.getClass() + " created with no shell", //$NON-NLS-1$
                        new Exception()));
    }
}

From source file:org.org.eclipse.core.utils.platform.dialogs.Dialog.java

License:Open Source License

/**
 * Creates a dialog instance. Note that the window will have no visual representation (no widgets) until it is told to open. By default, <code>open</code> blocks for dialogs.
 * //from   w  w  w  . ja va 2 s  .c o m
 * @param parentShell
 *            the parent shell, or <code>null</code> to create a top-level shell
 */
protected Dialog(Shell parentShell) {
    this(new SameShellProvider(parentShell));
    if (parentShell == null && Policy.DEBUG_DIALOG_NO_PARENT)
        Policy.getLog()
                .log(new Status(IStatus.INFO, Policy.JFACE, IStatus.INFO,
                        this.getClass() + " created with no shell", //$NON-NLS-1$
                        new Exception()));
}