本文整理匯總了Java中org.openide.NotifyDescriptor.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java NotifyDescriptor.setTitle方法的具體用法?Java NotifyDescriptor.setTitle怎麽用?Java NotifyDescriptor.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.NotifyDescriptor
的用法示例。
在下文中一共展示了NotifyDescriptor.setTitle方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkExistingDatabase
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
* Check to see if a database already exists, and raise a message to
* the user if it does.
*
* @return true if it's OK to continue or false to cancel
*/
private static boolean checkExistingDatabase(
DatabaseServer server, String dbname) throws DatabaseException {
if ( ! server.databaseExists(dbname)) {
return true;
}
NotifyDescriptor ndesc = new NotifyDescriptor.Message(
NbBundle.getMessage(CreateDatabasePanel.class,
"CreateNewDatabasePanel.MSG_DatabaseAlreadyExists",
dbname));
ndesc.setTitle(NbBundle.getMessage(CreateDatabasePanel.class,
"CreateNewDatabasePanel.STR_DatabaseExistsTitle"));
DialogDisplayer.getDefault().notify(ndesc);
return false;
}
示例2: performContextAction
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void performContextAction(final Node[] nodes) {
NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(DeleteLocalAction.class, "CTL_DeleteLocal_Prompt")); // NOI18N
descriptor.setTitle(NbBundle.getMessage(DeleteLocalAction.class, "CTL_DeleteLocal_Title")); // NOI18N
descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
Object res = DialogDisplayer.getDefault().notify(descriptor);
if (res != NotifyDescriptor.YES_OPTION) {
return;
}
final Context ctx = getContext(nodes);
ProgressSupport support = new ContextAction.ProgressSupport(this, nodes, ctx) {
public void perform() {
performDelete(ctx, this);
}
};
support.start(createRequestProcessor(ctx));
}
示例3: showDialog
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private static boolean showDialog(URL whereTo) {
String msg = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Message");
String tit = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Title");
String yes = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Yes");
String later = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Later");
String never = NbBundle.getMessage(FeedbackSurvey.class, "MSG_FeedbackSurvey_Never");
NotifyDescriptor nd = new NotifyDescriptor.Message(msg, NotifyDescriptor.QUESTION_MESSAGE);
nd.setTitle(tit);
//Object[] buttons = { yes, later, never };
JButton yesButton = new JButton();
yesButton.getAccessibleContext().setAccessibleDescription(
NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Yes"));
Mnemonics.setLocalizedText(yesButton, yes);
JButton laterButton = new JButton();
laterButton.getAccessibleContext().setAccessibleDescription(
NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Later"));
Mnemonics.setLocalizedText(laterButton, later);
JButton neverButton = new JButton();
neverButton.getAccessibleContext().setAccessibleDescription(
NbBundle.getMessage(FeedbackSurvey.class, "ACSD_FeedbackSurvey_Never"));
Mnemonics.setLocalizedText(neverButton, never);
Object[] buttons = { yesButton, laterButton, neverButton };
nd.setOptions(buttons);
Object res = DialogDisplayer.getDefault().notify(nd);
if (res == yesButton) {
HtmlBrowser.URLDisplayer.getDefault().showURL(whereTo);
return true;
} else {
if( res == neverButton ) {
Preferences prefs = NbPreferences.forModule(FeedbackSurvey.class);
prefs.putInt("feedback.survey.show.count", (int)bundledInt("MSG_FeedbackSurvey_AskTimes")); // NOI18N
}
return false;
}
}
示例4: harness
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Messages({
"ERR_harness_too_old=You are attempting to build a module or suite project which uses a new metadata format with an old version of the module build harness which does not understand this format. You may either choose a newer NetBeans platform, or switch the harness used by the selected platform to use a newer harness (try using the harness supplied with the IDE).",
"TITLE_harness_too_old=Harness Too Old"
})
static void promptForNewerHarness() {
// #82388: warn the user that the harness version is too low.
NotifyDescriptor d = new NotifyDescriptor.Message(ERR_harness_too_old(), NotifyDescriptor.ERROR_MESSAGE);
d.setTitle(TITLE_harness_too_old());
DialogDisplayer.getDefault().notify(d);
}
示例5: alert
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
/**
* Display an alert asking the user whether to really generate a target.
* @param commandDisplayName the display name of the action to be bound
* @param scriptPath the path that to the script that will be generated or written to
* @return true if IDE should proceed
*/
private boolean alert(String commandDisplayName, String scriptPath) {
String projectDisplayName = ProjectUtils.getInformation(project).getDisplayName();
String title = NbBundle.getMessage(JavaActions.class, "TITLE_generate_target_dialog", commandDisplayName, projectDisplayName);
String body = NbBundle.getMessage(JavaActions.class, "TEXT_generate_target_dialog", commandDisplayName, scriptPath);
NotifyDescriptor d = new NotifyDescriptor.Message(body, NotifyDescriptor.QUESTION_MESSAGE);
d.setTitle(title);
d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);
JButton generate = new JButton(NbBundle.getMessage(JavaActions.class, "LBL_generate"));
generate.setDefaultCapable(true);
d.setOptions(new Object[] {generate, NotifyDescriptor.CANCEL_OPTION});
return DialogDisplayer.getDefault().notify(d) == generate;
}
示例6: removeLocalesActionPerformed
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void removeLocalesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeLocalesActionPerformed
Object[] selectedValues = localesList.getSelectedValues();
String basicName = propDataObject.getPrimaryFile().getName();
basicName = Util.getBaseName(basicName);
NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(BundleNodeCustomizer.class, "CTL_Deletebundle_Prompt"));
descriptor.setTitle(NbBundle.getMessage(BundleNodeCustomizer.class, "CTL_Deletebundle_Title"));
descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
Object res = DialogDisplayer.getDefault().notify(descriptor);
if (res != NotifyDescriptor.YES_OPTION) {
return;
}
for(int i=0; i<selectedValues.length; i++) {
PropertiesFileEntry entry = propDataObject.getBundleStructure().getEntryByFileName(basicName + PropertiesDataLoader.PRB_SEPARATOR_CHAR + selectedValues[i].toString());
try {
entry.delete();
if (!propDataObject.isValid()) {
propDataObject = Util.findPrimaryDataObject(propDataObject);
nameText.setText(propDataObject.getName());
}
} catch(IOException ioe) {
org.openide.ErrorManager.getDefault().notify(org.openide.ErrorManager.INFORMATIONAL, ioe);
}
}
localesList.setListData(retrieveLocales(propDataObject));
}
示例7: displayConfirmation
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@Override
public Boolean displayConfirmation(String message, String caption, boolean cancellable) {
NotifyDescriptor nd = new NotifyDescriptor.Confirmation(message,
cancellable ? NotifyDescriptor.YES_NO_CANCEL_OPTION : NotifyDescriptor.YES_NO_OPTION);
if (caption != null) nd.setTitle(caption);
Object ret = DialogDisplayer.getDefault().notify(nd);
if (ret == NotifyDescriptor.YES_OPTION) return Boolean.TRUE;
if (ret == NotifyDescriptor.NO_OPTION) return Boolean.FALSE;
return null;
}
示例8: displayMessage
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private void displayMessage(String message, String caption, String details, int type) {
Object msg = message;
Object det = details;
if (isHtmlString(message)) msg = new NBHTMLLabel(message);
if (isHtmlString(details)) det = new NBHTMLLabel(message);
NotifyDescriptor nd = det == null ? new NotifyDescriptor.Message(msg, type) :
new ProfilerDialogs.MessageWithDetails(msg, det, type, false);
if (caption != null) nd.setTitle(caption);
ProfilerDialogs.notify(nd);
}
示例9: commitAfterMerge
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
private static boolean commitAfterMerge (boolean locallyModifiedExcluded, File repository) {
// XXX consider usage of repository to determine if there are any non-included files which have to be committed, too
// and thus removing the option HgModuleConfig.getDefault().getConfirmCommitAfterMerge()
if (locallyModifiedExcluded || HgModuleConfig.getDefault().getConfirmCommitAfterMerge()) { // ask before commit?
NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_QUERY")); // NOI18N
descriptor.setTitle(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_TITLE")); // NOI18N
descriptor.setMessageType(JOptionPane.WARNING_MESSAGE);
descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
Object res = DialogDisplayer.getDefault().notify(descriptor);
return res == NotifyDescriptor.YES_OPTION;
}
return true;
}
示例10: performAction
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
@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);
}
}
}
示例11: performAction
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
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);
}
}
}
示例12: showSaveError
import org.openide.NotifyDescriptor; //導入方法依賴的package包/類
protected void showSaveError(String errMsg) {
NotifyDescriptor errDialog
= new NotifyDescriptor.Message(errMsg, ERROR_MESSAGE);
errDialog.setTitle(getMessage("MSG_Title_SavingError")); //NOI18N
DialogDisplayer.getDefault().notify(errDialog);
}