當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。