本文整理汇总了Java中org.netbeans.api.progress.ProgressHandleFactory.createDetailLabelComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressHandleFactory.createDetailLabelComponent方法的具体用法?Java ProgressHandleFactory.createDetailLabelComponent怎么用?Java ProgressHandleFactory.createDetailLabelComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.progress.ProgressHandleFactory
的用法示例。
在下文中一共展示了ProgressHandleFactory.createDetailLabelComponent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: tryRefreshProviders
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
private static boolean tryRefreshProviders (Collection<UpdateUnitProvider> providers, PluginManagerUI manager, boolean force) {
ProgressHandle handle = ProgressHandleFactory.createHandle (NbBundle.getMessage(SettingsTableModel.class, ("Utilities_CheckingForUpdates")));
JComponent progressComp = ProgressHandleFactory.createProgressComponent (handle);
JLabel detailLabel = ProgressHandleFactory.createDetailLabelComponent (handle);
detailLabel.setHorizontalAlignment (SwingConstants.LEFT);
try {
manager.setProgressComponent (detailLabel, progressComp);
handle.setInitialDelay (0);
handle.start ();
if (providers == null) {
providers = UpdateUnitProviderFactory.getDefault ().getUpdateUnitProviders (true);
}
for (UpdateUnitProvider p : providers) {
try {
p.refresh (handle, force);
showProviderNotification(p);
} catch (IOException ioe) {
logger.log (Level.INFO, ioe.getMessage (), ioe);
JButton cancel = new JButton ();
Mnemonics.setLocalizedText (cancel, getBundle ("Utilities_NetworkProblem_Cancel")); // NOI18N
JButton skip = new JButton ();
Mnemonics.setLocalizedText (skip, getBundle ("Utilities_NetworkProblem_Skip")); // NOI18N
skip.setEnabled (providers.size() > 1);
JButton tryAgain = new JButton ();
Mnemonics.setLocalizedText (tryAgain, getBundle ("Utilities_NetworkProblem_Continue")); // NOI18N
ProblemPanel problem = new ProblemPanel (
getBundle ("Utilities_NetworkProblem_Text", p.getDisplayName (), ioe.getLocalizedMessage ()), // NOI18N
new JButton [] { tryAgain, skip, cancel });
Object ret = problem.showNetworkProblemDialog ();
if (skip.equals (ret)) {
// skip UpdateUnitProvider and try next one
continue;
} else if (tryAgain.equals (ret)) {
// try again
return false;
}
return true;
}
}
} finally {
if (handle != null) {
handle.finish ();
}
// XXX: Avoid NPE when called refresh providers on selected units
// #101836: OperationContainer.contains() sometimes fails
Containers.initNotify ();
manager.unsetProgressComponent (detailLabel, progressComp);
}
return true;
}
示例4: createDetailLabelComponent
import org.netbeans.api.progress.ProgressHandleFactory; //导入方法依赖的package包/类
/**
* Get the detail messages 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 contributors' <code>progress(String)</code> methods.
* @return the component to use in custom UI.
* @since org.netbeans.api.progress 1.8
*/
public static JLabel createDetailLabelComponent(AggregateProgressHandle handle) {
return ProgressHandleFactory.createDetailLabelComponent(getProgressHandle(handle));
}