本文整理汇总了Java中org.openide.DialogDisplayer类的典型用法代码示例。如果您正苦于以下问题:Java DialogDisplayer类的具体用法?Java DialogDisplayer怎么用?Java DialogDisplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DialogDisplayer类属于org.openide包,在下文中一共展示了DialogDisplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveSchemas
import org.openide.DialogDisplayer; //导入依赖的package包/类
@Override
protected boolean retrieveSchemas(SchemaPanel schemaPanel, DatabaseConnection dbcon, String defaultSchema) {
fireConnectionStep(NbBundle.getMessage (ConnectUsingDriverAction.class, "ConnectionProgress_Schemas")); // NOI18N
List<String> schemas = new ArrayList<String>();
try {
DatabaseMetaData dbMetaData = dbcon.getJDBCConnection().getMetaData();
if (dbMetaData.supportsSchemasInTableDefinitions()) {
ResultSet rs = dbMetaData.getSchemas();
if (rs != null) {
while (rs.next()) {
schemas.add(rs.getString(1).trim());
}
}
}
} catch (SQLException exc) {
String message = NbBundle.getMessage(ConnectUsingDriverAction.class, "ERR_UnableObtainSchemas", exc.getMessage()); // NOI18N
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(message, NotifyDescriptor.ERROR_MESSAGE));
}
return schemaPanel.setSchemas(schemas, defaultSchema);
}
示例2: showModalPanel
import org.openide.DialogDisplayer; //导入依赖的package包/类
/**
* Basically I18nPanel wrapped by Ok, Cancel and Help buttons shown.
* Handles OK button.
*/
private void showModalPanel() throws IOException {
DialogDescriptor dd = new DialogDescriptor(
createPanel(),
Util.getString("CTL_InsertI18nDialogTitle"),
true,
NotifyDescriptor.OK_CANCEL_OPTION,
NotifyDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx(InsertI18nStringAction.class),
null
);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
if (dd.getValue() == NotifyDescriptor.OK_OPTION) {
insertI18nString();
}
}
示例3: buttonManifestActionPerformed
import org.openide.DialogDisplayer; //导入依赖的package包/类
private void buttonManifestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonManifestActionPerformed
List<Map<String, String>> props = configs.getDefaultManifestEntriesTransparent();
JFXProjectProperties.PropertiesTableModel appManifestEntriesTableModel =
new JFXProjectProperties.PropertiesTableModel(props, null, JFXProjectConfigurations.APP_MANIFEST_SUFFIXES, appManifestEntriesColumnNames);
JFXApplicationMultiPropertyPanel panel = new JFXApplicationMultiPropertyPanel(appManifestEntriesTableModel);
panel.setTableTitle(NbBundle.getMessage(JFXPackagingPanel.class, "LBL_ApplicationCustomManifestEntries.tablelabel")); // NOI18N
panel.setRemark(NbBundle.getMessage(JFXPackagingPanel.class, "LBL_ApplicationCustomManifestEntries.remark")); // NOI18N
DialogDescriptor dialogDesc = new DialogDescriptor(panel, NbBundle.getMessage(JFXPackagingPanel.class, "TITLE_ApplicationCustomManifestEntries"), true, null); //NOI18N
panel.registerListeners();
panel.setDialogDescriptor(dialogDesc);
//panel.setColumnRenderer();
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDesc);
dialog.setVisible(true);
if (dialogDesc.getValue() == DialogDescriptor.OK_OPTION) {
appManifestEntriesTableModel.removeEmptyRows();
configs.setDefaultManifestEntriesTransparent(props);
updateManifestMessage();
}
panel.unregisterListeners();
dialog.dispose();
}
示例4: nameChanged
import org.openide.DialogDisplayer; //导入依赖的package包/类
@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);
}
}
}
示例5: show
import org.openide.DialogDisplayer; //导入依赖的package包/类
boolean show() {
okButton = new JButton(NbBundle.getMessage(MergeRevision.class, "LBL_MergeRevision.OKButton.text")); //NOI18N
org.openide.awt.Mnemonics.setLocalizedText(okButton, okButton.getText());
dd = new DialogDescriptor(panel, NbBundle.getMessage(MergeRevision.class, "LBL_MergeRevision.title"), true, //NOI18N
new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx("org.netbeans.modules.git.ui.merge.MergeRevision"), null); //NOI18N
enableRevisionPanel();
revisionPicker.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName() == RevisionDialogController.PROP_VALID) {
setValid(Boolean.TRUE.equals(evt.getNewValue()));
}
}
});
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return okButton == dd.getValue();
}
示例6: getFonts
import org.openide.DialogDisplayer; //导入依赖的package包/类
static private String [] getFonts () {
if (fonts == null) {
try {
fonts = GraphicsEnvironment.getLocalGraphicsEnvironment ().getAvailableFontFamilyNames();
} catch (RuntimeException e) {
fonts = new String[0]; //NOI18N
if (org.openide.util.Utilities.isMac()) {
String msg = NbBundle.getMessage(FontEditor.class, "MSG_AppleBug"); //NOI18N
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(msg));
} else {
throw e;
}
}
}
return fonts;
}
示例7: overrideAll
import org.openide.DialogDisplayer; //导入依赖的package包/类
private boolean overrideAll(Collection<ShortcutAction> actions) {
JPanel innerPane = new JPanel();
StringBuffer display = new StringBuffer();
for(ShortcutAction sc : actions) {
display.append(" '" + sc.getDisplayName() + "'<br>"); //NOI18N
}
innerPane.add(new JLabel(NbBundle.getMessage(KeymapViewModel.class, "Override_All", display))); //NOI18N
DialogDescriptor descriptor = new DialogDescriptor(
innerPane,
NbBundle.getMessage(KeymapViewModel.class, "Conflicting_Shortcut_Dialog"), //NOI18N
true,
DialogDescriptor.YES_NO_OPTION,
null,
null);
DialogDisplayer.getDefault().notify(descriptor);
if (descriptor.getValue().equals(DialogDescriptor.YES_OPTION))
return true;
else return false;
}
示例8: invoke
import org.openide.DialogDisplayer; //导入依赖的package包/类
@Override
public void invoke() {
Object o = component.getDocument().getProperty(Document.StreamDescriptionProperty);
if (o instanceof DataObject) {
DataObject d = (DataObject) o;
JButton ok = new JButton(LBL_ButtonOK());
FileObject primaryFile = d.getPrimaryFile();
TypeElement element = handle.resolve(javac);
TreePath path = javac.getTrees().getPath(element);
Scope scope = javac.getTrees().getScope(path);
final AddPropertyPanel addPropertyPanel = new AddPropertyPanel(javac, scope, existingFields, ok);
DialogDescriptor dd = new DialogDescriptor(addPropertyPanel, CAP_AddProperty(), true, new Object[] {ok, LBL_ButtonCancel()}, ok, DialogDescriptor.DEFAULT_ALIGN, null, null);
if (DialogDisplayer.getDefault().notify(dd) == ok) {
perform(primaryFile, component, addPropertyPanel.getAddPropertyConfig(), scope);
}
}
}
示例9: commitOrRollback
import org.openide.DialogDisplayer; //导入依赖的package包/类
protected void commitOrRollback(String cmdName) {
if (!error && commit(conn)) {
long executionTime = System.currentTimeMillis() - startTime;
String execTimeStr = SQLExecutionHelper.millisecondsToSeconds(executionTime);
String infoMsg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_execution_success", execTimeStr);
dataView.setInfoStatusText(infoMsg);
executeOnSucess(); // delegate
} else {
rollback(conn);
reinstateToolbar();
String msg = cmdName + " " + NbBundle.getMessage(SQLStatementExecutor.class, "MSG_failed");
if (ex == null) {
errorMsg = msg + " " + errorMsg;
} else {
errorMsg = msg;
}
ex = new DBException(errorMsg, ex);
dataView.setErrorStatusText(conn, null, ex);
NotifyDescriptor nd = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
}
}
示例10: handleEncodingChange
import org.openide.DialogDisplayer; //导入依赖的package包/类
private void handleEncodingChange () {
Charset enc = (Charset) encoding.getSelectedItem();
String encName;
if (enc != null) {
encName = enc.name();
}
else {
encName = originalEncoding;
}
if (!notified && encName!=null && !encName.equals(originalEncoding)) {
DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(
NbBundle.getMessage(CustomizerSources.class,"MSG_EncodingWarning"), NotifyDescriptor.WARNING_MESSAGE));
notified=true;
}
this.uiProperties.putAdditionalProperty(ProjectProperties.SOURCE_ENCODING, encName);
}
示例11: open
import org.openide.DialogDisplayer; //导入依赖的package包/类
public void open(JComponent progressComponent, String title) {
holder.add(progressComponent, BorderLayout.CENTER);
try {
DialogDescriptor dd = new DialogDescriptor(
this,
title,
true,
new Object[0],
DialogDescriptor.NO_OPTION,
DialogDescriptor.DEFAULT_ALIGN,
null,
null
);
dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
} finally {
if (dialog != null) {
dialog.dispose();
}
}
}
示例12: btnEditActionPerformed
import org.openide.DialogDisplayer; //导入依赖的package包/类
private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
ModelHandle2.Configuration conf = (ModelHandle2.Configuration) lstConfigurations.getSelectedValue();
if (conf != null) {
NewConfigurationPanel pnl = new NewConfigurationPanel();
pnl.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ConfigurationsPanel.class, "ACSD_Edit_Config"));
pnl.setConfigurationId(conf.getId());
pnl.setProfiles(conf.getActivatedProfiles());
pnl.setProperties(ActionMappings.createPropertiesList(conf.getProperties()));
pnl.setShared(conf.isShared());
DialogDescriptor dd = new DialogDescriptor(pnl, NbBundle.getMessage(ConfigurationsPanel.class, "TIT_Edit_Config"));
Object ret = DialogDisplayer.getDefault().notify(dd);
if (ret == DialogDescriptor.OK_OPTION) {
conf.setShared(pnl.isShared());
conf.setActivatedProfiles(pnl.getProfiles());
conf.setProperties(ActionMappings.convertStringToActionProperties(pnl.getProperties()));
handle.markConfigurationsAsModified();
createListModel();
lstConfigurations.setSelectedValue(conf, true);
}
}
}
示例13: createDialog
import org.openide.DialogDisplayer; //导入依赖的package包/类
/** Constructs managed dialog instance using TopManager.createDialog
* and returnrs it */
private Dialog createDialog () {
ResourceBundle bundle = NbBundle.getBundle (AddBreakpointAction.class);
panel = new AddBreakpointPanel ();
// create dialog descriptor, create & return the dialog
descriptor = new DialogDescriptor (
panel,
bundle.getString ("CTL_Breakpoint_Title"), // NOI18N
true,
this
);
descriptor.setOptions (new JButton[] {
bOk = new JButton (bundle.getString ("CTL_Ok")), // NOI18N
bCancel = new JButton (bundle.getString ("CTL_Cancel")) // NOI18N
});
bOk.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Ok")); // NOI18N
bCancel.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Cancel")); // NOI18N
descriptor.setClosingOptions (new Object [0]);
notificationSupport = descriptor.createNotificationLineSupport();
Dialog d = DialogDisplayer.getDefault ().createDialog (descriptor);
d.pack ();
return d;
}
示例14: addProcessorButtonActionPerformed
import org.openide.DialogDisplayer; //导入依赖的package包/类
private void addProcessorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addProcessorButtonActionPerformed
final AddAnnotationProcessor panel = new AddAnnotationProcessor();
final DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage (CustomizerCompile.class, "LBL_AddAnnotationProcessor_Title")); //NOI18N
desc.setValid(false);
panel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
String fqn = panel.getProcessorFQN();
desc.setValid(fqn.length() > 0);
}
});
Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
dlg.setVisible (true);
if (desc.getValue() == DialogDescriptor.OK_OPTION) {
((DefaultListModel)annotationProcessorsList.getModel()).addElement(panel.getProcessorFQN());
}
dlg.dispose();
}
示例15: importIntoExisting
import org.openide.DialogDisplayer; //导入依赖的package包/类
/**
* Checks if the target folder already exists in the repository.
* If it does exist, user will be asked to confirm the import into the existing folder.
* @param client
* @param repositoryFileUrl
* @return true if the target does not exist or user wishes to import anyway.
*/
private boolean importIntoExisting(SvnClient client, SVNUrl repositoryFileUrl) {
try {
ISVNInfo info = client.getInfo(repositoryFileUrl);
if (info != null) {
// target folder exists, ask user for confirmation
final boolean flags[] = {true};
NotifyDescriptor nd = new NotifyDescriptor(NbBundle.getMessage(ImportStep.class, "MSG_ImportIntoExisting", SvnUtils.decodeToString(repositoryFileUrl)), //NOI18N
NbBundle.getMessage(ImportStep.class, "CTL_TargetFolderExists"), NotifyDescriptor.YES_NO_CANCEL_OPTION, //NOI18N
NotifyDescriptor.QUESTION_MESSAGE, null, NotifyDescriptor.YES_OPTION);
if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.YES_OPTION) {
flags[0] = false;
}
return flags[0];
}
} catch (SVNClientException ex) {
// ignore
}
return true;
}