Example usage for org.eclipse.jface.dialogs IDialogConstants ABORT_ID

List of usage examples for org.eclipse.jface.dialogs IDialogConstants ABORT_ID

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants ABORT_ID.

Prototype

int ABORT_ID

To view the source code for org.eclipse.jface.dialogs IDialogConstants ABORT_ID.

Click Source Link

Document

Button id for an "Abort" button (value 7).

Usage

From source file:org.obeonetwork.dsl.dart.usage.internal.preferences.UsagePreferenceInitializer.java

License:Open Source License

@Override
public void initializeDefaultPreferences() {
    DartDesignerPlugin.getDefault().getPreferenceStore().setDefault(UsagePreferences.USAGE_USER_ANSWER_ID,
            IDialogConstants.ABORT_ID);
    DartDesignerPlugin.getDefault().getPreferenceStore().setDefault(UsagePreferences.USAGE_ENABLED_ID, false);
}

From source file:org.obeonetwork.dsl.uml2.usage.preferences.UsagePreferenceInitializer.java

License:Open Source License

@Override
public void initializeDefaultPreferences() {
    UMLDesignerPlugin.getDefault().getPreferenceStore().setDefault(UsagePreferences.USAGE_USER_ANSWER_ID,
            IDialogConstants.ABORT_ID);
    UMLDesignerPlugin.getDefault().getPreferenceStore().setDefault(UsagePreferences.USAGE_ENABLED_ID, false);
}

From source file:org.tigris.subversion.subclipse.ui.dialogs.CompareDialog.java

License:Open Source License

public int open() {
    if (compareResultOK(compareEditorInput))
        return super.open();
    else//  www .jav a 2 s.  c o m
        return IDialogConstants.ABORT_ID;
}

From source file:org2.eclipse.php.internal.debug.core.launching.PHPLaunchUtilities.java

License:Open Source License

/**
 * In case the preferences allow it, check to see if the current debugger uses a non-standard port for the session.
 * A message will be displayed asking to acknowledge this launch.
 * /*from   www .j  av a2s.  co m*/
 * @param debuggerID
 *            The debugger ID to check
 * @return True in case the preferences are set to 'Never' test it, or when the user clicked continue when prompted.
 */
public static boolean checkIsStandardPort(String debuggerID) {
    // check whether we should ask the user.
    IPreferenceStore store = PHPDebugEPLPlugin.getDefault().getPreferenceStore();
    String option = store.getString(IPHPDebugCorePreferenceKeys.NOTIFY_NON_STANDARD_PORT);
    if (MessageDialogWithToggle.ALWAYS.equals(option)) {
        IStatus warningStatus = null;
        int debugPort = PHPDebugEPLPlugin.getDebugPort(debuggerID);
        if (XDebugCommunicationDaemon.XDEBUG_DEBUGGER_ID.equals(debuggerID)) {
            if (!XDebugCommunicationDaemon.isDefaultDebugPort(debugPort)) {
                warningStatus = new Status(IStatus.WARNING, PHPDebugEPLPlugin.PLUGIN_ID, 0,
                        NLS.bind(PHPDebugCoreMessages.PHPLaunchUtilities_xdebugNonStandardPort, debugPort),
                        null);
            }
        } else if (DebuggerCommunicationDaemon.ZEND_DEBUGGER_ID.equals(debuggerID)) {
            if (!DebuggerCommunicationDaemon.isDefaultDebugPort(debugPort)) {
                warningStatus = new Status(IStatus.WARNING, PHPDebugEPLPlugin.PLUGIN_ID, 0,
                        NLS.bind(PHPDebugCoreMessages.PHPLaunchUtilities_zendDebugNonStandardPort, debugPort),
                        null);
            }
        }
        if (warningStatus == null) {
            return true; // The port is set to default
        }
        IStatus preferencesMassage = new Status(IStatus.INFO, PHPDebugEPLPlugin.PLUGIN_ID, 0,
                PHPDebugCoreMessages.PHPLaunchUtilities_portSettingsPreferencesPage, null);
        final MultiStatus multiStatus = new MultiStatus(PHPDebugEPLPlugin.PLUGIN_ID, 0,
                new IStatus[] { warningStatus, preferencesMassage },
                PHPDebugCoreMessages.PHPLaunchUtilities_confirmation, null);
        final DialogResultHolder resultHolder = new DialogResultHolder();
        Display.getDefault().syncExec(new Runnable() {
            public void run() {
                DebugPortNotificationDialog notificationDialog = new DebugPortNotificationDialog(
                        Display.getDefault().getActiveShell(),
                        PHPDebugCoreMessages.PHPLaunchUtilities_confirmation, null,
                        PHPDebugCoreMessages.PHPLaunchUtilities_nonStandardPort, multiStatus,
                        MessageDialog.INFORMATION, PHPDebugCoreMessages.PHPLaunchUtilities_doNotShowThisAgain,
                        false);
                resultHolder.setReturnCode(notificationDialog.open());
            }
        });

        switch (resultHolder.getReturnCode()) {
        case IDialogConstants.PROCEED_ID:
            return true;
        case IDialogConstants.ABORT_ID:
        case IDialogConstants.CANCEL_ID:
        case -1:
            return false;
        }
    }
    return true;
}