Java Code Examples for org.openide.NotifyDescriptor#DEFAULT_OPTION

The following examples show how to use org.openide.NotifyDescriptor#DEFAULT_OPTION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultDataObject.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Either opens the in text editor or asks user questions.
 */
public void open() {
    EditorCookie ic = getCookie(EditorCookie.class);
    if (ic != null) {
        ic.open();
    } else {
        // ask a query 
        List<Object> options = new ArrayList<Object>();
        options.add (NotifyDescriptor.OK_OPTION);
        options.add (NotifyDescriptor.CANCEL_OPTION);
        NotifyDescriptor nd = new NotifyDescriptor (
            NbBundle.getMessage (DefaultDataObject.class, "MSG_BinaryFileQuestion"),
            NbBundle.getMessage (DefaultDataObject.class, "MSG_BinaryFileWarning"),
            NotifyDescriptor.DEFAULT_OPTION,
            NotifyDescriptor.QUESTION_MESSAGE,
            options.toArray(), null
        );
        Object ret = DialogDisplayer.getDefault().notify (nd);
        if (ret != NotifyDescriptor.OK_OPTION) {
            return;
        }
        
        EditorCookie c = getCookie(EditorCookie.class, true);
        c.open ();
    }
}
 
Example 2
Source File: TemplateSelector.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private static byte[] getFileContentsAsByteArray (File file) throws IOException {
    long length = file.length();
    if(length > 1024 * 10) {
        NotifyDescriptor nd =
            new NotifyDescriptor(
                NbBundle.getMessage(TemplateSelector.class, "MSG_FileTooBig"),
                NbBundle.getMessage(TemplateSelector.class, "LBL_FileTooBig"),    // NOI18N
                NotifyDescriptor.DEFAULT_OPTION,
                NotifyDescriptor.WARNING_MESSAGE,
                new Object[] {NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION},
                NotifyDescriptor.OK_OPTION);
        if(DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.OK_OPTION) {
            return null;
        }
    }

    return FileUtils.getFileContentsAsByteArray(file);
}
 
Example 3
Source File: ParamEditor.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void showDialog() {

	if(editable == Editable.NEITHER) {
	    NotifyDescriptor d = 
		new NotifyDescriptor(this, title, 
				     NotifyDescriptor.DEFAULT_OPTION,
				     NotifyDescriptor.PLAIN_MESSAGE, 
				     new Object[] { NotifyDescriptor.OK_OPTION },
				     NotifyDescriptor.OK_OPTION); 
	    DialogDisplayer.getDefault().notify(d);
	}
	else {
	    editDialog = new DialogDescriptor
		(this, title, true, DialogDescriptor.OK_CANCEL_OPTION,
		 DialogDescriptor.CANCEL_OPTION,
		 new ActionListener() {
		     public void actionPerformed(ActionEvent e) {
			 evaluateInput(); 
		     }
		 }); 

	    dialog = DialogDisplayer.getDefault().createDialog(editDialog);
	    dialog.setVisible(true);
	    this.repaint();
	}
    }
 
Example 4
Source File: TableRowDialog.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void showDialog() {
    if (editable == Editable.NEITHER) {
        NotifyDescriptor d =
                new NotifyDescriptor(this, title,
                NotifyDescriptor.DEFAULT_OPTION,
                NotifyDescriptor.PLAIN_MESSAGE,
                new Object[]{NotifyDescriptor.OK_OPTION},
                NotifyDescriptor.OK_OPTION);
        DialogDisplayer.getDefault().notify(d);
    } else {
        editDialog = new DialogDescriptor(this, title, true, DialogDescriptor.OK_CANCEL_OPTION,
                DialogDescriptor.CANCEL_OPTION,
                new ActionListener() {

                    public void actionPerformed(ActionEvent e) {
                        evaluateInput();
                    }
                });

        dialog = DialogDisplayer.getDefault().createDialog(editDialog);
        dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(TableRowDialog.class, "ACSD_initparam_edit")); // NOI18N
        dialog.setVisible(true);
        this.repaint();
    }
}
 
