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


Java ProgressMonitorDialog.run方法代码示例

本文整理汇总了Java中org.eclipse.jface.dialogs.ProgressMonitorDialog.run方法的典型用法代码示例。如果您正苦于以下问题:Java ProgressMonitorDialog.run方法的具体用法?Java ProgressMonitorDialog.run怎么用?Java ProgressMonitorDialog.run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.dialogs.ProgressMonitorDialog的用法示例。


在下文中一共展示了ProgressMonitorDialog.run方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refresh

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
public static void refresh() {
	IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
	try {
		ValidationView instance = (ValidationView) page.showView("views.problems");
		List<ModelStatus> result = new ArrayList<>();
		ProgressMonitorDialog dialog = new ProgressMonitorDialog(UI.shell());
		dialog.run(true, true, (monitor) -> {
			DatabaseValidation validation = DatabaseValidation.with(monitor);
			result.addAll(validation.evaluateAll());				
		});
		StatusList[] model = createModel(result);
		instance.viewer.setInput(model);
		if (model.length == 0)
			Info.showBox(M.DatabaseValidationCompleteNoErrorsWereFound);
	} catch (Exception e) {
		log.error("Error validating database", e);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:19,代码来源:ValidationView.java

示例2: generateEMFCode

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
 * TODO merge monitor
 */
private void generateEMFCode(String genModelPath) throws InvocationTargetException, InterruptedException {
	/*
	 * Generate model & edit
	 */
	List<URI> uris = new ArrayList<URI>();
	uris.add(URI.createFileURI(genModelPath));
	List<GenModel> genModels = GeneratorUIUtil.loadGenModels(new NullProgressMonitor(), uris, shell);
	GeneratorUIUtil.GeneratorOperation editOp = new GeneratorUIUtil.GeneratorOperation(shell);
	editOp.addGeneratorAndArguments(GenModelUtil.createGenerator(genModels.get(0)), genModels.get(0),
			"org.eclipse.emf.codegen.ecore.genmodel.generator.EditProject", "Edit");
	editOp.addGeneratorAndArguments(GenModelUtil.createGenerator(genModels.get(0)), genModels.get(0),
			"org.eclipse.emf.codegen.ecore.genmodel.generator.ModelProject", "Model");
	ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(shell);
	progressMonitorDialog.run(true, true, editOp);
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:19,代码来源:OCCI2EMFGeneratorAction.java

示例3: run

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
 * @see org.eclipse.jface.action.Action#run()
 */
@Override
public void run() {
    // 진행 모니터 다이얼로그 생성
    ProgressMonitorDialog dialog = new ProgressMonitorDialog(parentShell);

    // 작업공간 변경 처리 생성
    workspaceModifyOperation = new UMLWorkspaceModifyOperation();

    try {
        // 진행 모니터 다이얼로그 실행
        dialog.run(false, true, workspaceModifyOperation);
    } catch (InvocationTargetException ite) {
        ite.printStackTrace();
    } catch (InterruptedException ie) {
        ie.printStackTrace();
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:AbstractUMLExplorerExtendedAction.java

示例4: actionPerformed

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
public void actionPerformed(final List<MObject> selectedElements, final IModule module) {
	ProgressMonitorDialog progress = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
	try {
		progress.run(true, false, new IRunnableWithProgress() {

			@Override
			public void run(IProgressMonitor arg0)
					throws InvocationTargetException, InterruptedException {					
				arg0.beginTask("Running...", IProgressMonitor.UNKNOWN);
				runScript(selectedElements, module);
				arg0.done();
			}
		});
	} catch (InvocationTargetException | InterruptedException e) {
		e.printStackTrace();
	}
}
 
开发者ID:juniper-project,项目名称:modelling-postgresql,代码行数:18,代码来源:MDACConfigurator.java

示例5: run

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Override
public void run() {

    ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
    try {
        dialog.run(false, true, new IRunnableWithProgress() {

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                new StopRuntimeProgress().run(monitor);
            }
        });
    } catch (Throwable e) {
        ExceptionHandler.process(e);
        IStatus status = new Status(IStatus.ERROR, ESBRunContainerPlugin.PLUGIN_ID, e.getMessage(), e);
        if (e.getCause() != null) {
            status = new Status(IStatus.ERROR, ESBRunContainerPlugin.PLUGIN_ID, e.getCause().getMessage(), e.getCause());
        }
        RuntimeErrorDialog.openError(shell,
                RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog6"),
                RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog6"), status);
    }
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:24,代码来源:StopRuntimeAction.java

示例6: run

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Override
public void run() {

    ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
    try {
        dialog.run(false, true, new IRunnableWithProgress() {

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                new StartRuntimeProgress(true).run(monitor);
            }
        });
    } catch (Throwable e) {
        ExceptionHandler.process(e);
        IStatus status = new Status(IStatus.ERROR, ESBRunContainerPlugin.PLUGIN_ID, e.getMessage(), e);
        if (e.getCause() != null) {
            status = new Status(IStatus.ERROR, ESBRunContainerPlugin.PLUGIN_ID, e.getCause().getMessage(), e.getCause());
        }
        RuntimeErrorDialog.openError(shell,
                RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog3"),
                RunContainerMessages.getString("RunContainerPreferencePage.InitailzeDialog3"), status);
    }
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:24,代码来源:StartRuntimeAction.java

示例7: main

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
 * Test code below
 */
public static void main(String[] arg) {
    Shell shl = new Shell();
    ProgressMonitorDialog dlg = new AsynchronousProgressMonitorDialog(shl);

    long l = System.currentTimeMillis();
    try {
        dlg.run(true, true, new IRunnableWithProgress() {

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                monitor.beginTask("Testing", 100000);
                for (long i = 0; i < 100000 && !monitor.isCanceled(); i++) {
                    //monitor.worked(1);
                    monitor.setTaskName("Task " + i);
                }
            }
        });
    } catch (Exception e) {
        Log.log(e);
    }
    System.out.println("Took " + ((System.currentTimeMillis() - l)));
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:26,代码来源:AsynchronousProgressMonitorDialog.java

示例8: jump

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
private void jump() {
    Preconditions.checkArgument(currentRecord != null);
    long duration = currentRecord.getEnd() - currentRecord.getStart();
    long relativeTime = scale.getSelection() * duration / scale.getMaximum();
    final long time = currentRecord.getStart() + relativeTime;

    try {
        if (selectedHandler == null) {
            // run with progress monitor
            ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(scale.getShell());
            progressMonitorDialog.run(false, false, new IRunnableWithProgress() {
                @Override
                public void run(IProgressMonitor monitor) {
                    runJump(time, monitor);
                }
            });
        } else {
            runJump(time, new NullProgressMonitor());
        }
    } catch (Exception e) {
        MessageDialog.openError(scale.getShell(), "Exception", "Exception (" + e.getClass().getSimpleName()
                + ") during jumping in time: " + e.getMessage());
    }
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:25,代码来源:CWDataBaseTimeScaleController.java

示例9: execute

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Execute
	public void execute(
			IEclipseContext context,
			@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
			@Named(IServiceConstants.ACTIVE_PART) final MContribution contribution)
			throws InvocationTargetException, InterruptedException {
		final IEclipseContext pmContext = context.createChild();

		ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
		dialog.open();
		dialog.run(true, true, new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor)
					throws InvocationTargetException, InterruptedException {
				pmContext.set(IProgressMonitor.class.getName(), monitor);
				if (contribution != null) {
					Object clientObject = contribution.getObject();
//					ContextInjectionFactory.invoke(clientObject, Persist.class, //$NON-NLS-1$
//							pmContext, null);
				}
			}
		});
		
		pmContext.dispose();
	}
 
开发者ID:CrowdsourcingGeek,项目名称:CrowdBenchmark,代码行数:25,代码来源:SaveHandler.java

示例10: okPressed

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Override
protected void okPressed(){
	ProgressMonitorDialog progress = new ProgressMonitorDialog(getShell());
	QueryProposalRunnable runnable = new QueryProposalRunnable();
	try {
		progress.run(true, true, runnable);
		if (runnable.isCanceled()) {
			return;
		} else {
			proposal = runnable.getProposal();
		}
	} catch (InvocationTargetException | InterruptedException e) {
		LoggerFactory.getLogger(BillingProposalWizardDialog.class)
			.error("Error running proposal query", e);
		MessageDialog.openError(getShell(), "Fehler",
			"Fehler beim Ausführen des Rechnungs-Vorschlags.");
		return;
	}
	
	super.okPressed();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:22,代码来源:BillingProposalWizardDialog.java

示例11: doCheckout

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
private void doCheckout(Commit commit) throws Exception {
	ProgressMonitorDialog dialog = new ProgressMonitorDialog(UI.shell());
	dialog.run(true, false, new IRunnableWithProgress() {

		@Override
		public void run(IProgressMonitor m) throws InvocationTargetException, InterruptedException {
			try {
				FetchNotifierMonitor monitor = new FetchNotifierMonitor(m, M.CheckingOutCommit);
				RepositoryClient client = Database.getRepositoryClient();
				client.checkout(commit.id, monitor);
			} catch (WebRequestException e) {
				throw new InvocationTargetException(e, e.getMessage());
			}
		}
	});
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:17,代码来源:CheckoutAction.java

示例12: close

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Override
public boolean close()
{
  ProgressMonitorDialog dialog = new ProgressMonitorDialog(this.getShell());

  try
  {
    IRunnableWithProgress runnable = new ShutdownRunnable();
    dialog.run(true, false, runnable);
  }
  catch (Throwable e)
  {
    this.error(e);

    return false;
  }

  return super.close();
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:20,代码来源:GISManagerWindow.java

示例13: setComparison

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
 * Creates a new default comparison of all API / implementation projects in the default workspace (i.e. the one
 * accessed via {@link IN4JSCore}) and shows this comparison in the widget.
 */
public void setComparison() {
	final ProgressMonitorDialog dlg = new ProgressMonitorDialog(getTree().getShell());
	try {
		dlg.run(false, false, new IRunnableWithProgress() {
			@Override
			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
				setComparison(monitor);
			}
		});
	} catch (InvocationTargetException | InterruptedException e) {
		// ignore
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:18,代码来源:ProjectCompareTree.java

示例14: execute

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
/**
 * @see AbstractHandler#execute
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	
	setShell(HandlerUtil.getActiveShell(event));
       
       ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
	try {
		
		Runnable update = () -> updateViews(event);
		
		dialog.run(true, true, new IRunnableWithProgress(){
		    public void run(IProgressMonitor monitor) {
		    	monitor.beginTask("Measuring", 16);
		    	for (int i = 0; i < 16; i++){
			    	
		    		monitor.subTask("Getting measure values " + (i+1) + " of "+ 16 + "...");
		    		Display.getDefault().syncExec(update);
		    		monitor.worked(1);
		    		
		    		if(monitor.isCanceled()){
	                    monitor.done();
	                    return;
	                }
		    	}
		    	monitor.done();
		    }
		});
	} catch (InvocationTargetException exception1) {
		logger.error(exception1);
	} catch (InterruptedException exception2) {
		logger.error(exception2);
		// Restore interrupted state...
	    Thread.currentThread().interrupt();
	}
	
	return null;
}
 
开发者ID:mariazevedo88,项目名称:o3smeasures-tool,代码行数:41,代码来源:Measurement.java

示例15: execute

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入方法依赖的package包/类
@Execute
public void execute(final Shell shell) {

	final RunnableImportScrapingBooking runnable = new RunnableImportScrapingBooking(manager);
	final ProgressMonitorDialog monitor = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
	try {
		monitor.run(true, true, runnable);
	} catch (final Exception e) {
		logger.error(e.getLocalizedMessage(), e);
	}
}
 
开发者ID:DrBookings,项目名称:drbookings,代码行数:12,代码来源:HandlerImportScrapingBooking.java


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