本文整理汇总了Java中org.openide.DialogDescriptor.BOTTOM_ALIGN属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.BOTTOM_ALIGN属性的具体用法?Java DialogDescriptor.BOTTOM_ALIGN怎么用?Java DialogDescriptor.BOTTOM_ALIGN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.BOTTOM_ALIGN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectFeature
private static ProfilerFeature selectFeature(Set<ProfilerFeature> features, String actionName) {
UI ui = UI.selectFeature(features);
HelpCtx helpCtx = new HelpCtx("SelectFeatureDialog.HelpCtx"); // NOI18N // TODO: should have a special one?
String caption = actionName == null ? Bundle.ProfilerSessions_selectFeature() : actionName;
DialogDescriptor dd = new DialogDescriptor(ui, caption, true, new Object[]
{ DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION },
DialogDescriptor.OK_OPTION, DialogDescriptor.BOTTOM_ALIGN,
helpCtx, null);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
ProfilerFeature ret = dd.getValue() == DialogDescriptor.OK_OPTION ? ui.selectedFeature() : null;
dd.setMessage(null); // Do not leak because of WindowsPopupMenuUI.mnemonicListener
return ret;
}
示例2: 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;
}
示例3: showDialog
public void showDialog() {
String titleMsgKey = replacing
? "LBL_ReplaceInProjects" //NOI18N
: "LBL_FindInProjects"; //NOI18N
DialogDescriptor dialogDescriptor = new DialogDescriptor(
this,
NbBundle.getMessage(getClass(), titleMsgKey),
false,
new Object[]{okButton, cancelButton},
okButton,
DialogDescriptor.BOTTOM_ALIGN,
new HelpCtx(getClass().getCanonicalName() + "." + replacing),
this);
dialogDescriptor.setTitle(NbBundle.getMessage(getClass(), titleMsgKey));
dialogDescriptor.createNotificationLineSupport();
dialogDescriptor.setAdditionalOptions(new Object[] {newTabCheckBox});
dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.addWindowListener(new DialogCloseListener());
this.setDialogDescriptor(dialogDescriptor);
dialog.pack();
setCurrentlyShown(this);
dialog.setVisible(
true);
dialog.requestFocus();
this.requestFocusInWindow();
updateHelp();
updateUsability();
if (selectedPresenter == null) {
chooseLastUsedPresenter();
}
}
示例4: showDialog
public static void showDialog( DataObject template, DataFolder targetFolder ) {
int type;
if ( template.getPrimaryFile().getName().equals( "file") ) {
type = TYPE_FILE;
}
else {
type = TYPE_FOLDER;
}
JButton options[] = new JButton[] {
new JButton( NbBundle.getMessage( NoProjectNew.class, "LBL_NonProject_OK_Button") ), // NOI18N
new JButton( NbBundle.getMessage( NoProjectNew.class, "LBL_NonProject_Cancel_Button") ), // NOI18N
};
NoProjectNew npn = new NoProjectNew( type, targetFolder, options[0] );
options[ 0 ].setActionCommand( COMMAND_OK );
options[ 0 ].addActionListener( npn );
options[ 1 ].setActionCommand( COMMAND_CANCEL );
options[ 1 ].addActionListener( npn );
DialogDescriptor dialogDescriptor = new DialogDescriptor(
npn, // innerPane
type == TYPE_FILE ? FILE_TITLE : FOLDER_TITLE, // displayName
true, // modal
options, // options
options[ 0 ], // initial value
DialogDescriptor.BOTTOM_ALIGN, // options align
null, // helpCtx
null ); // listener
dialogDescriptor.setClosingOptions( new Object[] { options[ 0 ], options[ 1 ] } );
Dialog dialog = DialogDisplayer.getDefault().createDialog( dialogDescriptor );
dialog.setVisible(true);
npn.createFile();
}
示例5: showDialog
public static FileObject showDialog( SourceGroup[] folders, Project project, String preselectedFileName ) {
BrowseFolders bf = new BrowseFolders( folders, project, preselectedFileName );
JButton options[] = new JButton[] {
new JButton(),
new JButton( NbBundle.getMessage( BrowseFolders.class, "BTN_BrowseFolders_Cancel_Option") ), // NOI18N
};
OptionsListener optionsListener = new OptionsListener( bf );
options[ 0 ].setActionCommand( OptionsListener.COMMAND_SELECT );
options[ 0 ].addActionListener( optionsListener );
Mnemonics.setLocalizedText(options[0], NbBundle.getMessage( BrowseFolders.class, "BTN_BrowseFolders_Select_Option") );
options[ 0 ].getAccessibleContext ().setAccessibleName (NbBundle.getMessage( BrowseFolders.class, "ACSN_BrowseFolders_Select_Option"));
options[ 0 ].getAccessibleContext ().setAccessibleDescription (NbBundle.getMessage( BrowseFolders.class, "ACSD_BrowseFolders_Select_Option"));
options[ 1 ].setActionCommand( OptionsListener.COMMAND_CANCEL );
options[ 1 ].addActionListener( optionsListener );
options[ 1 ].getAccessibleContext ().setAccessibleName (NbBundle.getMessage( BrowseFolders.class, "ACSN_BrowseFolders_Cancel_Option"));
options[ 1 ].getAccessibleContext ().setAccessibleDescription (NbBundle.getMessage( BrowseFolders.class, "ACSD_BrowseFolders_Cancel_Option"));
DialogDescriptor dialogDescriptor = new DialogDescriptor(
bf, // innerPane
NbBundle.getMessage( BrowseFolders.class, "LBL_BrowseFolders_Dialog"), // displayName
true, // modal
options, // options
options[ 0 ], // initial value
DialogDescriptor.BOTTOM_ALIGN, // options align
null, // helpCtx
null ); // listener
dialogDescriptor.setClosingOptions( new Object[] { options[ 0 ], options[ 1 ] } );
Dialog dialog = DialogDisplayer.getDefault().createDialog( dialogDescriptor );
dialog.setVisible(true);
return optionsListener.getResult();
}
示例6: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
if (ignoreActionEvents) {
return;
}
Object source = e.getSource();
if (source == cbProfile) {
String profile = (String) cbProfile.getSelectedItem();
if (profile != null)
getMutableModel().setCurrentProfile(profile);
getModel().update();
} else if (source == manageButton) {
//remember previous profile state, in case user will cancel dialog
Map<String, Map<ShortcutAction, Set<String>>> modifiedProfiles = getMutableModel().getModifiedProfiles();
Set<String> deletedProfiles = getMutableModel().getDeletedProfiles();
//show manage profiles dialog
final ProfilesPanel profilesPanel = new ProfilesPanel(this);
DialogDescriptor dd = new DialogDescriptor(
profilesPanel,
NbBundle.getMessage(KeymapPanel.class, "CTL_Manage_Keymap_Profiles"),
true, new Object[] { DialogDescriptor.CLOSED_OPTION }, DialogDescriptor.CLOSED_OPTION,
DialogDescriptor.BOTTOM_ALIGN,
new HelpCtx("org.netbeans.modules.options.keymap.ProfilesPanel"),
null
);
DialogDisplayer.getDefault().notify(dd);
final String selectedProfile = profilesPanel.getSelectedProfile();
getMutableModel().setCurrentProfile(selectedProfile);
refreshProfileCombo();
keymapModel.update();
}
return;
}
示例7: actionPerformed
@Override
public void actionPerformed(ActionEvent e) {
ImportManager ui = ImportManager.getInstance ();
ui.getPluginImporter().reinspect();
ui.initialize();
ui.attachButtons (bImportButton, bNoButton);
DialogDescriptor dd = new DialogDescriptor (
ui,
NbBundle.getMessage (Installer.class, "Installer_DialogTitle"),
true,
new Object[] {bImportButton, bNoButton, bRemindLaterButton},
NotifyDescriptor.OK_OPTION,
DialogDescriptor.BOTTOM_ALIGN,
null,
null);
dd.setClosingOptions (new Object[] {bImportButton, bNoButton, bRemindLaterButton});
DialogDisplayer.getDefault ().createDialog (dd).setVisible (true);
if (bImportButton.equals (dd.getValue ()) || bNoButton.equals (dd.getValue ())) {
ui.dontRemind ();
SwingUtilities.invokeLater (new Runnable () {
@Override
public void run () {
if( null != notification ) {
notification.clear();
}
}
});
} else if (bRemindLaterButton.equals (dd.getValue ())) {
ui.remindLater ();
}
}
示例8: getIssueString
public String getIssueString() {
final DialogDescriptor dd = new DialogDescriptor(this, Bundle.IssueNumberDialog_DialogCaption(), true,
new Object[]{okButton, DialogDescriptor.CANCEL_OPTION},
okButton, DialogDescriptor.BOTTOM_ALIGN, null, null);
final Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
if (dd.getValue() == okButton) {
return Integer.toString(Integer.parseInt(issueField.getText().trim()));
} else {
return null;
}
}
示例9: ConfirmDialog
/** Creates a new instance of ConfirmDialog */
public ConfirmDialog(String text, String title) {
super (text,title,true,
DialogDescriptor.YES_NO_OPTION,
DialogDescriptor.NO_OPTION,
DialogDescriptor.BOTTOM_ALIGN,
null,
null);
}
示例10: selectDevice
/**
* 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;
}
示例11: showDescription
public static void showDescription(Rule rule, String htmlDescription) {
Class ruleClass = rule.getClass();
URL ruleBase = ruleClass.getResource(ruleClass.getSimpleName() + ".class"); // NOI18N
final DialogDescriptor dd = new DialogDescriptor(new DescriptionDisplayer(ruleBase, htmlDescription),
rule.getDisplayName(), true,
new Object[] { DialogDescriptor.OK_OPTION },
DialogDescriptor.OK_OPTION, DialogDescriptor.BOTTOM_ALIGN, null, null);
final Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.pack(); // allows correct resizing of textarea in PreferredInstrFilterPanel
d.setVisible(true);
}
示例12: selectClasses
public static List<SourceClassInfo> selectClasses(ProfilerSession session) {
// TODO: wait for finished scan
UI ui = UI.forSession(session, false);
HelpCtx helpCtx = new HelpCtx("SelectClassDialog.HelpCtx"); // NOI18N
DialogDescriptor dd = new DialogDescriptor(ui, Bundle.ClassMethodSelector_selectClass(), true,
new Object[] { ui.getOKButton(), DialogDescriptor.CANCEL_OPTION },
ui.getOKButton(), DialogDescriptor.BOTTOM_ALIGN, helpCtx, null);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return dd.getValue() == ui.getOKButton() ? ui.selectedClasses() : Collections.EMPTY_LIST;
}
示例13: selectMethods
public static List<SourceMethodInfo> selectMethods(ProfilerSession session) {
// TODO: wait for finished scan
UI ui = UI.forSession(session, true);
HelpCtx helpCtx = new HelpCtx("SelectMethodDialog.HelpCtx"); // NOI18N
DialogDescriptor dd = new DialogDescriptor(ui, Bundle.ClassMethodSelector_selectMethod(), true,
new Object[] { ui.getOKButton(), DialogDescriptor.CANCEL_OPTION },
ui.getOKButton(), DialogDescriptor.BOTTOM_ALIGN, helpCtx, null);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.setVisible(true);
return dd.getValue() == ui.getOKButton() ? ui.selectedMethods() : Collections.EMPTY_LIST;
}
示例14: selectPlatformForCalibration
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;
}
示例15: showDialog
public static FileObject showDialog(SourceGroup[] folders) {
BrowseFolders bf = new BrowseFolders(folders);
JButton options[] = new JButton[]{
new JButton(NbBundle.getMessage(BrowseFolders.class, "LBL_SelectFile")),
new JButton(NbBundle.getMessage(BrowseFolders.class, "LBL_Cancel"))
};
OptionsListener optionsListener = new OptionsListener(bf);
options[ 0].setActionCommand(OptionsListener.COMMAND_SELECT);
options[ 0].addActionListener(optionsListener);
options[ 0].getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(BrowseFolders.class, "ACSD_SelectFile"));
options[ 1].setActionCommand(OptionsListener.COMMAND_CANCEL);
options[ 1].addActionListener(optionsListener);
options[ 1].getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(BrowseFolders.class, "ACSD_Cancel"));
DialogDescriptor dialogDescriptor = new DialogDescriptor(
bf, // innerPane
NbBundle.getMessage(BrowseFolders.class, "LBL_BrowseFiles"), // displayName
true, // modal
options, // options
options[ 0], // initial value
DialogDescriptor.BOTTOM_ALIGN, // options align
null, // helpCtx
null); // listener
dialogDescriptor.setClosingOptions(new Object[]{options[ 0], options[ 1]});
Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
dialog.setVisible(true);
return optionsListener.getResult();
}