Java Code Examples for org.openide.WizardDescriptor#FINISH_OPTION

The following examples show how to use org.openide.WizardDescriptor#FINISH_OPTION . 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: AvdManager.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
private void createDeviceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createDeviceActionPerformed
        // TODO add your handling code here:
        WizardDescriptor wiz = new WizardDescriptor(new CreateAvdWizardIterator(this));
        wiz.putProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
        wiz.putProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
        wiz.putProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
        wiz.putProperty(CreateAvdWizardIterator.DEVICE_MANAGER, deviceManager);
        wiz.putProperty(CreateAvdWizardIterator.IMAGE_MANAGER, systemImageManager);
        wiz.putProperty(CreateAvdWizardIterator.REPO_MANAGER, repoManager);
        wiz.putProperty(CreateAvdWizardIterator.ANDROID_SDK, defaultSdk);
        wiz.putProperty(CreateAvdWizardIterator.AVD_MANAGER, avdManager);
        wiz.setTitle("Create Virtual Device");
        wiz.setTitleFormat(new java.text.MessageFormat("{0}")); // NOI18N
        Dialog dlg = DialogDisplayer.getDefault().createDialog(wiz);
        try {
            dlg.setVisible(true);
            if (wiz.getValue() == WizardDescriptor.FINISH_OPTION) {
//                Set result = wiz.getInstantiatedObjects();
                model.fireTableStructureChanged();
            }
        } finally {
            dlg.dispose();
            //  wiz.getInstantiatedObjects();
        }
    }
 
Example 2
Source File: CheckoutWizard.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public boolean show() {
    wizardIterator = new PanelsIterator();
    wizardDescriptor = new WizardDescriptor(wizardIterator);        
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(CheckoutWizard.class, "CTL_Checkout")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CheckoutWizard.class, "CTL_Checkout"));
    dialog.setVisible(true);
    dialog.toFront();
    Object value = wizardDescriptor.getValue();
    boolean finnished = value == WizardDescriptor.FINISH_OPTION;
    
    if(finnished) {
        onFinished();
    } else {
        // wizard wasn't properly finnished ...
        if(value == WizardDescriptor.CLOSED_OPTION || 
           value == WizardDescriptor.CANCEL_OPTION ) 
        {
            // wizard was closed or canceled -> reset all steps & kill all running tasks
            repositoryStep.stop();                          
        }            
    }
    return finnished;
}
 
Example 3
Source File: ConvertOgreBinaryMeshesAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void actionPerformed(ActionEvent ev) {
    final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Convert Ogre Binary Meshes");
    wizardDescriptor.putProperty("project", context);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    final boolean deleteFiles = (Boolean) wizardDescriptor.getProperty("deleteoriginal");
    if (!cancelled) {
        new Thread(new Runnable() {

            public void run() {
                scanDir(((AssetPackProject) context).getAssetsFolder().getPath(), deleteFiles);
            }
        }).start();
    }
}
 
Example 4
Source File: FetchWizard.java    From netbeans with Apache License 2.0 6 votes vote down vote up
boolean show () {
    wizardIterator = new PanelsIterator();
    wizardDescriptor = new WizardDescriptor(wizardIterator);        
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(FetchWizard.class, "LBL_FetchWizard.title")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    setErrorMessage(wizardIterator.selectUriStep.getErrorMessage());
    dialog.setVisible(true);
    dialog.toFront();
    Object value = wizardDescriptor.getValue();
    boolean finnished = value == WizardDescriptor.FINISH_OPTION;
    if (!finnished) {
        // wizard wasn't properly finnished ...
        if (value == WizardDescriptor.CLOSED_OPTION || value == WizardDescriptor.CANCEL_OPTION ) {
            // wizard was closed or canceled -> reset all steps & kill all running tasks
            wizardIterator.selectUriStep.cancelBackgroundTasks();
            wizardIterator.fetchBranchesStep.cancelBackgroundTasks();
        }            
    }
    return finnished;
}
 
Example 5
Source File: PushWizard.java    From netbeans with Apache License 2.0 6 votes vote down vote up
boolean show () {
    wizardIterator = new PanelsIterator();
    wizardDescriptor = new WizardDescriptor(wizardIterator);        
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(PushWizard.class, "LBL_PushWizard.title")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    setErrorMessage(wizardIterator.selectUriStep.getErrorMessage());
    dialog.setVisible(true);
    dialog.toFront();
    Object value = wizardDescriptor.getValue();
    boolean finnished = value == WizardDescriptor.FINISH_OPTION;
    if (!finnished) {
        // wizard wasn't properly finnished ...
        if (value == WizardDescriptor.CLOSED_OPTION || value == WizardDescriptor.CANCEL_OPTION ) {
            // wizard was closed or canceled -> reset all steps & kill all running tasks
            wizardIterator.selectUriStep.cancelBackgroundTasks();
        }            
    }
    return finnished;
}
 
