01: /**
02: *
03: */package net.refractions.udig.project.command.provider;
04:
05: import net.refractions.udig.core.IBlockingProvider;
06: import net.refractions.udig.project.ILayer;
07: import net.refractions.udig.project.IMap;
08: import net.refractions.udig.project.command.MapCommand;
09: import net.refractions.udig.project.internal.commands.edit.SetAttributeCommand;
10:
11: import org.eclipse.core.runtime.IProgressMonitor;
12:
13: public class EditLayerProvider implements IBlockingProvider<ILayer> {
14:
15: private MapCommand command;
16: private IMap map;
17:
18: public EditLayerProvider(SetAttributeCommand command,
19: MapCommand command2) {
20: this .command = command;
21: this .command = command2;
22: }
23:
24: public EditLayerProvider(IMap map) {
25: this .map = map;
26: }
27:
28: public ILayer get(IProgressMonitor monitor) {
29: if (map != null)
30: return map.getEditManager().getEditLayer();
31: return command.getMap().getEditManager().getEditLayer();
32: }
33: }
|