svn-gvsig-desktop / trunk / examples / exaExampleCenterViewToPoint / src / org / gvsig / examples / example1 / centerViewToPoint / TOCMenuExtension.java @ 13669
History | View | Annotate | Download (1.04 KB)
1 |
package org.gvsig.examples.example1.centerViewToPoint; |
---|---|
2 |
|
3 |
|
4 |
import com.iver.andami.plugins.Extension; |
5 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
6 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
7 |
|
8 |
/**
|
9 |
* This extensions shows how to add a context menu to the TOC (table of
|
10 |
* contents) of the view).
|
11 |
*
|
12 |
* @author cesar
|
13 |
*
|
14 |
*/
|
15 |
public class TOCMenuExtension extends Extension { |
16 |
|
17 |
public void execute(String actionCommand) { |
18 |
|
19 |
} |
20 |
|
21 |
public void initialize() { |
22 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance(); |
23 |
extensionPoints.add("View_TocActions", "CenterViewToPoint", |
24 |
new PropertiesTocMenuEntry());
|
25 |
// after this, a new entry appears in the context menu
|
26 |
// When we click on this entry, PropertiesTocMenuEntry.execute() is called.
|
27 |
} |
28 |
|
29 |
public boolean isEnabled() { |
30 |
// the context menu will be visible regardless the extension status
|
31 |
return false; |
32 |
} |
33 |
|
34 |
public boolean isVisible() { |
35 |
// the context menu will be visible regardless the extension status
|
36 |
return false; |
37 |
} |
38 |
|
39 |
} |