gvsig-projects-pool / 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 @ 3517
History | View | Annotate | Download (21.3 KB)
1 | 2269 | jjdelcerro | /*
|
---|---|---|---|
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 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 | */
|
||
22 | 2381 | jjdelcerro | package org.gvsig.vcsgis.app; |
23 | 2269 | jjdelcerro | |
24 | 3068 | fdiaz | import org.gvsig.vcsgis.app.addlayer.WizardVCSGisVectorial; |
25 | import org.gvsig.vcsgis.app.addlayer.WizardVCSGisTabular; |
||
26 | 2573 | jjdelcerro | import java.util.Map; |
27 | 2330 | fdiaz | import javax.swing.JOptionPane; |
28 | 2276 | fdiaz | import org.gvsig.andami.IconThemeHelper; |
29 | 2578 | fdiaz | import org.gvsig.andami.PluginsLocator; |
30 | 2269 | jjdelcerro | import org.gvsig.andami.plugins.Extension; |
31 | 2891 | fdiaz | import org.gvsig.app.ApplicationLocator; |
32 | 3068 | fdiaz | import org.gvsig.app.extension.AddLayer; |
33 | 2330 | fdiaz | import org.gvsig.fmap.dal.feature.FeatureStore; |
34 | 2276 | fdiaz | import org.gvsig.tools.ToolsLocator; |
35 | 2573 | jjdelcerro | import org.gvsig.tools.dynobject.DynObject; |
36 | 2276 | fdiaz | import org.gvsig.tools.i18n.I18nManager; |
37 | import org.gvsig.tools.swing.api.ToolsSwingLocator; |
||
38 | 2330 | fdiaz | import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager; |
39 | 2276 | fdiaz | import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
40 | import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
||
41 | 3458 | jjdelcerro | import org.gvsig.vcsgis.app.VCSGisDialogsHelper.VCSGisDialogInfo; |
42 | 2697 | jjdelcerro | import org.gvsig.vcsgis.lib.VCSGisEntity; |
43 | 2573 | jjdelcerro | import org.gvsig.vcsgis.lib.VCSGisLocator; |
44 | 2725 | fdiaz | import org.gvsig.vcsgis.lib.VCSGisManager; |
45 | 2699 | jjdelcerro | import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace; |
46 | import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspaceDescriptor; |
||
47 | 2578 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisJAddToWorkspace; |
48 | import org.gvsig.vcsgis.swing.VCSGisJCheckout; |
||
49 | 3516 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisJCheckoutDataModel; |
50 | 3455 | jolivas | import org.gvsig.vcsgis.swing.VCSGisJCreateResourceTable; |
51 | 2893 | jjdelcerro | import org.gvsig.vcsgis.swing.VCSGisJExport; |
52 | 3284 | jjdelcerro | import org.gvsig.vcsgis.swing.VCSGisJImportHistory; |
53 | 2578 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisJInitServer; |
54 | import org.gvsig.vcsgis.swing.VCSGisJInitWorkspace; |
||
55 | 3517 | jjdelcerro | import org.gvsig.vcsgis.swing.VCSGisJLogout; |
56 | 2725 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisJShowServerTableForm; |
57 | 2578 | fdiaz | import org.gvsig.vcsgis.swing.VCSGisSwingLocator; |
58 | import org.gvsig.vcsgis.swing.VCSGisSwingManager; |
||
59 | 2269 | jjdelcerro | |
60 | /**
|
||
61 | *
|
||
62 | * @author gvSIG Team
|
||
63 | */
|
||
64 | 2381 | jjdelcerro | public class VCSGisExtension extends Extension { |
65 | 2269 | jjdelcerro | |
66 | 3458 | jjdelcerro | private VCSGisDialogsHelper dialogsHelper;
|
67 | 2998 | fdiaz | |
68 | 2269 | jjdelcerro | @Override
|
69 | public void initialize() { |
||
70 | 2381 | jjdelcerro | IconThemeHelper.registerIcon("action", "tools-vcsgis-init-server", this); |
71 | IconThemeHelper.registerIcon("action", "tools-vcsgis-init-workspace", this); |
||
72 | IconThemeHelper.registerIcon("action", "tools-vcsgis-add-to-workspace", this); |
||
73 | 2893 | jjdelcerro | IconThemeHelper.registerIcon("action", "tools-vcsgis-export", this); |
74 | 2381 | jjdelcerro | IconThemeHelper.registerIcon("action", "tools-vcsgis-checkout", this); |
75 | 2572 | jjdelcerro | IconThemeHelper.registerIcon("action", "tools-vcsgis-showchanges", this); |
76 | 2578 | fdiaz | IconThemeHelper.registerIcon("action", "tools-vcsgis-register-workspace", this); |
77 | 3077 | jjdelcerro | IconThemeHelper.registerIcon("action", "tools-vcsgis-show-revisions", this); |
78 | 3516 | fdiaz | IconThemeHelper.registerIcon("action", "tools-vcsgis-checkout-datamodel", this); |
79 | 3458 | jjdelcerro | |
80 | this.dialogsHelper = new VCSGisDialogsHelper(); |
||
81 | 2269 | jjdelcerro | } |
82 | |||
83 | @Override
|
||
84 | 2329 | fdiaz | public void postInitialize() { |
85 | super.postInitialize();
|
||
86 | 2701 | fdiaz | VCSGisManager manager = VCSGisLocator.getVCSGisManager(); |
87 | 2381 | jjdelcerro | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
88 | swingManager.setDefaultServices(new VCSGisSwingServicesImpl());
|
||
89 | 2573 | jjdelcerro | |
90 | DynObject pluginProperties = this.getPlugin().getPluginProperties();
|
||
91 | 2578 | fdiaz | Map<String, VCSGisWorkspaceDescriptor> workspaces = (Map) pluginProperties.getDynValue("workspaces"); |
92 | 2573 | jjdelcerro | manager.restoreWorkspaces(workspaces); |
93 | 2893 | jjdelcerro | |
94 | 3458 | jjdelcerro | PluginsLocator.getPluginsManager().addShutdownTask( |
95 | "VCSGisSave",
|
||
96 | () -> { |
||
97 | VCSGisManager manager1 = VCSGisLocator.getVCSGisManager(); |
||
98 | DynObject pluginProperties1 = getPlugin().getPluginProperties(); |
||
99 | pluginProperties1.setDynValue("workspaces", manager1.getWorkspaces());
|
||
100 | }, |
||
101 | 2893 | jjdelcerro | false,
|
102 | 2697 | jjdelcerro | 100
|
103 | ); |
||
104 | 3458 | jjdelcerro | |
105 | ApplicationLocator.getManager().registerAddTableWizard( |
||
106 | "VCSGis",
|
||
107 | "VCSGis",
|
||
108 | WizardVCSGisTabular.class |
||
109 | ); |
||
110 | 3068 | fdiaz | AddLayer.addWizard(WizardVCSGisVectorial.class); |
111 | 3458 | jjdelcerro | |
112 | 2329 | fdiaz | } |
113 | |||
114 | @Override
|
||
115 | 2269 | jjdelcerro | public void execute(String actionCommand) { |
116 | 2276 | fdiaz | |
117 | 2330 | fdiaz | switch (actionCommand) {
|
118 | 2572 | jjdelcerro | case "tools-vcsgis-showchanges": |
119 | 2269 | jjdelcerro | this.showChangesDialog();
|
120 | break;
|
||
121 | 2330 | fdiaz | |
122 | 2381 | jjdelcerro | case "tools-vcsgis-init-server": |
123 | 3458 | jjdelcerro | showInitializaRepositoryDialog(); |
124 | 2276 | fdiaz | break;
|
125 | 2381 | jjdelcerro | case "tools-vcsgis-init-workspace": |
126 | 2331 | fdiaz | showInitWorkspaceDialog(); |
127 | 2325 | fdiaz | break;
|
128 | 2381 | jjdelcerro | case "tools-vcsgis-add-to-workspace": |
129 | 2331 | fdiaz | showAddToWorkspaceDialog(); |
130 | 2330 | fdiaz | break;
|
131 | 2381 | jjdelcerro | case "tools-vcsgis-checkout": |
132 | 2331 | fdiaz | showCheckoutDialog(); |
133 | break;
|
||
134 | 2893 | jjdelcerro | case "tools-vcsgis-export": |
135 | showExportDialog(); |
||
136 | break;
|
||
137 | 2578 | fdiaz | case "tools-vcsgis-register-workspace": |
138 | showRegisterWorkspaceDialog(); |
||
139 | break;
|
||
140 | 2725 | fdiaz | case "tools-vcsgis-show_server-entities": |
141 | showServerEntitiesDialog(); |
||
142 | break;
|
||
143 | case "tools-vcsgis-show_server-hooks": |
||
144 | showServerHooksDialog(); |
||
145 | break;
|
||
146 | 3077 | jjdelcerro | case "tools-vcsgis-show-revisions": |
147 | showHistory(); |
||
148 | break;
|
||
149 | 3284 | jjdelcerro | case "tools-vcsgis-import-history": |
150 | showImportHistoryDialog(); |
||
151 | break;
|
||
152 | 3455 | jolivas | case "tools-vcsgis-create-resource-table": |
153 | 3458 | jjdelcerro | showCreateResourceTableDialog(); |
154 | 3455 | jolivas | break;
|
155 | 3517 | jjdelcerro | case "tools-vcsgis-logout": |
156 | showLogoutDialog(); |
||
157 | break;
|
||
158 | 3516 | fdiaz | case "tools-vcsgis-checkout-datamodel": |
159 | showCheckoutDataModelDialog(); |
||
160 | break;
|
||
161 | 2269 | jjdelcerro | } |
162 | } |
||
163 | |||
164 | 3458 | jjdelcerro | @Override
|
165 | public boolean isEnabled() { |
||
166 | return true; |
||
167 | } |
||
168 | |||
169 | @Override
|
||
170 | public boolean isVisible() { |
||
171 | return true; |
||
172 | } |
||
173 | |||
174 | // private void cleanHighligthed() {
|
||
175 | // VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager();
|
||
176 | // swingManager.getDefaultServices().cleanHighligthed();
|
||
177 | // }
|
||
178 | //
|
||
179 | |||
180 | 2331 | fdiaz | private void showAddToWorkspaceDialog() { |
181 | 2381 | jjdelcerro | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
182 | 2331 | fdiaz | |
183 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
184 | "AddToWorkingCopy",
|
||
185 | swingManager.createAddToWorkspacePanel(), |
||
186 | "_VCS_Add_to_workspace",
|
||
187 | "_VCS_Add_to_workspace",
|
||
188 | "_VCS_Add_to_workspace",
|
||
189 | () -> { |
||
190 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
191 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
192 | VCSGisJAddToWorkspace addToWorkspacePanel = (VCSGisJAddToWorkspace) this.dialogsHelper.getDialog("AddToWorkingCopy").getPanel(); |
||
193 | int r = addToWorkspacePanel.add();
|
||
194 | if (r != 0) { |
||
195 | FeatureStore featureStore = addToWorkspacePanel.getFeatureStore(); |
||
196 | String targetName = addToWorkspacePanel.getTabletName();
|
||
197 | VCSGisWorkspace workspace = addToWorkspacePanel.getWorkspace(); |
||
198 | dialogsManager.messageDialog( |
||
199 | i18n.getTranslation( |
||
200 | "_Cant_add_{0}_as_{1}_in_{2}",
|
||
201 | new String[]{ |
||
202 | featureStore.getName(), |
||
203 | targetName, |
||
204 | workspace.getLabel() |
||
205 | } |
||
206 | ) + "\n" + workspace.getErrorMessage(r),
|
||
207 | i18n.getTranslation("_VCS_Add_to_workspace"),
|
||
208 | JOptionPane.WARNING_MESSAGE
|
||
209 | ); |
||
210 | 2999 | jjdelcerro | } |
211 | 2995 | jjdelcerro | } |
212 | 2330 | fdiaz | ); |
213 | 3458 | jjdelcerro | dialog.show(); |
214 | 2330 | fdiaz | } |
215 | |||
216 | 3284 | jjdelcerro | private void showImportHistoryDialog() { |
217 | 3300 | jolivas | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
218 | |||
219 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
220 | "ImportHistory",
|
||
221 | swingManager.createInitWorkspacePanel(), |
||
222 | "_VCS_Import_history",
|
||
223 | "_VCS_Import_history",
|
||
224 | "_VCS_Import_history",
|
||
225 | () -> { |
||
226 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
227 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
228 | VCSGisJImportHistory importHistoryPanel = (VCSGisJImportHistory) this.dialogsHelper.getDialog("ImportHistory").getPanel(); |
||
229 | int r = importHistoryPanel.importHistory();
|
||
230 | if (r != 0) { |
||
231 | FeatureStore featureStore = importHistoryPanel.getFeatureStore(); |
||
232 | String targetName = importHistoryPanel.getTabletName();
|
||
233 | VCSGisWorkspace workspace = importHistoryPanel.getWorkspace(); |
||
234 | dialogsManager.messageDialog( |
||
235 | i18n.getTranslation( |
||
236 | "_Cant_add_{0}_as_{1}_in_{2}",
|
||
237 | new String[]{ |
||
238 | featureStore.getName(), |
||
239 | targetName, |
||
240 | workspace.getLabel() |
||
241 | } |
||
242 | ) + "\n" + workspace.getErrorMessage(r),
|
||
243 | i18n.getTranslation("_VCS_Import_history"),
|
||
244 | JOptionPane.WARNING_MESSAGE
|
||
245 | ); |
||
246 | 3300 | jolivas | } |
247 | } |
||
248 | ); |
||
249 | 3458 | jjdelcerro | dialog.show(); |
250 | 3284 | jjdelcerro | } |
251 | |||
252 | 2331 | fdiaz | private void showInitWorkspaceDialog() { |
253 | 2381 | jjdelcerro | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
254 | 2331 | fdiaz | |
255 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
256 | "InitializeWorkingCopy",
|
||
257 | swingManager.createInitWorkspacePanel(), |
||
258 | "_VCS_Initialize_workspace",
|
||
259 | "_VCS_Initialize_workspace",
|
||
260 | "_VCS_Initialize_workspace",
|
||
261 | () -> { |
||
262 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
263 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
264 | VCSGisJInitWorkspace panelInitWorkspace = (VCSGisJInitWorkspace) this.dialogsHelper.getDialog("InitializeWorkingCopy").getPanel(); |
||
265 | 2572 | jjdelcerro | int r = panelInitWorkspace.initializeWorkspace();
|
266 | 2330 | fdiaz | if (r != 0) { |
267 | 2893 | jjdelcerro | dialogsManager.messageDialog( |
268 | 3458 | jjdelcerro | i18n.getTranslation( |
269 | "_Cant_initialize_workspace_{0}",
|
||
270 | new String[]{panelInitWorkspace.getWorkspaceName()} |
||
271 | ), |
||
272 | i18n.getTranslation("_VCS_Initialize_workspace"),
|
||
273 | 2893 | jjdelcerro | JOptionPane.WARNING_MESSAGE
|
274 | ); |
||
275 | 2330 | fdiaz | } |
276 | 3458 | jjdelcerro | } |
277 | ); |
||
278 | 3462 | jjdelcerro | dialog.setAutoclose(true);
|
279 | 3458 | jjdelcerro | dialog.show(); |
280 | 2330 | fdiaz | } |
281 | |||
282 | 3458 | jjdelcerro | private void showInitializaRepositoryDialog() { |
283 | 2381 | jjdelcerro | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
284 | 2331 | fdiaz | |
285 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
286 | "InitializeRepository",
|
||
287 | swingManager.createInitRepositoryPanel(), |
||
288 | "_VCS_Initialize_repository",
|
||
289 | "_VCS_Initialize_repository",
|
||
290 | "_VCS_Initialize_repository",
|
||
291 | () -> { |
||
292 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
293 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
294 | VCSGisJInitServer panel = (VCSGisJInitServer) this.dialogsHelper.getDialog("InitializeRepository").getPanel(); |
||
295 | 2330 | fdiaz | int r = panel.initialize();
|
296 | if (r != 0) { |
||
297 | dialogsManager.messageDialog( |
||
298 | 3458 | jjdelcerro | i18n.getTranslation( |
299 | "_Cant_initialize_server_{0}",
|
||
300 | new String[]{panel.getConnectionLabel()} |
||
301 | 2893 | jjdelcerro | ), |
302 | 3458 | jjdelcerro | i18n.getTranslation("_VCS_Initialize_repository"),
|
303 | JOptionPane.WARNING_MESSAGE
|
||
304 | ); |
||
305 | 2330 | fdiaz | } |
306 | 3458 | jjdelcerro | } |
307 | ); |
||
308 | 3462 | jjdelcerro | dialog.setAutoclose(true);
|
309 | 3458 | jjdelcerro | dialog.show(); |
310 | 2330 | fdiaz | } |
311 | |||
312 | 2572 | jjdelcerro | private void showCheckoutDialog() { |
313 | 2381 | jjdelcerro | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
314 | 2331 | fdiaz | |
315 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
316 | "Checkout",
|
||
317 | swingManager.createCheckoutPanel(), |
||
318 | "_VCS_Checkout",
|
||
319 | "_VCS_Checkout",
|
||
320 | "_VCS_Checkout",
|
||
321 | () -> { |
||
322 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
323 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
324 | VCSGisJCheckout checkoutPanel = (VCSGisJCheckout) this.dialogsHelper.getDialog("Checkout").getPanel(); |
||
325 | int r = checkoutPanel.checkout();
|
||
326 | if (r != 0) { |
||
327 | VCSGisEntity entity = checkoutPanel.getTable(); |
||
328 | dialogsManager.messageDialog( |
||
329 | i18n.getTranslation( |
||
330 | "_Failed_checkout_of_{0}",
|
||
331 | new String[]{entity.toString()} |
||
332 | ), |
||
333 | i18n.getTranslation("_Checkout"),
|
||
334 | JOptionPane.WARNING_MESSAGE
|
||
335 | ); |
||
336 | 2998 | fdiaz | } |
337 | 2995 | jjdelcerro | } |
338 | 2331 | fdiaz | ); |
339 | 3458 | jjdelcerro | dialog.show(); |
340 | 2331 | fdiaz | } |
341 | |||
342 | 2893 | jjdelcerro | private void showExportDialog() { |
343 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
344 | |||
345 | 3458 | jjdelcerro | final VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
346 | "Export",
|
||
347 | swingManager.createExportPanel(), |
||
348 | "_VCS_Export",
|
||
349 | "_Export_to_a_local_table_a_table_of_the_repository",
|
||
350 | "_VCS_Export",
|
||
351 | () -> { |
||
352 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
353 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
354 | VCSGisJExport exportPanel = (VCSGisJExport) this.dialogsHelper.getDialog("Export").getPanel(); |
||
355 | int r = exportPanel.export();
|
||
356 | if (r != 0) { |
||
357 | VCSGisEntity entity = exportPanel.getTable(); |
||
358 | dialogsManager.messageDialog( |
||
359 | i18n.getTranslation( |
||
360 | "_Failed_export_of_{0}",
|
||
361 | new String[]{entity.toString()} |
||
362 | ), |
||
363 | i18n.getTranslation("_VCSGis_Export"),
|
||
364 | JOptionPane.WARNING_MESSAGE
|
||
365 | ); |
||
366 | 3234 | jjdelcerro | } |
367 | } |
||
368 | 2893 | jjdelcerro | ); |
369 | 3458 | jjdelcerro | dialog.show(); |
370 | 2893 | jjdelcerro | } |
371 | |||
372 | 2572 | jjdelcerro | private void showChangesDialog() { |
373 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
374 | |||
375 | 3458 | jjdelcerro | final VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
376 | "Changes",
|
||
377 | swingManager.createChangesPanel(), |
||
378 | "_VCS_Changes"
|
||
379 | 2572 | jjdelcerro | ); |
380 | 3458 | jjdelcerro | dialog.show(); |
381 | 2572 | jjdelcerro | } |
382 | |||
383 | 3077 | jjdelcerro | private void showHistory() { |
384 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
385 | |||
386 | 3458 | jjdelcerro | final VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
387 | "Revisions",
|
||
388 | swingManager.createRevisionsPanel(), |
||
389 | "_VCS_Revisions"
|
||
390 | 3077 | jjdelcerro | ); |
391 | 3458 | jjdelcerro | dialog.show(); |
392 | 3077 | jjdelcerro | } |
393 | |||
394 | 2578 | fdiaz | private void showRegisterWorkspaceDialog() { |
395 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
396 | |||
397 | 3458 | jjdelcerro | final VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog( |
398 | "RegisterWorkingCopies",
|
||
399 | swingManager.createRegisterWorkspacePanel(), |
||
400 | "_VCS_Register_workspace"
|
||
401 | 2578 | fdiaz | ); |
402 | 3458 | jjdelcerro | dialog.show(); |
403 | 2578 | fdiaz | } |
404 | |||
405 | 2893 | jjdelcerro | private void showServerEntitiesDialog() { |
406 | 2725 | fdiaz | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
407 | WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
||
408 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
409 | |||
410 | final VCSGisJShowServerTableForm panel = swingManager.createShowTableServerFormPanel("VCSGIS_ENTITIES"); |
||
411 | winManager.showWindow( |
||
412 | panel.asJComponent(), |
||
413 | 2893 | jjdelcerro | i18nManager.getTranslation("_VCS_Server_entities"),
|
414 | 2725 | fdiaz | WindowManager.MODE.WINDOW |
415 | ); |
||
416 | } |
||
417 | |||
418 | private void showServerHooksDialog() { |
||
419 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
420 | WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
||
421 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
422 | 2893 | jjdelcerro | |
423 | 2725 | fdiaz | final VCSGisJShowServerTableForm panel = swingManager.createShowTableServerFormPanel("VCSGIS_HOOKS"); |
424 | winManager.showWindow( |
||
425 | panel.asJComponent(), |
||
426 | 2893 | jjdelcerro | i18nManager.getTranslation("_VCS_Server_hooks"),
|
427 | 2725 | fdiaz | WindowManager.MODE.WINDOW |
428 | ); |
||
429 | } |
||
430 | 3458 | jjdelcerro | |
431 | private void showCreateResourceTableDialog() { |
||
432 | 3455 | jolivas | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
433 | 2725 | fdiaz | |
434 | 3458 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
435 | "CreateResourceTable",
|
||
436 | swingManager.createResourceTablePanel(), |
||
437 | "_VCS_Create_resource_table",
|
||
438 | "_Create_resource_table_parameters",
|
||
439 | "_Accept",
|
||
440 | () -> { |
||
441 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
442 | VCSGisJCreateResourceTable panel = (VCSGisJCreateResourceTable) this.dialogsHelper.getDialog("CreateResourceTable").getPanel(); |
||
443 | 3455 | jolivas | panel.createResourceTable(); |
444 | } |
||
445 | 3458 | jjdelcerro | ); |
446 | 3462 | jjdelcerro | dialog.setAutoclose(true);
|
447 | 3458 | jjdelcerro | dialog.show(); |
448 | 3455 | jolivas | } |
449 | |||
450 | 3517 | jjdelcerro | private void showLogoutDialog() { |
451 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
452 | |||
453 | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
||
454 | "Logout",
|
||
455 | swingManager.createLogoutPanel(), |
||
456 | "_VCS_Logout",
|
||
457 | "_Logout_the_current_user_from_a_VCSGis_working_copy",
|
||
458 | "_Accept",
|
||
459 | () -> { |
||
460 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
461 | VCSGisJLogout panel = (VCSGisJLogout) this.dialogsHelper.getDialog("Logout").getPanel(); |
||
462 | panel.logout(); |
||
463 | } |
||
464 | ); |
||
465 | dialog.setAutoclose(true);
|
||
466 | dialog.show(); |
||
467 | } |
||
468 | |||
469 | 3516 | fdiaz | private void showCheckoutDataModelDialog() { |
470 | VCSGisSwingManager swingManager = VCSGisSwingLocator.getVCSGisSwingManager(); |
||
471 | |||
472 | 3517 | jjdelcerro | VCSGisDialogInfo dialog = this.dialogsHelper.getOrCreateDialog(
|
473 | "CheckoutDataModel",
|
||
474 | 3516 | fdiaz | swingManager.createCheckoutDataModelPanel(), |
475 | 3517 | jjdelcerro | "_VCS_Checkout_DataModel",
|
476 | "_VCS_Checkout_DataModel",
|
||
477 | "_VCS_Checkout_DataModel",
|
||
478 | () -> { |
||
479 | I18nManager i18n = ToolsLocator.getI18nManager(); |
||
480 | ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
||
481 | VCSGisJCheckoutDataModel checkoutDataModelPanel = (VCSGisJCheckoutDataModel) this.dialogsHelper.getDialog("CheckoutDataModel").getPanel(); |
||
482 | int r = checkoutDataModelPanel.checkout();
|
||
483 | if (r != 0) { |
||
484 | String dataModel = checkoutDataModelPanel.getDataModel();
|
||
485 | dialogsManager.messageDialog( |
||
486 | i18n.getTranslation( |
||
487 | "_Failed_checkout_of_{0}",
|
||
488 | new String[]{dataModel} |
||
489 | ), |
||
490 | i18n.getTranslation("_CheckoutDataModel"),
|
||
491 | JOptionPane.WARNING_MESSAGE
|
||
492 | ); |
||
493 | } |
||
494 | } |
||
495 | 3516 | fdiaz | ); |
496 | dialog.show(); |
||
497 | } |
||
498 | 3517 | jjdelcerro | |
499 | 2269 | jjdelcerro | } |