本文整理汇总了Java中org.netbeans.api.progress.ProgressHandle.switchToIndeterminate方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressHandle.switchToIndeterminate方法的具体用法?Java ProgressHandle.switchToIndeterminate怎么用?Java ProgressHandle.switchToIndeterminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.progress.ProgressHandle
的用法示例。
在下文中一共展示了ProgressHandle.switchToIndeterminate方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveToFile
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private void saveToFile() {
final File file = new FileChooserBuilder(AttachmentsPanel.class)
.setFilesOnly(true).showSaveDialog();
if (file != null) {
String progressFormat = NbBundle.getMessage(
SaveAttachmentAction.class,
"Attachment.saveToFile.progress"); //NOI18N
String progressMessage = MessageFormat.format(progressFormat, getFilename());
final ProgressHandle handle = ProgressHandleFactory.createHandle(progressMessage);
handle.start();
handle.switchToIndeterminate();
Support.getInstance().getParallelRP().post(new Runnable() {
@Override
public void run() {
try {
getAttachmentData(file);
} catch (IOException ioex) {
LOG.log(Level.INFO, ioex.getMessage(), ioex);
} finally {
handle.finish();
}
}
});
}
}
示例2: applyPatch
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private void applyPatch() {
String progressFormat = NbBundle.getMessage(AttachmentsPanel.class,"Attachment.applyPatch.progress"); //NOI18N
String progressMessage = MessageFormat.format(progressFormat, getFilename());
final ProgressHandle handle = ProgressHandleFactory.createHandle(progressMessage);
handle.start();
handle.switchToIndeterminate();
Support.getInstance().getParallelRP().post(
new Runnable() {
@Override
public void run() {
IDEServices ideServices = Support.getInstance().getIDEServices();
if(ideServices != null) {
try {
ideServices.applyPatch(saveToTempFile());
} catch (IOException ex) {
LOG.log(Level.WARNING, ex.getMessage(), ex);
} finally {
handle.finish();
}
}
}
});
}
示例3: execute
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
@Override
public void execute() throws Exception {
ProgressHandle handle = ProgressHandleFactory.createHandle(Utils.getMessage("LBL_StoppingMySQLServer"), this);
try {
handle.start();
handle.switchToIndeterminate();
proc = runProcess(getStopPath(), getStopArgs());
// wait until server is shut down
proc.waitFor();
} finally {
if (proc != null) {
proc.destroy();
closeOutput();
}
handle.finish();
}
}
示例4: createProgressHandle
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private ProgressHandle createProgressHandle(InputOutput inputOutput,
String displayName, Cancellable cancellable) {
if (!descriptor.showProgress() && !descriptor.showSuspended()) {
return null;
}
ProgressHandle handle = ProgressHandleFactory.createHandle(displayName,
cancellable, new ProgressAction(inputOutput));
handle.setInitialDelay(0);
handle.start();
handle.switchToIndeterminate();
if (descriptor.showSuspended()) {
handle.suspend(NbBundle.getMessage(ExecutionService.class, "Running"));
}
return handle;
}
示例5: run
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
public void run() {
ProgressHandle ph = ProgressHandleFactory.createHandle(
NbBundle.getMessage(RetrieverEngineImpl.class,"LBL_PROGRESSBAR_Retrieve_XML"),
new Cancellable(){
public boolean cancel() {
synchronized(RetrieverEngineImpl.this){
if(!RetrieverEngineImpl.this.STOP_PULL){
RetrieverEngineImpl.this.STOP_PULL = true;
//taskThread.interrupt();
}
}
return true;
}
}, new AbstractAction(){
public void actionPerformed(ActionEvent e) {
getOPWindow().setOutputVisible(true);
getOPWindow().select();
}
});
ph.start();
ph.switchToIndeterminate();
try{
pullRecursively();
}finally{
ph.finish();
}
}
示例6: refreshButtonActionPerformed
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed
String refreshMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshMessage"); // NOI18N
String refreshMessage = MessageFormat.format(refreshMessageFormat, issue.getID());
final ProgressHandle handle = ProgressHandleFactory.createHandle(refreshMessage);
handle.start();
handle.switchToIndeterminate();
skipReload = true;
enableComponents(false);
RP.post(new Runnable() {
@Override
public void run() {
try {
issue.updateModelAndRefresh();
} finally {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
enableComponents(true);
skipReload = false;
}
});
handle.finish();
reloadFormInAWT(true);
}
}
});
}
示例7: invokeHandlers
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的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();
}
}
示例8: reconnect
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
@Override
public void reconnect(long timeToWait) throws DatabaseException, TimeoutException {
ArrayBlockingQueue<Runnable> queue = null;
checkNotOnDispatchThread();
queue = new ArrayBlockingQueue<Runnable>(1);
DatabaseCommand cmd = new DatabaseCommand(queue) {
@Override
public void execute() throws Exception {
disconnectSync();
checkConfiguration();
ProgressHandle progress = ProgressHandleFactory.createHandle(
Utils.getMessage("MSG_ConnectingToServer"));
try {
progress.start();
progress.switchToIndeterminate();
Connection conn = DatabaseUtils.connect(getURL(), getUser(), getPassword());
if (conn == null) {
throw new DatabaseException(NbBundle.getMessage(MySQLDatabaseServer.class, "MSG_UnableToConnect", getURL(), getUser())); // NOI8N
}
connProcessor.setConnection(conn);
setState(ServerState.CONNECTED);
} catch (DatabaseException dbe) {
disconnect();
throw dbe;
} catch (TimeoutException te) {
disconnect();
throw te;
}
finally {
refreshDatabaseList();
progress.finish();
}
}
};
cmd.postCommand("reconnect"); // NOI18N
// Sync up
try {
cmd.syncUp();
if (cmd.getException() != null) {
if (cmd.getException() instanceof DatabaseException) {
throw new DatabaseException(cmd.getException());
} else if (cmd.getException() instanceof TimeoutException) {
TimeoutException newte = new TimeoutException(cmd.getException().getMessage());
newte.initCause(cmd.getException());
throw newte;
} else {
throw Utils.launderThrowable(cmd.getException());
}
}
} catch (InterruptedException ie) {
LOGGER.log(Level.INFO, null, ie);
Thread.currentThread().interrupt();
}
}
示例9: reloadButtonActionPerformed
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) {
String reloadMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reloadMessage"); // NOI18N
final ProgressHandle handle = ProgressHandleFactory.createHandle(reloadMessage);
handle.start();
handle.switchToIndeterminate();
skipReload = true;
enableComponents(false);
RP.post(new Runnable() {
@Override
public void run() {
issue.getRepository().refreshConfiguration();
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
reloading = true;
Object product = productCombo.getSelectedItem();
Object platform = platformCombo.getSelectedItem();
Object os = osCombo.getSelectedItem();
Object priority = priorityCombo.getSelectedItem();
Object severity = severityCombo.getSelectedItem();
Object resolution = resolutionCombo.getSelectedItem();
Object issueType = issueTypeCombo.getSelectedItem();
initCombos();
initCustomFields();
selectInCombo(productCombo, product, false);
productChanged(false);
selectInCombo(platformCombo, platform, false);
selectInCombo(osCombo, os, false);
selectInCombo(priorityCombo, priority, false);
selectInCombo(severityCombo, severity, false);
initStatusCombo(statusCombo.getSelectedItem().toString());
selectInCombo(resolutionCombo, resolution, false);
if (BugzillaUtil.isNbRepository(issue.getRepository())) {
issueTypeCombo.setSelectedItem(issueType);
}
reloadCustomFields(true);
updateCustomFieldStatuses();
} finally {
reloading = false;
enableComponents(true);
skipReload = false;
}
}
});
handle.finish();
}
});
}
示例10: submitButtonActionPerformed
import org.netbeans.api.progress.ProgressHandle; //导入方法依赖的package包/类
private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitButtonActionPerformed
final boolean isNew = issue.isNew();
if(isNew && reproducibilityCombo.isVisible()) {
String repro = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reproducibilityCommitText", (String) reproducibilityCombo.getSelectedItem()); // NOI18N
String comment = addCommentArea.getText();
String nbInfo = getNetbeansInfo();
int idx = nbInfo.lastIndexOf("\n"); // NOI18N
if(idx > 0) {
String s = nbInfo.substring(idx, nbInfo.length() - 1);
idx = comment.indexOf(s);
if(idx > 0) {
idx += s.length() + 1;
comment = comment.substring(0, idx) + "\n\n" + repro + comment.substring(idx, comment.length()); // NOI18N
} else {
comment = repro + "\n\n" + comment; // NOI18N
}
} else {
comment = repro + "\n\n" + comment; // NOI18N
}
issue.setFieldValue(IssueField.DESCRIPTION, comment);
}
String submitMessage;
if (isNew) {
submitMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitNewMessage"); // NOI18N
} else {
String submitMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitMessage"); // NOI18N
submitMessage = MessageFormat.format(submitMessageFormat, issue.getID());
}
final ProgressHandle handle = ProgressHandleFactory.createHandle(submitMessage);
handle.start();
handle.switchToIndeterminate();
skipReload = true;
enableComponents(false);
RP.post(new Runnable() {
@Override
public void run() {
boolean submitOK = false;
try {
submitOK = issue.submitAndRefresh();
} finally {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
enableComponents(true);
skipReload = false;
}
});
handle.finish();
if(submitOK) {
if (isNew) {
// Show all custom fields, not only the ones shown on bug creation
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
initCustomFields();
}
});
}
reloadFormInAWT(true);
}
}
}
});
}