本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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() );
}
}
示例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();
}
}
示例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();
}
}
示例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]);
}
}
示例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);
}
}
示例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();
}
示例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;
}
}
示例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);
}