Example 5
Source File: DataAccessPane.java    From constellation with Apache License 2.0 5 votes vote down vote up
/**
 * Add and remove plugins from the favourites section
 */
private void manageFavourites() {
    final List<String> selectedPlugins = new ArrayList<>();

    // get a list of the selected plugins
    final QueryPhasePane queryPhasePane = getQueryPhasePane(getCurrentTab());
    queryPhasePane.getDataAccessPanes().stream().forEach(tp -> {
        if (tp.isQueryEnabled()) {
            selectedPlugins.add(tp.getPlugin().getName());
        }
    });

    if (selectedPlugins.isEmpty()) {
        final NotifyDescriptor nd = new NotifyDescriptor.Message("No plugins selected.", NotifyDescriptor.WARNING_MESSAGE);
        DialogDisplayer.getDefault().notify(nd);
    } else {
        final StringBuilder message = new StringBuilder(300);
        message.append("Add or remove plugins from your favourites category.\n\n");
        message.append("The following plugins were selected:\n");
        selectedPlugins.stream().forEach(plugin -> {
            message.append(plugin).append("\n");
        });
        message.append("\nNote that you need to restart before changes take effect.");

        final NotifyDescriptor nde = new NotifyDescriptor(message.toString(), "Manage Favourites", NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.QUESTION_MESSAGE,
                new Object[]{ADD_FAVOURITE, REMOVE_FAVOURITE, NotifyDescriptor.CANCEL_OPTION}, NotifyDescriptor.OK_OPTION);
        final Object option = DialogDisplayer.getDefault().notify(nde);

        if (option != NotifyDescriptor.CANCEL_OPTION) {
            selectedPlugins.stream().forEach(name -> {
                DataAccessPreferences.setFavourite(name, option == ADD_FAVOURITE);
            });
        }
    }
}
 
Example 6
Source File: EditPanelServer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void showErrorDialog() {

	Object[] options = { NotifyDescriptor.OK_OPTION };
	
	NotifyDescriptor errorDialog = 
	    new NotifyDescriptor((Object)NbBundle.getBundle(EditPanelServer.class).getString("MON_Bad_server"),
				 NbBundle.getBundle(EditPanelServer.class).getString("MON_Invalid_input"),
				 NotifyDescriptor.DEFAULT_OPTION,
				 NotifyDescriptor.ERROR_MESSAGE, 
				 options,
				 NotifyDescriptor.OK_OPTION);

	DialogDisplayer.getDefault().notify(errorDialog);
    }
 
Example 7
Source File: BugzillaExecutor.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static void notifyErrorMessage(String msg) {
    if("true".equals(System.getProperty("netbeans.t9y.throwOnClientError", "false"))) { // NOI18N
        Bugzilla.LOG.info(msg);
        throw new AssertionError(msg);
    }
    NotifyDescriptor nd =
            new NotifyDescriptor(
                msg,
                NbBundle.getMessage(BugzillaExecutor.class, "LBLError"),    // NOI18N
                NotifyDescriptor.DEFAULT_OPTION,
                NotifyDescriptor.ERROR_MESSAGE,
                new Object[] {NotifyDescriptor.OK_OPTION},
                NotifyDescriptor.OK_OPTION);
    DialogDisplayer.getDefault().notify(nd);
}
 
