Messages m = e.getAnnotation(Messages.class); if (m != null) { for (String kv : m.value()) { if (kv.startsWith(key + "=")) { return;
/** * Shows libraries customizer displaying all currently open library managers. * @return true if user pressed OK and libraries were sucessfully modified */ @Messages("TXT_LibrariesManager=Ant Library Manager") private static boolean showCustomizer () { AllLibrariesCustomizer customizer = new AllLibrariesCustomizer(); DialogDescriptor descriptor = new DialogDescriptor(customizer, TXT_LibrariesManager()); Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor); try { dlg.setVisible(true); if (descriptor.getValue() == DialogDescriptor.OK_OPTION) { return customizer.apply(); } else { return false; } } finally { dlg.dispose(); } }
@ActionID(category = "BusViews", id = "com.github.kayak.mapview.OpenMapViewAction") @ActionRegistration(displayName = "#CTL_OpenMapView", iconBase="com/github/kayak/mapview/icons/internet-web-browser.png") @ActionReferences(value = { @ActionReference(path = "Menu/Bus views", position = 15), @ActionReference(path = "Toolbars/Bus views", position = 15) }) @Messages("CTL_OpenMapView=Open map view") public final class OpenMapViewAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { MapViewTopComponent tc = new MapViewTopComponent(); tc.open(); tc.requestActive(); } }
@Messages("MSG_unsupported_rename=Renaming nonterminal package components is not supported in reduced tree mode when subpackages are present.") @Override public void setName (final String name) { if (parent != null) { if (PackageViewChildren.isValidPackageName(name)) { PackageRenameHandler prh = Lookup.getDefault().lookup(PackageRenameHandler.class); FolderRenameHandler frh = Lookup.getDefault().lookup(FolderRenameHandler.class); if (prh != null && frh != null) { // refactoring support present DataFolder folder = getLookup().lookup(DataFolder.class); DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(MSG_unsupported_rename(), NotifyDescriptor.INFORMATION_MESSAGE)); return; DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(MSG_InvalidPackageName(), NotifyDescriptor.INFORMATION_MESSAGE));
@Messages("CTL_GenerateAllAction=Generate All") @ActionID(id = "org.netbeans.modules.groovy.grailsproject.actions.GenerateAllAction", category = "Build") @ActionRegistration(lazy = false, displayName = "#CTL_GenerateAllAction") @ActionReference(path = ACTIONS, position = 20,separatorAfter=50) public final class GenerateAllAction extends GenerateAction { public GenerateAllAction() { super("generate-all", CTL_GenerateAllAction()); } }
@Messages({"LBL_Preparing=Preparing...", "#{0} - the name of the file being formatted", "LBL_Formatting=Formatting: {0}", "LBL_BulkFormatting=Formatting"}) private static void doFormat(ProgressHandle handle, AtomicBoolean cancel) throws IOException { try { for (PathRecognizer pr : Lookup.getDefault().lookupAll(PathRecognizer.class)) { Set<String> ids = pr.getSourcePathIds(); Set<FileObject> nonRecursiveRoots = new HashSet<FileObject>(); for (NonRecursiveFolder f : context.lookupAll(NonRecursiveFolder.class)) { if (cancel.get()) return; nonRecursiveRoots.add(f.getFolder());
@Messages("RenameTemplatePanel.title.text=Rename Template") private static void showRename(TemplateNode n) { String name = n.getFileName(); String displayName = n.getDisplayName(); FileObject fo = n.getLookup().lookup(FileObject.class); RenameTemplatePanel editPanel = new RenameTemplatePanel(isUserFile(fo)); if (LICENSES_FOLDER.equals(fo.getParent().getPath())) { editPanel.setIsLicense(true); } editPanel.setOtherFileNames(getOtherFileNames(n)); String title = RenameTemplatePanel_title_text(); DialogDescriptor dd = new DialogDescriptor(editPanel, title); editPanel.setDescriptor(dd); editPanel.setFileName(name); editPanel.setFileDisplayName(displayName); Object res = DialogDisplayer.getDefault().notify(dd); if (DialogDescriptor.OK_OPTION.equals(res)) { name = editPanel.getFileName(); displayName = editPanel.getFileDisplayName(); n.setFileName(name); try { fo.setAttribute (TEMPLATE_DISPLAY_NAME_ATTRIBUTE, displayName); fo.setAttribute (TEMPLATE_LOCALIZING_BUNDLE_ATTRIBUTE, null); } catch (IOException ex) { Logger.getLogger(TemplatesPanel.class.getName()).log(Level.WARNING, null, ex); } n.setDisplayName(displayName); } }
@Messages({ "# {0} - sharable library location", "FileChooserAccessory.warning1=Files can be only copied to the sharable libraries location ({0}) or its subfolder(s).", "# {0} - folder location to be created", "FileChooserAccessory.warning2=Are you sure you want to create folder {0} ?", if (!f.getPath().equals(sharedLibrariesFolder.getPath()) && !(f.getPath()).startsWith(sharedLibrariesFolder.getPath()+File.separatorChar)) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(FileChooserAccessory_warning1(sharedLibrariesFolder.getPath()))); File testFile = new File(f, file.getName()); if (testFile.exists()) { if (NotifyDescriptor.YES_OPTION != DialogDisplayer.getDefault().notify(new NotifyDescriptor.Confirmation(FileChooserAccessory_warning3()))) { return false;
@Messages({ "junitlib_confirm_title=Create Tests", "junitlib_confirm_text=<html><p>To create JUnit tests, the IDE needs to download and install the JUnit library.</p><p>Do you want to proceed?<p>", for (BrokenReferencesSupport.LibraryDefiner definer : Lookup.getDefault().lookupAll(BrokenReferencesSupport.LibraryDefiner.class)) { Callable<Library> download = definer.missingLibrary(version); if (download != null) { accept.setDefaultCapable(true); nd.setOptions(new Object[] {accept, NotifyDescriptor.CANCEL_OPTION}); if (DialogDisplayer.getDefault().notify(nd) == accept) { try { download.call();
@Messages({ "TXT_Loading=Loading...", "MSG_FailedSHA1=<Failed to calculate SHA1>", @Override public void componentOpened() { final Artifact artifact = getLookup().lookup(Artifact.class); assert artifact != null; final NBVersionInfo info = getLookup().lookup(NBVersionInfo.class); if (info != null) { txtGroupId.setText(info.getGroupId());
@TriggerTreeKind(Tree.Kind.CLASS) @Messages("ERR_CreateTestClassHint=Create Test Class") public static ErrorDescription computeWarning(HintContext context) { TreePath tp = context.getPath(); Collection<? extends TestCreatorProvider> providers = Lookup.getDefault().lookupAll(TestCreatorProvider.class); Map<Object, List<String>> validCombinations = Utils.getValidCombinations(info, null); if (validCombinations == null) { // no TestCreatorProvider found
/** * Sets the clipboard context in textual-format. * * @param content */ @Messages({ "# {0} - copied file path", "CTL_Status_CopyToClipboardSingle=Copy to Clipboard: {0}", "# {0} - number of copied paths", "CTL_Status_CopyToClipboardMulti={0} paths were copied to clipboard" }) private void setClipboardContents(String content, int items) { Clipboard clipboard = Lookup.getDefault().lookup(ExClipboard.class); if (clipboard == null) { clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); } if (clipboard != null) { String statusText = items > 1 ? Bundle.CTL_Status_CopyToClipboardMulti(items) : Bundle.CTL_Status_CopyToClipboardSingle(content); StatusDisplayer.getDefault().setStatusText(statusText); clipboard.setContents(new StringSelection(content), null); } } }
@Messages({ "ERR_InvalidName=The library name is not valid.", "# {0} - library name", "ERR_ExistingName=Library {0} already exists." }) private void nameChanged () { Node[] nodes = this.getExplorerManager().getSelectedNodes(); if (nodes.length == 1) { final LibraryImplementation lib = nodes[0].getLookup().lookup(LibraryImplementation.class); if (lib == null) { return; } final String newName = this.libraryName.getText(); if (newName.equals(LibrariesSupport.getLocalizedName(lib))) { return; } if (newName.length () == 0) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(ERR_InvalidName(), NotifyDescriptor.ERROR_MESSAGE)); } else if (isExistingDisplayName(model, newName, model.getArea(lib))) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(ERR_ExistingName(newName), NotifyDescriptor.ERROR_MESSAGE)); } else { LibrariesSupport.setDisplayName(lib, newName); } } }
/** * Show dialog that allows to edit source and javadoc jar/folder locations * for a given jar/folder on the classpath. Returns null when dialog was cancelled, * otherwise returns EditJarSupport.Item bean with new values. * * @param helper * @param item - bean with currently used values for classpath jar, source and javadoc jars location * @return null if dialog cancelled, or the original item with modified values */ @Messages("TIT_Edit_jar_reference=Edit Jar Reference") public static Item showEditDialog(AntProjectHelper helper, Item item) { EditJarPanel panel = new EditJarPanel(item, helper); DialogDescriptor dd = new DialogDescriptor(panel, TIT_Edit_jar_reference()); Object ret = DialogDisplayer.getDefault().notify(dd); if (DialogDescriptor.OK_OPTION == ret) { return panel.assignValues(); } return null; }
@Override @Messages({"BTN_OK=OK", "BTN_Cancel=Cancel", "CAP_Reformat=Format Recursively" final ProgressHandle handle = ProgressHandleFactory.createHandle("Format"); final ConfirmationPanel panel = new ConfirmationPanel(handle); DialogDescriptor nd = new DialogDescriptor(panel, Bundle.CAP_Reformat(), true, new Object[] {ok, cancelButton}, ok, DialogDescriptor.DEFAULT_ALIGN, null, new ActionListener() { @Override public void actionPerformed(ActionEvent e) {} }); d[0] = DialogDisplayer.getDefault().createDialog(nd); d[0].setVisible(true);
@Messages("LBL_Edit_Repo=Edit Repository") @Override public void actionPerformed(ActionEvent e) { final RepositoryRegisterUI rrui = new RepositoryRegisterUI(RepositoryNode.this.info); rrui.getAccessibleContext().setAccessibleDescription(LBL_Edit_Repo()); DialogDescriptor dd = new DialogDescriptor(rrui, LBL_Edit_Repo()); dd.setClosingOptions(new Object[]{ rrui.getButton(), DialogDescriptor.CANCEL_OPTION }); dd.setOptions(new Object[]{ rrui.getButton(), DialogDescriptor.CANCEL_OPTION }); Object ret = DialogDisplayer.getDefault().notify(dd); if (rrui.getButton() == ret) { RepositoryInfo info; info = rrui.getRepositoryInfo(); } catch (URISyntaxException x) { DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(x.getLocalizedMessage(), NotifyDescriptor.ERROR_MESSAGE)); return;
@Messages({ "LBL_Beans_LOADER=Files of Beans" }) displayName = "#LBL_Beans_LOADER" @ActionReferences({ @ActionReference( path = "Loaders/text/x-beans+xml/Actions", id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"), position = 100, separatorAfter = 200 ), @ActionReference( path = "Loaders/text/x-beans+xml/Actions", id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), position = 300 ), @ActionReference( path = "Loaders/text/x-beans+xml/Actions", id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), position = 400, separatorAfter = 500
/** * Show a multistep wizard for converting a non-sharable project to a sharable, self-contained one. * @param helper * @param ref * @param libraryNames * @param jarReferences * @return true is migration was performed, false when aborted. */ @Messages({ "TIT_MakeSharableWizard=New Libraries Folder", "ACSD_MakeSharableWizard=Wizard dialog that guides you through the process of making the project self-contained and sharable in respect to binary dependencies." }) public static boolean showMakeSharableWizard(final AntProjectHelper helper, ReferenceHelper ref, List<String> libraryNames, List<String> jarReferences) { final CopyIterator cpIt = new CopyIterator(helper); final WizardDescriptor wizardDescriptor = new WizardDescriptor(cpIt); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle(TIT_MakeSharableWizard()); wizardDescriptor.putProperty(PROP_HELPER, helper); wizardDescriptor.putProperty(PROP_REFERENCE_HELPER, ref); wizardDescriptor.putProperty(PROP_LIBRARIES, libraryNames); wizardDescriptor.putProperty(PROP_JAR_REFS, jarReferences); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.getAccessibleContext().setAccessibleDescription(ACSD_MakeSharableWizard()); dialog.setVisible(true); dialog.toFront(); return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION && cpIt.isSuccess(); }
@ActionID( category = "SonarQube", id = "qubexplorer.ui.SonarDialogAction") @ActionRegistration( displayName = "#CTL_SonarDialogAction") @Messages("CTL_SonarDialogAction=Get Issues from Server") public final class ServerIssuesAction implements ActionListener { private final Project context; public ServerIssuesAction(Project context) { this.context = context; } @Override public void actionPerformed(ActionEvent ev) { SonarQubeProjectConfiguration configuration = ConfigurationFactory.createDefaultConfiguration(context); if (configuration != null) { final ProjectContext projectContext = new ProjectContext(context, configuration); final SonarQube sonarQube = SonarQubeFactory.createForDefaultServerUrl(); TaskExecutor.execute(new SummaryTask(sonarQube, projectContext, new SummaryOptions<>(Severity.getType(), Collections.emptyList()))); } } }
String simplename = findCompilationUnitName(e); List<String> runningComments = new ArrayList<String>(); for (String keyValue : e.getAnnotation(NbBundle.Messages.class).value()) { if (keyValue.startsWith("#")) { runningComments.add(keyValue);