当前位置: 首页>>代码示例>>Java>>正文


Java BusyIndicator类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:21,代码来源:TableEdit.java

示例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;
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:CustomAboutDialog.java

示例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);
		}
	}
});
  }
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:19,代码来源:UIUtils.java

示例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);
		}
	}
});
  }
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:19,代码来源:UIUtils.java

示例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());
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:27,代码来源:ProgressServiceImpl.java

示例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);
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:20,代码来源:HTMLEditor.java

示例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);
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:HTMLEditor.java

示例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);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:17,代码来源:ViewChangeAction.java

示例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;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:25,代码来源:MergeResultsView.java

示例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;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:MergeViewResolveAction.java

示例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$
      }
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:21,代码来源:GcpLocalRunTab.java

示例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);
			}
		}
	});
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:17,代码来源:UIHelper.java

示例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();
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:22,代码来源:CloudUrlDialog.java

示例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]);
				}
			}
		});
	}
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:19,代码来源:JSBuildFileViewDropAdapter.java

示例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);
            }

        }
);
    }
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:17,代码来源:CheckboxTreeAndListGroup.java


注:本文中的org.eclipse.swt.custom.BusyIndicator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。