Java Code Examples for org.netbeans.api.progress.ProgressHandleFactory#createMainLabelComponent()

The following examples show how to use org.netbeans.api.progress.ProgressHandleFactory#createMainLabelComponent() . 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: ConfigurationPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateProgress(final ProgressHandle progressHandle) {
    final JLabel tmpMainLabel = ProgressHandleFactory.createMainLabelComponent(progressHandle);
    final JComponent tmpProgressPanel = ProgressHandleFactory.createProgressComponent(progressHandle);
    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            progressPanel.removeAll();
            progressPanel.add(tmpMainLabel);
            progressPanel.add(Box.createRigidArea(new Dimension(0, 5)));
            progressPanel.add(tmpProgressPanel);
            progressPanel.revalidate();
            progressPanel.repaint();
        }
    });
}
 
Example 2
Source File: EnableStep.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private Runnable doEnable (final FeatureInfo info) {
    return new Runnable () {
        public void run () {
            if (! doEnableRunning) {
                doEnableRunning = true;
                FindComponentModules find = new FindComponentModules(info);
                ModulesActivator activator = new ModulesActivator(forEnable, find);
                ProgressHandle enableHandle = ProgressHandleFactory.createHandle (
                        getBundle ("ModulesStep_Enable",
                        presentElementsForEnable (find)));
                JComponent enableComponent = ProgressHandleFactory.createProgressComponent (enableHandle);
                JComponent enableMainLabel = ProgressHandleFactory.createMainLabelComponent (enableHandle);
                JComponent enableDetailLabel = ProgressHandleFactory.createDetailLabelComponent (enableHandle);
                activator.assignEnableHandle (enableHandle);
                component.displayEnableTask (
                        enableMainLabel,
                        enableDetailLabel,
                        enableComponent);
                RequestProcessor.Task enable = activator.getEnableTask ();
                enable.schedule (0);
                enable.waitFinished ();
                FoDLayersProvider.getInstance().refreshForce();
                waitForDelegateWizard ();
            }
        }
    };
}
 
Example 3
Source File: LayoutLaunchingPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({
    "MSG_LaunchingApplication=Launching your application"
})
@Override
protected void readFromDataModel() {
    checkValidity();
    if (task == null) {
        try {
            task = DesignSupport.invokeDesignMode(data.getProject(), userDir, false, !data.isIgnorePreviousRun());
        } catch (IOException ex) {
            setError(ex.getMessage());
        }
        if(task != null) {
            handle = ProgressHandleFactory.createHandle(Bundle.MSG_LaunchingApplication());
            JComponent pc = ProgressHandleFactory.createProgressComponent(handle);
            JLabel ml = ProgressHandleFactory.createMainLabelComponent(handle);

            progress.add(ml);
            progress.add(pc);

            handle.start();
            markInvalid();
            /* XXX what was the purpose of this? cannot do it now, we are in EQ
            try {
                DesignSupport.existingModes(data);
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            }
            */
            task.addTaskListener(this);
        }
    }
}
 
Example 4
Source File: AggregateProgressFactory.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**
 * Get the task title component for use in custom dialogs, the task won't 
 * show in the progress bar anymore. The text of the label is changed by calls to handle's <code>setDisplayName()</code> method.
 * @return the component to use in custom UI.
 * @since org.netbeans.api.progress 1.8
 */
public static JLabel createMainLabelComponent(AggregateProgressHandle handle) {
    return ProgressHandleFactory.createMainLabelComponent(getProgressHandle(handle));
}