本文整理汇总了Java中org.eclipse.ui.progress.IProgressService.busyCursorWhile方法的典型用法代码示例。如果您正苦于以下问题:Java IProgressService.busyCursorWhile方法的具体用法?Java IProgressService.busyCursorWhile怎么用?Java IProgressService.busyCursorWhile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.progress.IProgressService
的用法示例。
在下文中一共展示了IProgressService.busyCursorWhile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.eclipse.ui.progress.IProgressService; //导入方法依赖的package包/类
@Override
public void run(IAction action) {
final ArrayList<File> tmp = new ArrayList<File>();
LeJOSEV3Util.getFilesFromSelection(_selection, tmp);
if (!tmp.isEmpty())
{
// open progress monitor
IWorkbench wb = PlatformUI.getWorkbench();
IProgressService ps = wb.getProgressService();
try {
ps.busyCursorWhile(new IRunnableWithProgress() {
public void run(IProgressMonitor pm) {
uploadFile(pm, tmp);
} // end run
});
} catch (Throwable t) {
// log
LeJOSEV3Util.log(t);
}
}
}
示例2: getBookmarks
import org.eclipse.ui.progress.IProgressService; //导入方法依赖的package包/类
private List<Bookmark> getBookmarks(IStructuredSelection selection) {
List<Bookmark> bookmarks = new ArrayList<>();
IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
try {
progressService.busyCursorWhile(monitor -> {
bookmarks.addAll(getBookmarks(selection, monitor));
});
} catch (InvocationTargetException | InterruptedException e) {
// ignore
}
return bookmarks;
}
示例3: terminateLaunches
import org.eclipse.ui.progress.IProgressService; //导入方法依赖的package包/类
private void terminateLaunches() {
if( preferences.isTerminateBeforeRelaunch() ) {
IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
try {
progressService.busyCursorWhile( this::terminateLaunches );
} catch( InvocationTargetException ite ) {
handleException( ite.getCause() );
} catch( InterruptedException ignore ) {
Thread.interrupted();
}
}
}
示例4: execute
import org.eclipse.ui.progress.IProgressService; //导入方法依赖的package包/类
public void execute(ICustomContext context) {
try {
URI uri = getDiagram().eResource().getURI();
URI bpmnUri = uri.trimFragment();
bpmnUri = bpmnUri.trimFileExtension();
bpmnUri = bpmnUri.appendFileExtension("bpmn20.xml");
IProject project = null;
String parentDiagramName = null;
if (bpmnUri.isPlatformResource()) {
String platformString = bpmnUri.toPlatformString(true);
IResource fileResource = ResourcesPlugin.getWorkspace().getRoot().findMember(platformString);
if (fileResource != null) {
project = fileResource.getProject();
parentDiagramName = uri.trimFragment().trimFileExtension().lastSegment();
}
}
final IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
final ExportMarshallerRunnable runnable = new ExportMarshallerRunnable(getDiagram(), ActivitiBPMNDiagramConstants.BPMN_MARSHALLER_NAME);
progressService.busyCursorWhile(runnable);
} catch (Exception e) {
e.printStackTrace();
}
}