Java Code Examples for org.openide.NotifyDescriptor#INFORMATION_MESSAGE
The following examples show how to use
org.openide.NotifyDescriptor#INFORMATION_MESSAGE .
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: SAView.java From visualvm with GNU General Public License v2.0 | 6 votes |
public void refresh(Object thread) { this.removeAll(); try { JavaStackTracePanel tracePanel = saModel.createJavaStackTracePanel(); if (thread != null) { tracePanel.setJavaThread(thread); } traceViewer = tracePanel.getPanel(); } catch (Throwable t) { NotifyDescriptor nd = new NotifyDescriptor.Message("Java Stack Trace Viewer is not yet implemented for this platform", NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(nd); dvc.removeDetailsView(detailsView); return; } add(traceViewer, BorderLayout.CENTER); }
Example 2
Source File: Configuration.java From netbeans with Apache License 2.0 | 5 votes |
private void handleIOEFromReload(IOException e) { Project project = FileOwnerQuery.getOwner(getProjectsConfigurationFile()); String projectDisplayName = project != null ? ProjectUtils.getInformation(project).getDisplayName() : "???"; //NOI18N String msg = String.format("An error found in the configuration file %s in the project %s: %s", getProjectsConfigurationFile().getNameExt(), projectDisplayName, e.getMessage()); NotifyDescriptor d = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notifyLater(d); }
Example 3
Source File: JBInstantiatingIterator.java From netbeans with Apache License 2.0 | 5 votes |
public static void showInformation(final String msg, final String title) { Runnable info = new Runnable() { public void run() { NotifyDescriptor d = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); d.setTitle(title); DialogDisplayer.getDefault().notify(d); } }; if (SwingUtilities.isEventDispatchThread()) { info.run(); } else { SwingUtilities.invokeLater(info); } }
Example 4
Source File: IpListActions.java From NBANDROID-V2 with Apache License 2.0 | 5 votes |
@Override protected void performAction(Node[] activatedNodes) { for (Node activatedNode : activatedNodes) { DevicesNode.MobileDeviceHolder holder = activatedNode.getLookup().lookup(DevicesNode.MobileDeviceHolder.class); if (holder != null) { List<AdbTools.IpRecord> deviceIps = AdbTools.getDeviceIps(holder.getUsb(), true); JTable table = new JTable(new DeviceIpListTablemodel(deviceIps)); JScrollPane pane = new JScrollPane(table); NotifyDescriptor nd = new NotifyDescriptor.Message(pane, NotifyDescriptor.INFORMATION_MESSAGE); nd.setTitle(holder.getSerialNumber() + " IP list"); DialogDisplayer.getDefault().notifyLater(nd); } } }
Example 5
Source File: RefreshServiceDialog.java From netbeans with Apache License 2.0 | 5 votes |
/** * This prompts the user if he/she wants to regenerate the impl bean * but does not give a choice as to refreshing the nodes (i.e. the nodes are * always refreshed. */ public static RefreshServiceDialog.Result openWithOKButtonOnly(boolean downloadWsdl, String implClass, String url) { RefreshServiceDialog delDialog = new RefreshServiceDialog(downloadWsdl, implClass, url); NotifyDescriptor desc = new NotifyDescriptor.Message(delDialog, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(desc); if(delDialog.regenerate()) { return Result.REGENERATE_IMPL_CLASS; } return Result.CLOSE; }
Example 6
Source File: PropertiesTableModel.java From netbeans with Apache License 2.0 | 5 votes |
private boolean isNotUnique(String newVal){ for(int i=0; i<data.size()-1; i++){ NameValuePair pair = (NameValuePair)data.elementAt(i); if(pair.getParamName().equals(newVal)){ NotifyDescriptor d = new NotifyDescriptor.Message(bundle.getString("Err_DuplicateValue"), NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(d); return true; } } return false; }
Example 7
Source File: NbPresenter.java From netbeans with Apache License 2.0 | 5 votes |
private static String getMessageTypeDescription(int messageType) { switch(messageType) { case NotifyDescriptor.ERROR_MESSAGE: return NbBundle.getBundle(NbPresenter.class).getString("ACSD_ErrorMessage"); // NOI18N case NotifyDescriptor.WARNING_MESSAGE: return NbBundle.getBundle(NbPresenter.class).getString("ACSD_WarningMessage"); // NOI18N case NotifyDescriptor.QUESTION_MESSAGE: return NbBundle.getBundle(NbPresenter.class).getString("ACSD_QuestionMessage"); // NOI18N case NotifyDescriptor.INFORMATION_MESSAGE: return NbBundle.getBundle(NbPresenter.class).getString("ACSD_InformationMessage"); // NOI18N case NotifyDescriptor.PLAIN_MESSAGE: return NbBundle.getBundle(NbPresenter.class).getString("ACSD_PlainMessage"); // NOI18N } return ""; // NOI18N }
Example 8
Source File: SelfSamplerAction.java From netbeans with Apache License 2.0 | 5 votes |
/** * Invoked when an action occurs. */ @Override public void actionPerformed(final ActionEvent e) { Sampler c = Sampler.createManualSampler("Self Sampler"); // NOI18N if (c != null) { if (RUNNING.compareAndSet(null, c)) { putValue(Action.NAME, ACTION_NAME_STOP); putValue(Action.SHORT_DESCRIPTION, ACTION_NAME_STOP); putValue ("iconBase", "org/netbeans/core/ui/sampler/selfSamplerRunning.png"); // NOI18N c.start(); } else if ((c = RUNNING.getAndSet(null)) != null) { final Sampler controller = c; setEnabled(false); SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { controller.stop(); return null; } @Override protected void done() { putValue(Action.NAME, ACTION_NAME_START); putValue(Action.SHORT_DESCRIPTION, ACTION_NAME_START); putValue ("iconBase", "org/netbeans/core/ui/sampler/selfSampler.png"); // NOI18N SelfSamplerAction.this.setEnabled(true); } }; worker.execute(); } } else { NotifyDescriptor d = new NotifyDescriptor.Message(NOT_SUPPORTED, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(d); } }
Example 9
Source File: CipherStrengthAction.java From constellation with Apache License 2.0 | 5 votes |
@Override public void actionPerformed(ActionEvent e) { try { final int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES"); final String msg = String.format("Maximum key length: %s", maxKeyLen == Integer.MAX_VALUE ? "unlimited" : Integer.toString(maxKeyLen)); final NotifyDescriptor nd = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(nd); } catch (NoSuchAlgorithmException ex) { Exceptions.printStackTrace(ex); } }
Example 10
Source File: GotoOppositeAction.java From netbeans with Apache License 2.0 | 5 votes |
public void handleResult(LocationResult opposite) { FileObject fileObject = opposite.getFileObject(); if (fileObject != null) { NbDocument.openDocument(fileObject, opposite.getOffset(), Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS); } else if (opposite.getErrorMessage() != null) { String msg = opposite.getErrorMessage(); NotifyDescriptor descr = new NotifyDescriptor.Message(msg, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(descr); } }
Example 11
Source File: AboutBart.java From BART with MIT License | 5 votes |
@Override public void actionPerformed(ActionEvent e) { ComponentKeyBinding.install(controller, panel); controller.getDocumentViewController().setAnnotationCallback( new org.icepdf.ri.common.MyAnnotationCallback( controller.getDocumentViewController())); //controller.openDocument("C:/Users/Musicrizz/Desktop/TR-01-2015.pdf"); //controller.openDocument("it/unibas/bartgui/resources/aboutbart/TR012015.pdf"); try{ FileObject file = FileUtil.getConfigFile("AboutBart/AboutBart.pdf"); if(file == null)throw new Exception(); controller.openDocument(file.getInputStream(), "About Bart engine", file.getPath()); }catch(Exception ex) { StringBuffer sb = new StringBuffer(); sb.append("Error Generation for Evaluating Data-Cleaning Algorithms \n\n"); sb.append(" Patricia C. Arocena - University of Toronto, Canada \n"); sb.append(" Giansalvatore Mecca - University of Basilicata, Italy \n"); sb.append(" Boris Glavic - Illinois Inst. of Technology, US \n"); sb.append(" Renée J. Miller - University of Toronto, Canada \n"); sb.append(" Paolo Papotti - QCRI Doha, Qatar \n"); sb.append(" Donatello Santoro - University of Basilicata, Italy \n"); NotifyDescriptor nd = new NotifyDescriptor.Message(sb.toString(), NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(nd); return; } DialogDescriptor dd = new DialogDescriptor(panel,"About BART"); DialogDisplayer.getDefault().createDialog(dd).setVisible(true); }
Example 12
Source File: RefreshWsDialog.java From netbeans with Apache License 2.0 | 5 votes |
/** * This prompts the user if he/she wants to regenerate the impl bean * but does not give a choice as to refreshing the nodes (i.e. the nodes are * always refreshed. */ public static String openWithOKButtonOnly(boolean downloadWsdl, String implClass, String url) { RefreshWsDialog delDialog = new RefreshWsDialog(downloadWsdl, implClass, url); NotifyDescriptor desc = new NotifyDescriptor.Message(delDialog, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(desc); if(delDialog.regenerate()) { return REGENERATE_IMPL_CLASS; } return DO_NOTHING; }
Example 13
Source File: DependenciesPanel.java From netbeans with Apache License 2.0 | 4 votes |
/** * Checks whether there is already dependency of the same name but * of a different type. If so then a dialog is displayed to determine * what should happen. * * @param libraryName name of the dependency to check. * @return {@code true} when the new dependency should be added, * returns {@code false} when the user decided to cancel addition * of the dependency. */ @NbBundle.Messages({ "DependenciesPanel.otherDependencyTitle=Another Dependency Type", "# {0} - library name", "# {1} - other dependencies message", "DependenciesPanel.otherDependencyWarning=There is another type " + "of dependency for \"{0}\" package. " + "{1}Do you want to remove these existing dependencies?", "DependenciesPanel.otherRegularDependency=a regular", "DependenciesPanel.otherDevelopmentDependency=a development", "DependenciesPanel.otherOptionalDependency=an optional", "# {0} - type of dependency", "DependenciesPanel.alsoDependency=It is also {0} dependency. ", "DependenciesPanel.addAndKeep=Add and Keep Existing", "DependenciesPanel.addAndRemove=Add and Remove Existing", "DependenciesPanel.cancel=Cancel" }) private boolean checkOtherDependencyTypes(String libraryName) { List<Dependency.Type> types = allDependencies.otherDependencyTypes(libraryName, dependencyType); if (!types.isEmpty()) { StringBuilder dependencyTypesMessage = new StringBuilder(); for (Dependency.Type type : types) { String dependencyTypeMessage; switch(type) { case REGULAR: dependencyTypeMessage = Bundle.DependenciesPanel_otherRegularDependency(); break; case DEVELOPMENT: dependencyTypeMessage = Bundle.DependenciesPanel_otherDevelopmentDependency(); break; case OPTIONAL: dependencyTypeMessage = Bundle.DependenciesPanel_otherOptionalDependency(); break; default: throw new InternalError(); } dependencyTypesMessage.append(Bundle.DependenciesPanel_alsoDependency(dependencyTypeMessage)); } String message = Bundle.DependenciesPanel_otherDependencyWarning(libraryName, dependencyTypesMessage); NotifyDescriptor descriptor = new NotifyDescriptor( message, Bundle.DependenciesPanel_otherDependencyTitle(), -1, NotifyDescriptor.INFORMATION_MESSAGE, new Object[] { Bundle.DependenciesPanel_addAndRemove(), Bundle.DependenciesPanel_addAndKeep(), Bundle.DependenciesPanel_cancel() }, Bundle.DependenciesPanel_addAndRemove() ); DialogDisplayer.getDefault().notify(descriptor); Object retVal = descriptor.getValue(); if (Bundle.DependenciesPanel_addAndKeep().equals(retVal)) { return true; } else if (Bundle.DependenciesPanel_addAndRemove().equals(retVal)) { allDependencies.removeOtherDependencies(libraryName, dependencyType); return true; } return false; } return true; }
Example 14
Source File: ExportDiffChangesAction.java From netbeans with Apache License 2.0 | 4 votes |
void performContextAction (Node[] nodes, final boolean singleDiffSetup) { boolean noop; final VCSContext context = HgUtils.getCurrentContext(nodes); TopComponent activated = TopComponent.getRegistry().getActivated(); Collection<Setup> setups = null; if (activated instanceof DiffSetupSource) { noop = (setups = ((DiffSetupSource) activated).getSetups()).isEmpty(); } else { File [] files = HgUtils.getModifiedFiles(context, FileInformation.STATUS_LOCAL_CHANGE, false); noop = files.length == 0; } if (noop) { NotifyDescriptor msg = new NotifyDescriptor.Message(NbBundle.getMessage(ExportDiffChangesAction.class, "BK3001"), NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(msg); return; } File[] roots = setups == null ? HgUtils.getActionRoots(context) : getRoots(setups); if (roots == null || roots.length == 0) { LOG.log(Level.INFO, "Null roots for {0}", context.getRootFiles()); //NOI18N return; } File contextFile = roots[0]; final File root = Mercurial.getInstance().getRepositoryRoot(contextFile); ExportDiffSupport exportDiffSupport = new ExportDiffSupport(new File[] {contextFile}, HgModuleConfig.getDefault().getPreferences()) { @Override public void writeDiffFile(final File toFile) { ExportDiffAction.saveFolderToPrefs(toFile); RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(root); HgProgressSupport ps = new HgProgressSupport() { @Override protected void perform() { async(this, root, context, toFile, singleDiffSetup); } }; ps.start(rp, root, org.openide.util.NbBundle.getMessage(ExportDiffChangesAction.class, "LBL_ExportChanges_Progress")).waitFinished(); } }; exportDiffSupport.export(); }
Example 15
Source File: CreateAvdVisualPanel1.java From NBANDROID-V2 with Apache License 2.0 | 4 votes |
private void unimplemented() { NotifyDescriptor nd = new NotifyDescriptor.Message("The feature is not yet implemented", NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notifyLater(nd); }
Example 16
Source File: ProfilesPanel.java From netbeans with Apache License 2.0 | 4 votes |
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 17
Source File: JAXBRefreshAction.java From netbeans with Apache License 2.0 | 4 votes |
protected void performAction(Node[] nodes) { Node node = nodes[ 0 ]; FileObject fo = node.getLookup().lookup( FileObject.class ); Project proj = node.getLookup().lookup(Project.class); String origLoc = (String) node.getValue( JAXBWizModuleConstants.ORIG_LOCATION); Boolean origLocIsURL = (Boolean) node.getValue( JAXBWizModuleConstants.ORIG_LOCATION_TYPE); FileObject locSchemaRoot = (FileObject) node.getValue( JAXBWizModuleConstants.LOC_SCHEMA_ROOT); if ( ( fo != null ) && ( origLoc != null ) ) { // XXX TODO run in separate non-awt thread. try { if (fo.canWrite()){ if (origLocIsURL){ URL url = new URL(origLoc); ProjectHelper.retrieveResource(locSchemaRoot, url.toURI()); } else { File projDir = FileUtil.toFile( proj.getProjectDirectory()); //File srcFile = new File(origLoc); File srcFile = FileSysUtil.Relative2AbsolutePath( projDir, origLoc); ProjectHelper.retrieveResource(fo.getParent(), srcFile.toURI()); } } else { String msg = NbBundle.getMessage(this.getClass(), "MSG_CanNotRefreshFile"); //NOI18N NotifyDescriptor d = new NotifyDescriptor.Message( msg, NotifyDescriptor.INFORMATION_MESSAGE); d.setTitle(NbBundle.getMessage(this.getClass(), "LBL_RefreshFile")); //NOI18N DialogDisplayer.getDefault().notify(d); } } catch (Exception ex){ log(ex); } } }
Example 18
Source File: EntityManagerGenerator.java From netbeans with Apache License 2.0 | 4 votes |
/** * Generates the code needed for retrieving and invoking * an instance of <code>javax.persistence.EntityManager</code>. The generated * code depends on the environment of the target class (e.g. whether * it supports injection or not). * * @param options the options for the generation. Must not be null. * @return the modified file object of the target java class. */ public FileObject generate(final GenerationOptions options) throws IOException{ final Class<? extends EntityManagerGenerationStrategy> strategyClass = getStrategy(); if (strategyClass == null){ NotifyDescriptor d = new NotifyDescriptor.Message( NbBundle.getMessage(EntityManagerGenerator.class, "ERR_NotSupported"), NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(d); return targetFo; } return generate(options, strategyClass); }
Example 19
Source File: ContainerManagedJTANonInjectableInWeb.java From netbeans with Apache License 2.0 | 4 votes |
public ClassTree generate() { if(!ElementKind.CLASS.equals(getClassElement().getKind())) { NotifyDescriptor nd = new NotifyDescriptor.Message(NbBundle.getMessage(ContainerManagedJTANonInjectableInWeb.class, "LBL_ClassOnly"), NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(nd); return getClassTree(); } else { FieldInfo em = getEntityManagerFieldInfo(); ModifiersTree methodModifiers = getTreeMaker().Modifiers( getGenerationOptions().getModifiers(), Collections.<AnnotationTree>emptyList() ); MethodTree newMethod = getTreeMaker().Method( methodModifiers, computeMethodName(), getTreeMaker().PrimitiveType(TypeKind.VOID), Collections.<TypeParameterTree>emptyList(), getParameterList(), Collections.<ExpressionTree>emptyList(), "{ " + getMethodBody(em) + "}", null ); //TODO: should be added automatically, but accessing web / ejb apis from this module // would require API changes that might not be doable for 6.0 String addToWebXmlComment = " Add this to the deployment descriptor of this module (e.g. web.xml, ejb-jar.xml):\n" + "<persistence-context-ref>\n" + " <persistence-context-ref-name>persistence/LogicalName</persistence-context-ref-name>\n" + " <persistence-unit-name>"+ getPersistenceUnitName() + "</persistence-unit-name>\n" + "</persistence-context-ref>\n" + "<resource-ref>\n" + " <res-ref-name>UserTransaction</res-ref-name>\n" + " <res-type>javax.transaction.UserTransaction</res-type>\n" + " <res-auth>Container</res-auth>\n" + "</resource-ref>\n"; MethodTree method = (MethodTree) importFQNs(newMethod); getTreeMaker().addComment(method.getBody().getStatements().get(0), Comment.create(Comment.Style.BLOCK, 0, 0, 4, addToWebXmlComment), true); return getTreeMaker().addClassMember(getClassTree(), method); } }
Example 20
Source File: SQLHistoryAction.java From netbeans with Apache License 2.0 | 4 votes |
private static void notifyNoSQLExecuted() { String message = NbBundle.getMessage(SQLExecutionBaseAction.class, "LBL_NoSQLExecuted"); NotifyDescriptor desc = new NotifyDescriptor.Message(message, NotifyDescriptor.INFORMATION_MESSAGE); DialogDisplayer.getDefault().notify(desc); }