Revision 42500 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/toc/AbstractActionInfoAdapterToTocContextMenuAction.java

View differences:

AbstractActionInfoAdapterToTocContextMenuAction.java
11 11

  
12 12
public class AbstractActionInfoAdapterToTocContextMenuAction extends AbstractTocContextMenuAction {
13 13

  
14
	private static final Logger logger = LoggerFactory.getLogger(AbstractActionInfoAdapterToTocContextMenuAction.class);
15
	protected ActionInfo action = null;
16
	protected String group = null;
17
	protected int groupOrder = 1;
18
	protected int order = 1;
19
	
20
	protected AbstractActionInfoAdapterToTocContextMenuAction(ActionInfo action, String group, int groupOrder, int order) {
21
		this.action = action;
22
		this.group = group;
23
		this.groupOrder = groupOrder;
24
		this.order = order;
25
        }
14
    private static final Logger logger = LoggerFactory.getLogger(AbstractActionInfoAdapterToTocContextMenuAction.class);
15
    protected ActionInfo action = null;
16
    protected String group = null;
17
    protected int groupOrder = 1;
18
    protected int order = 1;
26 19

  
27
        protected AbstractActionInfoAdapterToTocContextMenuAction(ActionInfo action, String group, int groupOrder) {
28
            this(action, group, groupOrder, (int) action.getPosition());
29
        }
30
        
31
        protected AbstractActionInfoAdapterToTocContextMenuAction(String actionName, String group, int groupOrder, int order) {
32
                this(
33
                        PluginsLocator.getActionInfoManager().getAction(actionName),
34
                        group,groupOrder,order
35
                );
36
	}
37
	
38
	protected AbstractActionInfoAdapterToTocContextMenuAction(String actionName,  String group, int groupOrder) {
39
                this(
40
                        PluginsLocator.getActionInfoManager().getAction(actionName),
41
                        group,groupOrder
42
                );
43
        }
44
        
45
	public String getGroup() {
46
		return this.group;
47
	}
20
    protected AbstractActionInfoAdapterToTocContextMenuAction(ActionInfo action, String group, int groupOrder, int order) {
21
        this.action = action;
22
        this.group = group;
23
        this.groupOrder = groupOrder;
24
        this.order = order;
25
    }
48 26

  
49
	public int getGroupOrder() {
50
		return this.groupOrder;
51
	}
27
    protected AbstractActionInfoAdapterToTocContextMenuAction(ActionInfo action, String group, int groupOrder) {
28
        this(action, group, groupOrder, (int) action.getPosition());
29
    }
52 30

  
53
	public int getOrder() {
54
		return this.order;
55
	}
31
    protected AbstractActionInfoAdapterToTocContextMenuAction(String actionName, String group, int groupOrder, int order) {
32
        this(
33
                PluginsLocator.getActionInfoManager().getAction(actionName),
34
                group, groupOrder, order
35
        );
36
    }
56 37

  
57
	public String getText() {
58
		I18nManager i18nManager = ToolsLocator.getI18nManager();
59
		return i18nManager.getTranslation( this.action.getLabel() );
60
	}
38
    protected AbstractActionInfoAdapterToTocContextMenuAction(String actionName, String group, int groupOrder) {
39
        this(
40
                PluginsLocator.getActionInfoManager().getAction(actionName),
41
                group, groupOrder
42
        );
43
    }
61 44

  
62
	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
63
		return this.action.isEnabled();
64
	}
45
    public String getGroup() {
46
        return this.group;
47
    }
65 48

  
66
	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
67
		boolean n = this.action.isVisible();
68
		return n;
69
	}
49
    public int getGroupOrder() {
50
        return this.groupOrder;
51
    }
70 52

  
71
	public void execute(ITocItem item, FLayer[] selectedItems) {
72
		this.action.execute(selectedItems);
73
   }
53
    public int getOrder() {
54
        return this.order;
55
    }
56

  
57
    public String getText() {
58
        I18nManager i18nManager = ToolsLocator.getI18nManager();
59
        return i18nManager.getTranslation(this.action.getLabel());
60
    }
61

  
62
    public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
63
        return this.action.isEnabled();
64
    }
65

  
66
    public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
67
        boolean n = this.action.isVisible();
68
        return n;
69
    }
70

  
71
    public void execute(ITocItem item, FLayer[] selectedItems) {
72
        this.action.execute(selectedItems);
73
    }
74 74
}

Also available in: Unified diff