gvsig-raster / org.gvsig.raster.tools / trunk / templates / rasterTaskProjectTemplate / alg_template / sources / app / ProjectTemplateTocMenuEntry.java @ 2354
History | View | Annotate | Download (1.51 KB)
1 |
package org.gvsig.raster.projecttemplate.app; |
---|---|
2 |
|
3 |
import javax.swing.Icon; |
4 |
|
5 |
import org.gvsig.andami.IconThemeHelper; |
6 |
import org.gvsig.andami.plugins.Extension; |
7 |
import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction; |
8 |
import org.gvsig.app.project.documents.view.toc.ITocItem; |
9 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
10 |
import org.gvsig.i18n.Messages; |
11 |
import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem; |
12 |
|
13 |
public class ProjectTemplateTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem { |
14 |
static private ProjectTemplateTocMenuEntry singleton = null; |
15 |
private static Extension extension = null; |
16 |
|
17 |
|
18 |
public static void setExtension(Extension ext) { |
19 |
extension = ext; |
20 |
} |
21 |
|
22 |
private ProjectTemplateTocMenuEntry() {}
|
23 |
|
24 |
static public ProjectTemplateTocMenuEntry getSingleton() { |
25 |
if (singleton == null) |
26 |
singleton = new ProjectTemplateTocMenuEntry();
|
27 |
return singleton;
|
28 |
} |
29 |
|
30 |
public String getGroup() { |
31 |
return "Enhanced"; |
32 |
} |
33 |
|
34 |
public int getGroupOrder() { |
35 |
return 55; |
36 |
} |
37 |
|
38 |
public int getOrder() { |
39 |
return 0; |
40 |
} |
41 |
|
42 |
public String getText() { |
43 |
return Messages.getText("projecttemplate"); |
44 |
} |
45 |
|
46 |
public boolean isEnabled(ITocItem item, FLayer[] selectedItems) { |
47 |
return true; |
48 |
} |
49 |
|
50 |
public boolean isVisible(ITocItem item, FLayer[] selectedItems) { |
51 |
return true; |
52 |
} |
53 |
|
54 |
public void execute(ITocItem item, FLayer[] selectedItems) { |
55 |
extension.execute("ProjectTemplate");
|
56 |
} |
57 |
|
58 |
public Icon getIcon() { |
59 |
return IconThemeHelper.getImageIcon("gvsig-icon"); |
60 |
} |
61 |
} |