本文整理汇总了Java中org.openide.DialogDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor类的具体用法?Java DialogDescriptor怎么用?Java DialogDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DialogDescriptor类属于org.openide包,在下文中一共展示了DialogDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.openide.DialogDescriptor; //导入依赖的package包/类
public void open(JComponent progressComponent) {
holder.add(progressComponent, BorderLayout.CENTER);
DialogDescriptor dd = new DialogDescriptor(
this,
NbBundle.getMessage(ProgressPanel.class, "MSG_PleaseWait"),
true,
new Object[0],
DialogDescriptor.NO_OPTION,
DialogDescriptor.DEFAULT_ALIGN,
null,
null
);
dialog = DialogDisplayer.getDefault().createDialog(dd);
if (dialog instanceof JDialog) {
((JDialog)dialog).setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
}
dialog.setResizable(false);
dialog.setVisible(true);
}
示例2: 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();
}
示例3: askUserLastWasJUnit4NowSource14
import org.openide.DialogDescriptor; //导入依赖的package包/类
/**
*/
private boolean askUserLastWasJUnit4NowSource14(String sourceLevel) {
// assert EventQueue.isDispatchThread(); #170707
JComponent msg
= createMessageComponent("MSG_last_was_junit4_what_now", //NOI18N
sourceLevel);
Object selectOption = NbBundle.getMessage(
getClass(),
"LBL_create_junit3_tests"); //NOI18N
Object answer = DialogDisplayer.getDefault().notify(
new DialogDescriptor(
wrapDialogContent(msg),
NbBundle.getMessage(
getClass(),
"LBL_title_cannot_use_junit4"), //NOI18N
true,
new Object[] {selectOption, CANCEL_OPTION},
selectOption,
DialogDescriptor.DEFAULT_ALIGN,
(HelpCtx) null,
(ActionListener) null));
return answer == selectOption;
}
示例4: askUserToSpecifyRepository
import org.openide.DialogDescriptor; //导入依赖的package包/类
private RepositoryImpl askUserToSpecifyRepository(RepositoryImpl suggestedRepo) {
Collection<RepositoryImpl> repos = RepositoryRegistry.getInstance().getKnownRepositories(true);
DelegatingConnector[] connectors = BugtrackingManager.getInstance().getConnectors();
final RepositorySelectorBuilder selectorBuilder = new RepositorySelectorBuilder();
selectorBuilder.setDisplayFormForExistingRepositories(true);
selectorBuilder.setExistingRepositories(repos.toArray(new RepositoryImpl[repos.size()]));
selectorBuilder.setBugtrackingConnectors(connectors);
selectorBuilder.setPreselectedRepository(suggestedRepo);
selectorBuilder.setLabelAboveComboBox();
String dialogTitle = NbBundle.getMessage(BugtrackingOwnerSupport.class, "LBL_BugtrackerSelectorTitle"); // NOI18N
DialogDescriptor dialogDescriptor
= selectorBuilder.createDialogDescriptor(dialogTitle);
Object selectedOption = DialogDisplayer.getDefault().notify(dialogDescriptor);
RepositoryImpl repository = selectorBuilder.getSelectedRepository();
if (selectedOption == NotifyDescriptor.OK_OPTION) {
repository.applyChanges();
return repository;
} else {
repository.cancelChanges();
return null;
}
}
示例5: showConfirmation
import org.openide.DialogDescriptor; //导入依赖的package包/类
/** Opens confirmation dialog. */
void showConfirmation() {
DialogDescriptor dd = new DialogDescriptor(
this,
NbBundle.getMessage(ImportConfirmationPanel.class, "ImportConfirmationPanel.title"),
true,
DialogDescriptor.YES_NO_OPTION,
DialogDescriptor.YES_OPTION,
null);
dd.setMessageType(DialogDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
if (DialogDescriptor.OK_OPTION.equals(dd.getValue())) {
confirmed = true;
} else {
confirmed = false;
}
}
示例6: getDialogDisplayerConstant
import org.openide.DialogDescriptor; //导入依赖的package包/类
int getDialogDisplayerConstant() {
switch (this) {
case WARNING:
return DialogDescriptor.WARNING_MESSAGE;
case INFO:
return DialogDescriptor.INFORMATION_MESSAGE;
case QUESTION:
return DialogDescriptor.QUESTION_MESSAGE;
case PLAIN:
return DialogDescriptor.PLAIN_MESSAGE;
case ERROR:
return DialogDescriptor.ERROR_MESSAGE;
default:
throw new AssertionError();
}
}
示例7: actionPerformed
import org.openide.DialogDescriptor; //导入依赖的package包/类
@Messages("TIT_Run_maven=Run Maven")
@Override public void actionPerformed(ActionEvent e) {
BeanRunConfig newConfig = new BeanRunConfig(config);
if (debug) {
RunGoalsPanel pnl = new RunGoalsPanel();
DialogDescriptor dd = new DialogDescriptor(pnl, TIT_Run_maven());
pnl.readConfig(config);
Object retValue = DialogDisplayer.getDefault().notify(dd);
if (retValue == DialogDescriptor.OK_OPTION) {
pnl.applyValues(newConfig);
} else {
return;
}
}
actionStatesAtStart();
InputOutput inputOutput = getInputOutput();
try {
inputOutput.getOut().reset();
} catch (IOException ex) {
ex.printStackTrace();
}
MavenCommandLineExecutor.executeMaven(newConfig, inputOutput, tabContext);
//TODO the waiting on tasks won't work..
}
示例8: open
import org.openide.DialogDescriptor; //导入依赖的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();
}
}
}
示例9: showConfigurationPanel
import org.openide.DialogDescriptor; //导入依赖的package包/类
private AdjustConfigurationPanel showConfigurationPanel(AnalyzerFactory preselectedAnalyzer, String preselected, Configuration configurationToSelect) {
final NotificationLineSupport[] nls = new NotificationLineSupport[1];
final DialogDescriptor[] dd = new DialogDescriptor[1];
ErrorListener errorListener = new ErrorListener() {
@Override public void setError(String error) {
nls[0].setErrorMessage(error);
dd[0].setValid(error == null);
}
};
AdjustConfigurationPanel panel = new AdjustConfigurationPanel(analyzers, preselectedAnalyzer, preselected, configurationToSelect, errorListener);
DialogDescriptor nd = new DialogDescriptor(panel, Bundle.LBL_Configurations(), true, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.OK_OPTION, null);
nls[0] = nd.createNotificationLineSupport();
dd[0] = nd;
if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) {
return panel;
}
return null;
}
示例10: invoke
import org.openide.DialogDescriptor; //导入依赖的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);
}
}
}
示例11: editBrowserButtonActionPerformed
import org.openide.DialogDescriptor; //导入依赖的package包/类
private void editBrowserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editBrowserButtonActionPerformed
final WebBrowsersOptionsModel wbModel = new WebBrowsersOptionsModel();
WebBrowsersOptionsPanel wbPanel = new WebBrowsersOptionsPanel(wbModel, cbWebBrowser.getSelectedItem().toString());
DialogDescriptor dialogDesc = new DialogDescriptor (wbPanel, loc("LBL_WebBrowsersPanel_Title"), true, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (DialogDescriptor.OK_OPTION.equals(e.getSource())) {
wbModel.applyChanges();
} else {
wbModel.discardChanges();
}
}
});
dialogDesc.setHelpCtx( new HelpCtx("WebBrowsersManager") ); //NOI18N
DialogDisplayer.getDefault().createDialog(dialogDesc).setVisible(true);
if (dialogDesc.getValue().equals(DialogDescriptor.OK_OPTION)) {
updateWebBrowsers();
for (int i = 0, items = cbWebBrowser.getItemCount(); i < items; i++) {
Object item = cbWebBrowser.getItemAt(i);
if (item.equals(wbModel.getSelectedValue())) {
cbWebBrowser.setSelectedItem(item);
break;
}
}
}
}
示例12: createDescriptor
import org.openide.DialogDescriptor; //导入依赖的package包/类
@Override
protected DialogDescriptor createDescriptor() {
Object[] rightButtons = getRightButtons();
Object[] leftButtons = getLeftButtons();
DialogDescriptor descriptor = new DialogDescriptor(
getResizableXY(createPanel()),
i18n("LBL_Print_Preview"), // NOI18N
true,
rightButtons,
myPrintButton,
DialogDescriptor.DEFAULT_ALIGN,
null,
null
);
descriptor.setClosingOptions(new Object[] { myPrintButton, myCloseButton });
descriptor.setAdditionalOptions(leftButtons);
return descriptor;
}
示例13: show
import org.openide.DialogDescriptor; //导入依赖的package包/类
void show(boolean valid) {
setValid(valid);
String title = NbBundle.getMessage(SvnOptionsController.class, "CTL_ManageLabels");
String accesibleDescription = NbBundle.getMessage(SvnOptionsController.class, "ACSD_ManageLabels");
HelpCtx helpCtx = new HelpCtx(AnnotationSettings.class);
dialogDescriptor = new DialogDescriptor(panel, title);
dialogDescriptor.setModal(true);
dialogDescriptor.setHelpCtx(helpCtx);
dialogDescriptor.setValid(valid);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(accesibleDescription);
//dialog.setModal(false);
dialog.setAlwaysOnTop(false);
dialog.setVisible(true);
}
示例14: 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();
}
示例15: displayAlert
import org.openide.DialogDescriptor; //导入依赖的package包/类
/**
* Just show the dialog but do not do anything about it.
*/
private boolean displayAlert(String projectDisplayName) {
String title = NbBundle.getMessage(UnboundTargetAlert.class, "UTA_TITLE", label, projectDisplayName);
final DialogDescriptor d = new DialogDescriptor(this, title);
d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION);
d.setMessageType(NotifyDescriptor.ERROR_MESSAGE);
d.setValid(false);
selectCombo.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
d.setValid(((String) selectCombo.getSelectedItem()).trim().length() > 0);
}
});
Dialog dlg = DialogDisplayer.getDefault().createDialog(d);
selectCombo.requestFocusInWindow();
// XXX combo box gets cut off at the bottom unless you do something - why??
Dimension sz = dlg.getSize();
dlg.setSize(sz.width, sz.height + 30);
dlg.setVisible(true);
return d.getValue() == NotifyDescriptor.OK_OPTION;
}