Example 6
Source File: PublishAssetPackAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void actionPerformed(ActionEvent ev) {
    final WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Publish AssetPack");
    wizardDescriptor.putProperty("project", context);
    String projectName = ((AssetPackProject) context).getProjectName().replaceAll(" ", "_") + ".zip";
    wizardDescriptor.putProperty("filename", projectName);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        new Thread(new Runnable() {

            public void run() {
                ProgressHandle handle = ProgressHandleFactory.createHandle("Publishing AssetPack..");
                handle.start();
                packZip(wizardDescriptor);
                copyData(wizardDescriptor);
                handle.progress("Uploading AssetPack..");
                uploadData(wizardDescriptor);
                cleanup(wizardDescriptor);
                handle.finish();
            }
        }).start();
    }
}
 
Example 7
Source File: SkyboxWizardAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void performAction() {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Skybox Wizard");
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        topComponent.generateSkybox(wizardDescriptor);
    }
}
 
Example 8
Source File: URLPatternWizard.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public boolean show() {
    wizardIterator = new PanelsIterator();
    wizardDescriptor = new WizardDescriptor(wizardIterator);        
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(URLPatternWizard.class, "CTL_URLPattern")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(URLPatternWizard.class, "CTL_URLPattern")); // NOI18N
    dialog.setVisible(true);
    dialog.toFront();
    
    return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION;
}
 
Example 9
Source File: NewBloomFilterAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected Object showWizard(Node node) {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Your wizard dialog title here");
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        return wizardDescriptor;
    }
    return null;
}
 
Example 10
Source File: CloneWizard.java    From netbeans with Apache License 2.0 5 votes vote down vote up
boolean show () {
    wizardIterator = new PanelsIterator();
    wizardDescriptor = new WizardDescriptor(wizardIterator);        
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N
    wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(CloneWizard.class, "LBL_CloneWizard.title")); // NOI18N
    
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    if(pa != null && forPath != null) {
        Git.getInstance().getRequestProcessor().post(new Runnable() {
            @Override
            public void run () {
                wizardIterator.repositoryStep.waitPopulated();
                // url and credential already provided, so try 
                // to reach the next step ...
                EventQueue.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        wizardDescriptor.doNextClick();
                    }
                });
            }
        });
    }
    setErrorMessage(wizardIterator.repositoryStep.getErrorMessage());
    dialog.setVisible(true);
    dialog.toFront();
    Object value = wizardDescriptor.getValue();
    boolean finished = value == WizardDescriptor.FINISH_OPTION;
    if (finished) {
        onFinished();
    } else {
        // wizard wasn't properly finnished ...
        if (value == WizardDescriptor.CLOSED_OPTION || value == WizardDescriptor.CANCEL_OPTION ) {
            // wizard was closed or canceled -> reset all steps & kill all running tasks
            wizardIterator.repositoryStep.cancelBackgroundTasks();
        }            
    }
    return finished;
}
 
Example 11
Source File: BloomWizardAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public @Override
void actionPerformed(ActionEvent e) {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Your wizard dialog title here");
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        // do something
    }
}
 
Example 12
Source File: AddSkyboxAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected Object showWizard(org.openide.nodes.Node node) {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Skybox Wizard");
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        return wizardDescriptor;
    }
    return null;
}
 
Example 13
Source File: CodelessProjectWizardAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void performAction() {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Import External Project Assets");
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        createProjectSettings(wizardDescriptor);
    }
}
 
Example 14
Source File: Clusterize.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private boolean perform() {
    wizardDescriptor.createNotificationLineSupport();
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle(NbBundle.getMessage(Clusterize.class, "LAB_ClusterizeWizard"));
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION;
}
 
Example 15
Source File: InstallUnitWizard.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 16
Source File: AddTerrainAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
protected Object showWizard(org.openide.nodes.Node node) {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Terrain Wizard");
    wizardDescriptor.putProperty("main_node", node);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        return wizardDescriptor;
    }
    return null;
}
 