Example 8
Source File: SvnClientExceptionHandler.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static void annotate(String msg) {        
    CommandReport report = new CommandReport(NbBundle.getMessage(SvnClientExceptionHandler.class, "MSG_SubversionCommandError"), msg);
    JButton ok = new JButton(NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_CommandReport_OK"));
    NotifyDescriptor descriptor = new NotifyDescriptor(
            report, 
            NbBundle.getMessage(SvnClientExceptionHandler.class, "MSG_CommandFailed_Title"), 
            NotifyDescriptor.DEFAULT_OPTION,
            NotifyDescriptor.ERROR_MESSAGE,
            new Object [] { ok },
            ok);
    DialogDisplayer.getDefault().notify(descriptor);        
}
 
Example 9
Source File: CreateAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void notifyImportImpossible(String msg) {
    NotifyDescriptor nd =
        new NotifyDescriptor(
            msg,
            NbBundle.getMessage(CreateAction.class, "MSG_ImportNotAllowed"), // NOI18N
            NotifyDescriptor.DEFAULT_OPTION,
            NotifyDescriptor.WARNING_MESSAGE,
            new Object[] {NotifyDescriptor.OK_OPTION},
            NotifyDescriptor.OK_OPTION);
    DialogDisplayer.getDefault().notify(nd);
}
 
Example 10
Source File: EditPanelQuery.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void showErrorDialog() {

	Object[] options = { NotifyDescriptor.OK_OPTION };
	
	NotifyDescriptor errorDialog = 
	    new NotifyDescriptor((Object)NbBundle.getBundle(EditPanelQuery.class).getString("MON_Bad_param"),
				 NbBundle.getBundle(EditPanelQuery.class).getString("MON_Invalid_input"),
				 NotifyDescriptor.DEFAULT_OPTION,
				 NotifyDescriptor.ERROR_MESSAGE, 
				 options,
				 NotifyDescriptor.OK_OPTION);

	DialogDisplayer.getDefault().notify(errorDialog);
    }
 
Example 11
Source File: ModulesInstaller.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private void installMissingModules () {
    try {
        doInstallMissingModules ();
    } catch (Exception x) {
        JButton tryAgain = new JButton ();
        tryAgain.addActionListener(new ActionListener () {
            public void actionPerformed (ActionEvent e) {
                if (installContainer != null) {
                    try {
                        installContainer.getSupport ().doCancel ();
                    } catch (Exception ex) {
                        Logger.getLogger (ModulesInstaller.class.getName ()).
                                log (Level.INFO, ex.getLocalizedMessage (), ex);
                    }
                }
                RequestProcessor.Task task = getInstallTask ();
                if (task != null) {
                    task.schedule (10);
                }
            }
        });
        tryAgain.setEnabled (getInstallTask () != null);
        Mnemonics.setLocalizedText (tryAgain, getBundle ("InstallerMissingModules_TryAgainButton"));
        NotifyDescriptor nd = new NotifyDescriptor (
                getErrorNotifyPanel (x),
                getBundle ("InstallerMissingModules_ErrorPanel_Title"),
                NotifyDescriptor.DEFAULT_OPTION,
                NotifyDescriptor.ERROR_MESSAGE,
                new Object [] { tryAgain, NotifyDescriptor.OK_OPTION },
                NotifyDescriptor.OK_OPTION
                );
        DialogDisplayer.getDefault ().notifyLater (nd);
    }
}
 
Example 12
Source File: Utils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public static void displayErrorMessage(String message) {
    NotifyDescriptor ndesc = new NotifyDescriptor(
            message, 
            Utils.getBundle().getString("MSG_ErrorDialogTitle"),
            NotifyDescriptor.DEFAULT_OPTION,
            NotifyDescriptor.ERROR_MESSAGE, 
            new Object[] { NotifyDescriptor.OK_OPTION },
            NotifyDescriptor.OK_OPTION);

    DialogDisplayer.getDefault().notify(ndesc);
}
 
Example 13
Source File: Controller.java    From netbeans with Apache License 2.0 5 votes vote down vote up
boolean checkServer(boolean replay) { 

	try { 
	    URL u = getSampleHTTPServerURL();
	    if(debug) log("Getting HTTP server - url " + u);
	    if (u.getProtocol().equals("http")) {
    	    //HttpServer.getRepositoryRoot();
	        if(debug) log("Got the HTTP server");
	        return true;
	    }
	}
	catch(Throwable t) { 

	    if(debug) { 
		log("Exception: " + t.getMessage());
		t.printStackTrace();
	    }

	    Object[] options = {
		NbBundle.getBundle(Controller.class).getString("MON_OK"),
	    };
	    String msg = null;
	    if(replay) 
		msg = NbBundle.getBundle(Controller.class).getString("MON_CantReplay"); 
	    else
		msg = NbBundle.getBundle(Controller.class).getString("MON_NoServer");

	    
	    NotifyDescriptor noServerDialog = 
		new NotifyDescriptor(msg,
				     NbBundle.getBundle(Controller.class).getString("MON_NoServerTitle"),
				     NotifyDescriptor.DEFAULT_OPTION,
				     NotifyDescriptor.INFORMATION_MESSAGE,
				     options,
				     options[0]);
	    DialogDisplayer.getDefault().notify(noServerDialog);
	}
	return false;
    }
 
Example 14
Source File: Util.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public static void notifyError (final String title, final String message) {
    NotifyDescriptor nd = new NotifyDescriptor(message, title, NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.ERROR_MESSAGE, new Object[] {NotifyDescriptor.OK_OPTION}, NotifyDescriptor.OK_OPTION);
    DialogDisplayer.getDefault().notifyLater(nd);
}
 
Example 15
Source File: OpenEgtaskFile.java    From BART with MIT License 4 votes vote down vote up
private NotifyDescriptor myNotify(String message)   {
    return new NotifyDescriptor(message, 
         "Wrog File", 
          NotifyDescriptor.DEFAULT_OPTION, 
          NotifyDescriptor.ERROR_MESSAGE, new Object[]{NotifyDescriptor.CLOSED_OPTION}, null);
}
 
Example 16
Source File: ViewAdminConsoleAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
protected void performAction(Node[] activatedNodes) {
    CommonServerSupport commonSupport
            = (CommonServerSupport)activatedNodes[0]
            .getLookup().lookup(GlassfishModule.class);
    if(commonSupport != null) {
        if (GlassFishState.isOnline(commonSupport.getInstance())) {
            try {
                Map<String, String> ip = commonSupport.getInstanceProperties();
                StringBuilder urlBuilder = new StringBuilder(128);
                String port = !("false".equals(System.getProperty("glassfish.useadminport"))) ?
                    ip.get(GlassfishModule.ADMINPORT_ATTR) : ip.get(GlassfishModule.HTTPPORT_ATTR);
                String host = ip.get(GlassfishModule.HOSTNAME_ATTR);
                String uri = ip.get(GlassfishModule.URL_ATTR);
                if (uri == null || !uri.contains("ee6wc")) {
                    urlBuilder.append(Utils.getHttpListenerProtocol(host, port));
                } else {
                    urlBuilder.append("http");
                }
                urlBuilder.append("://"); // NOI18N
                urlBuilder.append(ip.get(GlassfishModule.HOSTNAME_ATTR));
                urlBuilder.append(":");
                urlBuilder.append(port);
                if("false".equals(System.getProperty("glassfish.useadminport"))) {
                    // url for admin gui when on http port (8080)
                    urlBuilder.append("/admin");
                }
                URL url = new URL(urlBuilder.toString());
                URLDisplayer.getDefault().showURL(url);
            } catch (MalformedURLException ex) {
                Logger.getLogger("glassfish").log(Level.WARNING, ex.getLocalizedMessage(), ex); // NOI18N
            }
        } else {
            String message = NbBundle.getMessage(ViewAdminConsoleAction.class, 
                    "MSG_ServerMustBeRunning"); // NOI18N
            NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message,
                    NotifyDescriptor.DEFAULT_OPTION);
            DialogDisplayer.getDefault().notify(nd);
        }
    }
}
 
