Java Code Examples for org.openide.WizardDescriptor#ArrayIterator

The following examples show how to use org.openide.WizardDescriptor#ArrayIterator . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: I18nTestWizardAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Gets wizard iterator thru panels used in wizard invoked by this action, 
 * i.e I18N wizard. */
private WizardDescriptor.Iterator getWizardIterator() {
    WizardDescriptor.Panel[] panels = new WizardDescriptor.Panel[3];
    
    panels[0] = new SourceWizardPanel.Panel(true);
    panels[1] = new ResourceWizardPanel.Panel(true);
    panels[2] = new TestStringWizardPanel.Panel();
    
    return new WizardDescriptor.ArrayIterator(panels);
        
}
 
Example 2
Source File: I18nWizardAction.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Gets wizard iterator thru panels used in wizard invoked by this action, 
 * i.e I18N wizard. */
private WizardDescriptor.Iterator<I18nWizardDescriptor.Settings> getWizardIterator() {
    List<WizardDescriptor.Panel<I18nWizardDescriptor.Settings>> panels
            = new ArrayList<WizardDescriptor.Panel<I18nWizardDescriptor.Settings>>(4);
    
    panels.add(new SourceWizardPanel.Panel());
    panels.add(new ResourceWizardPanel.Panel());
    panels.add(new AdditionalWizardPanel.Panel());
    panels.add(new HardStringWizardPanel.Panel());
    
    return new WizardDescriptor.ArrayIterator<I18nWizardDescriptor.Settings>(
        panels.toArray(new WizardDescriptor.Panel[panels.size()])
    );
}
 
Example 3
Source File: WizardOperatorTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** 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);
}
 
Example 4
Source File: RunTagWizard.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "MSG_ReceivingImageInfo=Receiving Image Details",
    "LBL_Run=Run {0}"
})
public void show() {
    DockerImageDetail info = BaseProgressUtils.showProgressDialogAndRun(
            new DockerImageInfoRunnable(tag.getImage()), Bundle.MSG_ReceivingImageInfo(), false);

    List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList<>();
    panels.add(new RunContainerPropertiesPanel(info));
    panels.add(new RunPortBindingsPanel(info));
    String[] steps = new String[panels.size()];
    for (int i = 0; i < panels.size(); i++) {
        JComponent c = (JComponent) panels.get(i).getComponent();
        // Default step name to component name of panel.
        steps[i] = c.getName();
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        c.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
    }
    final WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels));
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wiz.setTitleFormat(new MessageFormat("{0}"));
    wiz.setTitle(Bundle.LBL_Run(getImage(tag)));
    if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
        run(tag, wiz);
    }
}
 
Example 5
Source File: BuildImageWizard.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@NbBundle.Messages("LBL_BuildImage=Build Image")
public void show() {
    List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList<>();
    if (instance == null) {
        panels.add(new BuildInstancePanel());
    }
    panels.add(new BuildContextPanel(fileSystem));
    panels.add(new BuildOptionsPanel());
    String[] steps = new String[panels.size()];
    for (int i = 0; i < panels.size(); i++) {
        JComponent c = (JComponent) panels.get(i).getComponent();
        // Default step name to component name of panel.
        steps[i] = c.getName();
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        c.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
    }

    WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels));
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wiz.setTitleFormat(new MessageFormat("{0}"));
    wiz.setTitle(Bundle.LBL_BuildImage());

    if (instance != null) {
        wiz.putProperty(INSTANCE_PROPERTY, instance);
    }
    if (dockerfile != null && dockerfile.isData()) {
        wiz.putProperty(BUILD_CONTEXT_PROPERTY, dockerfile.getParent().getPath());
        wiz.putProperty(DOCKERFILE_PROPERTY, dockerfile.getName());
    }
    wiz.putProperty(FILESYSTEM_PROPERTY, fileSystem);

    if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
        Boolean pull = (Boolean) wiz.getProperty(PULL_PROPERTY);
        Boolean noCache = (Boolean) wiz.getProperty(NO_CACHE_PROPERTY);
        build((DockerInstance) wiz.getProperty(INSTANCE_PROPERTY),
                (String) wiz.getProperty(BUILD_CONTEXT_PROPERTY),
                (String) wiz.getProperty(DOCKERFILE_PROPERTY),
                (Map<String, String>) wiz.getProperty(BUILD_ARGUMENTS_PROPERTY),
                (String) wiz.getProperty(REPOSITORY_PROPERTY),
                (String) wiz.getProperty(TAG_PROPERTY),
                pull != null ? pull : PULL_DEFAULT,
                noCache != null ? noCache : NO_CACHE_DEFAULT);
    }
}