本文整理汇总了Java中org.openide.DialogDescriptor.OK_CANCEL_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.OK_CANCEL_OPTION属性的具体用法?Java DialogDescriptor.OK_CANCEL_OPTION怎么用?Java DialogDescriptor.OK_CANCEL_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.OK_CANCEL_OPTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonDownloadModeActionPerformed
private void buttonDownloadModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDownloadModeActionPerformed
final JFXDownloadModePanel rc = new JFXDownloadModePanel(
jfxProps.getRuntimeCP(),
jfxProps.getLazyJars());
final DialogDescriptor dd = new DialogDescriptor(rc,
NbBundle.getMessage(JFXDeploymentPanel.class, "TXT_ManageResources"), // NOI18N
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
null);
if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
jfxProps.setLazyJars(rc.getResources());
jfxProps.setLazyJarsChanged(true);
refreshDownloadModeControls();
}
}
示例2: open
/**
* Opens dialog for adding entities.
* @return fully qualified names of the selected entities' classes.
*/
public static List<String> open(EntityClassScope entityClassScope, Set<String> ignoreClassNames){
AddEntityPanel panel = AddEntityPanel.create(entityClassScope, ignoreClassNames);
final DialogDescriptor nd = new DialogDescriptor(
panel,
NbBundle.getMessage(AddEntityDialog.class, "LBL_AddEntity"),
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx(AddEntityPanel.class),
null
);
Object button = DialogDisplayer.getDefault().notify(nd);
if (button != NotifyDescriptor.OK_OPTION) {
return Collections.emptyList();
}
return Collections.unmodifiableList(panel.getSelectedEntityClasses());
}
示例3: VersionUpdaterDialog
private VersionUpdaterDialog(String title, ElementValue value, VersionUpdaterPanel versionpanel, ChangePanel panel) {
this.panel = panel;
this.versionpanel = versionpanel;
this.value = value;
panel.setText(value.getText());
dd = new DialogDescriptor(
panel,
title,
false, //isModal,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
new DialogDoneListener()
);
dd.setClosingOptions(new Object[]{});
dd.addPropertyChangeListener(dcl);
DialogDisplayer.getDefault().notifyLater(dd);
}
示例4: manageResources
private void manageResources(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageResources
final ResourcesCustomizer rc = new ResourcesCustomizer(
jwsProps.runtimeCP,
jwsProps.lazyJars);
final DialogDescriptor dd = new DialogDescriptor(rc,
NbBundle.getMessage(JWSCustomizerPanel.class, "TXT_ManageResources"), //NOI18N
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
null);
if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
jwsProps.lazyJars = rc.getResources();
jwsProps.lazyJarsChanged = true;
}
}
示例5: customNode
/**
*/
private static TreeNode customNode (TreeNode treeNode, Component panel, String title, boolean mode) {
DialogDescriptor dd = new DialogDescriptor
(panel, title, true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION,
DialogDescriptor.BOTTOM_ALIGN, null, null);
//??? Warning same code is also in tree.nodes.NodeFactory
if (panel instanceof JComponent) {
// set hints to the customizer component
if (mode) {
((JComponent)panel).putClientProperty("xml-edit-mode", "new"); // NOI18N
} else {
((JComponent)panel).putClientProperty("xml-edit-mode", "edit"); // NOI18N
}
}
DialogDisplayer.getDefault ().createDialog (dd).setVisible(true);
if (dd.getValue() != DialogDescriptor.OK_OPTION) {
return null;
}
return treeNode;
}
示例6: getEnvironment
@Override
protected ExecutionEnvironment getEnvironment() {
String title = NbBundle.getMessage(RemoteTerminalAction.class, "RemoteConnectionTitle");
cfgPanel.init();
DialogDescriptor dd = new DialogDescriptor(cfgPanel, title, // NOI18N
true, DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION, null);
Dialog cfgDialog = DialogDisplayer.getDefault().createDialog(dd);
try {
cfgDialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
cfgDialog.dispose();
}
if (dd.getValue() != DialogDescriptor.OK_OPTION) {
return null;
}
final ExecutionEnvironment env = cfgPanel.getExecutionEnvironment();
return env;
}
示例7: argumentsButtonActionPerformed
/** Action handler for arguments button. */
private void argumentsButtonActionPerformed(ActionEvent evt) {
final JavaI18nString javaI18nString = (JavaI18nString)i18nString;
final Dialog[] dialogs = new Dialog[1];
final ParamsPanel paramsPanel = new ParamsPanel();
paramsPanel.setArguments(javaI18nString.getArguments());
DialogDescriptor dd = new DialogDescriptor(
paramsPanel,
bundle.getString("CTL_ParamsPanelTitle"), // NOI18N
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
new ActionListener() {
public void actionPerformed(ActionEvent ev) {
if (ev.getSource() == DialogDescriptor.OK_OPTION) {
javaI18nString.setArguments(paramsPanel.getArguments());
updateReplaceText();
dialogs[0].setVisible(false);
dialogs[0].dispose();
} else {
dialogs[0].setVisible(false);
dialogs[0].dispose();
}
}
});
dialogs[0] = DialogDisplayer.getDefault().createDialog(dd);
dialogs[0].setVisible(true);
}
示例8: advancedActionPerformed
@Messages("CAP_ProjectSpecificOptions=Project Specific Options Settings")
private void advancedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advancedActionPerformed
AdvancedLocationPanel panel = new AdvancedLocationPanel(settingsFileLocation, projectSettings);
DialogDescriptor dd = new DialogDescriptor(panel, Bundle.CAP_ProjectSpecificOptions(), true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
settingsFileLocation = panel.getHintFileLocation();
settingsFileLocationChanged();
settingsOriginChanged();
}
}
示例9: show
/**
* Shows a dialog listing all given versioning info properties.
* @param properties
*/
public static void show (HashMap<File, Map<String, String>> properties) {
PropertySheet ps = new PropertySheet();
ps.setNodes(new VersioningInfoNode[] {new VersioningInfoNode(properties)});
DialogDescriptor dd = new DialogDescriptor(ps, NbBundle.getMessage(VersioningInfo.class, "MSG_VersioningInfo_title"), //NOI18N
true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.addWindowListener(new DialogBoundsPreserver(NbPreferences.forModule(VersioningInfo.class), "versioning.util.versioningInfo")); //NOI18N
dialog.setVisible(true);
}
示例10: getCreateLocaleComponent
/**
* Provides a visual component (modal dialog) usable as a property
* customizer that allows create a new locale file for given bundle (default
* bundle name provided). The created locale should be written as a string
* (locale suffix) to the given propery editor.
*/
@Override
public Component getCreateLocaleComponent(final PropertyEditor prEd, FileObject srcFile, String bundleName) {
final PropertiesDataObject propertiesDO;
try {
propertiesDO = getPropertiesDataObject(srcFile, bundleName);
}
catch (DataObjectNotFoundException ex) {
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
return null;
}
final Dialog[] dialog = new Dialog[1];
final LocalePanel localePanel = new LocalePanel();
DialogDescriptor dialogDescriptor = new DialogDescriptor(
localePanel,
NbBundle.getBundle(PropertiesDataObject.class).getString("CTL_NewLocaleTitle"), // NOI18N
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() == DialogDescriptor.OK_OPTION) {
String locale = localePanel.getLocale().toString();
org.netbeans.modules.properties.Util.createLocaleFile(
propertiesDO, locale, false);
prEd.setValue("_" + locale); // NOI18N
}
dialog[0].setVisible(false);
dialog[0].dispose();
}
}
);
dialog[0] = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
return dialog[0];
}
示例11: editButtonActionPerformed
private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
Variable var = explorer.getSelectedNodes()[0].getLookup().lookup(Variable.class);
VariablePanel p = new VariablePanel(model, var);
DialogDescriptor dd = new DialogDescriptor (p, NbBundle.getMessage(VariablesPanel.class, "DIALOG_Edit_Variable"), // NOI18N
true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
p.setDialogDescriptor(dd);
Dialog dlg = DialogDisplayer.getDefault().createDialog (dd);
dlg.setVisible(true);
if (dd.getValue() == DialogDescriptor.OK_OPTION) {
var.setValue(p.getVariableLocation());
setRootNode();
}
}
示例12: create
/** Overrides superclass method. */
@Override
public void create() throws IOException {
final PropertiesDataObject propertiesDataObject =
(PropertiesDataObject)getCookie(DataObject.class);
final Dialog[] dialog = new Dialog[1];
final LocalePanel panel = new LocalePanel();
DialogDescriptor dialogDescriptor = new DialogDescriptor(
panel,
NbBundle.getBundle(PropertiesDataNode.class).getString("CTL_NewLocaleTitle"),
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() == DialogDescriptor.OK_OPTION) {
if (containsLocale(propertiesDataObject, panel.getLocale())) {
NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
MessageFormat.format(NbBundle.getBundle(PropertiesDataNode.class).getString("MSG_LangExists"), panel.getLocale()),
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(msg);
} else {
Util.createLocaleFile(propertiesDataObject, panel.getLocale().toString(), true);
dialog[0].setVisible(false);
dialog[0].dispose();
}
}
}
}
);
dialogDescriptor.setClosingOptions(new Object [] { DialogDescriptor.CANCEL_OPTION });
dialog[0] = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog[0].setVisible(true);
}
示例13: changeNameButtonActionPerformed
private void changeNameButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeNameButtonActionPerformed
final Dialog[] dialog = new Dialog[1];
final LocalePanel panel = new LocalePanel(getLocale(entry));
DialogDescriptor dd = new DialogDescriptor(
panel,
NbBundle.getBundle(PropertiesDataNode.class).getString("CTL_NewLocaleTitle"),
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
new ActionListener() {
public void actionPerformed(ActionEvent evt2) {
// OK pressed
if (evt2.getSource() == DialogDescriptor.OK_OPTION) {
dialog[0].setVisible(false);
dialog[0].dispose();
updateName(panel.getLocale());
// Cancel pressed
} else if (evt2.getSource() == DialogDescriptor.CANCEL_OPTION) {
dialog[0].setVisible(false);
dialog[0].dispose();
}
}
}
);
dialog[0] = DialogDisplayer.getDefault().createDialog(dd);
dialog[0].setVisible(true);
}
示例14: customizeMethod
/**
* Opens modal window for method customization.
*
* @return true if OK button on customizer was pressed and changes should be written to source files,
* false if Cancel button on customizer was pressed or if customizer was cancelled in any other way and
* nothing should be written to source files.
*/
public boolean customizeMethod() {
DialogDescriptor notifyDescriptor = new DialogDescriptor(
panel, title, true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
null
);
panel.addPropertyChangeListener(new ValidatingPropertyChangeListener(panel, notifyDescriptor, existingMethods, prefix));
return DialogDisplayer.getDefault().notify(notifyDescriptor) == NotifyDescriptor.OK_OPTION;
}
示例15: open
boolean open() {
final DialogDescriptor dd =
new DialogDescriptor (
this,
NbBundle.getMessage(RevertDeletedAction.class, "LBL_SELECT_FILES"), // NOI18N
true,
DialogDescriptor.OK_CANCEL_OPTION,
DialogDescriptor.OK_OPTION,
null);
final Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
return dd.getValue() == DialogDescriptor.OK_OPTION;
}