gvsig-projects-pool / org.gvsig.vcsgis / trunk / org.gvsig.vcsgis / org.gvsig.vcsgis.swing / org.gvsig.vcsgis.swing.impl / src / main / java / org / gvsig / vcsgis / swing / impl / checkoutDataModel / VCSGisJCheckoutDataModelImpl.java @ 3517
History | View | Annotate | Download (15.4 KB)
1 | 2276 | fdiaz | /*
|
---|---|---|---|
2 | 2572 | jjdelcerro | * 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 3
|
||
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, see <https://www.gnu.org/licenses/>.
|
||
18 | *
|
||
19 | * For any additional information, do not hesitate to contact us
|
||
20 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
21 | 2276 | fdiaz | */
|
22 | 3457 | fdiaz | package org.gvsig.vcsgis.swing.impl.checkoutDataModel; |
23 | 2276 | fdiaz | |
24 | 3516 | fdiaz | import java.awt.Cursor; |
25 | 2325 | fdiaz | import java.awt.Dimension; |
26 | 2822 | fdiaz | import java.awt.event.ActionEvent; |
27 | 3457 | fdiaz | import java.awt.event.ItemEvent; |
28 | 3459 | fdiaz | import java.util.ArrayList; |
29 | import java.util.HashSet; |
||
30 | import java.util.List; |
||
31 | import java.util.Set; |
||
32 | 2822 | fdiaz | import javax.swing.ComboBoxModel; |
33 | 3457 | fdiaz | import javax.swing.DefaultComboBoxModel; |
34 | 3516 | fdiaz | import javax.swing.ImageIcon; |
35 | 2276 | fdiaz | import javax.swing.JComponent; |
36 | 2892 | fdiaz | import javax.swing.SwingUtilities; |
37 | 2276 | fdiaz | import javax.swing.event.ChangeEvent; |
38 | 2822 | fdiaz | import org.apache.commons.lang3.StringUtils; |
39 | 3517 | jjdelcerro | import org.gvsig.fmap.dal.BaseStoresRepository; |
40 | import org.gvsig.fmap.dal.DALLocator; |
||
41 | import org.gvsig.fmap.dal.DataManager; |
||
42 | import org.gvsig.fmap.dal.OpenDataStoreParameters; |
||
43 | import org.gvsig.fmap.dal.StoresRepository; |
||
44 | 2822 | fdiaz | import org.gvsig.fmap.dal.feature.FeatureStore; |
45 | 2827 | fdiaz | import org.gvsig.tools.ToolsLocator; |
46 | 3459 | fdiaz | import org.gvsig.tools.dispose.DisposeUtils; |
47 | 2827 | fdiaz | import org.gvsig.tools.i18n.I18nManager; |
48 | 2276 | fdiaz | import org.gvsig.tools.swing.api.Component; |
49 | import org.gvsig.tools.swing.api.ToolsSwingLocator; |
||
50 | import org.gvsig.tools.swing.api.ToolsSwingManager; |
||
51 | import org.gvsig.tools.swing.api.pickercontroller.PickerController; |
||
52 | 2999 | jjdelcerro | import org.gvsig.tools.swing.api.task.TaskStatusController; |
53 | import org.gvsig.tools.swing.api.task.TaskStatusSwingManager; |
||
54 | 2276 | fdiaz | import org.gvsig.tools.swing.api.windowmanager.Dialog; |
55 | import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
||
56 | 3516 | fdiaz | import org.gvsig.tools.util.ContainerUtils; |
57 | import static org.gvsig.tools.util.ContainerUtils.EQUALS_IGNORECASE_COMPARATOR; |
||
58 | 2822 | fdiaz | import org.gvsig.tools.util.LabeledValue; |
59 | 2697 | jjdelcerro | import org.gvsig.vcsgis.lib.VCSGisEntity; |
60 | 2999 | jjdelcerro | import static org.gvsig.vcsgis.lib.VCSGisManager.ERR_CANT_CHECKOUT; |
61 | 2822 | fdiaz | import static org.gvsig.vcsgis.lib.VCSGisManager.ERR_OK; |
62 | 3516 | fdiaz | import org.gvsig.vcsgis.lib.VCSGisRuntimeException; |
63 | 2699 | jjdelcerro | import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
64 | 3457 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisJCheckoutDataModel; |
65 | 2631 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
66 | import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
||
67 | 2822 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisSwingServices; |
68 | 3234 | jjdelcerro | import org.gvsig.vcsgis.swing.impl.VCSGisEntitySelectorController; |
69 | 3457 | fdiaz | import static org.gvsig.vcsgis.swing.impl.VCSGisEntitySelectorController.ALL_ENTITIES; |
70 | 2999 | jjdelcerro | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.notInSwingThreadInvokeLater; |
71 | 3233 | fdiaz | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.refreshDocument; |
72 | 3516 | fdiaz | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.showAuthenticationErrors; |
73 | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.showAuthenticationRequiredMessage; |
||
74 | import org.gvsig.vcsgis.swing.impl.VCSGisSwingManagerImpl; |
||
75 | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingManagerImpl.ICON_COMMON_GROUP_NAME; |
||
76 | 3068 | fdiaz | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingManagerImpl.ICON_GROUP_NAME; |
77 | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingManagerImpl.ICON_PROVIDER_NAME; |
||
78 | import static org.gvsig.vcsgis.swing.impl.VCSGisSwingManagerImpl.registerIcons; |
||
79 | 2276 | fdiaz | import org.slf4j.LoggerFactory; |
80 | |||
81 | /**
|
||
82 | *
|
||
83 | 2572 | jjdelcerro | * @author gvSIG Team
|
84 | 2276 | fdiaz | */
|
85 | 3457 | fdiaz | public class VCSGisJCheckoutDataModelImpl extends VCSGisJCheckoutDataModelView |
86 | implements Component, VCSGisJCheckoutDataModel { |
||
87 | 2895 | fdiaz | |
88 | 3457 | fdiaz | private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(VCSGisJCheckoutDataModelImpl.class); |
89 | 2276 | fdiaz | |
90 | private Dialog dialog; |
||
91 | 2895 | fdiaz | |
92 | 2998 | fdiaz | private boolean processing; |
93 | 3234 | jjdelcerro | private PickerController<VCSGisWorkspace> workspacePicker;
|
94 | 2999 | jjdelcerro | private TaskStatusController taskStatusController;
|
95 | 3234 | jjdelcerro | private VCSGisEntitySelectorController entitySelector;
|
96 | 2276 | fdiaz | |
97 | 3457 | fdiaz | public VCSGisJCheckoutDataModelImpl() {
|
98 | 2999 | jjdelcerro | processing = false;
|
99 | 2822 | fdiaz | initComponents(); |
100 | 2325 | fdiaz | } |
101 | 2330 | fdiaz | |
102 | 2822 | fdiaz | private void initComponents() { |
103 | 2999 | jjdelcerro | TaskStatusSwingManager taskStatusManager = ToolsSwingLocator.getTaskStatusSwingManager(); |
104 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
105 | VCSGisSwingServices services = swingManager.getDefaultServices(); |
||
106 | |||
107 | 3516 | fdiaz | translate(); |
108 | |||
109 | this.btnCheckAllEntities.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
||
110 | this.btnUnCheckAllEntities.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
||
111 | |||
112 | |||
113 | this.entitySelector = VCSGisEntitySelectorController.create(lstTables, txtFilter, btnTable, btnCheckAllEntities, btnUnCheckAllEntities);
|
||
114 | 3457 | fdiaz | this.entitySelector.setFilter(ALL_ENTITIES);
|
115 | this.entitySelector.setViewFilter(ALL_ENTITIES);
|
||
116 | this.entitySelector.setChecksEnabled(true); |
||
117 | 3516 | fdiaz | // this.entitySelector.addActionListener((ActionEvent e) -> {
|
118 | // doChangeTable();
|
||
119 | // });
|
||
120 | 3234 | jjdelcerro | this.entitySelector.addChangeListener((ChangeEvent e) -> { |
121 | doUpdateComponents(); |
||
122 | }); |
||
123 | |||
124 | 2999 | jjdelcerro | this.taskStatusController = taskStatusManager.createTaskStatusController(
|
125 | this.lblStatusTitle,
|
||
126 | this.lblStatusMessages,
|
||
127 | this.pbStatus
|
||
128 | ); |
||
129 | this.taskStatusController.setShowCancelButton(false); |
||
130 | this.taskStatusController.setShowRemoveTaskButton(false); |
||
131 | this.taskStatusController.bind(ToolsLocator.getTaskStatusManager());
|
||
132 | SwingUtilities.invokeLater(() -> {this.setVisibleStatus(false); }); |
||
133 | |||
134 | 2381 | jjdelcerro | this.workspacePicker = swingManager.createWorkspacePickerController(
|
135 | 2331 | fdiaz | cboWorkspaces, |
136 | btnInitWorkspace |
||
137 | ); |
||
138 | 2895 | fdiaz | |
139 | 2331 | fdiaz | this.workspacePicker.addChangeListener((ChangeEvent e) -> { |
140 | doChangeWorkspace(); |
||
141 | 2895 | fdiaz | doUpdateComponents(); |
142 | 2331 | fdiaz | }); |
143 | 3077 | jjdelcerro | |
144 | 3457 | fdiaz | this.cboDataModels.addItemListener((ItemEvent e) -> { |
145 | 3516 | fdiaz | doChangeDataModel(); |
146 | 3457 | fdiaz | }); |
147 | 3516 | fdiaz | |
148 | 2822 | fdiaz | ComboBoxModel<LabeledValue> viewDocumentsModel = services.getViewDocumentsComboBoxModel();
|
149 | 2895 | fdiaz | |
150 | 3457 | fdiaz | this.chkOverwriteExistingTables.addActionListener((ActionEvent e) -> { |
151 | 3233 | fdiaz | doUpdateComponents(); |
152 | }); |
||
153 | 2999 | jjdelcerro | |
154 | 2998 | fdiaz | showMessage(" ", null); |
155 | 2822 | fdiaz | |
156 | 2999 | jjdelcerro | this.setPreferredSize(new Dimension(520, 400)); |
157 | 2325 | fdiaz | |
158 | 2276 | fdiaz | } |
159 | 2895 | fdiaz | |
160 | 2276 | fdiaz | @Override
|
161 | public JComponent asJComponent() { |
||
162 | return this; |
||
163 | } |
||
164 | |||
165 | 2999 | jjdelcerro | public void setVisibleStatus(boolean visible) { |
166 | if( notInSwingThreadInvokeLater(() -> {setVisibleStatus(visible);}) ) {
|
||
167 | return;
|
||
168 | } |
||
169 | 3068 | fdiaz | this.lblStatusTitle.setVisible(visible);
|
170 | this.pbStatus.setVisible(visible);
|
||
171 | 2999 | jjdelcerro | this.lblStatusMessages.setVisible(true); |
172 | } |
||
173 | |||
174 | 2330 | fdiaz | @Override
|
175 | 2276 | fdiaz | public void setDialog(Dialog dialog) { |
176 | this.dialog = dialog;
|
||
177 | 2895 | fdiaz | this.doUpdateComponents();
|
178 | 2276 | fdiaz | } |
179 | 2895 | fdiaz | |
180 | 2331 | fdiaz | private void doChangeWorkspace() { |
181 | 3516 | fdiaz | try {
|
182 | VCSGisWorkspace ws = this.getWorkspace();
|
||
183 | if (ws == null) { |
||
184 | ComboBoxModel<String> model = new DefaultComboBoxModel<>(); |
||
185 | this.cboDataModels.setModel(model);
|
||
186 | this.cboDataModels.setSelectedIndex(-1); |
||
187 | this.entitySelector.setWorkspace(ws);
|
||
188 | doUpdateComponents(); |
||
189 | return;
|
||
190 | } |
||
191 | if (ws.authenticate(null)) { |
||
192 | ComboBoxModel<String> model = new DefaultComboBoxModel<>(ws.getDataModels().toArray(new String[0])); |
||
193 | this.cboDataModels.setModel(model);
|
||
194 | this.cboDataModels.setSelectedIndex(-1); |
||
195 | this.entitySelector.setWorkspace(ws);
|
||
196 | doUpdateComponents(); |
||
197 | return;
|
||
198 | } |
||
199 | showAuthenticationRequiredMessage("_VCS_Checkout");
|
||
200 | this.workspacePicker.set(null); |
||
201 | doChangeWorkspace(); |
||
202 | } catch (VCSGisRuntimeException e1) {
|
||
203 | LOGGER.warn("Can't set workspace.", e1);
|
||
204 | if (showAuthenticationErrors("_VCS_Checkout", e1)) { |
||
205 | this.workspacePicker.set(null); |
||
206 | doChangeWorkspace(); |
||
207 | } |
||
208 | } catch (Exception e2) { |
||
209 | LOGGER.warn("Can't set workspace.", e2);
|
||
210 | 2999 | jjdelcerro | } |
211 | } |
||
212 | |||
213 | 2381 | jjdelcerro | @Override
|
214 | public VCSGisWorkspace getWorkspace() {
|
||
215 | 2647 | fdiaz | return this.workspacePicker.get(); |
216 | 2331 | fdiaz | } |
217 | |||
218 | 2895 | fdiaz | private void doUpdateComponents() { |
219 | 2999 | jjdelcerro | if( notInSwingThreadInvokeLater(this::doUpdateComponents) ) { |
220 | return;
|
||
221 | } |
||
222 | 3234 | jjdelcerro | boolean isProcessing = this.processing || this.entitySelector.isProcessing(); |
223 | |||
224 | 2895 | fdiaz | I18nManager i18n = ToolsLocator.getI18nManager(); |
225 | 2999 | jjdelcerro | VCSGisWorkspace workspace = getWorkspace(); |
226 | 3516 | fdiaz | List<VCSGisEntity> checkedEntities = this.entitySelector.getCheckedEntities(); |
227 | 3233 | fdiaz | |
228 | 3516 | fdiaz | this.btnCheckAllEntities.setEnabled(!isProcessing);
|
229 | this.btnUnCheckAllEntities.setEnabled(!isProcessing);
|
||
230 | 2894 | fdiaz | |
231 | 3516 | fdiaz | this.chkOverwriteExistingTables.setEnabled(!isProcessing);
|
232 | |||
233 | 3234 | jjdelcerro | boolean canCheckout = !isProcessing &&
|
234 | workspace!=null &&
|
||
235 | 3516 | fdiaz | checkedEntities.size() > 0;
|
236 | 2999 | jjdelcerro | |
237 | 3234 | jjdelcerro | this.workspacePicker.setEnabled(!isProcessing);
|
238 | this.entitySelector.setEnabled(!isProcessing && workspace!=null ); |
||
239 | 2331 | fdiaz | |
240 | 3234 | jjdelcerro | this.pbStatus.setVisible(isProcessing);
|
241 | this.lblStatusTitle.setVisible(isProcessing);
|
||
242 | 3005 | jjdelcerro | |
243 | 2276 | fdiaz | if (dialog != null) { |
244 | this.dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK,
|
||
245 | 3516 | fdiaz | canCheckout |
246 | 2276 | fdiaz | ); |
247 | } |
||
248 | } |
||
249 | 2895 | fdiaz | |
250 | private boolean isLayer(VCSGisEntity entity) { |
||
251 | return entity != null && !StringUtils.isBlank(entity.getGeometryFieldName()); |
||
252 | 2822 | fdiaz | } |
253 | 2330 | fdiaz | |
254 | @Override
|
||
255 | 2331 | fdiaz | public int checkout() { |
256 | 3457 | fdiaz | |
257 | 2998 | fdiaz | I18nManager i18n = ToolsLocator.getI18nManager(); |
258 | 2999 | jjdelcerro | |
259 | 3459 | fdiaz | List<VCSGisEntity> entities = entitySelector.getCheckedEntities();
|
260 | 2999 | jjdelcerro | final VCSGisWorkspace workspace = this.getWorkspace(); |
261 | 3517 | jjdelcerro | final String dataModelName = this.getDataModel(); |
262 | 3233 | fdiaz | |
263 | 3459 | fdiaz | if (workspace != null && entities != null && entities.size()>0) { |
264 | List<String> entityCodes = new ArrayList<>(); |
||
265 | for (VCSGisEntity entity : entities) {
|
||
266 | entityCodes.add(entity.getEntityCode()); |
||
267 | } |
||
268 | |||
269 | 2892 | fdiaz | try {
|
270 | 2999 | jjdelcerro | processing = true;
|
271 | 3006 | fdiaz | doUpdateComponents(); |
272 | 2999 | jjdelcerro | |
273 | showMessage(i18n.getTranslation("_Processing"), null); |
||
274 | 3233 | fdiaz | int res = ERR_OK;
|
275 | 3457 | fdiaz | if(chkOverwriteExistingTables.isSelected()){
|
276 | 3459 | fdiaz | res = workspace.removeEntities(entityCodes); |
277 | 3233 | fdiaz | } |
278 | if(res == ERR_OK){
|
||
279 | res = workspace.checkout( |
||
280 | 3459 | fdiaz | entityCodes, |
281 | null
|
||
282 | 3233 | fdiaz | ); |
283 | 3459 | fdiaz | for (VCSGisEntity entity : entities) {
|
284 | VCSGisEntity lEntity = workspace.getEntity(entity.getEntityCode()); |
||
285 | workspace.getExplorer().setCustomResources(entity.getEntityName(), lEntity.getResources()); |
||
286 | } |
||
287 | 3517 | jjdelcerro | registerStoresRepository(workspace, dataModelName, entities); |
288 | 3459 | fdiaz | postCheckout(res, entities); |
289 | 3233 | fdiaz | } |
290 | 2999 | jjdelcerro | showMessage(i18n.getTranslation("_Ended_process"), null); |
291 | return res;
|
||
292 | } finally {
|
||
293 | processing = false;
|
||
294 | 3006 | fdiaz | doUpdateComponents(); |
295 | 2892 | fdiaz | } |
296 | } |
||
297 | 2999 | jjdelcerro | return ERR_CANT_CHECKOUT;
|
298 | } |
||
299 | 2822 | fdiaz | |
300 | 3459 | fdiaz | private void postCheckout(int checkoutStatus, List<VCSGisEntity> entities) { |
301 | if( notInSwingThreadInvokeLater(() -> {postCheckout(checkoutStatus,entities);}) ) {
|
||
302 | 2999 | jjdelcerro | return;
|
303 | } |
||
304 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
305 | VCSGisSwingServices services = swingManager.getDefaultServices(); |
||
306 | final VCSGisWorkspace workspace = this.getWorkspace(); |
||
307 | 2895 | fdiaz | |
308 | 2999 | jjdelcerro | if (checkoutStatus == ERR_OK) {
|
309 | 3459 | fdiaz | //Nos vamos guardando los stores para, después, refrescar solo una vez cada documento al que pertenecen
|
310 | Set stores = new HashSet(); |
||
311 | for (VCSGisEntity entity : entities) {
|
||
312 | FeatureStore store = workspace.getFeatureStore(entity.getEntityName()); |
||
313 | stores.add(store); |
||
314 | 2822 | fdiaz | } |
315 | 3459 | fdiaz | if (chkOverwriteExistingTables.isSelected() && !stores.isEmpty()) {
|
316 | refreshDocument(stores); |
||
317 | } |
||
318 | for (Object store : stores) { |
||
319 | DisposeUtils.dispose(store); |
||
320 | } |
||
321 | 3233 | fdiaz | |
322 | 2999 | jjdelcerro | this.setVisibleStatus(false); |
323 | } else {
|
||
324 | this.setVisibleStatus(true); |
||
325 | } |
||
326 | 3006 | fdiaz | this.doUpdateComponents();
|
327 | 2330 | fdiaz | } |
328 | 3517 | jjdelcerro | |
329 | private void registerStoresRepository(VCSGisWorkspace workspace, String name, List<VCSGisEntity> entities) { |
||
330 | DataManager dataManager = DALLocator.getDataManager(); |
||
331 | BaseStoresRepository modelRepository = new BaseStoresRepository(name);
|
||
332 | for (VCSGisEntity entity : entities) {
|
||
333 | OpenDataStoreParameters params = workspace.createOpenStoreParameters(entity.getEntityName()); |
||
334 | modelRepository.add(entity.getEntityName(), params); |
||
335 | } |
||
336 | StoresRepository globalRepository = dataManager.getStoresRepository(); |
||
337 | globalRepository.addRepository(modelRepository); |
||
338 | } |
||
339 | |||
340 | 2998 | fdiaz | private void showMessage(String message, String toolTipText) { |
341 | 2999 | jjdelcerro | if( notInSwingThreadInvokeLater(() -> {showMessage(message, toolTipText);}) ) {
|
342 | 2998 | fdiaz | return;
|
343 | } |
||
344 | 2999 | jjdelcerro | this.lblStatusMessages.setText(message);
|
345 | this.lblStatusMessages.setToolTipText(toolTipText);
|
||
346 | 2998 | fdiaz | } |
347 | 2330 | fdiaz | |
348 | 2276 | fdiaz | private void translate() { |
349 | ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
||
350 | 2331 | fdiaz | swingManager.translate(this.lblWorkspace);
|
351 | 3457 | fdiaz | swingManager.translate(this.lblDataModel);
|
352 | swingManager.translate(this.chkOverwriteExistingTables);
|
||
353 | 2276 | fdiaz | } |
354 | |||
355 | 2999 | jjdelcerro | @Override
|
356 | public boolean isProcessing() { |
||
357 | 2998 | fdiaz | return processing;
|
358 | } |
||
359 | 2892 | fdiaz | |
360 | 3068 | fdiaz | public static void selfRegister() { |
361 | String[][] iconsInfo = new String[][]{ |
||
362 | 3516 | fdiaz | new String[]{ICON_PROVIDER_NAME, ICON_GROUP_NAME, "vcsgis-checkout"}, |
363 | new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-off"}, |
||
364 | new String[]{ICON_PROVIDER_NAME, ICON_COMMON_GROUP_NAME, "common-check-on"}, |
||
365 | }; |
||
366 | 3068 | fdiaz | registerIcons(iconsInfo); |
367 | } |
||
368 | |||
369 | 3516 | fdiaz | // private void doChangeTable() {
|
370 | // VCSGisWorkspace workspace = getWorkspace();
|
||
371 | // VCSGisEntity selectedTable = this.entitySelector.getSelectedEntity();
|
||
372 | //
|
||
373 | // this.chkOverwriteExistingTables.setSelected(workspace!=null && workspace.existsInWorkspace(selectedTable));
|
||
374 | //
|
||
375 | // doUpdateComponents();
|
||
376 | // }
|
||
377 | 3234 | jjdelcerro | |
378 | @Override
|
||
379 | 3457 | fdiaz | public String getDataModel() { |
380 | return (String)this.cboDataModels.getSelectedItem(); |
||
381 | 3234 | jjdelcerro | } |
382 | |||
383 | 3516 | fdiaz | private void doChangeDataModel() { |
384 | String selectedDataModel = getDataModel();
|
||
385 | this.entitySelector.setViewFilter(
|
||
386 | (VCSGisEntity t) -> (ContainerUtils.contains( |
||
387 | t.getDataModelsAsList(), |
||
388 | selectedDataModel, |
||
389 | EQUALS_IGNORECASE_COMPARATOR)) |
||
390 | ); |
||
391 | |||
392 | } |
||
393 | |||
394 | @Override
|
||
395 | public ImageIcon loadImage(String imageName) { |
||
396 | return VCSGisSwingManagerImpl.loadImage(imageName);
|
||
397 | } |
||
398 | |||
399 | |||
400 | 2276 | fdiaz | } |