Examples of IProgressMonitor


Examples of org.eclipse.core.runtime.IProgressMonitor

  public void run(IProgressMonitor monitor) throws Exception {

    if (monitor == null) {
      monitor = new NullProgressMonitor();
    }
    IProgressMonitor prepMonitor = SubMonitor.convert(monitor, 80);
    prepMonitor.beginTask("Splitting features", 1); //$NON-NLS-1$

    LineString splitter = getSplittingLineInMapCRS(handler);
    assert splitter.getUserData() instanceof CoordinateReferenceSystem;

    FeatureCollection<SimpleFeatureType, SimpleFeature> featuresToSplit = getFeaturesToSplit(splitter);
    prepMonitor.worked(2);

    final List<UndoableMapCommand> undoableCommands = new ArrayList<UndoableMapCommand>();

    List<UndoableMapCommand> commands = buildCommandList(featuresToSplit, splitter);
    undoableCommands.addAll(commands);
    prepMonitor.worked(3);

    prepMonitor.done();

    if (undoableCommands.size() == 0) {
            ProjectPlugin.log("The split did not apply to any feature"); //$NON-NLS-1$
       
      throw new IllegalArgumentException(Messages.SplitFeaturesCommand_did_not_apply_to_any_feature);
    }
    IProgressMonitor splitMonitor = SubMonitor.convert(monitor, 20);
    composite = new UndoableComposite(undoableCommands);

    // cascade setMap on the aggregate commands
    composite.setMap(getMap());
    composite.run(splitMonitor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.