Java Code Examples for org.openide.WizardDescriptor#CLOSED_OPTION

The following examples show how to use org.openide.WizardDescriptor#CLOSED_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: 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 2
Source File: PullWizard.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(PullWizard.class, "LBL_PullWizard.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 3
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 4
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 5
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 6
Source File: ImportWizard.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(ImportWizard.class, "CTL_Import")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ImportWizard.class, "CTL_Import"));
    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                
            repositoryStep.stop();
            importStep.stop();
            importPreviewStep.stop();
        }            
    } else if (value == WizardDescriptor.FINISH_OPTION) {
        if(wizardIterator.current() == importStep) {
            setupImportPreviewStep(true);
        } else if (wizardIterator.current() == importPreviewStep) {
            importPreviewStep.storeTableSorter();
            importPreviewStep.startCommitTask(repositoryStep.getRepositoryFile().getRepositoryUrl());
        }            
    }
    return finnished;
}