Example 17
Source File: ViewAdminConsoleAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
protected void performAction(Node[] activatedNodes) {
    CommonServerSupport commonSupport
            = (CommonServerSupport)activatedNodes[0]
            .getLookup().lookup(PayaraModule.class);
    if(commonSupport != null) {
        if (PayaraState.isOnline(commonSupport.getInstance())) {
            try {
                Map<String, String> ip = commonSupport.getInstanceProperties();
                StringBuilder urlBuilder = new StringBuilder(128);
                String port = !("false".equals(System.getProperty("payara.useadminport"))) ?
                    ip.get(PayaraModule.ADMINPORT_ATTR) : ip.get(PayaraModule.HTTPPORT_ATTR);
                String host = ip.get(PayaraModule.HOSTNAME_ATTR);
                String uri = ip.get(PayaraModule.URL_ATTR);
                if (uri == null || !uri.contains("ee6wc")) {
                    urlBuilder.append(Utils.getHttpListenerProtocol(host, port));
                } else {
                    urlBuilder.append("http");
                }
                urlBuilder.append("://"); // NOI18N
                urlBuilder.append(ip.get(PayaraModule.HOSTNAME_ATTR));
                urlBuilder.append(":");
                urlBuilder.append(port);
                if("false".equals(System.getProperty("payara.useadminport"))) {
                    // url for admin gui when on http port (8080)
                    urlBuilder.append("/admin");
                }
                URL url = new URL(urlBuilder.toString());
                URLDisplayer.getDefault().showURL(url);
            } catch (MalformedURLException ex) {
                Logger.getLogger("payara").log(Level.WARNING, ex.getLocalizedMessage(), ex); // NOI18N
            }
        } else {
            String message = NbBundle.getMessage(ViewAdminConsoleAction.class, 
                    "MSG_ServerMustBeRunning"); // NOI18N
            NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message,
                    NotifyDescriptor.DEFAULT_OPTION);
            DialogDisplayer.getDefault().notify(nd);
        }
    }
}
 
