本文整理汇总了Java中org.openide.WizardDescriptor.setModal方法的典型用法代码示例。如果您正苦于以下问题:Java WizardDescriptor.setModal方法的具体用法?Java WizardDescriptor.setModal怎么用?Java WizardDescriptor.setModal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.WizardDescriptor
的用法示例。
在下文中一共展示了WizardDescriptor.setModal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initWizard
import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/** Initializes wizard descriptor. */
private void initWizard(WizardDescriptor wizardDesc) {
// Init properties.
wizardDesc.putProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE);
wizardDesc.putProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE);
wizardDesc.putProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE);
ArrayList contents = new ArrayList(3);
contents.add(Util.getString("TXT_SelectTestSources")); //NOI18N
contents.add(Util.getString("TXT_SelectTestResources")); //NOI18N
contents.add(Util.getString("TXT_FoundMissingResources")); //NOI18N
wizardDesc.putProperty(WizardDescriptor.PROP_CONTENT_DATA, (String[])contents.toArray(new String[contents.size()]));
wizardDesc.setTitle(Util.getString("LBL_TestWizardTitle")); //NOI18N
wizardDesc.setTitleFormat(new MessageFormat("{0} ({1})")); //NOI18N
wizardDesc.setModal(false);
}
示例2: initWizard
import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/** Initializes wizard descriptor. */
private void initWizard(WizardDescriptor wizardDesc) {
// Init properties.
wizardDesc.putProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE);
wizardDesc.putProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE);
wizardDesc.putProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE);
List<String> contents = new ArrayList<String>(4);
contents.add(Util.getString("TXT_SelectSourcesHelp")); //NOI18N
contents.add(Util.getString("TXT_SelectResourceHelp")); //NOI18N
contents.add(Util.getString("TXT_AdditionalHelp")); //NOI18N
contents.add(Util.getString("TXT_FoundStringsHelp")); //NOI18N
wizardDesc.putProperty(
WizardDescriptor.PROP_CONTENT_DATA,
contents.toArray(new String[contents.size()])
);
wizardDesc.setTitle(Util.getString("LBL_WizardTitle")); //NOI18N
wizardDesc.setTitleFormat(new MessageFormat("{0} ({1})")); // NOI18N
wizardDesc.setModal(false);
}
示例3: showTestWizard
import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/** Opens test wizard with 3 steps. */
private void showTestWizard() {
TestPanel panel0 = new TestPanel(0);
panel0.addPropertyChangeListener(this);
TestPanel panel1 = new TestPanel(1);
panel1.addPropertyChangeListener(this);
TestPanel panel2 = new TestPanel(2);
panel2.addPropertyChangeListener(this);
WizardDescriptor.Panel[] panels = {
panel0,
panel1,
panel2
};
WizardDescriptor.ArrayIterator iterator = new WizardDescriptor.ArrayIterator(panels);
wd = new WizardDescriptor(iterator);
wd.putProperty(PROP_AUTO_WIZARD_STYLE, Boolean.TRUE);
wd.putProperty(PROP_CONTENT_DISPLAYED, Boolean.TRUE);
wd.putProperty(PROP_CONTENT_NUMBERED, Boolean.TRUE);
wd.putProperty(PROP_CONTENT_DATA, new String[]{
TEST_WIZARD_PANEL0,
TEST_WIZARD_PANEL1,
TEST_WIZARD_PANEL2
});
wd.setTitle(TEST_WIZARD_TITLE);
wd.setModal(false);
dialog = DialogDisplayer.getDefault().createDialog(wd);
dialog.setSize(600, 400);
dialog.setVisible(true);
}
示例4: implInvokeWizard
import org.openide.WizardDescriptor; //导入方法依赖的package包/类
private boolean implInvokeWizard (WizardDescriptor.Iterator<WizardDescriptor> iterator) {
WizardDescriptor wizardDescriptor = new WizardDescriptor (iterator);
wizardDescriptor.setModal (true);
wizardDescriptor.setTitleFormat (new MessageFormat(NbBundle.getMessage (InstallUnitWizard.class, "InstallUnitWizard_MessageFormat")));
wizardDescriptor.setTitle (NbBundle.getMessage (InstallUnitWizard.class, "InstallUnitWizard_Title"));
Dialog dialog = DialogDisplayer.getDefault ().createDialog (wizardDescriptor);
dialog.setVisible (true);
dialog.toFront ();
boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
log.log (Level.FINE, "InstallUnitWizard returns with value " + wizardDescriptor.getValue ());
return !cancelled;
}
示例5: testLeakingNbPresenterDescriptor
import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@RandomlyFails // NB-Core-Build #1189
public void testLeakingNbPresenterDescriptor () throws InterruptedException, InvocationTargetException {
try {
Class.forName("java.lang.AutoCloseable");
} catch (ClassNotFoundException ex) {
// this test is known to fail due to JDK bugs 7070542 & 7072167
// which are unlikely to be fixed on JDK6. Thus, if AutoCloseable
// is not present, skip the test
return;
}
WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels(), null);
wizardDescriptor.setModal (false);
Dialog dialog = DialogDisplayer.getDefault ().createDialog (wizardDescriptor);
WeakReference<WizardDescriptor> w = new WeakReference<WizardDescriptor> (wizardDescriptor);
SwingUtilities.invokeAndWait (new EDTJob(dialog, true));
assertShowing("button is visible", true, dialog);
SwingUtilities.invokeAndWait (new EDTJob(dialog, false));
assertShowing("button is no longer visible", false, dialog);
boolean cancelled = wizardDescriptor.getValue() !=
WizardDescriptor.FINISH_OPTION;
Dialog d = new JDialog();
// workaround for JDK bug 6575402
JPanel p = new JPanel();
d.setLayout(new BorderLayout());
d.add(p, BorderLayout.CENTER);
JButton btn = new JButton("Button");
p.add(btn, BorderLayout.NORTH);
SwingUtilities.invokeAndWait (new EDTJob(d, true));
assertShowing("button is visible", true, btn);
dialog.setBounds(Utilities.findCenterBounds(dialog.getSize()));
SwingUtilities.invokeAndWait (new EDTJob(d, false));
assertShowing("button is no longer visible", false, btn);
assertNull ("BufferStrategy was disposed.", dialog.getBufferStrategy ());
RepaintManager rm = RepaintManager.currentManager(dialog);
rm.setDoubleBufferingEnabled(!rm.isDoubleBufferingEnabled());
rm.setDoubleBufferingEnabled(!rm.isDoubleBufferingEnabled());
dialog = null;
wizardDescriptor = null;
SwingUtilities.invokeAndWait (new Runnable() {
@Override
public void run() {
Frame f = new Frame();
f.setPreferredSize( new Dimension(100,100));
f.setVisible( true );
JDialog dlg = new JDialog(f);
dlg.setVisible(true);
}
});
assertGC ("Dialog disappears.", w);
}