Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.MessageDialogWithToggle


        BndPreferences prefs = new BndPreferences();
        boolean hideWarning = prefs.getHideInitCnfAdvice();
        if (hideWarning)
            return true;

        MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(getShell(), Messages.CnfSetupNeverWarningTitle, Messages.CnfSetupNeverWarning, Messages.DontShowMessageAgain, false, null, null);

        if (dialog.getToggleState()) {
            prefs.setHideInitCnfAdvice(true);
        }
        return dialog.getReturnCode() == MessageDialogWithToggle.OK;
    }
View Full Code Here


        message = NLS.bind(
            IDEWorkbenchMessages.PromptOnExitDialog_message1,
            productName);
      }

      MessageDialogWithToggle dlg = MessageDialogWithToggle
          .openOkCancelConfirm(parentShell,
              IDEWorkbenchMessages.PromptOnExitDialog_shellTitle,
              message,
              IDEWorkbenchMessages.PromptOnExitDialog_choice,
              false, null, null);
      if (dlg.getReturnCode() != IDialogConstants.OK_ID) {
        return false;
      }
      if (dlg.getToggleState()) {
        store
            .setValue(
                IDEInternalPreferences.EXIT_PROMPT_ON_CLOSE_LAST_WINDOW,
                false);
        IDEWorkbenchPlugin.getDefault().savePluginPreferences();
View Full Code Here

            private boolean handleFileDrop(File[] files) {
                if (files.length > 0) {
                    BndPreferences prefs = new BndPreferences();
                    boolean hideWarning = prefs.getHideWarningExternalFile();
                    if (!hideWarning) {
                        MessageDialogWithToggle dialog = MessageDialogWithToggle.openWarning(getSection().getShell(), "Add External Files",
                                "External files cannot be directly added to a project, they must be added to a local repository first.", "Do not show this warning again.", false, null, null);
                        if (Window.CANCEL == dialog.getReturnCode())
                            return false;
                        if (dialog.getToggleState()) {
                            prefs.setHideWarningExternalFile(true);
                        }
                    }

                    AddFilesToRepositoryWizard wizard = new AddFilesToRepositoryWizard(null, files);
                    WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard);
                    if (Window.OK == dialog.open()) {
                        List<Pair<String,String>> addingBundles = wizard.getSelectedBundles();
                        List<VersionedClause> addingClauses = new ArrayList<VersionedClause>(addingBundles.size());

                        for (Pair<String,String> addingBundle : addingBundles) {
                            Attrs attribs = new Attrs();
                            attribs.put(Constants.VERSION_ATTRIBUTE, addingBundle.getSecond());
                            addingClauses.add(new VersionedClause(addingBundle.getFirst(), attribs));
                        }

                        handleAdd(addingClauses);
                    }
                    return true;
                }
                return false;
            }

            private boolean handleSelectionDrop() {
                ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
                if (selection.isEmpty() || !(selection instanceof IStructuredSelection)) {
                    return false;
                }
                List<VersionedClause> adding = new LinkedList<VersionedClause>();
                Iterator< ? > iterator = ((IStructuredSelection) selection).iterator();
                while (iterator.hasNext()) {
                    Object item = iterator.next();
                    if (item instanceof RepositoryBundle) {
                        VersionedClause newClause = RepositoryUtils.convertRepoBundle((RepositoryBundle) item);
                        adding.add(newClause);
                    } else if (item instanceof RepositoryBundleVersion) {
                        RepositoryBundleVersion bundleVersion = (RepositoryBundleVersion) item;
                        VersionedClause newClause = RepositoryUtils.convertRepoBundleVersion(bundleVersion, phase);
                        adding.add(newClause);
                    }
                }

                handleAdd(adding);
                return true;
            }

            private boolean handleURLDrop(String urlStr) {
                try {
                    URI uri = new URI(urlStr);
                    AddJpmDependenciesWizard wizard = new AddJpmDependenciesWizard(uri);
                    WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard);
                    if (dialog.open() == Window.OK) {
                        Set<ResourceDescriptor> resources = wizard.getResult();
                        List<VersionedClause> newBundles = new ArrayList<VersionedClause>(resources.size());
                        for (ResourceDescriptor resource : resources) {
                            Attrs attrs = new Attrs();
                            attrs.put(Constants.VERSION_ATTRIBUTE, resource.version != null ? resource.version.toString() : Version.emptyVersion.toString());
View Full Code Here

    {
        Runnable r = new Runnable()
        {
            public void run()
            {
                MessageDialogWithToggle questionDialog = MessageDialogWithToggle.openYesNoQuestion(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                    "Sigil Configuration",
                    "Missing OSGi installation. Open preferences to configure it now?",
                    "Do not show this message again", false, null, null);
                prefs.setValue(SigilCore.PREFERENCES_NOASK_OSGI_INSTALL,
                    questionDialog.getToggleState());
                if (questionDialog.getReturnCode() == IDialogConstants.YES_ID)
                {
                    PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(
                        null, SigilCore.OSGI_INSTALLS_PREFERENCES_ID, null, null);
                    dialog.open();
                }
View Full Code Here

                break;
            case Never:
                result = false;
                break;
            case Prompt:
                MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(
                    parentShell, title, text, "Do not ask this again", false, null, null);
                result = (dialog.getReturnCode() == IDialogConstants.YES_ID);
                if (dialog.getToggleState())
                {
                    // User said don't ask again... take the current answer as the new preference
                    prefStore.setValue(prefName,
                        result ? PromptablePreference.Always.name()
                            : PromptablePreference.Never.name());
View Full Code Here

                break;
            case Never:
                result = IDialogConstants.NO_ID;
                break;
            case Prompt:
                MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(
                    parentShell, title, text, "Do not ask this again", false, null, null);
                result = dialog.getReturnCode();
                if (result != IDialogConstants.CANCEL_ID)
                {
                    if (dialog.getToggleState())
                    {
                        // User said don't ask again... take the current answer as the new preference
                        prefStore.setValue(
                            prefName,
                            (result == IDialogConstants.YES_ID) ? PromptablePreference.Always.name()
View Full Code Here

                        if ( command instanceof RollbackCommand ||
                                command instanceof CommitCommand )
                            string += "?"; //$NON-NLS-1$
                        else
                            string+=Messages.CommandManager_warning2;
                        MessageDialogWithToggle dialog = MessageDialogWithToggle
                                .openOkCancelConfirm(
                                        PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                                                .getShell(),
                                        Messages.CommandManager_warningTitle, string, 
                                        Messages.CommandManager_toggleMessage, false, preferenceStore, PreferenceConstants.P_WARN_IRREVERSIBLE_COMMAND);
                        runCommand[0] = dialog.getReturnCode() == IDialogConstants.OK_ID;
                        if (dialog.getToggleState()) {
                            preferenceStore
                                    .setValue(PreferenceConstants.P_IRREVERSIBLE_COMMAND_VALUE,
                                            runCommand[0]);
                        }
                    }
View Full Code Here

        IPreferenceStore preferenceStore = UiPlugin.getDefault().getPreferenceStore();
        if (!preferenceStore.getBoolean(CACHING_WARNING) && !shown) {
            shown = true;

            MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(display
                    .getActiveShell(), Messages.FeatureTableControl_warningTitle,
                    Messages.FeatureTableControl_warningMessage,
                    Messages.FeatureTableControl_warningToggle, false, null, null);
            // MessageDialogWithToggle dialog = MessageDialogWithToggle.openWarning(display
            // .getActiveShell(), Messages.FeatureTableControl_warningTitle,
            // Messages.FeatureTableControl_warningMessage,
            // Messages.FeatureTableControl_warningToggle, false, null, null);
            preferenceStore.setValue(CACHING_WARNING, dialog.getToggleState());
            if (dialog.getReturnCode() == MessageDialogWithToggle.OK) {
                return true;
            } else {
                return false;
            }
View Full Code Here

        BndPreferences prefs = new BndPreferences();
        boolean hideWarning = prefs.getHideInitCnfAdvice();
        if (hideWarning)
            return true;

        MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(getShell(), Messages.CnfSetupNeverWarningTitle, Messages.CnfSetupNeverWarning, Messages.DontShowMessageAgain, false, null, null);

        if (dialog.getToggleState()) {
            prefs.setHideInitCnfAdvice(true);
        }
        return dialog.getReturnCode() == MessageDialogWithToggle.OK;
    }
View Full Code Here

                store.setDefault(SHOW_DIALOG_KEY, true);
                boolean openDialog=store.getBoolean(SHOW_DIALOG_KEY);
                boolean updateMapCRS;
                if( openDialog ){
                    Shell shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
                    MessageDialogWithToggle dialog=MessageDialogWithToggle.openYesNoQuestion(shell,
                            Messages.CRSPropertyPage_title,
                            Messages.CRSPropertyPage_message,
                            Messages.CRSPropertyPage_toggle_message,
                            false,
                            store,
                            SHOW_DIALOG_KEY );
                    int returnCode=dialog.getReturnCode();
                    updateMapCRS=returnCode==IDialogConstants.YES_ID?true:false;
                    store.setValue(UPDATE_MAP_CRS_KEY, updateMapCRS);
                }else{
                    updateMapCRS=store.getBoolean(UPDATE_MAP_CRS_KEY);
                }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.MessageDialogWithToggle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.