本文整理汇总了Java中org.openide.DialogDescriptor.setValid方法的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.setValid方法的具体用法?Java DialogDescriptor.setValid怎么用?Java DialogDescriptor.setValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.setValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: addProcessorButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的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();
}
示例4: perform
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public static void perform(org.openide.nodes.Node[] activatedNodes) {
CatalogNode node = (CatalogNode) activatedNodes[0].getCookie(CatalogNode.class);
CatalogWriter catalog = (CatalogWriter)node.getCatalogReader();
CatalogEntryPanel panel = new CatalogEntryPanel();
DialogDescriptor dd = new DialogDescriptor(panel,
NbBundle.getMessage(AddCatalogEntryAction.class, "TITLE_addCatalogEntry")); //NOI18N
//dd.setHelpCtx(new HelpCtx(CatalogMounterPanel.class));
panel.setEnclosingDesc(dd);
java.awt.Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dd.setValid(false);
dialog.setVisible(true);
if (dd.getValue().equals(DialogDescriptor.OK_OPTION)) {
if (panel.isPublic()) {
catalog.registerCatalogEntry("PUBLIC:"+panel.getPublicId(), panel.getUri()); //NOI18N
} else if (isXmlSchema(panel.getSystemId(), panel.getUri())) {
catalog.registerCatalogEntry("SCHEMA:"+panel.getSystemId(), panel.getUri()); //NOI18N
} else {
catalog.registerCatalogEntry("SYSTEM:"+panel.getSystemId(), panel.getUri()); //NOI18N
}
}
}
示例5: FileSelector
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/** Creates new form RootSelectorPanel */
public FileSelector(String text, String title, HelpCtx helpCtx, Preferences pref) {
this.text = text;
this.title = title;
this.helpCtx = helpCtx;
this.pref = pref;
initComponents();
filesList.addListSelectionListener(this);
dialogDescriptor = new DialogDescriptor(this, title);
okButton = new JButton(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Select"));
okButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Select"));
okButton.setEnabled(false);
cancelButton = new JButton(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Cancel")); // NOI18N
dialogDescriptor.setOptions(new Object[] {okButton, cancelButton});
dialogDescriptor.setModal(true);
dialogDescriptor.setHelpCtx(new HelpCtx(this.getClass()));
dialogDescriptor.setValid(false);
}
示例6: displayDialog
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public void displayDialog() {
dlg = new DialogDescriptor(this, NbBundle.getMessage(AddWebServiceDlg.class, "ADD_WEB_SERVICE"),
true, NotifyDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN, this.getHelpCtx(), this);
dialog = DialogDisplayer.getDefault().createDialog(dlg);
dlg.setValid(false);
dialog.setVisible(true);
if (dlg.getValue() == DialogDescriptor.OK_OPTION) {
createService();
}
}
示例7: selectDevice
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/**
* Selects a device
*
* @return device info or {@code null}
*/
@Override
public LaunchData selectDevice(AvdManager avdManager, IDevice[] devices) {
final DeviceUiChooser panel = new DeviceUiChooser(avdManager, devices);
final Object[] options = new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION
};
final DialogDescriptor desc = new DialogDescriptor(panel,
"Select device",
true, options, options[0], DialogDescriptor.BOTTOM_ALIGN, null, null);
desc.setMessageType(DialogDescriptor.INFORMATION_MESSAGE);
desc.setValid(false); // no selection yet
panel.addLaunchDataListener(new LaunchDeviceListener() {
@Override
public void lauchDeviceChanged(LaunchData launchData) {
desc.setValid(launchData != null);
}
});
final Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
panel.addSelectCallback(new Runnable() {
@Override
public void run() {
dlg.setVisible(false);
desc.setValue(options[0]);
}
});
dlg.setVisible(true);
dlg.dispose();
if (desc.getValue() == options[0]) {
return panel.getLaunchData();
}
return null;
}
示例8: propertyDetailsButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void propertyDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_propertyDetailsButtonActionPerformed
PropertyPicker propertyPicker = new PropertyPicker(formModel, null, valueType);
propertyPicker.setSelectedComponent(selectedComponent);
propertyPicker.setSelectedProperty(selectedProperty);
String title = FormUtils.getFormattedBundleString(
"CTL_FMT_CW_SelectProperty", // NOI18N
new Object[] { valueType.getSimpleName() });
final DialogDescriptor dd = new DialogDescriptor(propertyPicker, title);
dd.setValid(propertyPicker.isPickerValid());
propertyPicker.addPropertyChangeListener("pickerValid", new PropertyChangeListener() { // NOI18N
@Override
public void propertyChange(PropertyChangeEvent evt2) {
dd.setValid(((Boolean)evt2.getNewValue()).booleanValue());
}
});
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
if (dd.getValue() == DialogDescriptor.OK_OPTION) {
selectedComponent = propertyPicker.getSelectedComponent();
PropertyPicker.PropertyPickerItem selectedItem = propertyPicker.getSelectedProperty();
propertyField.setEnabled(true);
if (selectedComponent == formModel.getTopRADComponent())
propertyField.setText(selectedItem.getPropertyName());
else
propertyField.setText(selectedComponent.getName() + "." + selectedItem.getPropertyName()); // NOI18N
selectedProperty = selectedItem.getPropertyDescriptor();
if (selectedProperty == null)
propertyEditor.setValue(new RADConnectionPropertyEditor.RADConnectionDesignValue(selectedItem.getReadMethodName()));
else if (selectedComponent != null)
propertyEditor.setValue(new RADConnectionPropertyEditor.RADConnectionDesignValue(selectedComponent, selectedProperty));
else
propertyEditor.setValue(BeanSupport.NO_VALUE);
}
}
示例9: methodDetailsButtonActionPerformed
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void methodDetailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_methodDetailsButtonActionPerformed
MethodPicker picker = new MethodPicker(formModel, null, requiredType);
picker.setSelectedComponent(selectedComponent);
picker.setSelectedMethod(selectedMethod);
String title = FormUtils.getFormattedBundleString(
"CTL_FMT_CW_SelectMethod", // NOI18N
new Object[] { Utilities.getShortClassName(requiredType) });
final DialogDescriptor dd = new DialogDescriptor(picker, title);
dd.setValid(picker.isPickerValid());
picker.addPropertyChangeListener("pickerValid", new PropertyChangeListener() { // NOI18N
public void propertyChange(PropertyChangeEvent evt2) {
dd.setValid(((Boolean)evt2.getNewValue()).booleanValue());
}
});
java.awt.Dialog dialog = org.openide.DialogDisplayer.getDefault().createDialog(dd);
dialog.show();
if (dd.getValue() == DialogDescriptor.OK_OPTION) {
selectedComponent = picker.getSelectedComponent();
selectedMethod = picker.getSelectedMethod();
methodLabel.setEnabled(true);
if (selectedComponent == formModel.getTopRADComponent()) {
methodLabel.setText(selectedMethod.getName());
} else {
methodLabel.setText(selectedComponent.getName() + "." + selectedMethod.getName()); // NOI18N
}
methodLabel.repaint();
fireStateChange();
}
}
示例10: 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;
}
示例11: attachDialogDisplayer
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
void attachDialogDisplayer(DialogDescriptor dd) {
this.dd = dd;
dd.setValid(false);
nls = dd.getNotificationLineSupport();
if (nls == null) {
nls = dd.createNotificationLineSupport();
}
}
示例12: validate
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void validate( DialogDescriptor dd ) {
String name = txtName.getText();
if( null == name )
name = ""; //NOI18N
name = name.trim();
dd.setValid( !name.isEmpty() && !DEFAULT_NAME.equals(name) );
}
示例13: showDialog
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(Clone.class, "CTL_CloneDialog"), // NOI18N
true, new Object[] {okButton, cancelButton}, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(this.getClass()), null);
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(Clone.class, "ACSD_CloneDialog")); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}
示例14: showDialog
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void showDialog(DialogDescriptor dialogDescriptor) {
dialogDescriptor.setModal(true);
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.setVisible(true);
}
示例15: showDialog
import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public boolean showDialog() {
DialogDescriptor dialogDescriptor = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(RevertModifications.class, "CTL_RevertDialog")); // NOI18N
dialogDescriptor.setOptions(new Object[] {okButton, cancelButton});
dialogDescriptor.setModal(true);
dialogDescriptor.setHelpCtx(new HelpCtx(this.getClass()));
dialogDescriptor.setValid(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(RevertModifications.class, "ACSD_RevertDialog")); // NOI18N
dialog.setVisible(true);
dialog.setResizable(false);
boolean ret = dialogDescriptor.getValue() == okButton;
return ret;
}