root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / view / toc / AbstractTocContextMenuAction.java @ 31496
History | View | Annotate | Download (2.01 KB)
1 |
package org.gvsig.app.project.documents.view.toc; |
---|---|
2 |
|
3 |
import java.util.Map; |
4 |
|
5 |
import org.gvsig.app.project.documents.view.AbstractContextMenuAction; |
6 |
import org.gvsig.fmap.mapcontext.MapContext; |
7 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
8 |
import org.gvsig.tools.extensionpoint.ExtensionBuilder; |
9 |
|
10 |
|
11 |
public abstract class AbstractTocContextMenuAction extends AbstractContextMenuAction implements ExtensionBuilder{ |
12 |
private MapContext mapContext;
|
13 |
|
14 |
public MapContext getMapContext() {
|
15 |
return this.mapContext; |
16 |
} |
17 |
|
18 |
public void setMapContext(MapContext mapContext) { |
19 |
this.mapContext = mapContext;
|
20 |
} |
21 |
|
22 |
/**
|
23 |
* @deprecated use public boolean isEnabled(ITocItem item, FLayer[] selectedItems)
|
24 |
*/
|
25 |
public boolean isEnabled(Object item, Object[] selectedItems) { |
26 |
return this.isEnabled((ITocItem)item, (FLayer[])selectedItems); |
27 |
} |
28 |
|
29 |
/**
|
30 |
* @deprecated use public boolean isVisible(ITocItem item, FLayer[] selectedItems)
|
31 |
*/
|
32 |
public boolean isVisible(Object item, Object[] selectedItems) { |
33 |
return this.isVisible((ITocItem)item, (FLayer[])selectedItems); |
34 |
} |
35 |
|
36 |
/**
|
37 |
* @deprecated use public void execute(ITocItem item, FLayer[] selectedItems)
|
38 |
*/
|
39 |
public void execute(Object item, Object[] selectedItems) { |
40 |
this.execute((ITocItem)item, (FLayer[])selectedItems); |
41 |
} |
42 |
|
43 |
public FLayer getNodeLayer(ITocItem node) {
|
44 |
if (isTocItemBranch(node))
|
45 |
return ((TocItemBranch) node).getLayer();
|
46 |
return null; |
47 |
} |
48 |
public boolean isTocItemLeaf(ITocItem node) { |
49 |
return node instanceof TocItemLeaf; |
50 |
} |
51 |
|
52 |
public boolean isTocItemBranch(ITocItem node) { |
53 |
return node instanceof TocItemBranch; |
54 |
} |
55 |
|
56 |
|
57 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
58 |
return true; |
59 |
} |
60 |
|
61 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
62 |
return true; |
63 |
} |
64 |
|
65 |
public abstract void execute(ITocItem item, FLayer[] selectedItems); |
66 |
|
67 |
public Object create() { |
68 |
return this; |
69 |
} |
70 |
|
71 |
public Object create(Map args) { |
72 |
// TODO Auto-generated method stub
|
73 |
return this; |
74 |
} |
75 |
|
76 |
public Object create(Object[] args) { |
77 |
// TODO Auto-generated method stub
|
78 |
return this; |
79 |
} |
80 |
|
81 |
} |