Package org.openide

Examples of org.openide.NotifyDescriptor


        }
        else if (language.toLowerCase().equals("beanshell")) {
            sourceFile += ".bsh";
        }
        else {
            NotifyDescriptor d = new NotifyDescriptor.Message(
                "Language not defined for this Parcel Folder");
            TopManager.getDefault().notify(d);
            return;
        }

        FileSystem fs = Repository.getDefault().getDefaultFileSystem();
        DataObject result = null;
        try {
            DataObject dObj = DataObject.find(fs.findResource(sourceFile));
            result = dObj.createFromTemplate(parent);
        }
        catch (IOException ioe) {
            ErrorManager.getDefault().notify(ioe);
        }

        FileObject fo = result.getPrimaryFile();
        if (fo.getExt().equals("java")) {
            FileLock lock = null;
            try {
                PackageRemover.removeDeclaration(FileUtil.toFile(fo));

                // IssueZilla 11986 - rename the FileObject
                // so the JavaNode is resynchronized
                lock = fo.lock();
                if (lock != null) {
                    fo.rename(lock, fo.getName(), fo.getExt());
                }
            }
            catch (IOException ioe) {
                NotifyDescriptor d = new NotifyDescriptor.Message(
                 "Error removing package declaration from file: " +
                 fo.getNameExt() +
                 ". You should manually remove this declaration " +
                 "before building the Parcel Recipe");
                TopManager.getDefault().notify(d);
View Full Code Here


    private boolean promptForOverwrite(File source, File target) {
        String message = source.getName() + " has already been deployed " +
            "to this target. Do you wish to overwrite it?";

        NotifyDescriptor d = new NotifyDescriptor.Confirmation(
            message, NotifyDescriptor.OK_CANCEL_OPTION);
        TopManager.getDefault().notify(d);

        if (d.getValue() == NotifyDescriptor.CANCEL_OPTION)
            return false;
        else
            return true;
    }
View Full Code Here

    private boolean askIfCreateDirectory(File directory) {
        String message = directory.getAbsolutePath() + " does not exist. " +
            "Do you want to create it now?";

        NotifyDescriptor d = new NotifyDescriptor.Confirmation(
            message, NotifyDescriptor.OK_CANCEL_OPTION);
        TopManager.getDefault().notify(d);

        if (d.getValue() == NotifyDescriptor.CANCEL_OPTION)
            return false;

        boolean result;
        try {
            result = directory.mkdirs();
        }
        catch (SecurityException se) {
            result = false;
        }

        if (result == false) {
            String tmp = "Error creating: " + directory.getAbsolutePath();
            NotifyDescriptor d2 = new NotifyDescriptor.Message(
                tmp, NotifyDescriptor.ERROR_MESSAGE);
            TopManager.getDefault().notify(d2);
        }
        return result;
    }
View Full Code Here

    }

    private boolean showRestartDialog() {
        String msg = NbBundle.getMessage(Upgrader.class, "Upgrader.restart.message");
        String title = NbBundle.getMessage(Upgrader.class, "Upgrader.restart.title");
        NotifyDescriptor nd = new NotifyDescriptor.Confirmation(msg, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);

        if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION) {
            return true;
        }
        return false;
View Full Code Here

    }

    private boolean showUpgradeDialog(File source) {
        String msg = NbBundle.getMessage(Upgrader.class, "Upgrader.message", source.getName());
        String title = NbBundle.getMessage(Upgrader.class, "Upgrader.title");
        NotifyDescriptor nd = new NotifyDescriptor.Confirmation(msg, title, NotifyDescriptor.YES_NO_OPTION, NotifyDescriptor.QUESTION_MESSAGE);

        if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.YES_OPTION) {
            return true;
        }
        return false;
View Full Code Here

                    FileObject nodeModules = getProjectDirectory().getFileObject( NodeJSProjectFactory.NODE_MODULES_FOLDER );
                    needRunNPMInstall = nodeModules == null;
                    if (needRunNPMInstall) {
                        String msg = NbBundle.getMessage( NodeJSProject.class, "DETAIL_RUN_NPM_INSTALL" ); //NOI18N
                        String title = NbBundle.getMessage( NodeJSProject.class, "TITLE_RUN_NPM_INSTALL" ); //NOI18N
                        NotifyDescriptor nd = new NotifyDescriptor.Confirmation( msg, title, NotifyDescriptor.YES_NO_CANCEL_OPTION );
                        Object dlgResult = DialogDisplayer.getDefault().notify( nd );
                        needRunNPMInstall = NotifyDescriptor.YES_OPTION.equals( dlgResult );
                        if (NotifyDescriptor.CANCEL_OPTION.equals( dlgResult )) {
                            return;
                        }
View Full Code Here

    @Override
    public void save () throws IOException {
        assert !EventQueue.isDispatchThread();
        if (this.map != null) {
            if (hasErrors) {
                NotifyDescriptor nd = new NotifyDescriptor.Confirmation( NbBundle.getMessage( ProjectMetadataImpl.class, "OVERWRITE_BAD_JSON", ProjectUtils.getInformation( project).getDisplayName() ) );
                if (!DialogDisplayer.getDefault().notify( nd ).equals( NotifyDescriptor.OK_OPTION )) {
                    synchronized ( this ) {
                        map = null;
                    }
                    return;
View Full Code Here

        FuelPhpOptions options = FuelPhpOptions.getInstance();
        try {
            options.setDefaultConfig(config.asText("UTF-8")); // NOI18N

            // open dialog
            NotifyDescriptor descriptor = new NotifyDescriptor(
                    "Success : Set source code of config.php to Options",
                    getPureName(),
                    NotifyDescriptor.DEFAULT_OPTION,
                    NotifyDescriptor.INFORMATION_MESSAGE,
                    null,
View Full Code Here

        int curPort = Integer.parseInt(Settings.get().get(Settings.PORT, Settings.PORT_DEFAULT));
        this.port = curPort;
        try {
            serverSocket = new java.net.ServerSocket(curPort);
        } catch (IOException ex) {
            NotifyDescriptor message = new NotifyDescriptor.Message("Could not create server. Listening for incoming data is disabled.", NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notifyLater(message);
            return;
        }

        Runnable runnable = new Runnable() {

            public void run() {
                while (true) {
                    try {
                        Socket clientSocket = serverSocket.accept();
                        if (serverRunnable != this) {
                            clientSocket.close();
                            return;
                        }
                        RequestProcessor.getDefault().post(new Client(clientSocket, networkTextField, Server.this), 0, Thread.MAX_PRIORITY);
                    } catch (IOException ex) {
                        serverSocket = null;
                        NotifyDescriptor message = new NotifyDescriptor.Message("Error during listening for incoming connections. Listening for incoming data is disabled.", NotifyDescriptor.ERROR_MESSAGE);
                        DialogDisplayer.getDefault().notifyLater(message);
                        return;
                    }
                }
            }
View Full Code Here

            } catch (NoClassDefFoundError ncdfe) {
                Logger.getLogger("global").log(Level.SEVERE, null, ncdfe);
            }

            if (chosen == null) {
                NotifyDescriptor message = new NotifyDescriptor.Message("Could not find a scripting engine. Please make sure that the Rhino scripting engine is available. Otherwise filter cannot be used.", NotifyDescriptor.ERROR_MESSAGE);
                DialogDisplayer.getDefault().notifyLater(message);
                chosen = new NullScriptEngine();
            }

            engine = chosen;
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.