本文整理汇总了Java中org.netbeans.api.progress.ProgressHandleFactory.createProgressComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressHandleFactory.createProgressComponent方法的具体用法?Java ProgressHandleFactory.createProgressComponent怎么用?Java ProgressHandleFactory.createProgressComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.progress.ProgressHandleFactory
的用法示例。
在下文中一共展示了ProgressHandleFactory.createProgressComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readSettings
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
@Override
public void readSettings(WizardDescriptor settings) {
sources = null;
sourcesString = null;
javadoc = null;
javadocString = null;
this.wiz = settings;
this.component.progressPanel.setVisible (true);
this.component.progressLabel.setVisible (true);
this.progressHandle = ProgressHandleFactory.createHandle(NbBundle.getMessage(DetectPanel.class,"TXT_PlatfromDetectProgress"));
this.component.progressPanel.removeAll();
this.component.progressPanel.setLayout (new GridBagLayout ());
GridBagConstraints c = new GridBagConstraints ();
c.gridx = c.gridy = GridBagConstraints.RELATIVE;
c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0;
JComponent pc = ProgressHandleFactory.createProgressComponent(this.progressHandle);
((GridBagLayout)this.component.progressPanel.getLayout ()).setConstraints(pc,c);
this.component.progressPanel.add (pc);
this.progressHandle.start ();
task.schedule(0);
}
示例2: panelForHandle
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
private static JPanel panelForHandle(ProgressHandle handle) {
JLabel label = ProgressHandleFactory.createDetailLabelComponent(handle);
JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
JPanel panel = new JPanel();
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(label)
.addComponent(progress))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createSequentialGroup()
.addContainerGap()
.addComponent(label)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(progress)
.addContainerGap()
);
return panel;
}
示例3: ProgressL
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
public ProgressL() {
final String lab = NbBundle.getMessage(RefactoringPanel.class, "LBL_RefactorProgressLabel");
handle = ProgressHandleFactory.createHandle(lab);
JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
JPanel component = new JPanel();
component.setLayout(new BorderLayout());
component.setBorder(new EmptyBorder(12,12,11,11));
JLabel label = new JLabel(lab);
label.setBorder(new EmptyBorder(0, 0, 6, 0));
component.add(label, BorderLayout.NORTH);
component.add(progress, BorderLayout.CENTER);
DialogDescriptor desc = new DialogDescriptor(component, NbBundle.getMessage(RefactoringPanel.class, "LBL_RefactoringInProgress"), true, new Object[]{}, null, 0, null, null);
desc.setLeaf(true);
d = DialogDisplayer.getDefault().createDialog(desc);
((JDialog) d).setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
}
示例4: ProgressFrame
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
/** Creates new form ProgressFrame */
public ProgressFrame() {
propertySupport = new PropertyChangeSupport(this);
initComponents ();
this.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_ProgressFrameTabA11yDesc")); // NOI18N
okButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_CancelButtonA11yDesc")); // NOI18N
progressHandle = ProgressHandleFactory.createHandle(null);
progressComponent = ProgressHandleFactory.createProgressComponent(progressHandle);
progressPanel.add(progressComponent);
progressHandle.start();
javax.swing.ImageIcon ideIcon = new javax.swing.ImageIcon("/org/netbeans/core/resources/frames/ide.gif"); //NOI18N
setIconImage(ideIcon.getImage());
java.awt.Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setSize(380, 150);
setLocation(dim.width/2 - 190, dim.height/2 - 80);
}
示例5: ProgressPanel
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
/** Creates new form ProgressPanel */
public ProgressPanel() {
initComponents();
handle = ProgressHandleFactory.createHandle(
NbBundle.getMessage(ImportProjectAction.class, "CTL_ProgressDialogTitle")); // NOI18N
progress = ProgressHandleFactory.createProgressComponent(handle);
setLayout(new GridBagLayout());
setPreferredSize(new Dimension(450, 80));
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new Insets(0, 5, 0, 5);
add(progress, gridBagConstraints);
}
示例6: ProgressPanel
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
public ProgressPanel(ProgressHandle pHandle) {
messageLabel = ProgressHandleFactory.createDetailLabelComponent(pHandle);
messageLabel.setText(NbBundle.getMessage(ProgressDialog.class,
"MSG_StartingProgress")); // NOI18N
progressBar = ProgressHandleFactory.createProgressComponent(pHandle);
initComponents();
}
示例7: create
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
private static ProgressBar create(ProgressHandle handle) {
ProgressBar instance = new ProgressBar();
instance.setLayout(new BorderLayout());
instance.label = new JLabel(" "); //NOI18N
instance.label.setBorder(new EmptyBorder(0, 0, 2, 0));
instance.add(instance.label, BorderLayout.NORTH);
JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
instance.add(progress, BorderLayout.CENTER);
return instance;
}
示例8: init
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
private void init(Runnable run) {
this.run = run;
JComponent c = ProgressHandleFactory.createProgressComponent(progressHandle);
c.setPreferredSize(new Dimension(3 * c.getPreferredSize().width, 3 * c.getPreferredSize().height));
c.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
getContentPane().add(c);
progressHandle.start();
getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(JavaHelp.class, "ACSD_Loading_Dialog")); //NOI18N
pack();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension me = getSize();
setLocation((screen.width - me.width) / 2, (screen.height - me.height) / 2);
}
示例9: DiffPresenter
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
/**
* Creates <i>just computing diff</i> presenter. The mode
* is left on {@link #initWithDiffInfo} call.
*/
public DiffPresenter() {
String label = NbBundle.getMessage(DiffPresenter.class, "diff.prog");
ProgressHandle progress = ProgressHandleFactory.createHandle(label);
progressPanel = ProgressHandleFactory.createProgressComponent(progress);
add(progressPanel);
progress.start();
}
示例10: doWithProgress
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
public static <T> T doWithProgress(String message, final Callable<? extends T> run) throws InvocationTargetException {
final ProgressPanel panel = new ProgressPanel();
panel.setCancelVisible(false);
panel.setText(message);
ProgressHandle handle = ProgressHandleFactory.createHandle(null);
JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
handle.start();
final List<T> result = new ArrayList<T>(1);
final List<Exception> exception = new ArrayList<Exception>(1);
try {
Task task = RequestProcessor.getDefault().post(new Runnable() {
public void run() {
if (!SwingUtilities.isEventDispatchThread()) {
try {
result.add(run.call());
exception.add(null);
} catch (Exception e) {
result.add(null);
exception.add(e);
} finally {
SwingUtilities.invokeLater(this);
}
} else {
panel.close();
}
}
});
panel.open(progress);
task.waitFinished();
} finally {
handle.finish();
}
Exception inner = exception.get(0);
if (inner != null) {
throw new InvocationTargetException(inner, inner.getMessage());
}
return result.get(0);
}
示例11: preRun
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
protected void preRun() {
handle = ProgressHandleFactory.createHandle(labelText, this);
JComponent comp = ProgressHandleFactory.createProgressComponent(handle);
panel.progressPanel.removeAll();
panel.progressPanel.add(comp, BorderLayout.CENTER);
panel.cancelButton.addActionListener(this);
panel.connectionLabel.setVisible(false);
handle.start();
panel.progressPanel.setVisible(true);
panel.cancelButton.setVisible(true);
panel.validateButton.setVisible(false);
panel.validateLabel.setVisible(true);
panel.enableFields(false);
panel.validateLabel.setText(labelText); // NOI18N
}
示例12: readFromDataModel
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
@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);
}
}
}
示例13: invokeHandlers
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
private void invokeHandlers(final List/*<Handler>*/ handlers, final Parameters params) {
final ProgressPanel progressPanel = new ProgressPanel();
ProgressHandle progressHandle = ProgressHandleFactory.createHandle(null);
JComponent progressComponent = ProgressHandleFactory.createProgressComponent(progressHandle);
progressHandle.start();
progressHandle.switchToIndeterminate();
final int[] index = new int[1];
try {
RequestProcessor.Task task = RequestProcessor.getDefault().create(new Runnable() {
public void run() {
index[0] = invokeHandlers(handlers, index[0], params, progressPanel);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
progressPanel.close();
}
});
}
});
while (index[0] < handlers.size()) {
index[0] = invokeHandlers(handlers, index[0], params, null);
if (index[0] < handlers.size()) {
task.schedule(0);
progressPanel.open(progressComponent);
}
}
} finally {
progressHandle.finish();
}
}
示例14: actionPerformed
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
public void actionPerformed( final ActionEvent e ) {
String command = e.getActionCommand();
if ( COMMAND_OK.equals( command ) ) {
// Call the OK option listener
ProjectManager.mutex().writeAccess(new Mutex.Action<Object>() {
public Object run() {
okOptionListener.actionPerformed( e ); // XXX maybe create new event
actionPerformed(e, categories);
return null;
}
});
final ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(CustomizerDialog.class, "LBL_Saving_Project_data_progress"));
JComponent component = ProgressHandleFactory.createProgressComponent(handle);
Frame mainWindow = WindowManager.getDefault().getMainWindow();
final JDialog dialog = new JDialog(mainWindow,
NbBundle.getMessage(CustomizerDialog.class, "LBL_Saving_Project_data"), true);
SavingProjectDataPanel panel = new SavingProjectDataPanel(component);
dialog.getContentPane().add(panel);
dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
dialog.pack();
Rectangle bounds = mainWindow.getBounds();
int middleX = bounds.x + bounds.width / 2;
int middleY = bounds.y + bounds.height / 2;
Dimension size = dialog.getPreferredSize();
dialog.setBounds(middleX - size.width / 2, middleY - size.height / 2, size.width, size.height);
// Call storeListeners out of AWT EQ
RequestProcessor.getDefault().post(new Runnable() {
@Override
public void run() {
try {
ProjectManager.mutex().writeAccess(new Mutex.Action<Object>() {
@Override
public Object run() {
FileUtil.runAtomicAction(new Runnable() {
@Override
public void run() {
handle.start();
if (storeListener != null) {
storeListener.actionPerformed(e);
}
storePerformed(e, categories);
// #97998 related
saveModifiedProject();
}
});
return null;
}
});
} finally {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
dialog.setVisible(false);
dialog.dispose();
}
});
}
}
});
dialog.setVisible(true);
}
}
示例15: getProgressComponent
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
public JComponent getProgressComponent() {
return ProgressHandleFactory.createProgressComponent(getProgressHandle());
}