Package org.openide

Examples of org.openide.NotifyDescriptor


            Handler[] handlers = Logger.getLogger("").getHandlers();
            for (int i = 0; i < handlers.length; i++) {
                Handler h = handlers[i];
                h.close();
            }
            NotifyDescriptor nd = new NotifyDescriptor.Message(MEMORY_ERROR, NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notify(nd);
            LifecycleManager.getDefault().exit();
        }
    }
View Full Code Here


        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            String message = NbBundle.getMessage(WorkspacePanePanel.class, "WorkspacePanePanel_closeWorkspace_Question");
            String title = NbBundle.getMessage(WorkspacePanePanel.class, "WorkspacePanePanel_closeWorkspace_Title");
            NotifyDescriptor dd = new NotifyDescriptor(message, title,
                    NotifyDescriptor.YES_NO_OPTION,
                    NotifyDescriptor.QUESTION_MESSAGE, null, null);
            Object retType = DialogDisplayer.getDefault().notify(dd);
            if (retType == NotifyDescriptor.YES_OPTION) {
                ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
View Full Code Here

            generate.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    PaletteGeneratorPanel pgn = new PaletteGeneratorPanel();
                    pgn.setup(colorsCount);
                    NotifyDescriptor nd = new NotifyDescriptor(pgn,
                            NbBundle.getMessage(PartitionColorTransformerPanel.class, "PartitionColorTransformerPanel.generatePalettePanel.title"),
                            NotifyDescriptor.OK_CANCEL_OPTION,
                            NotifyDescriptor.DEFAULT_OPTION, null, null);

                    if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) {
View Full Code Here

            String messageBundle = NbBundle.getMessage(ProjectControllerUIImpl.class, "CloseProject_confirm_message");
            String titleBundle = NbBundle.getMessage(ProjectControllerUIImpl.class, "CloseProject_confirm_title");
            String saveBundle = NbBundle.getMessage(ProjectControllerUIImpl.class, "CloseProject_confirm_save");
            String doNotSaveBundle = NbBundle.getMessage(ProjectControllerUIImpl.class, "CloseProject_confirm_doNotSave");
            String cancelBundle = NbBundle.getMessage(ProjectControllerUIImpl.class, "CloseProject_confirm_cancel");
            NotifyDescriptor msg = new NotifyDescriptor(messageBundle, titleBundle,
                    NotifyDescriptor.YES_NO_CANCEL_OPTION,
                    NotifyDescriptor.INFORMATION_MESSAGE,
                    new Object[]{saveBundle, doNotSaveBundle, cancelBundle}, saveBundle);
            Object result = DialogDisplayer.getDefault().notify(msg);
            if (result == saveBundle) {
View Full Code Here

        if (canIncreaseMemory()) {
            String messageBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.canIncreaseMemory.message", getMb(Runtime.getRuntime().maxMemory()) + " mb", getMb(getMaximumXmx()) + " mb");
            String titleBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.title");
            String increaseAndRestart = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.canIncreaseMemory.button");
            String cancelBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.cancel");
            NotifyDescriptor msg = new NotifyDescriptor(messageBundle, titleBundle,
                    NotifyDescriptor.YES_NO_CANCEL_OPTION,
                    NotifyDescriptor.ERROR_MESSAGE,
                    new Object[]{increaseAndRestart, cancelBundle}, increaseAndRestart);

            if (DialogDisplayer.getDefault().notify(msg) != increaseAndRestart) {
                resumeThreads();
                return;

            }

            String xmx = getMb(getMaximumXmx()) + "m";

            try {
                updateConfiguration(xmx);
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            }
        } else {
            String messageBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.canIncreaseMemory.message", getMb(Runtime.getRuntime().maxMemory()) + " mb");
            String titleBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.title");
            String saveAndRestart = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.canIncreaseMemory.button");
            String cancelBundle = NbBundle.getMessage(MemoryStarvationManager.class, "OutOfMemoryError.cancel");
            NotifyDescriptor msg = new NotifyDescriptor(messageBundle, titleBundle,
                    NotifyDescriptor.YES_NO_CANCEL_OPTION,
                    NotifyDescriptor.ERROR_MESSAGE,
                    new Object[]{saveAndRestart, cancelBundle}, saveAndRestart);

            if (DialogDisplayer.getDefault().notify(msg) != saveAndRestart) {
View Full Code Here

                    }
                }
            }
        } catch (OutOfMemoryError ex) {
            System.gc();
            NotifyDescriptor nd = new NotifyDescriptor.Message(MEMORY_ERROR, NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notify(nd);
        } catch (Exception ex) {
            ex.printStackTrace();
            NotifyDescriptor nd = new NotifyDescriptor.Message("CommandLineParsing " + ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notify(nd);
        }
    }
View Full Code Here

     *
     * @return True if the definition is valid, false otherwise.
     */
    boolean isValidDefinition() {
        if (this.nameTextField.getText().isEmpty()) {
            NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                    NbBundle.getMessage(FilesSetPanel.class, "FilesSetPanel.messages.filesSetsMustBeNamed"),
                    NotifyDescriptor.WARNING_MESSAGE);
            DialogDisplayer.getDefault().notify(notifyDesc);
            return false;
        }
View Full Code Here

     * @return True if the definition is valid, false otherwise.
     */
    boolean isValidRuleDefinition() {
        // The rule must have a name.
        if (this.ruleNameTextField.getText().isEmpty()) {
            NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                    NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.filesSetRulesMustBeNamed"),
                    NotifyDescriptor.WARNING_MESSAGE);
            DialogDisplayer.getDefault().notify(notifyDesc);
            return false;
        }

        // The rule must have name filter text.
        if (this.nameTextField.getText().isEmpty()) {
            NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                    NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.emptyNameFilter"),
                    NotifyDescriptor.WARNING_MESSAGE);
            DialogDisplayer.getDefault().notify(notifyDesc);
            return false;
        }

        // The name filter must either be a regular expression that compiles or
        // a string without illegal file name chars.
        if (this.nameRegexCheckbox.isSelected()) {
            try {
                Pattern.compile(this.nameTextField.getText());
            } catch (PatternSyntaxException ex) {
                NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                        NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidNameRegex", ex.getLocalizedMessage()),
                        NotifyDescriptor.WARNING_MESSAGE);
                DialogDisplayer.getDefault().notify(notifyDesc);
                return false;
            }
        } else {
            if (!FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
                NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                        NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInName"),
                        NotifyDescriptor.WARNING_MESSAGE);
                DialogDisplayer.getDefault().notify(notifyDesc);
                return false;
            }
        }

        // The path filter, if specified, must either be a regular expression
        // that compiles or a string without illegal file path chars.
        if (!this.pathTextField.getText().isEmpty()) {
            if (this.pathRegexCheckBox.isSelected()) {
                try {
                    Pattern.compile(this.pathTextField.getText());
                } catch (PatternSyntaxException ex) {
                    NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                            NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidPathRegex", ex.getLocalizedMessage()),
                            NotifyDescriptor.WARNING_MESSAGE);
                    DialogDisplayer.getDefault().notify(notifyDesc);
                    return false;
                }
            } else {
                if (!FilesSetRulePanel.containsOnlyLegalChars(this.pathTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_PATH_CHARS)) {
                    NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
                            NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.invalidCharInPath"),
                            NotifyDescriptor.WARNING_MESSAGE);
                    DialogDisplayer.getDefault().notify(notifyDesc);
                    return false;
                }
