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


Java ProgressMonitorDialog类代码示例

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


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

示例1: 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

示例2: 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

示例3: performOk

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
@Override
public boolean performOk() {
	final MultiStatus multistatus = statusHelper
			.createMultiStatus("Status of importing target platform.");
	try {
		new ProgressMonitorDialog(getShell()).run(true, false, monitor -> {
			final IStatus status = store.save(monitor);
			if (!status.isOK()) {
				setMessage(status.getMessage(), ERROR);
				multistatus.merge(status);
			} else {
				updateInput(viewer, store.getLocations());
			}
		});
	} catch (final InvocationTargetException | InterruptedException exc) {
		multistatus.merge(statusHelper.createError("Error while building external libraries.", exc));
	}

	if (multistatus.isOK())
		return super.performOk();
	else
		return false;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:ExternalLibraryPreferencePage.java

示例4: 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

示例5: generateDesignProject

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
private IProject generateDesignProject(String occieLocation, String designName, String designProjectName,
		final IProgressMonitor monitor) throws CoreException, IOException {

	// Load the ecore file.
	String ecoreLocation = occieLocation.replace(".occie", ".ecore");
	URI ecoreURI = URI.createFileURI(ecoreLocation);
	// Create a new resource set.
	ResourceSet resourceSet = new ResourceSetImpl();
	// Load the OCCI resource.
	org.eclipse.emf.ecore.resource.Resource resource = resourceSet.getResource(ecoreURI, true);
	// Return the first element.
	EPackage ePackage = (EPackage) resource.getContents().get(0);

	String extensionScheme = Occi2Ecore.convertEcoreNamespace2OcciScheme(ePackage.getNsURI());

	// Register the ePackage to avoid an error when trying to open the generated
	// .odesign file,
	EPackage.Registry.INSTANCE.put(ePackage.getNsURI(), ePackage);

	
	URI occieURI = URI.createFileURI(occieLocation);
	
	/*
	 * Create design project
	 */
	IProject project = DesignerGeneratorUtils.genDesignProject(designProjectName, designName, extensionScheme,
			new ProgressMonitorDialog(shell));

	/*
	 * Create design model
	 */
	org.eclipse.cmf.occi.core.gen.design.main.Generate generator = new org.eclipse.cmf.occi.core.gen.design.main.Generate(
			occieURI, project.getFolder("description").getLocation().toFile(), new ArrayList<String>());
	generator.doGenerate(BasicMonitor.toMonitor(monitor));
	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
	return project;
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:38,代码来源:DesignerGeneratorAction.java

示例6: refreshViewer

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
/**
  * this is called whenever a new repository location is added for example
  * or when user wants to refresh
  */
 protected void refreshViewer(Object object, boolean refreshRepositoriesFolders) {
     if (treeViewer == null) return;
     if (refreshRepositoriesFolders) {
     	IRunnableWithProgress runnable = new IRunnableWithProgress() {
	public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
             	SVNProviderPlugin.getPlugin().getRepositories().refreshRepositoriesFolders(monitor);
	}
     	};
         try {
	new ProgressMonitorDialog(getShell()).run(true, false, runnable);
} catch (Exception e) {
          SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_TEAM_EXCEPTIONS);
}
     }
     if (object == null) treeViewer.refresh();
     else {
     	if (object instanceof ISVNRemoteFolder) {
     		ISVNRemoteFolder parent = ((ISVNRemoteFolder)object).getParent();
     		if (parent == null) {
     			treeViewer.refresh();
     			return;
     		}
     	}
     	treeViewer.refresh(object); 
     }
 }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:31,代码来源:RepositoriesView.java

