Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / contextmenu / gui / AbstractLayoutContextMenuAction.java @ 36648

History | View | Annotate | Download (2.79 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.project.documents.layout.contextmenu.gui;
23

    
24
import java.util.Map;
25

    
26
import org.slf4j.Logger;
27
import org.slf4j.LoggerFactory;
28

    
29
import org.gvsig.app.project.documents.layout.LayoutContext;
30
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
31
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
32
import org.gvsig.app.project.documents.view.AbstractContextMenuAction;
33
import org.gvsig.tools.extensionpoint.ExtensionBuilder;
34

    
35
public abstract class AbstractLayoutContextMenuAction extends
36
    AbstractContextMenuAction implements ExtensionBuilder {
37

    
38
    protected static final Logger LOG = LoggerFactory
39
        .getLogger(AbstractLayoutContextMenuAction.class);
40
    private LayoutPanel layout;
41

    
42
    public LayoutPanel getLayout() {
43
        return this.layout;
44
    }
45

    
46
    public void setLayout(LayoutPanel layout) {
47
        this.layout = layout;
48
    }
49

    
50
    public boolean isEnabled(LayoutContext layoutContext,
51
        IFFrame[] selectedFrames) {
52
        return true;
53
    }
54

    
55
    public boolean isVisible(LayoutContext layoutContext,
56
        IFFrame[] selectedFrames) {
57
        return true;
58
    }
59

    
60
    public abstract void execute(LayoutContext layoutContext,
61
        IFFrame[] selectedFrames);
62

    
63
    public Object create() {
64
        return this;
65
    }
66

    
67
    public Object create(Map args) {
68
        // TODO Auto-generated method stub
69
        return this;
70
    }
71

    
72
    public Object create(Object[] args) {
73
        // TODO Auto-generated method stub
74
        return this;
75
    }
76

    
77
    public boolean isEnabled(Object item, Object[] selectedItems) {
78
        return isEnabled((LayoutContext) item, (IFFrame[]) selectedItems);
79
    }
80

    
81
    public boolean isVisible(Object item, Object[] selectedItems) {
82
        return isVisible((LayoutContext) item, (IFFrame[]) selectedItems);
83
    }
84

    
85
    public void execute(Object item, Object[] selectedItems) {
86
        execute((LayoutContext) item, (IFFrame[]) selectedItems);
87

    
88
    }
89

    
90
}