View Full Code Here

            }
            else {
                logDir = new File(Places.getUserDirectory().getAbsolutePath() + File.separator + "var" + File.separator + "log");
            }
            if (logDir.exists() == false) {
                NotifyDescriptor d =
                        new NotifyDescriptor.Message(
                                NbBundle.getMessage(this.getClass(), "OpenLogFolder.error1", logDir.getAbsolutePath()),
                                NotifyDescriptor.ERROR_MESSAGE);
                DialogDisplayer.getDefault().notify(d);
            } else {
View Full Code Here

                    if (!baseDir.exists()) {
                        // get confirmation to create directory
                        String confMsg = NbBundle
                                .getMessage(this.getClass(), "NewCaseWizardPanel1.validate.confMsg.createDir.msg",
                                            caseParentDir);
                        NotifyDescriptor d2 = new NotifyDescriptor.Confirmation(confMsg,
                                                                                NbBundle.getMessage(this.getClass(),
                                                                                                    "NewCaseWizardPanel1.validate.confMsg.createDir.title"),
                                                                                NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.WARNING_MESSAGE);
                        d2.setValue(NotifyDescriptor.NO_OPTION);

                        Object res2 = DialogDisplayer.getDefault().notify(d2);
                        if (res2 != null && res2 == DialogDescriptor.YES_OPTION) {
                            // if user say yes
                            try {
View Full Code Here

TOP

Related Classes of org.openide.NotifyDescriptor

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.