示例7: execute

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException 
{

	Shell activeShell = HandlerUtil.getActiveShell(event);
	IRunnableWithProgress runner = ProjectSourceUtil.getRunner();

	try
	{
		new ProgressMonitorDialog( activeShell ).run( true, false, runner );

	}
	catch( InvocationTargetException | InterruptedException e )
	{
		Throwable t = (e instanceof InvocationTargetException) ? e.getCause() : e;
		MessageDialog.openError( activeShell, "Error detaching sources", t.toString() );
	}

	return null;
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:21,代码来源:DetachSourcesHandler.java

示例8: attachSources

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
/**
 * Attaches the sources.
 */
private void attachSources()
{
	final File sourceArchive = page2.getSourceFile();	
	
	if (sourceArchive == null) 
	{
		return; //nothing to do
	}
	
	IRunnableWithProgress runner = ProjectSourceUtil.getRunner(sourceArchive);

	try
	{
		new ProgressMonitorDialog( getContainer().getShell() ).run( true, false, runner );

	}
	catch( InvocationTargetException | InterruptedException e )
	{
		Throwable t = (e instanceof InvocationTargetException) ? e.getCause() : e;
		MessageDialog.openError( getShell(), "Error attaching sources", t.toString() );
	}
	
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:27,代码来源:ImportPlatformWizard.java

示例9: 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

示例10: 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

示例11: run

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
@Override
public void run() {
	Shell shell= JavaPlugin.getActiveWorkbenchShell();
	SelectionDialog dialog= null;
	try {
		dialog= JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell),
			SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_ALL_TYPES, false);
	} catch (JavaModelException e) {
		String title= getDialogTitle();
		String message= PackagesMessages.GotoType_error_message;
		ExceptionHandler.handle(e, title, message);
		return;
	}

	dialog.setTitle(getDialogTitle());
	dialog.setMessage(PackagesMessages.GotoType_dialog_message);
	if (dialog.open() == IDialogConstants.CANCEL_ID) {
		return;
	}

	Object[] types= dialog.getResult();
	if (types != null && types.length > 0) {
		gotoType((IType) types[0]);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:GotoTypeAction.java

示例12: 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

示例13: okPressed

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void okPressed() {
	ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(getShell());
	progressMonitorDialog.open();
	progressMonitorDialog.getProgressMonitor().beginTask("connecting", IProgressMonitor.UNKNOWN);

	Properties serverProperties = new Properties();

	serverProperties.put(Context.PROVIDER_URL, serverName.getText());
	serverProperties.put(LdapImportSource.LDAP_BASE, ldapBase.getText());

	this.ldapImport.setProperties(serverProperties);
	try {
		this.ldapImport.connect();
		this.isInitFinished = true;
		progressMonitorDialog.close();
	} catch (CorruptedSourceException e) {
		progressMonitorDialog.close();
		this.isInitFinished = false;
		EMFStoreMessageDialog.showExceptionDialog("An exception occured", e);
	}

	this.isOkPressed = true;
	close();
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:29,代码来源:LdapSourceDialog.java

示例14: performFinish

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.wizard.Wizard#performFinish()
 * @return a boolean which indicates, if there are items selected or not.
 */
@Override
public boolean performFinish() {
	ArrayList<ImportItemWrapper> wrappedOrgUnits = ((AcUserImportPageTwo) this.getPages()[1]).getCheckedItems();
	if (wrappedOrgUnits.size() > 0) {
		ProgressMonitorDialog progressMonitorDialog = new ProgressMonitorDialog(getShell());
		progressMonitorDialog.open();
		progressMonitorDialog.getProgressMonitor().beginTask("Importing users", IProgressMonitor.UNKNOWN);

		importController.importOrgUnits(wrappedOrgUnits);

		progressMonitorDialog.close();
		return true;
	} else {
		return false;
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:21,代码来源:AcUserImportWizard.java

示例15: doFilter

import org.eclipse.jface.dialogs.ProgressMonitorDialog; //导入依赖的package包/类
private void doFilter(final TmxEditorFilterBean filter) {
	TeActiveCellEditor.commit();
	final String srcSearchStr = getSearchText(srcSearchText);
	final String tgtSearchStr = getSearchText(tgtSearchText);
	IRunnableWithProgress progress = new IRunnableWithProgress() {
		@Override
		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
			tmxDataAccess.loadDisplayTuIdentifierByFilter(monitor, filter, srcLangCode, tgtLangCode, srcSearchStr,
					tgtSearchStr);
		}
	};
	try {
		new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, true, progress);
	} catch (Exception e) {
		e.printStackTrace();
	}
	tmxEditorImpWithNattable.setSrcSearchStr(srcSearchStr);
	tmxEditorImpWithNattable.setTgtSearchStr(tgtSearchStr);
	tmxEditorImpWithNattable.getTable().setFocus();
	tmxEditorImpWithNattable.refrush();
	tmxEditorImpWithNattable.selectCell(getTgtColumnIndex(), 0);
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:23,代码来源:TmxEditor.java


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