Revision 3455
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/java/org/gvsig/vcsgis/app/VCSGisExtension.java | ||
---|---|---|
53 | 53 |
import org.gvsig.vcsgis.swing.VCSGisJAddToWorkspace; |
54 | 54 |
import org.gvsig.vcsgis.swing.VCSGisJChanges; |
55 | 55 |
import org.gvsig.vcsgis.swing.VCSGisJCheckout; |
56 |
import org.gvsig.vcsgis.swing.VCSGisJCreateResourceTable; |
|
56 | 57 |
import org.gvsig.vcsgis.swing.VCSGisJExport; |
57 | 58 |
import org.gvsig.vcsgis.swing.VCSGisJImportHistory; |
58 | 59 |
import org.gvsig.vcsgis.swing.VCSGisJInitServer; |
... | ... | |
78 | 79 |
private VCSGisJChanges changesPanel = null; |
79 | 80 |
private VCSGisJCheckout checkoutPanel = null; |
80 | 81 |
private VCSGisJRevisions revisionsPanel = null; |
81 |
private VCSGisJExport exportPanel = null; |
|
82 |
private VCSGisJExport exportPanel = null; |
|
83 |
private VCSGisJCreateResourceTable createResurceTable = null; |
|
82 | 84 |
|
83 | 85 |
private boolean addToWorkspacePanelClosed = true; |
84 | 86 |
private boolean importHistoryPanelClosed = true; |
... | ... | |
162 | 164 |
case "tools-vcsgis-import-history": |
163 | 165 |
showImportHistoryDialog(); |
164 | 166 |
break; |
167 |
case "tools-vcsgis-create-resource-table": |
|
168 |
createResourceTableDialog(); |
|
169 |
break; |
|
170 |
|
|
165 | 171 |
|
166 | 172 |
} |
167 | 173 |
} |
... | ... | |
832 | 838 |
WindowManager.MODE.WINDOW |
833 | 839 |
); |
834 | 840 |
} |
841 |
|
|
842 |
private void createResourceTableDialog() { |
|
843 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
844 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
845 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
835 | 846 |
|
847 |
final VCSGisJCreateResourceTable panel = swingManager.createResourceTablePanel(); |
|
848 |
final Dialog dialog = winManager.createDialog( |
|
849 |
panel.asJComponent(), |
|
850 |
i18nManager.getTranslation("_VCS_Create_resource_table"), |
|
851 |
i18nManager.getTranslation("_Create_resource_table_parameters"), |
|
852 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
853 |
); |
|
854 |
|
|
855 |
panel.setDialog(dialog); |
|
856 |
|
|
857 |
dialog.setButtonLabel( |
|
858 |
WindowManager_v2.BUTTON_OK, |
|
859 |
i18nManager.getTranslation("_Accept") |
|
860 |
); |
|
861 |
dialog.setButtonLabel( |
|
862 |
WindowManager_v2.BUTTON_CANCEL, |
|
863 |
i18nManager.getTranslation("_Close") |
|
864 |
); |
|
865 |
|
|
866 |
dialog.addActionListener((ActionEvent e) -> { |
|
867 |
switch (dialog.getAction()) { |
|
868 |
case WindowManager_v2.BUTTON_OK: |
|
869 |
panel.createResourceTable(); |
|
870 |
} |
|
871 |
}); |
|
872 |
|
|
873 |
dialog.show(WindowManager.MODE.WINDOW); |
|
874 |
} |
|
875 |
|
|
876 |
|
|
836 | 877 |
@Override |
837 | 878 |
public boolean isEnabled() { |
838 | 879 |
return true; |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
161 | 161 |
icon="tools-vcsgis-show-revisions" |
162 | 162 |
accelerator="" |
163 | 163 |
/> |
164 |
|
|
165 |
<action |
|
166 |
name="tools-vcsgis-create-resource-table" |
|
167 |
label="_VCS_Create_resource_table" |
|
168 |
tooltip="_Create_resource_table" |
|
169 |
position="900700104" |
|
170 |
action-command="tools-vcsgis-create-resource-table" |
|
171 |
icon="" |
|
172 |
accelerator="" |
|
173 |
/> |
|
164 | 174 |
|
165 | 175 |
<menu text="tools/_VCSGis/_Administration/_VCS_Initialize_repository" name="tools-vcsgis-init-server" /> |
166 | 176 |
<menu text="tools/_VCSGis/_Administration/_VCS_Register_workspace" name="tools-vcsgis-register-workspace" /> |
167 | 177 |
<menu text="tools/_VCSGis/_Administration/_VCS_Show_server_entities" name="tools-vcsgis-show_server-entities" /> |
168 | 178 |
<menu text="tools/_VCSGis/_Administration/_VCS_Show_server_hooks" name="tools-vcsgis-show_server-hooks" /> |
179 |
<menu text="tools/_VCSGis/_Administration/_VCS_Create_resource_table" name="tools-vcsgis-create-resource-table" /> |
|
169 | 180 |
<menu text="tools/_VCSGis/_VCS_Initialize_workspace" name="tools-vcsgis-init-workspace" /> |
170 | 181 |
<menu text="tools/_VCSGis/_VCS_Add_to_workspace" name="tools-vcsgis-add-to-workspace" /> |
171 | 182 |
<menu text="tools/_VCSGis/_VCS_Checkout" name="tools-vcsgis-checkout" /> |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
153 | 153 |
_User_login=Inicio de sesi\u00f3n de usuario |
154 | 154 |
_Others=Otras |
155 | 155 |
_Table_already_exists_in_working_copy=La tabla ya existe en la copia de trabajo |
156 |
_You_can_rename_the_table=Puede usted cambiar el nombre de la tabla |
|
156 |
_You_can_rename_the_table=Puede usted cambiar el nombre de la tabla |
|
157 |
_VCS_Create_resource_table=Crear tabla de recursos |
|
158 |
_Create_resource_table_parameters=Par\u00e1metros para la creaci\u00f3n de la tabla de recursos |
|
159 |
_TableName= Nombre de tabla |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.app/org.gvsig.vcsgis.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
141 | 141 |
_User_login=User login |
142 | 142 |
_Others=Others |
143 | 143 |
_Table_already_exists_in_working_copy=Table already exists in working copy |
144 |
_You_can_rename_the_table=You can rename the table |
|
144 |
_You_can_rename_the_table=You can rename the table |
|
145 |
_VCS_Create_resource_table=Create resource table |
|
146 |
_Create_resource_table_parameters=Create resource table parameters |
|
147 |
_TableName=Table name |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/VCSGisSwingManagerImpl.java | ||
---|---|---|
37 | 37 |
import org.gvsig.vcsgis.swing.VCSGisJAddToWorkspace; |
38 | 38 |
import org.gvsig.vcsgis.swing.VCSGisJChanges; |
39 | 39 |
import org.gvsig.vcsgis.swing.VCSGisJCheckout; |
40 |
import org.gvsig.vcsgis.swing.VCSGisJCreateResourceTable; |
|
40 | 41 |
import org.gvsig.vcsgis.swing.VCSGisJExport; |
41 | 42 |
import org.gvsig.vcsgis.swing.VCSGisJImportHistory; |
42 | 43 |
import org.gvsig.vcsgis.swing.VCSGisJInitServer; |
... | ... | |
56 | 57 |
import org.gvsig.vcsgis.swing.impl.initworkspace.VCSGisJInitWorkspaceImpl; |
57 | 58 |
import org.gvsig.vcsgis.swing.impl.loggin.VCSGisUserIdentificationRequesterDialog; |
58 | 59 |
import org.gvsig.vcsgis.swing.impl.registerWorkspace.VCSGisJRegisterWorkspaceImpl; |
60 |
import org.gvsig.vcsgis.swing.impl.resourceTable.VCSGisJCreateResourceTableImpl; |
|
59 | 61 |
import org.gvsig.vcsgis.swing.impl.revisions.VCSGisJRevisionsImpl; |
60 | 62 |
import org.gvsig.vcsgis.swing.impl.showServerTableForm.VCSGisJShowServerTableFormImpl; |
61 | 63 |
|
... | ... | |
176 | 178 |
public VCSGisJImportHistory createImportHistoryPanel() { |
177 | 179 |
return new ImportHistoryImpl(); |
178 | 180 |
} |
181 |
|
|
182 |
@Override |
|
183 |
public VCSGisJCreateResourceTable createResourceTablePanel() { |
|
184 |
return new VCSGisJCreateResourceTableImpl(); |
|
185 |
} |
|
179 | 186 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/resourceTable/VCSGisJCreateResourceTableImpl.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (c) 2007-2020 gvSIG Association |
|
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 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.vcsgis.swing.impl.resourceTable; |
|
25 |
|
|
26 |
import java.awt.Cursor; |
|
27 |
import java.awt.Dimension; |
|
28 |
import javax.swing.JComponent; |
|
29 |
import javax.swing.event.ChangeEvent; |
|
30 |
import org.gvsig.fmap.dal.DALLocator; |
|
31 |
import org.gvsig.fmap.dal.DataManager; |
|
32 |
import org.gvsig.fmap.dal.DatabaseWorkspaceManager; |
|
33 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
|
34 |
import org.gvsig.tools.swing.api.Component; |
|
35 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
36 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
37 |
import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
|
38 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
39 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
40 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
41 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
42 |
import org.gvsig.vcsgis.swing.VCSGisJCreateResourceTable; |
|
43 |
import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
|
44 |
import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
|
45 |
import org.slf4j.LoggerFactory; |
|
46 |
|
|
47 |
/** |
|
48 |
* |
|
49 |
* @author gvSIG Team |
|
50 |
*/ |
|
51 |
public class VCSGisJCreateResourceTableImpl extends VCSGisJCreateResourceTableView |
|
52 |
implements Component, VCSGisJCreateResourceTable { |
|
53 |
|
|
54 |
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(VCSGisJCreateResourceTableImpl.class); |
|
55 |
|
|
56 |
private PickerController<VCSGisWorkspace> wsConnectionPicker; |
|
57 |
private Dialog dialog; |
|
58 |
private JDBCServerExplorerParameters connection; |
|
59 |
|
|
60 |
|
|
61 |
public VCSGisJCreateResourceTableImpl() { |
|
62 |
translate(); |
|
63 |
initComponents(); |
|
64 |
} |
|
65 |
|
|
66 |
private void initComponents() { |
|
67 |
VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
|
68 |
|
|
69 |
this.btnAddWsConnection.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
|
70 |
|
|
71 |
this.wsConnectionPicker = swingManager.createWorkspacePickerController( |
|
72 |
cboWsConnections, |
|
73 |
btnAddWsConnection |
|
74 |
); |
|
75 |
|
|
76 |
this.wsConnectionPicker.addChangeListener((ChangeEvent e) -> { |
|
77 |
doUpdateEnableComponents(); |
|
78 |
}); |
|
79 |
|
|
80 |
this.setPreferredSize( |
|
81 |
new Dimension(520, 80) |
|
82 |
); |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
@Override |
|
87 |
public JComponent asJComponent() { |
|
88 |
return this; |
|
89 |
} |
|
90 |
|
|
91 |
@Override |
|
92 |
public void setDialog(Dialog dialog) { |
|
93 |
this.dialog = dialog; |
|
94 |
this.doUpdateEnableComponents(); |
|
95 |
} |
|
96 |
|
|
97 |
@Override |
|
98 |
public void createResourceTable() { |
|
99 |
if (getWorkspace() != null && this.txtTableName != null) { |
|
100 |
DataManager dataManager = DALLocator.getDataManager(); |
|
101 |
this.connection = getWorkspace().getExplorerParameters(); |
|
102 |
DatabaseWorkspaceManager dbWorkspaceManager = dataManager. |
|
103 |
createDatabaseWorkspaceManager(this.connection); |
|
104 |
dbWorkspaceManager.createTableResources(this.txtTableName.getText()); |
|
105 |
} |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
109 |
public String getWorkspaceName() { |
|
110 |
return this.txtTableName.getText(); |
|
111 |
} |
|
112 |
|
|
113 |
@Override |
|
114 |
public VCSGisWorkspace getWorkspace() { |
|
115 |
return this.wsConnectionPicker.get(); |
|
116 |
} |
|
117 |
|
|
118 |
@Override |
|
119 |
public VCSGisEntity getTable() { |
|
120 |
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. |
|
121 |
} |
|
122 |
|
|
123 |
private void doUpdateEnableComponents() { |
|
124 |
boolean enableInit = (this.getWorkspace() != null); |
|
125 |
if (dialog != null) { |
|
126 |
this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, |
|
127 |
enableInit |
|
128 |
); |
|
129 |
} |
|
130 |
} |
|
131 |
private void translate() { |
|
132 |
ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
133 |
swingManager.translate(this.lblWorkspace); |
|
134 |
swingManager.translate(this.lblResourceTable); |
|
135 |
} |
|
136 |
|
|
137 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/resourceTable/VCSGisJCreateResourceTableView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jovivas/datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/resourceTable/VCSGisResourceTableView.xml</at> |
|
28 |
<at name="path">datos/devel/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/resourceTable/VCSGisResourceTableView.xml</at> |
|
29 |
<at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:22PX:NONE,CENTER:2DLU:NONE</at> |
|
30 |
<at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at> |
|
31 |
<at name="components"> |
|
32 |
<object classname="java.util.LinkedList"> |
|
33 |
<item > |
|
34 |
<at name="value"> |
|
35 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
36 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
37 |
<at name="cellconstraints"> |
|
38 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
39 |
<at name="column">2</at> |
|
40 |
<at name="row">2</at> |
|
41 |
<at name="colspan">1</at> |
|
42 |
<at name="rowspan">1</at> |
|
43 |
<at name="halign">default</at> |
|
44 |
<at name="valign">default</at> |
|
45 |
<at name="insets" object="insets">0,0,0,0</at> |
|
46 |
</object> |
|
47 |
</at> |
|
48 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
49 |
</super> |
|
50 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
51 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
52 |
<at name="beanproperties"> |
|
53 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
54 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
55 |
<at name="properties"> |
|
56 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
57 |
<at name="border"> |
|
58 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
59 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
60 |
<at name="name">border</at> |
|
61 |
</super> |
|
62 |
<at name="borders"> |
|
63 |
<object classname="java.util.LinkedList"> |
|
64 |
<item > |
|
65 |
<at name="value"> |
|
66 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
67 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
68 |
<at name="name">border</at> |
|
69 |
</super> |
|
70 |
</object> |
|
71 |
</at> |
|
72 |
</item> |
|
73 |
</object> |
|
74 |
</at> |
|
75 |
</object> |
|
76 |
</at> |
|
77 |
<at name="name">lblWorkspace</at> |
|
78 |
<at name="width">70</at> |
|
79 |
<at name="text">_Workspace</at> |
|
80 |
<at name="fill"> |
|
81 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
82 |
<at name="name">fill</at> |
|
83 |
</object> |
|
84 |
</at> |
|
85 |
<at name="height">14</at> |
|
86 |
</object> |
|
87 |
</at> |
|
88 |
</object> |
|
89 |
</at> |
|
90 |
</object> |
|
91 |
</at> |
|
92 |
</item> |
|
93 |
<item > |
|
94 |
<at name="value"> |
|
95 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
96 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
97 |
<at name="cellconstraints"> |
|
98 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
99 |
<at name="column">6</at> |
|
100 |
<at name="row">2</at> |
|
101 |
<at name="colspan">1</at> |
|
102 |
<at name="rowspan">1</at> |
|
103 |
<at name="halign">default</at> |
|
104 |
<at name="valign">default</at> |
|
105 |
<at name="insets" object="insets">0,0,0,0</at> |
|
106 |
</object> |
|
107 |
</at> |
|
108 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
109 |
</super> |
|
110 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
111 |
<at name="beanclass">javax.swing.JButton</at> |
|
112 |
<at name="beanproperties"> |
|
113 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
114 |
<at name="classname">javax.swing.JButton</at> |
|
115 |
<at name="properties"> |
|
116 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
117 |
<at name="border"> |
|
118 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
119 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
120 |
<at name="name">border</at> |
|
121 |
</super> |
|
122 |
<at name="borders"> |
|
123 |
<object classname="java.util.LinkedList"> |
|
124 |
<item > |
|
125 |
<at name="value"> |
|
126 |
<object classname="com.jeta.forms.store.properties.EmptyBorderProperty"> |
|
127 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
128 |
<at name="name">border</at> |
|
129 |
</super> |
|
130 |
<at name="top">2</at> |
|
131 |
<at name="left">2</at> |
|
132 |
<at name="bottom">2</at> |
|
133 |
<at name="right">2</at> |
|
134 |
</object> |
|
135 |
</at> |
|
136 |
</item> |
|
137 |
</object> |
|
138 |
</at> |
|
139 |
</object> |
|
140 |
</at> |
|
141 |
<at name="actionCommand">...</at> |
|
142 |
<at name="opaque">false</at> |
|
143 |
<at name="name">btnAddWsConnection</at> |
|
144 |
<at name="width">16</at> |
|
145 |
<at name="text">...</at> |
|
146 |
<at name="height">18</at> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
</object> |
|
152 |
</at> |
|
153 |
</item> |
|
154 |
<item > |
|
155 |
<at name="value"> |
|
156 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
157 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
158 |
<at name="cellconstraints"> |
|
159 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
160 |
<at name="column">4</at> |
|
161 |
<at name="row">2</at> |
|
162 |
<at name="colspan">1</at> |
|
163 |
<at name="rowspan">1</at> |
|
164 |
<at name="halign">default</at> |
|
165 |
<at name="valign">default</at> |
|
166 |
<at name="insets" object="insets">0,0,0,0</at> |
|
167 |
</object> |
|
168 |
</at> |
|
169 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
170 |
</super> |
|
171 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
172 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
173 |
<at name="beanproperties"> |
|
174 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
175 |
<at name="classname">javax.swing.JComboBox</at> |
|
176 |
<at name="properties"> |
|
177 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
178 |
<at name="border"> |
|
179 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
180 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
181 |
<at name="name">border</at> |
|
182 |
</super> |
|
183 |
<at name="borders"> |
|
184 |
<object classname="java.util.LinkedList"> |
|
185 |
<item > |
|
186 |
<at name="value"> |
|
187 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
188 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
189 |
<at name="name">border</at> |
|
190 |
</super> |
|
191 |
</object> |
|
192 |
</at> |
|
193 |
</item> |
|
194 |
</object> |
|
195 |
</at> |
|
196 |
</object> |
|
197 |
</at> |
|
198 |
<at name="name">cboWsConnections</at> |
|
199 |
<at name="width">735</at> |
|
200 |
<at name="items"> |
|
201 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
202 |
<at name="name">items</at> |
|
203 |
</object> |
|
204 |
</at> |
|
205 |
<at name="height">20</at> |
|
206 |
</object> |
|
207 |
</at> |
|
208 |
</object> |
|
209 |
</at> |
|
210 |
</object> |
|
211 |
</at> |
|
212 |
</item> |
|
213 |
<item > |
|
214 |
<at name="value"> |
|
215 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
216 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
217 |
<at name="cellconstraints"> |
|
218 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
219 |
<at name="column">2</at> |
|
220 |
<at name="row">4</at> |
|
221 |
<at name="colspan">1</at> |
|
222 |
<at name="rowspan">1</at> |
|
223 |
<at name="halign">default</at> |
|
224 |
<at name="valign">default</at> |
|
225 |
<at name="insets" object="insets">0,0,0,0</at> |
|
226 |
</object> |
|
227 |
</at> |
|
228 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
229 |
</super> |
|
230 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
231 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
232 |
<at name="beanproperties"> |
|
233 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
234 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
235 |
<at name="properties"> |
|
236 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
237 |
<at name="border"> |
|
238 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
239 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
240 |
<at name="name">border</at> |
|
241 |
</super> |
|
242 |
<at name="borders"> |
|
243 |
<object classname="java.util.LinkedList"> |
|
244 |
<item > |
|
245 |
<at name="value"> |
|
246 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
247 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
248 |
<at name="name">border</at> |
|
249 |
</super> |
|
250 |
</object> |
|
251 |
</at> |
|
252 |
</item> |
|
253 |
</object> |
|
254 |
</at> |
|
255 |
</object> |
|
256 |
</at> |
|
257 |
<at name="name">lblResourceTable</at> |
|
258 |
<at name="width">70</at> |
|
259 |
<at name="text">_TableName</at> |
|
260 |
<at name="fill"> |
|
261 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
262 |
<at name="name">fill</at> |
|
263 |
</object> |
|
264 |
</at> |
|
265 |
<at name="height">14</at> |
|
266 |
</object> |
|
267 |
</at> |
|
268 |
</object> |
|
269 |
</at> |
|
270 |
</object> |
|
271 |
</at> |
|
272 |
</item> |
|
273 |
<item > |
|
274 |
<at name="value"> |
|
275 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
276 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
277 |
<at name="cellconstraints"> |
|
278 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
279 |
<at name="column">4</at> |
|
280 |
<at name="row">4</at> |
|
281 |
<at name="colspan">3</at> |
|
282 |
<at name="rowspan">1</at> |
|
283 |
<at name="halign">default</at> |
|
284 |
<at name="valign">default</at> |
|
285 |
<at name="insets" object="insets">0,0,0,0</at> |
|
286 |
</object> |
|
287 |
</at> |
|
288 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
289 |
</super> |
|
290 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
291 |
<at name="beanclass">javax.swing.JTextField</at> |
|
292 |
<at name="beanproperties"> |
|
293 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
294 |
<at name="classname">javax.swing.JTextField</at> |
|
295 |
<at name="properties"> |
|
296 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
297 |
<at name="border"> |
|
298 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
299 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
300 |
<at name="name">border</at> |
|
301 |
</super> |
|
302 |
<at name="borders"> |
|
303 |
<object classname="java.util.LinkedList"> |
|
304 |
<item > |
|
305 |
<at name="value"> |
|
306 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
307 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
308 |
<at name="name">border</at> |
|
309 |
</super> |
|
310 |
</object> |
|
311 |
</at> |
|
312 |
</item> |
|
313 |
</object> |
|
314 |
</at> |
|
315 |
</object> |
|
316 |
</at> |
|
317 |
<at name="name">txtTableName</at> |
|
318 |
<at name="width">762</at> |
|
319 |
<at name="height">18</at> |
|
320 |
</object> |
|
321 |
</at> |
|
322 |
</object> |
|
323 |
</at> |
|
324 |
</object> |
|
325 |
</at> |
|
326 |
</item> |
|
327 |
</object> |
|
328 |
</at> |
|
329 |
<at name="properties"> |
|
330 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
331 |
<at name="classname">com.jeta.forms.gui.form.GridView</at> |
|
332 |
<at name="properties"> |
|
333 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
334 |
<at name="border"> |
|
335 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
336 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
337 |
<at name="name">border</at> |
|
338 |
</super> |
|
339 |
<at name="borders"> |
|
340 |
<object classname="java.util.LinkedList"/> |
|
341 |
</at> |
|
342 |
</object> |
|
343 |
</at> |
|
344 |
<at name="name"/> |
|
345 |
<at name="fill"> |
|
346 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
347 |
<at name="name">fill</at> |
|
348 |
</object> |
|
349 |
</at> |
|
350 |
<at name="scollBars"> |
|
351 |
<object classname="com.jeta.forms.store.properties.ScrollBarsProperty"> |
|
352 |
<at name="name">scollBars</at> |
|
353 |
<at name="verticalpolicy">21</at> |
|
354 |
<at name="horizontalpolicy">31</at> |
|
355 |
<at name="border"> |
|
356 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
357 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
358 |
<at name="name">border</at> |
|
359 |
</super> |
|
360 |
<at name="borders"> |
|
361 |
<object classname="java.util.LinkedList"> |
|
362 |
<item > |
|
363 |
<at name="value"> |
|
364 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
365 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
366 |
<at name="name">border</at> |
|
367 |
</super> |
|
368 |
</object> |
|
369 |
</at> |
|
370 |
</item> |
|
371 |
</object> |
|
372 |
</at> |
|
373 |
</object> |
|
374 |
</at> |
|
375 |
</object> |
|
376 |
</at> |
|
377 |
</object> |
|
378 |
</at> |
|
379 |
</object> |
|
380 |
</at> |
|
381 |
<at name="cellpainters"> |
|
382 |
<object classname="com.jeta.forms.store.support.Matrix"> |
|
383 |
<at name="rows"> |
|
384 |
<object classname="[Ljava.lang.Object;" size="5"> |
|
385 |
<at name="item" index="0"> |
|
386 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
387 |
</at> |
|
388 |
<at name="item" index="1"> |
|
389 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
390 |
</at> |
|
391 |
<at name="item" index="2"> |
|
392 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
393 |
</at> |
|
394 |
<at name="item" index="3"> |
|
395 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
396 |
</at> |
|
397 |
<at name="item" index="4"> |
|
398 |
<object classname="[Ljava.lang.Object;" size="7"/> |
|
399 |
</at> |
|
400 |
</object> |
|
401 |
</at> |
|
402 |
</object> |
|
403 |
</at> |
|
404 |
<at name="rowgroups"> |
|
405 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
406 |
<at name="groups"> |
|
407 |
<object classname="java.util.HashMap"/> |
|
408 |
</at> |
|
409 |
</object> |
|
410 |
</at> |
|
411 |
<at name="colgroups"> |
|
412 |
<object classname="com.jeta.forms.store.memento.FormGroupSet"> |
|
413 |
<at name="groups"> |
|
414 |
<object classname="java.util.HashMap"/> |
|
415 |
</at> |
|
416 |
</object> |
|
417 |
</at> |
|
418 |
</object> |
|
419 |
</at> |
|
420 |
</object> |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/resourceTable/VCSGisJCreateResourceTableView.java | ||
---|---|---|
1 |
package org.gvsig.vcsgis.swing.impl.resourceTable; |
|
2 |
|
|
3 |
import com.jeta.open.i18n.I18NUtils; |
|
4 |
import com.jgoodies.forms.layout.CellConstraints; |
|
5 |
import com.jgoodies.forms.layout.FormLayout; |
|
6 |
import java.awt.BorderLayout; |
|
7 |
import java.awt.ComponentOrientation; |
|
8 |
import java.awt.Container; |
|
9 |
import java.awt.Dimension; |
|
10 |
import javax.swing.Box; |
|
11 |
import javax.swing.ImageIcon; |
|
12 |
import javax.swing.JButton; |
|
13 |
import javax.swing.JComboBox; |
|
14 |
import javax.swing.JFrame; |
|
15 |
import javax.swing.JLabel; |
|
16 |
import javax.swing.JPanel; |
|
17 |
import javax.swing.JTextField; |
|
18 |
import javax.swing.border.EmptyBorder; |
|
19 |
|
|
20 |
|
|
21 |
public class VCSGisJCreateResourceTableView extends JPanel |
|
22 |
{ |
|
23 |
JLabel lblWorkspace = new JLabel(); |
|
24 |
JButton btnAddWsConnection = new JButton(); |
|
25 |
JComboBox cboWsConnections = new JComboBox(); |
|
26 |
JLabel lblResourceTable = new JLabel(); |
|
27 |
JTextField txtTableName = new JTextField(); |
|
28 |
|
|
29 |
/** |
|
30 |
* Default constructor |
|
31 |
*/ |
|
32 |
public VCSGisJCreateResourceTableView() |
|
33 |
{ |
|
34 |
initializePanel(); |
|
35 |
} |
|
36 |
|
|
37 |
/** |
|
38 |
* Adds fill components to empty cells in the first row and first column of the grid. |
|
39 |
* This ensures that the grid spacing will be the same as shown in the designer. |
|
40 |
* @param cols an array of column indices in the first row where fill components should be added. |
|
41 |
* @param rows an array of row indices in the first column where fill components should be added. |
|
42 |
*/ |
|
43 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
|
44 |
{ |
|
45 |
Dimension filler = new Dimension(10,10); |
|
46 |
|
|
47 |
boolean filled_cell_11 = false; |
|
48 |
CellConstraints cc = new CellConstraints(); |
|
49 |
if ( cols.length > 0 && rows.length > 0 ) |
|
50 |
{ |
|
51 |
if ( cols[0] == 1 && rows[0] == 1 ) |
|
52 |
{ |
|
53 |
/** add a rigid area */ |
|
54 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
|
55 |
filled_cell_11 = true; |
|
56 |
} |
|
57 |
} |
|
58 |
|
|
59 |
for( int index = 0; index < cols.length; index++ ) |
|
60 |
{ |
|
61 |
if ( cols[index] == 1 && filled_cell_11 ) |
|
62 |
{ |
|
63 |
continue; |
|
64 |
} |
|
65 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
|
66 |
} |
|
67 |
|
|
68 |
for( int index = 0; index < rows.length; index++ ) |
|
69 |
{ |
|
70 |
if ( rows[index] == 1 && filled_cell_11 ) |
|
71 |
{ |
|
72 |
continue; |
|
73 |
} |
|
74 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
|
75 |
} |
|
76 |
|
|
77 |
} |
|
78 |
|
|
79 |
/** |
|
80 |
* Helper method to load an image file from the CLASSPATH |
|
81 |
* @param imageName the package and name of the file to load relative to the CLASSPATH |
|
82 |
* @return an ImageIcon instance with the specified image file |
|
83 |
* @throws IllegalArgumentException if the image resource cannot be loaded. |
|
84 |
*/ |
|
85 |
public ImageIcon loadImage( String imageName ) |
|
86 |
{ |
|
87 |
try |
|
88 |
{ |
|
89 |
ClassLoader classloader = getClass().getClassLoader(); |
|
90 |
java.net.URL url = classloader.getResource( imageName ); |
|
91 |
if ( url != null ) |
|
92 |
{ |
|
93 |
ImageIcon icon = new ImageIcon( url ); |
|
94 |
return icon; |
|
95 |
} |
|
96 |
} |
|
97 |
catch( Exception e ) |
|
98 |
{ |
|
99 |
e.printStackTrace(); |
|
100 |
} |
|
101 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
|
102 |
} |
|
103 |
|
|
104 |
/** |
|
105 |
* Method for recalculating the component orientation for |
|
106 |
* right-to-left Locales. |
|
107 |
* @param orientation the component orientation to be applied |
|
108 |
*/ |
|
109 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
|
110 |
{ |
|
111 |
// Not yet implemented... |
|
112 |
// I18NUtils.applyComponentOrientation(this, orientation); |
|
113 |
super.applyComponentOrientation(orientation); |
|
114 |
} |
|
115 |
|
|
116 |
public JPanel createPanel() |
|
117 |
{ |
|
118 |
JPanel jpanel1 = new JPanel(); |
|
119 |
FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:22PX:NONE,CENTER:2DLU:NONE"); |
|
120 |
CellConstraints cc = new CellConstraints(); |
|
121 |
jpanel1.setLayout(formlayout1); |
|
122 |
|
|
123 |
lblWorkspace.setName("lblWorkspace"); |
|
124 |
lblWorkspace.setText("_Workspace"); |
|
125 |
jpanel1.add(lblWorkspace,cc.xy(2,2)); |
|
126 |
|
|
127 |
btnAddWsConnection.setActionCommand("..."); |
|
128 |
btnAddWsConnection.setName("btnAddWsConnection"); |
|
129 |
btnAddWsConnection.setOpaque(false); |
|
130 |
btnAddWsConnection.setText("..."); |
|
131 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
|
132 |
btnAddWsConnection.setBorder(emptyborder1); |
|
133 |
jpanel1.add(btnAddWsConnection,cc.xy(6,2)); |
|
134 |
|
|
135 |
cboWsConnections.setName("cboWsConnections"); |
|
136 |
jpanel1.add(cboWsConnections,cc.xy(4,2)); |
|
137 |
|
|
138 |
lblResourceTable.setName("lblResourceTable"); |
|
139 |
lblResourceTable.setText("_TableName"); |
|
140 |
jpanel1.add(lblResourceTable,cc.xy(2,4)); |
|
141 |
|
|
142 |
txtTableName.setName("txtTableName"); |
|
143 |
jpanel1.add(txtTableName,cc.xywh(4,4,3,1)); |
|
144 |
|
|
145 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7 },new int[]{ 1,2,3,4,5 }); |
|
146 |
return jpanel1; |
|
147 |
} |
|
148 |
|
|
149 |
/** |
|
150 |
* Initializer |
|
151 |
*/ |
|
152 |
protected void initializePanel() |
|
153 |
{ |
|
154 |
setLayout(new BorderLayout()); |
|
155 |
add(createPanel(), BorderLayout.CENTER); |
|
156 |
} |
|
157 |
|
|
158 |
|
|
159 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.api/src/main/java/org/gvsig/vcsgis/swing/VCSGisSwingManager.java | ||
---|---|---|
65 | 65 |
public VCSGisJShowServerTableForm createShowTableServerFormPanel(String tableName); |
66 | 66 |
|
67 | 67 |
public String getHTMLColoredForEntity(VCSGisWorkspaceEntity entity, String name); |
68 |
|
|
69 |
public VCSGisJCreateResourceTable createResourceTablePanel(); |
|
68 | 70 |
|
69 | 71 |
} |
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.api/src/main/java/org/gvsig/vcsgis/swing/VCSGisJCreateResourceTable.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.vcsgis.swing; |
|
7 |
|
|
8 |
import org.gvsig.tools.swing.api.Component; |
|
9 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
10 |
import org.gvsig.vcsgis.lib.VCSGisEntity; |
|
11 |
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
* @author jovivas |
|
16 |
*/ |
|
17 |
public interface VCSGisJCreateResourceTable extends Component { |
|
18 |
|
|
19 |
public void createResourceTable(); |
|
20 |
|
|
21 |
public void setDialog(Dialog dialog); |
|
22 |
|
|
23 |
public String getWorkspaceName(); |
|
24 |
|
|
25 |
public VCSGisWorkspace getWorkspace(); |
|
26 |
|
|
27 |
public VCSGisEntity getTable(); |
|
28 |
|
|
29 |
} |
Also available in: Unified diff