本文整理匯總了Java中org.openide.NotifyDescriptor.INFORMATION_MESSAGE屬性的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.INFORMATION_MESSAGE屬性的具體用法?Java NotifyDescriptor.INFORMATION_MESSAGE怎麽用?Java NotifyDescriptor.INFORMATION_MESSAGE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openide.NotifyDescriptor
的用法示例。
在下文中一共展示了NotifyDescriptor.INFORMATION_MESSAGE屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: schemaTypeChangeHandler
private void schemaTypeChangeHandler(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schemaTypeChangeHandler
if (!this.isInitializing()){
if (!SCHEMA_TYPE_XML.equals(this.cmbSchemaType.getSelectedItem())){
NotifyDescriptor nd = new NotifyDescriptor.Message(
getMsg("MSG_SchemaTypeNotSupported", // NOI18N
this.cmbSchemaType.getSelectedItem()),
NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
}
}
}
示例2: performContextAction
void performContextAction (final Node[] nodes, final boolean singleDiffSetup) {
// reevaluate fast enablement logic guess
if(!Subversion.getInstance().checkClientAvailable()) {
return;
}
boolean noop;
Context context = getContext(nodes);
TopComponent activated = TopComponent.getRegistry().getActivated();
if (activated instanceof DiffSetupSource) {
noop = ((DiffSetupSource) activated).getSetups().isEmpty();
} else {
noop = !Subversion.getInstance().getStatusCache().containsFiles(context, FileInformation.STATUS_LOCAL_CHANGE, true);
}
if (noop) {
NotifyDescriptor msg = new NotifyDescriptor.Message(NbBundle.getMessage(ExportDiffAction.class, "BK3001"), NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notify(msg);
return;
}
ExportDiffSupport exportDiffSupport = new ExportDiffSupport(context.getRootFiles(), SvnModuleConfig.getDefault().getPreferences()) {
@Override
public void writeDiffFile(final File toFile) {
RequestProcessor rp = Subversion.getInstance().getRequestProcessor();
SvnProgressSupport ps = new SvnProgressSupport() {
@Override
protected void perform() {
async(this, nodes, toFile, singleDiffSetup);
}
};
ps.start(rp, null, getRunningName(nodes)).waitFinished();
}
};
exportDiffSupport.export();
}
示例3: getMessageTypeDescription
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
}
示例4: handleResult
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);
}
}
示例5: findAndRunAction
/**
* Find action by display name and run it.
*/
@NbBundle.Messages({
"LBL_SearchingRecentResult=Searching for a Quick Search Item",
"MSG_RecentResultNotFound=Recent Quick Search Item was not found."})
private void findAndRunAction() {
final AtomicBoolean cancelled = new AtomicBoolean(false);
ProgressHandle handle = ProgressHandleFactory.createHandle(
Bundle.LBL_SearchingRecentResult(), new Cancellable() {
@Override
public boolean cancel() {
cancelled.set(true);
return true;
}
});
handle.start();
ResultsModel model = ResultsModel.getInstance();
Task evaluate = CommandEvaluator.evaluate(
stripHTMLandPackageNames(name), model);
RP.post(evaluate);
int tries = 0;
boolean found = false;
while (tries++ < 30 && !cancelled.get()) {
if (checkActionWasFound(model, true)) {
found = true;
break;
} else if (evaluate.isFinished()) {
found = checkActionWasFound(model, false);
break;
}
}
handle.finish();
if (!found && !cancelled.get()) {
NotifyDescriptor nd = new NotifyDescriptor.Message(
Bundle.MSG_RecentResultNotFound(),
NotifyDescriptor.INFORMATION_MESSAGE);
DialogDisplayer.getDefault().notifyLater(nd);
}
}
示例6: handleIOEFromReload
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);
}
示例7: actionPerformed
/**
* 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);
}
}
示例8: taskFinished
@Override
public void taskFinished(Task task) {
FileObject modeDir = userDir.get().getFileObject("config/Windows2Local/Modes");
OutputStream os;
if (modeDir != null) {
StringBuilder sb = new StringBuilder();
try {
FileSystem layer = findLayer(project);
if (layer == null) {
throw new IOException("Cannot find layer in " + project); // NOI18N
}
for (FileObject m : modeDir.getChildren()) {
if (m.isData() && "wsmode".equals(m.getExt())) {
final String name = "Windows2/Modes/" + m.getNameExt(); // NOI18N
FileObject mode = FileUtil.createData(layer.getRoot(), name); // NOI18N
os = mode.getOutputStream();
os.write(DesignSupport.readMode(m).getBytes("UTF-8")); // NOI18N
os.close();
sb.append(name).append("\n");
}
}
NotifyDescriptor nd = new NotifyDescriptor.Message(
NbBundle.getMessage(DesignSupport.class, "MSG_ModesGenerated", new Object[] {sb}),
NotifyDescriptor.INFORMATION_MESSAGE
);
DialogDisplayer.getDefault().notifyLater(nd);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
EventQueue.invokeLater(this);
}
示例9: performAction
@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);
}
}
}
示例10: generate
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);
}
}
示例11: generate
/**
* 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);
}
示例12: performAction
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);
}
}
}
示例13: importButtonActionPerformed
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);
}
}
示例14: notifyNoSQLExecuted
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);
}
示例15: performContextAction
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();
}