Example 18
Source File: AndroidBrowser.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void run() {
    String checkDevices = checkDevices();
    while (checkDevices != null) {
        NotifyDescriptor not = new NotifyDescriptor(
                checkDevices,
                Bundle.ERR_Title(),
                NotifyDescriptor.DEFAULT_OPTION,
                NotifyDescriptor.ERROR_MESSAGE,
                null,
                null);
        Object value = DialogDisplayer.getDefault().notify(not);
        if (NotifyDescriptor.CANCEL_OPTION == value || checkDevices.equals(Bundle.ERR_AdbNotFound())) {
            return;
        } else {
            checkDevices = checkDevices();
        }
    }

    Browser b;
    boolean emulator;
    if (kind.equals(AndroidBrowser.Kind.ANDROID_DEVICE_DEFAULT)) {
        b = Browser.DEFAULT;
        emulator = false;
    } else if (kind.equals(AndroidBrowser.Kind.ANDROID_DEVICE_CHROME)) {
        b = Browser.CHROME;
        emulator = false;
    } else {
        b = Browser.DEFAULT;
        emulator = true;
    }
    Device device = new AndroidDevice("android", b, emulator); // NOI18N

    device.openUrl(url.toExternalForm());

    final Project project = context.lookup(Project.class);
    if (Browser.CHROME.getName().equals(b.getName()) && project != null) {
        try {
            build.startDebugging(device, project, new ProxyLookup(context, Lookups.fixed(BrowserFamilyId.ANDROID, ImageUtilities.loadImage("org/netbeans/modules/cordova/platforms/android/androiddevice16.png"), url)), false);
        } catch (IllegalStateException ex) {
            LOGGER.log(Level.INFO, ex.getMessage(), ex);
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    JOptionPane.showMessageDialog(
                            WindowManager.getDefault().getMainWindow(),
                            Bundle.ERR_WebDebug());
                }
            });
        }
    }

}
 
