本文整理汇总了Java中org.eclipse.swt.custom.BusyIndicator类的典型用法代码示例。如果您正苦于以下问题:Java BusyIndicator类的具体用法?Java BusyIndicator怎么用?Java BusyIndicator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BusyIndicator类属于org.eclipse.swt.custom包,在下文中一共展示了BusyIndicator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endTableEdit
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
protected void endTableEdit(TableCursor tableCursor, ControlEditor editor,
final CommitEditRunnable commitEditRunnable, TableItem row, int column, String newValue) throws Exception {
if (commitEditRunnable == null) {
return;
}
commitEditRunnable.setTableCursor(tableCursor);
commitEditRunnable.setEditor(editor);
commitEditRunnable.setRow(row);
commitEditRunnable.setColumn(column);
commitEditRunnable.setNewValue(newValue);
BusyIndicator.showWhile(row.getDisplay(), commitEditRunnable);
Exception error = commitEditRunnable.getError();
if (error != null) {
throw error;
}
}
示例2: buttonPressed
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case DETAILS_ID:
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
InstallationDialog dialog = new InstallationDialog(getShell(), workbenchWindow);
dialog.setModalParent(CustomAboutDialog.this);
dialog.open();
}
});
break;
default:
super.buttonPressed(buttonId);
break;
}
}
示例3: expandAll
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
public static void expandAll(final TreeViewer treeViewer, final String context) {
AvroSchemaLogger.logMsg(context + " BEGIN", false);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
long time1 = System.currentTimeMillis();
try {
treeViewer.getTree().setRedraw(false);
treeViewer.expandAll();
} finally {
treeViewer.getTree().setRedraw(true);
long time2 = System.currentTimeMillis();
long delay = time2 - time1;
AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
}
}
});
}
示例4: run
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
public static void run(final TreeViewer treeViewer, final Runnable runnable, final String context) {
AvroSchemaLogger.logMsg(context + " BEGIN", false);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
@Override
public void run() {
long time1 = System.currentTimeMillis();
try {
treeViewer.getTree().setRedraw(false);
runnable.run();
} finally {
treeViewer.getTree().setRedraw(true);
long time2 = System.currentTimeMillis();
long delay = time2 - time1;
AvroSchemaLogger.logMsg(context + " END : " + delay + " ms", false);
}
}
});
}
示例5: runInUI
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
@Override
public void runInUI(IRunnableContext context,
IRunnableWithProgress runnable, ISchedulingRule rule)
throws InvocationTargetException, InterruptedException {
final RunnableWithStatus runnableWithStatus = new RunnableWithStatus(
context,
runnable, rule);
uiSynchronize.syncExec(new Runnable() {
@Override
public void run() {
BusyIndicator.showWhile(getDisplay(), runnableWithStatus);
}
});
IStatus status = runnableWithStatus.getStatus();
if (!status.isOK()) {
Throwable exception = status.getException();
if (exception instanceof InvocationTargetException)
throw (InvocationTargetException) exception;
else if (exception instanceof InterruptedException)
throw (InterruptedException) exception;
else // should be OperationCanceledException
throw new InterruptedException(exception.getMessage());
}
}
示例6: openLinkUnderSelection
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
/**
* Handles the user typing control-enter on an existing link in the editor.
*/
private void openLinkUnderSelection() {
log.debug("opening link under selection"); //$NON-NLS-1$
BusyIndicator.showWhile(getDisplay(), new Runnable() {
@Override
public void run() {
// More immediate feedback.
hideToolTip();
final Object linkObject = evaluate("return editor.getLinkUnderSelection() || '';"); //$NON-NLS-1$
if ((linkObject instanceof String) && linkObject.toString().length() > 0) {
openLink((String) linkObject);
}
}
});
}
示例7: openLinkUnderMouseCursor
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
/**
* Handles the user clicking (or typing control-enter on) an existing link
* in the editor.
*/
private void openLinkUnderMouseCursor() {
log.debug("opening link under mouse cursor"); //$NON-NLS-1$
BusyIndicator.showWhile(getDisplay(), new Runnable() {
@Override
public void run() {
// More immediate feedback.
hideToolTip();
final Object linkObject = evaluate("return editor.getLinkUnderMouseCursor() || '';"); //$NON-NLS-1$
if ((linkObject instanceof String) && linkObject.toString().length() > 0) {
openLink((String) linkObject);
}
}
});
}
示例8: doRun
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
@Override
protected void doRun(final TFSRepository repository) {
final Change change = (Change) adaptSelectionFirstElement(Change.class);
final String[] localItem = new String[1];
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
@Override
public void run() {
localItem[0] = getLocalItemToView(change, repository);
}
});
final IWorkbenchPage workbenchPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ViewFileHelper.viewLocalFileOrFolder(localItem[0], workbenchPage, inModalContext);
}
示例9: getTreeConflict
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
private SVNTreeConflict getTreeConflict(final IResource resource) {
treeConflict = null;
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
ISVNClientAdapter client = null;
try {
client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
for (int i = 0; i < statuses.length; i++) {
if (statuses[i].hasTreeConflict()) {
treeConflict = new SVNTreeConflict(statuses[i]);
break;
}
}
} catch (Exception e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
finally {
SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
}
}
});
return treeConflict;
}
示例10: getTreeConflict
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
private SVNTreeConflict getTreeConflict(final IResource resource) {
BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
public void run() {
ISVNClientAdapter client = null;
try {
client = SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().getSVNClient();
ISVNStatus[] statuses = client.getStatus(resource.getLocation().toFile(), true, true, true);
for (int i = 0; i < statuses.length; i++) {
if (statuses[i].hasTreeConflict()) {
treeConflict = new SVNTreeConflict(statuses[i]);
break;
}
}
} catch (Exception e) {
SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
}
finally {
SVNWorkspaceRoot.getSVNResourceFor(resource).getRepository().returnSVNClient(client);
}
}
});
return treeConflict;
}
示例11: updateProjectSelector
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
private void updateProjectSelector() {
final Credential credential = accountSelector.getSelectedCredential();
if (credential == null) {
projectSelector.setProjects(new ArrayList<GcpProject>());
return;
}
BusyIndicator.showWhile(projectSelector.getDisplay(), new Runnable() {
@Override
public void run() {
try {
List<GcpProject> gcpProjects = projectRepository.getProjects(credential);
projectSelector.setProjects(gcpProjects);
} catch (ProjectRepositoryException e) {
logger.log(Level.WARNING,
"Could not retrieve GCP project information from server.", e); //$NON-NLS-1$
}
}
});
}
示例12: showDynamicHelp
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
public static void showDynamicHelp() {
// This may take a while, so use the busy indicator
BusyIndicator.showWhile(null, new Runnable() {
public void run() {
getActiveWindow().getWorkbench().getHelpSystem().displayDynamicHelp();
// the following ensure that the help view receives focus
// prior to adding this, it would not receive focus if
// it was opened into a folder or was already
// open in a folder in which another part had focus
IViewPart helpView = findView("org.eclipse.help.ui.HelpView");
if (helpView != null && getActiveWindow() != null && getActiveWindow().getActivePage() != null) {
getActiveWindow().getActivePage().activate(helpView);
}
}
});
}
示例13: okPressed
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
@Override
protected void okPressed() {
final boolean[] shouldProceed = new boolean[] {false};
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
public void run() {
try {
CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(url).getCloudInfo();
shouldProceed[0] = true;
}
catch (Exception e) {
shouldProceed[0] = MessageDialog.openQuestion(getParentShell(), Messages.CloudUrlDialog_TEXT_INVALID_URL, NLS.bind(Messages.CloudUrlDialog_TEXT_CONN_FAILED, url));
}
}
});
if (shouldProceed[0]) {
super.okPressed();
}
}
示例14: drop
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
/**
* @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
*/
@Override
public void drop(DropTargetEvent event) {
Object data = event.data;
if (data instanceof String[]) {
final String[] strings = (String[]) data;
BusyIndicator.showWhile(null, new Runnable() {
@Override
public void run() {
for (int i = 0; i < strings.length; i++) {
processString(strings[i]);
}
}
});
}
}
示例15: checkStateChanged
import org.eclipse.swt.custom.BusyIndicator; //导入依赖的package包/类
public void checkStateChanged(final CheckStateChangedEvent event)
{
BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() {
public void run()
{
if(event.getCheckable().equals(fTreeViewer))
treeItemChecked(event.getElement(), event.getChecked());
else
listItemChecked(event.getElement(), event.getChecked(), true);
notifyCheckStateChangeListeners(event);
}
}
);
}