本文整理汇总了Java中org.openide.DialogDescriptor.DEFAULT_ALIGN属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.DEFAULT_ALIGN属性的具体用法?Java DialogDescriptor.DEFAULT_ALIGN怎么用?Java DialogDescriptor.DEFAULT_ALIGN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.DEFAULT_ALIGN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showCustomizer
/**
* Shows platforms customizer
*
* @param platform which should be seelcted, may be null
* @return boolean for future extension, currently always true
*/
public static boolean showCustomizer() {
SdksCustomizer customizer
= new SdksCustomizer();
javax.swing.JButton close = new javax.swing.JButton(NbBundle.getMessage(SdksCustomizer.class, "CTL_Close"));
close.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SdksCustomizer.class, "AD_Close"));
DialogDescriptor descriptor = new DialogDescriptor(customizer, NbBundle.getMessage(SdksCustomizer.class,
"TXT_PlatformsManager"), true, new Object[]{close}, close, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx("org.nbandroid.netbeans.gradle.v2.sdk.ui.PlatformsCustomizer"), null); // NOI18N
Dialog dlg = null;
try {
dlg = DialogDisplayer.getDefault().createDialog(descriptor);
dlg.setVisible(true);
} finally {
if (dlg != null) {
dlg.dispose();
}
}
return true;
}
示例2: show
boolean show (HelpCtx helpCtx) {
okButton = new JButton(getOkButtonLabel());
org.openide.awt.Mnemonics.setLocalizedText(okButton, okButton.getText());
dd = new DialogDescriptor(panel, getDialogTitle(), true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, helpCtx, null);
validateBranchCB();
revisionPicker.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName() == RevisionDialogController.PROP_VALID) {
setRevisionValid(Boolean.TRUE.equals(evt.getNewValue()));
} else if (evt.getPropertyName() == RevisionDialogController.PROP_REVISION_ACCEPTED) {
if (dd.isValid()) {
okButton.doClick();
}
}
}
});
panel.branchNameField.getDocument().addDocumentListener(this);
panel.cbCheckoutAsNewBranch.addActionListener(this);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return okButton == dd.getValue();
}
示例3: getProblemDesriptor
private DialogDescriptor getProblemDesriptor(String message) {
Object [] options;
if (buttons == null || buttons.length == 0) {
options = new Object [] { DialogDescriptor.OK_OPTION };
} else {
options = buttons;
}
DialogDescriptor descriptor = new DialogDescriptor(
this,
isWarning ? NbBundle.getMessage(ProblemPanel.class, "CTL_Warning") : message,
true, // Modal
options, // Option list
null, // Default
DialogDescriptor.DEFAULT_ALIGN, // Align
null, // Help
null
);
descriptor.setMessageType (isWarning ? NotifyDescriptor.WARNING_MESSAGE : NotifyDescriptor.ERROR_MESSAGE);
descriptor.setClosingOptions(null);
return descriptor;
}
示例4: show
boolean show() {
okButton = new JButton(NbBundle.getMessage(CreateBranch.class, "LBL_CreateBranch.OKButton.text")); //NOI18N
org.openide.awt.Mnemonics.setLocalizedText(okButton, okButton.getText());
dd = new DialogDescriptor(panel, NbBundle.getMessage(CreateBranch.class, "LBL_CreateBranch.title"), true, //NOI18N
new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx("org.netbeans.modules.git.ui.branch.CreateBranch"), null); //NOI18N
validate();
revisionPicker.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName() == RevisionDialogController.PROP_VALID) {
setRevisionValid(Boolean.TRUE.equals(evt.getNewValue()));
}
}
});
panel.branchNameField.getDocument().addDocumentListener(this);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return okButton == dd.getValue();
}
示例5: performAction
@NbBundle.Messages({
"LBL_PortBindings=Port Bindings",
})
@Override
protected void performAction(DockerContainer container) throws DockerException {
DockerAction facade = new DockerAction(container.getInstance());
DockerContainerDetail details = facade.getDetail(container);
List<PortMapping> portMappings = details.portMappings();
final ViewPortBindingsPanel panel = new ViewPortBindingsPanel(portMappings);
DialogDescriptor descriptor = new DialogDescriptor(panel, Bundle.LBL_PortBindings(),
true, new Object[] {DialogDescriptor.OK_OPTION}, null,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dlg = null;
try {
dlg = DialogDisplayer.getDefault().createDialog(descriptor);
dlg.setVisible(true);
} finally {
if (dlg != null) {
dlg.dispose();
}
}
}
示例6: testDefaultOptionWithStandardCancel
public void testDefaultOptionWithStandardCancel () {
JButton testButton = new JButton ("for-test-only");
DialogDescriptor dd = new DialogDescriptor (
"Hello", // innerPane
"title", // title
false, // isModal
new Object[] { NotifyDescriptor.OK_OPTION, NotifyDescriptor.CANCEL_OPTION }, // options
NotifyDescriptor.CANCEL_OPTION, // initialValue
DialogDescriptor.DEFAULT_ALIGN, // optionsAlign
HelpCtx.DEFAULT_HELP, // help
null); // action listener
dd.setAdditionalOptions (new JButton[] {testButton});
Dialog dlg = DialogDisplayer.getDefault ().createDialog (dd);
//dlg.setVisible (true);
assertEquals ("CANCEL_OPTION is the default value.", NotifyDescriptor.CANCEL_OPTION, dd.getDefaultValue ());
assertEquals ("CANCEL_OPTION is the default button on dialog",
NbBundle.getBundle (NbPresenter.class).getString ("CANCEL_OPTION_CAPTION"),
testButton.getRootPane ().getDefaultButton ().getText ());
//dlg.dispose ();
}
示例7: show
boolean show() {
okButton = new JButton(NbBundle.getMessage(CreateTag.class, "LBL_CreateTag.OKButton.text")); //NOI18N
org.openide.awt.Mnemonics.setLocalizedText(okButton, okButton.getText());
dd = new DialogDescriptor(panel, NbBundle.getMessage(CreateTag.class, "LBL_CreateTag.title"), true, //NOI18N
new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(CreateTag.class), null);
validate();
revisionPicker.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName() == RevisionDialogController.PROP_VALID) {
setRevisionValid(Boolean.TRUE.equals(evt.getNewValue()));
}
}
});
panel.tagNameField.getDocument().addDocumentListener(this);
panel.tagMessageField.getDocument().addDocumentListener(this);
panel.cbForceUpdate.addActionListener(this);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return okButton == dd.getValue();
}
示例8: invoke
@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: Export
public Export(File fromFile, boolean localChanges) {
this.fromFile = fromFile;
panel = new ExportPanel();
panel.scanCheckBox.setSelected(SvnModuleConfig.getDefault().getPreferences().getBoolean(SCAN_AFTER_EXPORT, false));
panel.exportFromTextField.setText(fromFile.getAbsolutePath());
panel.browseToFolderButton.addActionListener(this);
panel.exportToTextField.getDocument().addDocumentListener(this);
panel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(Export.class, "CTL_ExportDialog_Title")); // NOI18N
okButton = new JButton(NbBundle.getMessage(Export.class, "CTL_Export"));
okButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(Export.class, "CTL_Export"));
cancelButton = new JButton(NbBundle.getMessage(Export.class, "CTL_Cancel")); // NOI18N
cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(Export.class, "CTL_Cancel")); // NOI18N
dialogDescriptor =
new DialogDescriptor(
panel,
NbBundle.getMessage(Export.class, "CTL_ExportDialog_Title"),
true,
new Object[]{okButton, cancelButton},
okButton,
DialogDescriptor.DEFAULT_ALIGN,
null,
null);
okButton.setEnabled(false);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(Export.class, "CTL_ExportDialog_Title")); // NOI18N
validateUserInput();
}
示例10: perform
public void perform(FileObject file, JTextComponent pane) {
JButton ok = new JButton(NbBundle.getMessage(AddPropertyCodeGenerator.class, "LBL_ButtonOK"));
CodeStyle cs = CodeStyle.getDefault(pane.getDocument());
if(cs == null) {
cs = CodeStyle.getDefault(file);
}
final AddPropertyPanel addPropertyPanel = new AddPropertyPanel(file, className, cs, existingFields, pcsName, vcsName, ok);
String caption = NbBundle.getMessage(AddPropertyCodeGenerator.class, "CAP_AddProperty");
String cancel = NbBundle.getMessage(AddPropertyCodeGenerator.class, "LBL_ButtonCancel");
DialogDescriptor dd = new DialogDescriptor(addPropertyPanel,caption, true, new Object[] {ok,cancel}, ok, DialogDescriptor.DEFAULT_ALIGN, null, null);
if (DialogDisplayer.getDefault().notify(dd) == ok) {
insertCode2(file, pane, addPropertyPanel.getAddPropertyConfig(), cs);
}
}
示例11: performAction
@NbBundle.Messages({
"LBL_Rename=&Rename",
"# {0} - container name",
"LBL_RenameContainer=Rename {0}"
})
@Override
protected void performAction(Node[] activatedNodes) {
StatefulDockerContainer container = activatedNodes[0].getLookup().lookup(StatefulDockerContainer.class);
if (container != null) {
JButton renameButton = new JButton();
Mnemonics.setLocalizedText(renameButton, Bundle.LBL_Rename());
RenamePanel panel = new RenamePanel(renameButton);
DialogDescriptor descriptor
= new DialogDescriptor(panel, Bundle.LBL_RenameContainer(container.getDetail().getName()),
true, new Object[] {renameButton, DialogDescriptor.CANCEL_OPTION}, renameButton,
DialogDescriptor.DEFAULT_ALIGN, null, null);
descriptor.setClosingOptions(new Object[] {renameButton, DialogDescriptor.CANCEL_OPTION});
panel.setMessageLine(descriptor.createNotificationLineSupport());
Dialog dlg = null;
try {
dlg = DialogDisplayer.getDefault().createDialog(descriptor);
dlg.setVisible(true);
if (descriptor.getValue() == renameButton) {
perform(container, panel.getContainerName());
}
} finally {
if (dlg != null) {
dlg.dispose();
}
}
}
}
示例12: performAction
@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();
}
}
}
}
示例13: showReport
public static void showReport(String title, List<String> problems) {
if (problems.size() == 0) {
return;
}
ImportProblemsPanel p = new ImportProblemsPanel(problems);
DialogDescriptor dd = new DialogDescriptor (p, title,
true, new Object[]{DialogDescriptor.CLOSED_OPTION}, null,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dlg = DialogDisplayer.getDefault().createDialog (dd);
dlg.setVisible(true);
}
示例14: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
DialogDescriptor dd = new DialogDescriptor(changesetPickerPanel,
org.openide.util.NbBundle.getMessage(ExportBundle.class, "CTL_ExportBundle.ChangesetPicker_Title"), // NOI18N
true,
new Object[]{selectButton, DialogDescriptor.CANCEL_OPTION},
selectButton,
DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx("org.netbeans.modules.mercurial.ui.repository.ChangesetPickerPanel"), //NOI18N
null);
selectButton.setEnabled(changesetPickerPanel.getSelectedRevision() != null);
changesetPickerPanel.addPropertyChangeListener(this);
changesetPickerPanel.initRevisions();
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
changesetPickerPanel.removePropertyChangeListener(this);
if (dd.getValue() == selectButton) {
HgLogMessage revisionWithChangeset = changesetPickerPanel.getSelectedRevision();
String revision = ChangesetPickerPanel.HG_TIP.equals(revisionWithChangeset.getRevisionNumber()) ? ChangesetPickerPanel.HG_TIP
: new StringBuilder(revisionWithChangeset.getRevisionNumber()).append(SEP).append("(").append(revisionWithChangeset.getCSetShortID()).append(")").toString();
if (ExportBundlePanel.CMD_SELECT_BASE_REVISION.equals(command)) {
panel.baseRevision.setModel(new DefaultComboBoxModel(new String[] {HG_NULL_BASE, revision})); //NOI18N
panel.baseRevision.setSelectedItem(revision);
} else if (ExportBundlePanel.CMD_SELECT_REVISION.equals(command)) {
panel.txtTopRevision.setText(revision);
}
}
}
示例15: askPassword
@Override
public boolean askPassword(ExecutionEnvironment execEnv, String prompt) {
tfUser.setText(execEnv.getUser());
String hostName = execEnv.getHost();
if (execEnv.getSSHPort() != 22) {
hostName += ":" + execEnv.getSSHPort(); //NOI18N
}
tfHost.setText(hostName); // NOI18N
cbRememberPwd.setSelected(PasswordManager.getInstance().isRememberPassword(execEnv));
DialogDescriptor dd = new DialogDescriptor(this,
loc("TITLE_Password"), 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;
}