Example 17
Source File: ImportAssetAction.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void actionPerformed(ActionEvent ev) {
    WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels());
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wizardDescriptor.setTitleFormat(new MessageFormat("{0}"));
    wizardDescriptor.setTitle("Import Asset to AssetPack..");
    wizardDescriptor.putProperty("project", context);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        importAsset(wizardDescriptor);
    }
}
 
Example 18
Source File: AddServerInstanceWizard.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public static String showAddServerInstanceWizard(Map<String, String> props) {
    Collection<Server> allServers = ServerRegistry.getInstance().getServers();
    for (java.util.Iterator<Server> it = allServers.iterator(); it.hasNext();) {
        Server server = it.next();
        OptionalDeploymentManagerFactory factory = server.getOptionalFactory();
        if (factory == null || factory.getAddInstanceIterator() == null) {
            it.remove();
        }
    }
    if (allServers.isEmpty()) {
        // display the warning dialog - no server plugins
        String close = NbBundle.getMessage(AddServerInstanceWizard.class, "LBL_NoServerPlugins_Close");
        DialogDescriptor descriptor = new DialogDescriptor(
                NbBundle.getMessage(AddServerInstanceWizard.class, "LBL_NoServerPlugins_Text"),
                NbBundle.getMessage(AddServerInstanceWizard.class, "LBL_NoServerPlugins_Title"),
                true,
                new Object[] {close},
                close,
                DialogDescriptor.DEFAULT_ALIGN,
                null,
                null);

        // TODO invoke plugin manager once API to do that will be available
        DialogDisplayer.getDefault().notify(descriptor);
        return null;
    }
        
    AddServerInstanceWizard wizard = new AddServerInstanceWizard(props);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizard);
    try {
        dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(AddServerInstanceWizard.class, "ACSD_Add_Server_Instance"));
        dialog.setVisible(true);
    } finally {
        dialog.dispose();
    }
    if (wizard.getValue() == WizardDescriptor.FINISH_OPTION) {
        Set instantiatedObjects = wizard.getInstantiatedObjects();
        if (instantiatedObjects != null && instantiatedObjects.size() > 0) {
            Object result = instantiatedObjects.iterator().next();
            if (result instanceof InstanceProperties) {
                return ((InstanceProperties) result).getProperty(InstanceProperties.URL_ATTR);
            } else {
                LOGGER.warning(wizard.iterator.getSelectedServer() + "'s add server instance wizard iterator should return " + // NOI18N
                        "a Set containing new server instance InstanceProperties object as a result of the " + // NOI18N
                        "WizardDescriptor.InstantiatingIterator.instantiate() method."); // NOI18N
                // there is an error in the server plugin, cannot return the added instance
                return null;
            }
        }
    }
    // the wizard was cancelled
    return null;
}
 
Example 19
Source File: InsertProfilingPointAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void performAction(Lookup.Provider project) {
    ProfilingPointsManager manager = ProfilingPointsManager.getDefault();
    if (manager.isProfilingSessionInProgress()) {
        ProfilerDialogs.displayWarning(
                Bundle.InsertProfilingPointAction_ProfilingInProgressMsg());

        return;
    }

    if (ProjectUtilities.getOpenedProjects().length == 0) {
        ProfilerDialogs.displayWarning(
                Bundle.InsertProfilingPointAction_NoProjectMsg());

        return;
    }

    ProfilingPointWizard ppWizard = ProfilingPointWizard.getDefault();
    final WizardDescriptor wd = ppWizard.getWizardDescriptor(project);

    if (wd != null) { // if null then another PP is currently being created/customized and user is already notified

        final Dialog d = DialogDisplayer.getDefault().createDialog(wd);
        d.setVisible(true);

        boolean createPPoint = wd.getValue() == WizardDescriptor.FINISH_OPTION;
        ProfilingPoint profilingPoint = ppWizard.finish(!createPPoint); // Wizard must be finished even in cancelled to release its resources

        if (createPPoint) {
            manager.addProfilingPoint(profilingPoint);

            if (profilingPoint instanceof GlobalProfilingPoint) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        ProfilingPointsWindow ppWin = ProfilingPointsWindow.getDefault();
                        if (!ppWin.isOpened()) {
                            ppWin.open();
                            ppWin.requestVisible();
                        }
                    }
                });
            }
        }
    }
}
 
Example 20
Source File: CloneWizard.java    From netbeans with Apache License 2.0 4 votes vote down vote up
boolean isFinishing () {
    return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION;
}