Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app.document.table.app / org.gvsig.app.document.table.app.mainplugin / src / main / java / org / gvsig / app / project / documents / table / gui / TableProperties.java @ 47784

History | View | Annotate | Download (3.52 KB)

1 40558 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3 40435 jjdelcerro
 *
4 40558 jjdelcerro
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6 40435 jjdelcerro
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8 40558 jjdelcerro
 * as published by the Free Software Foundation; either version 3
9 40435 jjdelcerro
 * of the License, or (at your option) any later version.
10 40558 jjdelcerro
 *
11 40435 jjdelcerro
 * 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 40558 jjdelcerro
 *
16 40435 jjdelcerro
 * 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 40558 jjdelcerro
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 40435 jjdelcerro
 * MA  02110-1301, USA.
20 40558 jjdelcerro
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23 40435 jjdelcerro
 */
24 41707 jjdelcerro
package org.gvsig.app.project.documents.table.gui;
25 40435 jjdelcerro
26
import java.awt.Dimension;
27 46731 jjdelcerro
import org.apache.commons.lang3.StringUtils;
28 40435 jjdelcerro
import org.gvsig.andami.PluginServices;
29
import org.gvsig.andami.ui.mdiManager.SingletonWindow;
30
import org.gvsig.andami.ui.mdiManager.WindowInfo;
31 46731 jjdelcerro
import org.gvsig.app.ApplicationLocator;
32
import org.gvsig.app.ApplicationManager;
33 41707 jjdelcerro
import org.gvsig.app.project.documents.table.TableDocument;
34 41248 jjdelcerro
import org.gvsig.app.project.documents.view.ViewDocument;
35 46731 jjdelcerro
import org.gvsig.fmap.dal.feature.FeatureStore;
36 40435 jjdelcerro
import org.gvsig.i18n.Messages;
37 41350 jjdelcerro
import org.gvsig.propertypage.BasePropertiesPageDialog;
38 46731 jjdelcerro
import org.gvsig.tools.ToolsLocator;
39
import org.gvsig.tools.i18n.I18nManager;
40 40435 jjdelcerro
41
/**
42
 * Dialogo donde se muestran las propiedades de una vista
43
 *
44
 * @author gvSIG Team
45
 */
46 41707 jjdelcerro
public class TableProperties extends BasePropertiesPageDialog implements SingletonWindow {
47 40435 jjdelcerro
48
    private static final long serialVersionUID = 5328865370833315385L;
49 41707 jjdelcerro
    private TableDocument tableDocument;
50 40435 jjdelcerro
51
    /**
52
     * This is the default constructor
53
     *
54 41707 jjdelcerro
     * @param tableDocument
55 40435 jjdelcerro
     *            Vista que se representa
56
     */
57 41707 jjdelcerro
    public TableProperties(TableDocument tableDocument) {
58
        this.tableDocument = tableDocument;
59
        this.init(TableDocument.TABLE_PROPERTIES_PAGE_GROUP,tableDocument);
60 40435 jjdelcerro
    }
61
62 41350 jjdelcerro
    @Override
63
    protected boolean useTabsAlwais() {
64
        return super.useTabsAlwais();
65
        // return true;
66 40435 jjdelcerro
    }
67
68
69 41350 jjdelcerro
    public boolean isAcceppted() {
70
        return this.getUserAction()==BasePropertiesPageDialog.ACTION_ACCEPT;
71 40435 jjdelcerro
    }
72
73 41350 jjdelcerro
    public Object getWindowModel() {
74 41707 jjdelcerro
        return tableDocument;
75 40435 jjdelcerro
    }
76
77 41350 jjdelcerro
    public Object getWindowProfile() {
78
        return WindowInfo.PROPERTIES_PROFILE;
79 40435 jjdelcerro
    }
80 41350 jjdelcerro
81 40435 jjdelcerro
    public WindowInfo getWindowInfo() {
82 46731 jjdelcerro
        I18nManager i18n = ToolsLocator.getI18nManager();
83 41402 jjdelcerro
        WindowInfo m_viewinfo = new WindowInfo(
84
                WindowInfo.RESIZABLE |
85
                WindowInfo.MAXIMIZABLE |
86
                WindowInfo.MAXIMIZABLE |
87
                WindowInfo.ICONIFIABLE
88
        );
89
90 40435 jjdelcerro
        this.validate();
91 46731 jjdelcerro
        ApplicationManager application = ApplicationLocator.getApplicationManager();
92
        FeatureStore store = this.tableDocument.getFeatureStore();
93
        m_viewinfo.setTitle(application.makeTitle("propiedades_tabla",this.tableDocument.getName(), store==null?null:store.getName()));
94 40435 jjdelcerro
        Dimension dim = getPreferredSize();
95 41350 jjdelcerro
        m_viewinfo.setWidth(dim.width);
96
        m_viewinfo.setHeight(dim.height);
97 40435 jjdelcerro
        return m_viewinfo;
98 41350 jjdelcerro
    }
99 40435 jjdelcerro
100 41350 jjdelcerro
    @Override
101
    protected void closeDialog() {
102
        PluginServices.getMDIManager().closeWindow(this);
103 40435 jjdelcerro
    }
104 41139 nbrodin
105 40435 jjdelcerro
106
}