Example 19
Source File: ProfilesPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed
    JFileChooser chooser = getFileChooser();
    int ret = chooser.showOpenDialog(this);
    boolean notFound = false;
    Throwable err = null;
    
    if(ret != JFileChooser.APPROVE_OPTION) {
        return;
    }
    MutableShortcutsModel kmodel = getKeymapPanel().getMutableModel();
    String newProfile = null;
    try {
        InputSource is = new InputSource(new FileInputStream(chooser.getSelectedFile()));
        newProfile = duplicateProfile();
        if (newProfile == null) return; //invalid (duplicate) profile name
        kmodel.setCurrentProfile(newProfile);

        Document doc = XMLUtil.parse(is, false, true, null, EntityCatalog.getDefault());
        Node root = doc.getElementsByTagName(ELEM_XML_ROOT).item(0);
        if (root == null) {
            throw new IOException(NbBundle.getMessage(ProfilesPanel.class, "Import.invalid.file"));
        }
        NodeList nl = root.getChildNodes();
        for (int i = 0; i < nl.getLength(); i++) {//iterate stored actions
            Node action = nl.item(i);
            final NamedNodeMap attributes = action.getAttributes();
            if (attributes == null) continue;
            String id = attributes.item(0).getNodeValue();
            ShortcutAction sca = kmodel.findActionForId(id);
            NodeList childList = action.getChildNodes();
            int childCount = childList.getLength();
            Set<String> shortcuts = new LinkedHashSet<String>(childCount);
            for (int j = 0; j < childCount; j++) {//iterate shortcuts
                //iterate shortcuts
                NamedNodeMap attrs = childList.item(j).getAttributes();
                if (attrs != null) {
                    String sc = attrs.item(0).getNodeValue();
                    shortcuts.add(ExportShortcutsAction.portableRepresentationToShortcut(sc));
                }
            }
            if (sca == null) {
                notFound = true;
                LOG.log(Level.WARNING, "Failed to import binding for: {0}, keys: {1}", new Object[] { id, shortcuts });
                continue;
            } else {
                kmodel.setShortcuts(sca, shortcuts);
            }
        }

    } catch (IOException | SAXException ex) {
        err = ex;
    }
    
    String msg = null;
    
    if (err != null) {
        msg = NbBundle.getMessage(ProfilesPanel.class, "Import.io.error", err.getLocalizedMessage());
        // attempt to remove the newly created profile:
        if (newProfile != null) {
            kmodel.deleteOrRestoreProfile(newProfile);
            model.removeItem(newProfile);
            profilesList.clearSelection();
        }
    } else if (notFound) {
        msg = NbBundle.getMessage(ProfilesPanel.class, "Import.failed.unknown.id");
    }
    
    if (msg != null) {
        NotifyDescriptor nd = new NotifyDescriptor(
                msg, 
                NbBundle.getMessage(ProfilesPanel.class, "Import.failed.title"), 
                NotifyDescriptor.DEFAULT_OPTION, 
                NotifyDescriptor.INFORMATION_MESSAGE, new Object[] { NotifyDescriptor.OK_OPTION }, NotifyDescriptor.OK_OPTION);
    
        DialogDisplayer.getDefault().notify(nd);
    }

}
 
Example 20
Source File: PluginManager.java    From netbeans with Apache License 2.0 3 votes vote down vote up
/** Open standard dialog for installing a module including declared dependencies.
 * Shows it to the user, asks for confirmation, license acceptance, etc.
 * The whole operation requires AWT dispatch thread access (to show the dialog)
 * and blocks (until the user clicks through), so either call from AWT dispatch
 * thread directly, or be sure you hold no locks and block no progress of other
 * threads to avoid deadlocks.
 *
 * @param codenamebase the codenamebase of module to install
 * @param displayName the display name of the module
 * @param alternativeOptions alternative options possibly displayed in error
 *             dialog user may choose if it is not possible to install the plugin;
 *             if chosen the option is return value of this method
 * @return <code>null</code> if the module has been successfully installed
 *             and/or activated, otherwise it returns the options user has
 *             selected in problem dialog, typically {@link NotifyDescriptor#DEFAULT_OPTION}
 *             (on esc), {@link NotifyDescriptor#CANCEL_OPTION} or
 *             any of <code>alternativeOptions</code>.
 * @since 1.35
 * @see #install(java.util.Set, java.lang.Object[]) 
 */
@CheckForNull
public static Object installSingle(@NonNull String codenamebase, @NonNull String displayName,
        @NonNull Object... alternativeOptions) {
    Parameters.notNull("cnb", codenamebase);
    Parameters.notNull("displayName", displayName);
    Parameters.notNull("alternativeOptions", alternativeOptions);

    try {
        return new ModuleInstallerSupport(alternativeOptions).installPlugins(displayName, Collections.singleton(codenamebase));
    } catch (OperationException ex) {
        Logger.getLogger(PluginManager.class.getName()).log(Level.WARNING, null, ex);
    }
    return NotifyDescriptor.DEFAULT_OPTION;
}