Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubProgressMonitor


              final IProgressMonitor monitor = _elvis;
              try {
                monitor.beginTask("", 4);
                final IProjectDescription description = workspace.newProjectDescription(ErlProject.this.name);
                description.setLocationURI(location);
                SubProgressMonitor _subProgressMonitor = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.create(description, _subProgressMonitor);
                SubProgressMonitor _subProgressMonitor_1 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.open(_subProgressMonitor_1);
                description.setNatureIds(new String[] { IErlProject.NATURE_ID });
                SubProgressMonitor _subProgressMonitor_2 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDescription(description, _subProgressMonitor_2);
                SubProgressMonitor _subProgressMonitor_3 = new SubProgressMonitor(monitor, 1);
                ErlProject.this.workspaceProject.setDefaultCharset("UTF-8", _subProgressMonitor_3);
              } finally {
                monitor.done();
              }
            } catch (Throwable _e) {
View Full Code Here


        return CommandResult.newOKCommandResult();
      }
    };
    try {
      OperationHistoryFactory.getOperationHistory().execute(command,
          new SubProgressMonitor(progressMonitor, 1), null);
    } catch (ExecutionException e) {
      OntoUML.diagram.part.OntoUMLDiagramEditorPlugin.getInstance()
          .logError("Unable to create model and diagram", e); //$NON-NLS-1$
    }
    return diagramResource;
View Full Code Here

   
    private SimpleFeatureCollection getFeaturesInBbox( ILayer layer, Envelope bbox,
            IProgressMonitor monitor ) throws IOException {

        SimpleFeatureSource featureSource = (SimpleFeatureSource) layer.getResource(
                FeatureSource.class, new SubProgressMonitor(monitor, 1));

        if (featureSource == null) return null;

        Filter bboxFilter = layer.createBBoxFilter(bbox, monitor);
        return featureSource.getFeatures(bboxFilter);
View Full Code Here

                    SimpleFeatureCollection collection = null;
                    FeatureIterator<SimpleFeature> iter = null;
                    try {
                        ILayer selectedLayer = getContext().getSelectedLayer();
                        SimpleFeatureSource source = selectedLayer.getResource(
                                SimpleFeatureSource.class, new SubProgressMonitor(monitor, 1));
                        if (source == null)
                            return;
                        collection = source.getFeatures(selectedLayer.createBBoxFilter(bbox,
                                new SubProgressMonitor(monitor, 1)));
                        iter = collection.features();
                        if (!iter.hasNext()) {
                            if (!e.buttonsDown()) {
                                getContext().sendASyncCommand(
                                        getContext().getEditFactory()
View Full Code Here

                    return;

                if (command instanceof PostDeterminedEffectCommand) {

                    PostDeterminedEffectCommand c = (PostDeterminedEffectCommand) command;
                    if (c.execute(new SubProgressMonitor(monitor, 1000))) {
                        undone.clear();
                        addToHistory(command);
                    }

                } else {
                    command.run(new SubProgressMonitor(monitor, 1000));

                    undone.clear();
                    addToHistory(command);

                }
View Full Code Here

            Command command = undone.removeLast();
            monitor.beginTask(Messages.CommandManager_redo + command.getName(), 1000);
            try {
                if (command instanceof PostDeterminedEffectCommand) {
                    PostDeterminedEffectCommand post = (PostDeterminedEffectCommand) command;
                    post.execute(new SubProgressMonitor(monitor, 1000));
                } else {
                    command.run(new SubProgressMonitor(monitor, 1000));
                }
                addToHistory(command);
                notifyOwner(command);
            } catch (Exception e) {
                handleError(command, e);
View Full Code Here

                c = history.removeLast();
                if (c instanceof UndoableCommand) {
                    UndoableCommand command = (UndoableCommand) c;
                    monitor.beginTask(Messages.CommandManager_undo + command.getName(), 1000);
                    try {
                        command.rollback(new SubProgressMonitor(monitor, 1000));
                        addToUndone(command);
                    } catch (Throwable e) {
                        handleRollbackError(command, e);
                    }
                } else {
View Full Code Here

        for( Location location : geocoders ){
            try {
                monitor.subTask( location.getClass().getCanonicalName() );
                List<SimpleFeature> found = location.search(query.text,
                                query.bbox,
                                new SubProgressMonitor(monitor,10) );
                results.addAll(
                        found
                );
                count += found.size();
            } catch (Exception e) {
View Full Code Here

        monitor.worked(2);
        boolean changedState=false;
        try{
        for (MapCommand command : commands) {
            command.setMap(getMap());
            SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
            if( command instanceof PostDeterminedEffectCommand){
                boolean change=((PostDeterminedEffectCommand) command).execute(subProgressMonitor);
                changedState=changedState||change;
            }else{
                command.run(subProgressMonitor);
                changedState=true;
            }
            subProgressMonitor.done();
        }
        }finally{
            for (MapCommand command : finalizerCommands) {
                command.setMap(getMap());
                SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
                if( command instanceof PostDeterminedEffectCommand){
                    boolean change=((PostDeterminedEffectCommand) command).execute(subProgressMonitor);
                    changedState=changedState||change;
                }else{
                    command.run(subProgressMonitor);
                    changedState=true;
                }
                subProgressMonitor.done();
            }
           
        }
        monitor.done();
View Full Code Here

        monitor.beginTask(getName(), 2+10*commands.size()+10*finalizerCommands.size());
        monitor.worked(2);
        try{
    for (MapCommand command : commands) {
           
      SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
            command.setMap(getMap());
            command.run(subProgressMonitor);
            subProgressMonitor.done();
    }
        }finally{
            for( MapCommand c : finalizerCommands ) {
                try{
                    SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitor, 10);
                    c.setMap(getMap());
                    c.run(subProgressMonitor);
                    subProgressMonitor.done();
                }catch( Exception e){
                    ProjectPlugin.log("", e); //$NON-NLS-1$
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.SubProgressMonitor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.