本文整理汇总了Java中org.openide.DialogDescriptor.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.getValue方法的具体用法?Java DialogDescriptor.getValue怎么用?Java DialogDescriptor.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOptionButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void addOptionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addOptionButtonActionPerformed
final AddProcessorOption panel = new AddProcessorOption();
final DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage (CustomizerCompile.class, "LBL_AddProcessorOption_Title")); //NOI18N
desc.setValid(false);
panel.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
String key = panel.getOptionKey();
for(String s : key.split("\\.", -1)) { //NOI18N
if (!SourceVersion.isIdentifier(s)) {
desc.setValid(false);
return;
}
}
desc.setValid(true);
}
});
Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
dlg.setVisible (true);
if (desc.getValue() == DialogDescriptor.OK_OPTION) {
((DefaultTableModel)processorOptionsTable.getModel()).addRow(new String[] {panel.getOptionKey(), panel.getOptionValue()});
}
dlg.dispose();
}
示例2: selectConnection
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public static DatabaseConnection selectConnection(boolean passwordRequired) {
DatabaseConnection resConn = null;
SelectConnectionPanel panel = new SelectConnectionPanel(passwordRequired);
DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(SelectConnectionPanel.class, "MSG_SelectConnection"));
desc.createNotificationLineSupport();
panel.initialize(desc);
Dialog dialog = DialogDisplayer.getDefault().createDialog(desc);
dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SelectConnectionPanel.class, "ACSD_SelectConnection"));
dialog.setVisible(true);
dialog.dispose();
if (desc.getValue() == DialogDescriptor.OK_OPTION) {
return panel.dbconn;
}
// If the user cancels, keep the selection they started with, rather than setting it to null
return resConn;
}
示例3: actionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
JTextComponent component = getTextComponent(e);
ControlPanel panel = new ControlPanel(component);
DialogDescriptor dd = new DialogDescriptor(
panel,
"Braces Matching Control Panel", //NOI18N
true,
null
);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
if (dd.getValue() == DialogDescriptor.OK_OPTION) {
panel.applyChanges();
}
}
示例4: open
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public boolean open() {
String title = NbBundle.getMessage(SelectConfigFilesPanel.class, "LBL_ConfigFilesTitle");
descriptor = new DialogDescriptor(this, title, true, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
cancelDetection();
}
});
if (availableFiles == null) {
// No available files, will run the detection task.
descriptor.setValid(false);
configFileTable.setEnabled(true);
progressBar.setIndeterminate(true);
detectTask = rp.create(new FileDetector());
detectTask.schedule(0);
} else {
updateAvailableFiles(availableFiles);
}
Dialog dialog = DialogDisplayer.getDefault().createDialog(descriptor);
try {
dialog.setVisible(true);
} finally {
dialog.dispose();
}
return descriptor.getValue() == DialogDescriptor.OK_OPTION;
}
示例5: displaySelectionDialog
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private static List<ElementHandle<? extends Element>> displaySelectionDialog(ElementNode.Description root, boolean isImplement) {
final ImplementOverridePanel panel = new ImplementOverridePanel(root, isImplement);
final DialogDescriptor dialogDescriptor = GeneratorUtils.createDialogDescriptor(panel,
NbBundle.getMessage(ConstructorGenerator.class, isImplement ? "LBL_generate_implement" : "LBL_generate_override")); //NOI18N
panel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
List<ElementHandle<? extends Element>> meths = panel.getSelectedMethods();
dialogDescriptor.setValid(meths != null && !meths.isEmpty());
}
});
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.setVisible(true);
if (dialogDescriptor.getValue() != dialogDescriptor.getDefaultValue()) {
return null;
}
return panel.getSelectedMethods();
}
示例6: customizeLibrary
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@Messages("LibrariesCustomizer.customizeLibrary.title=Customize Library")
private static boolean customizeLibrary(org.netbeans.modules.project.libraries.ui.LibrariesCustomizer customizer,
LibraryImplementation activeLibrary) {
customizer.hideLibrariesList();
customizer.setBorder(new EmptyBorder(12, 8, 0, 10));
customizer.setSelectedLibrary (activeLibrary);
DialogDescriptor descriptor = new DialogDescriptor(customizer, LibrariesCustomizer_customizeLibrary_title());
Dialog dlg = DialogDisplayer.getDefault().createDialog(descriptor);
setAccessibleDescription(dlg, customizer.getAccessibleContext().getAccessibleDescription());
try {
dlg.setVisible(true);
if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {
customizer.apply();
return true;
} else {
return false;
}
} finally {
dlg.dispose();
}
}
示例7: signingCustomizeButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void signingCustomizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_signingCustomizeButtonActionPerformed
SigningPanel panel = new SigningPanel(jwsProps);
DialogDescriptor dialogDesc = new DialogDescriptor(panel, NbBundle.getMessage(SigningPanel.class, "TITLE_SigningPanel"), true, null); //NOI18N
panel.registerListeners();
panel.setDialogDescriptor(dialogDesc);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDesc);
dialog.setVisible(true);
if (dialogDesc.getValue() == DialogDescriptor.OK_OPTION) {
panel.store();
refreshSigningLabel();
}
panel.unregisterListeners();
dialog.dispose();
}
示例8: askPassword
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@Override
public boolean askPassword(ExecutionEnvironment execEnv, String key) {
Mnemonics.setLocalizedText(promptLabel, NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.promptLabel.text", key)); // NOI18N
tfUser.setText(execEnv.getUser());
String hostName = execEnv.getHost();
if (execEnv.getSSHPort() != 22) {
hostName += ":" + execEnv.getSSHPort(); //NOI18N
}
tfHost.setText(hostName); // NOI18N
DialogDescriptor dd = new DialogDescriptor(this,
NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.title.text"), // NOI18N
true, // NOI18N
new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION},
DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setResizable(false);
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
return dd.getValue() == DialogDescriptor.OK_OPTION;
}
示例9: askTrustSSLServer
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@Override
public int askTrustSSLServer(String certMessage, boolean allowPermanently) {
if((SvnClientExceptionHandler.EX_NO_CERTIFICATE & handledExceptions) != SvnClientExceptionHandler.EX_NO_CERTIFICATE) {
return -1; // XXX test me
}
AcceptCertificatePanel acceptCertificatePanel = new AcceptCertificatePanel();
acceptCertificatePanel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_Error_CertFailed"));
acceptCertificatePanel.certificatePane.setText(certMessage);
DialogDescriptor dialogDescriptor = new DialogDescriptor(acceptCertificatePanel, org.openide.util.NbBundle.getMessage(SvnClientCallback.class, "CTL_Error_CertFailed")); // NOI18N
JButton permanentlyButton = new JButton(org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_Cert_AcceptPermanently")); // NOI18N
JButton temporarilyButton = new JButton(org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_Cert_AcceptTemp")); // NOI18N
JButton rejectButton = new JButton(org.openide.util.NbBundle.getMessage(SvnClientExceptionHandler.class, "CTL_Cert_Reject")); // NOI18N
dialogDescriptor.setOptions(new Object[] { permanentlyButton, temporarilyButton, rejectButton });
dialogDescriptor.setHelpCtx(new HelpCtx("org.netbeans.modules.subversion.serverCertificateVerification"));
showDialog(dialogDescriptor);
if(dialogDescriptor.getValue() == permanentlyButton) {
return ISVNPromptUserPassword.AcceptPermanently;
} else if(dialogDescriptor.getValue() == temporarilyButton) {
return ISVNPromptUserPassword.AcceptTemporary;
} else {
return ISVNPromptUserPassword.Reject;
}
}
示例10: askPassword
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public boolean askPassword() {
suPasswordField.setText(null);
final DialogDescriptor dd = new DialogDescriptor(this,
loc("GrantPrivilegesDialog.title"), true, // NOI18N
new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION
}, DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN, null, null);
res = false;
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.addWindowFocusListener(new WindowAdapter() {
@Override
public void windowGainedFocus(WindowEvent e) {
suPasswordField.requestFocusInWindow();
}
});
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
res = dd.getValue() == DialogDescriptor.OK_OPTION;
return res;
}
示例11: performAction
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@NbBundle.Messages({
"LBL_Commit=&Commit",
"# {0} - container id",
"LBL_CommitContainer=Commit {0}"
})
@Override
protected void performAction(Node[] activatedNodes) {
DockerContainer container = activatedNodes[0].getLookup().lookup(DockerContainer.class);
if (container != null) {
JButton commitButton = new JButton();
Mnemonics.setLocalizedText(commitButton, Bundle.LBL_Commit());
CommitPanel panel = new CommitPanel(container.getInstance(), commitButton);
DialogDescriptor descriptor
= new DialogDescriptor(panel, Bundle.LBL_CommitContainer(container.getShortId()),
true, new Object[] {commitButton, DialogDescriptor.CANCEL_OPTION}, commitButton,
DialogDescriptor.DEFAULT_ALIGN, null, null);
descriptor.setClosingOptions(new Object[] {commitButton, DialogDescriptor.CANCEL_OPTION});
panel.setMessageLine(descriptor.createNotificationLineSupport());
Dialog dlg = null;
try {
dlg = DialogDisplayer.getDefault().createDialog(descriptor);
dlg.setVisible(true);
if (descriptor.getValue() == commitButton) {
perform(container, panel.getRepository(), panel.getTag(),
panel.getAuthor(), panel.getMessage(), panel.isPause());
}
} finally {
if (dlg != null) {
dlg.dispose();
}
}
}
}
示例12: onManageClick
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void onManageClick() {
final PropertiesPanel panel = new PropertiesPanel();
final PropertiesTable propTable;
propTable = new PropertiesTable(panel.labelForTable, PropertiesTable.PROPERTIES_COLUMNS, new String[] { PropertiesTableModel.COLUMN_NAME_VALUE});
panel.setPropertiesTable(propTable);
JComponent component = propTable.getComponent();
panel.propsPanel.setLayout(new BorderLayout());
panel.propsPanel.add(component, BorderLayout.CENTER);
HgExtProperties hgProperties = new HgExtProperties(panel, propTable, null) ;
final JButton okButton = new JButton(NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_Properties_Action_OK")); // NOI18N
okButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_Properties_Action_OK")); // NOI18N
final JButton cancelButton = new JButton(NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_Properties_Action_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_Properties_Action_Cancel")); // NOI18N
DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_PropertiesDialog_Title", null), // NOI18N
true, new Object[] {okButton, cancelButton}, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(MercurialOptionsPanelController.class),
null);
panel.putClientProperty("contentTitle", null); // NOI18N
panel.putClientProperty("DialogDescriptor", dd); // NOI18N
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(MercurialOptionsPanelController.class, "CTL_PropertiesDialog_Title")); // NOI18N
dialog.pack();
dialog.setVisible(true);
if (dd.getValue() == okButton) {
hgProperties.setProperties();
}
}
示例13: configure
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@Override
public AttachSettings configure(AttachSettings settings, boolean partially) {
if (settings == null)
settings = new AttachSettings();
// Configure default settings
if (settings.getTargetType().isEmpty()) {
settings.setDirect(false);
settings.setDynamic16(true);
settings.setRemote(false);
}
// Configure implicit settings
settings.setTargetType(Bundle.AttachDialog_JavaApplication());
settings.setServerType(Bundle.AttachDialog_JavaApplication());
// // Workaround for remote OS
// if (settings.isRemote()) settings.setHostOS(null);
panel = new Panel();
panel.setup(settings);
DialogDescriptor dd = new DialogDescriptor(panel, Bundle.AttachDialog_Caption());
if (!partially) {
dd.setValid(false);
panel.setDisplayer(dd);
}
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
AttachSettings result = dd.getValue() == DialogDescriptor.OK_OPTION ?
panel.getSettings() : null;
if (currentProvider != null) currentProvider.removeChangeListener(panel);
currentProvider = null;
panel = null;
return result;
}
示例14: addButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
VariablePanel p = new VariablePanel(model, null);
DialogDescriptor dd = new DialogDescriptor (p, NbBundle.getMessage(VariablesPanel.class, "DIALOG_Add_New_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) {
model.add(p.getVariableName(), p.getVariableLocation());
setRootNode();
}
}
示例15: selectPlatformForCalibration
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public JavaPlatform selectPlatformForCalibration() {
java.util.List<JavaPlatform> platforms = JavaPlatform.getPlatforms();
if (platforms.size() == 0) {
ProfilerDialogs.displayError(Bundle.JavaPlatformSelector_NoSupportedPlatformMsg());
JavaPlatform.showCustomizer();
return null;
}
noteLabel.setText(Bundle.JavaPlatformSelector_SelectPlatformCalibrateMsg());
noteLabel.getAccessibleContext().setAccessibleName(Bundle.JavaPlatformSelector_SelectPlatformCalibrateMsg());
list.getAccessibleContext().setAccessibleDescription(Bundle.JavaPlatformSelector_SelectPlatformCalibrateMsg());
list.setModel(new JPListModel(platforms));
alwaysCheckBox.setVisible(false);
DialogDescriptor dd = new DialogDescriptor(this, Bundle.JavaPlatformSelector_SelectPlatformCalibrateDialogCaption(), true,
new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton,
DialogDescriptor.BOTTOM_ALIGN, null, null);
list.setSelectedIndex(0);
validateOKButton();
Dialog selectDialog = DialogDisplayer.getDefault().createDialog(dd);
selectDialog.getAccessibleContext().setAccessibleDescription(Bundle.JavaPlatformSelector_SelectPlatformCalibrateDialogCaption());
selectDialog.setVisible(true);
if (dd.getValue() == okButton) {
int idx = list.getSelectedIndex();
return (JavaPlatform) platforms.get(idx);
}
return null;
}