svn-document-layout / trunk / org.gvsig.app.document.layout2.app / org.gvsig.app.document.layout2.app.mainplugin / src / main / java / org / gvsig / app / extension / LayoutMainExtension.java @ 1757
History | View | Annotate | Download (17.8 KB)
1 | 5 | jldominguez | /* 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.extension; |
||
23 | |||
24 | import java.awt.Component; |
||
25 | 606 | jjdelcerro | import java.beans.PropertyVetoException; |
26 | 5 | jldominguez | import java.io.File; |
27 | import java.io.FileInputStream; |
||
28 | 109 | jldominguez | import java.io.IOException; |
29 | 605 | jjdelcerro | import java.util.Iterator; |
30 | 109 | jldominguez | import javax.swing.JOptionPane; |
31 | 1756 | fdiaz | import javax.swing.JPanel; |
32 | 24 | jldominguez | import org.gvsig.andami.IconThemeHelper; |
33 | 5 | jldominguez | import org.gvsig.andami.PluginServices; |
34 | import org.gvsig.andami.plugins.Extension; |
||
35 | 605 | jjdelcerro | import org.gvsig.andami.ui.mdiManager.IWindow; |
36 | import org.gvsig.andami.ui.mdiManager.MDIManager; |
||
37 | 5 | jldominguez | import org.gvsig.app.ApplicationLocator; |
38 | 605 | jjdelcerro | import org.gvsig.app.ApplicationManager; |
39 | 5 | jldominguez | import org.gvsig.app.project.Project; |
40 | import org.gvsig.app.project.ProjectManager; |
||
41 | 605 | jjdelcerro | import org.gvsig.app.project.documents.Document; |
42 | 5 | jldominguez | import org.gvsig.app.project.documents.layout.DefaultLayoutManager; |
43 | import org.gvsig.app.project.documents.layout.LayoutDocument; |
||
44 | import org.gvsig.app.project.documents.layout.LayoutManager; |
||
45 | import org.gvsig.app.project.documents.layout.contextmenu.gui.BeforeLayoutMenuEntry; |
||
46 | import org.gvsig.app.project.documents.layout.contextmenu.gui.BehindLayoutMenuEntry; |
||
47 | import org.gvsig.app.project.documents.layout.contextmenu.gui.CancelLayoutMenuEntry; |
||
48 | import org.gvsig.app.project.documents.layout.contextmenu.gui.CopyLayoutMenuEntry; |
||
49 | import org.gvsig.app.project.documents.layout.contextmenu.gui.CutLayoutMenuEntry; |
||
50 | import org.gvsig.app.project.documents.layout.contextmenu.gui.PasteLayoutMenuEntry; |
||
51 | import org.gvsig.app.project.documents.layout.contextmenu.gui.PositionLayoutMenuEntry; |
||
52 | import org.gvsig.app.project.documents.layout.contextmenu.gui.PropertyLayoutMenuEntry; |
||
53 | import org.gvsig.app.project.documents.layout.contextmenu.gui.RefreshLayoutMenuEntry; |
||
54 | import org.gvsig.app.project.documents.layout.contextmenu.gui.SelectAllLayoutMenuEntry; |
||
55 | import org.gvsig.app.project.documents.layout.contextmenu.gui.SimplifyLayoutMenuEntry; |
||
56 | import org.gvsig.app.project.documents.layout.contextmenu.gui.TerminateLayoutMenuEntry; |
||
57 | import org.gvsig.app.project.documents.layout.fframes.FFrame; |
||
58 | import org.gvsig.app.project.documents.layout.fframes.FFrameBasicFactory; |
||
59 | import org.gvsig.app.project.documents.layout.fframes.FFrameGraphics; |
||
60 | import org.gvsig.app.project.documents.layout.fframes.FFrameGraphicsFactory; |
||
61 | import org.gvsig.app.project.documents.layout.fframes.FFrameGrid; |
||
62 | import org.gvsig.app.project.documents.layout.fframes.FFrameGridFactory; |
||
63 | import org.gvsig.app.project.documents.layout.fframes.FFrameGroup; |
||
64 | import org.gvsig.app.project.documents.layout.fframes.FFrameGroupFactory; |
||
65 | import org.gvsig.app.project.documents.layout.fframes.FFrameLegend; |
||
66 | import org.gvsig.app.project.documents.layout.fframes.FFrameLegendFactory; |
||
67 | import org.gvsig.app.project.documents.layout.fframes.FFrameNorth; |
||
68 | import org.gvsig.app.project.documents.layout.fframes.FFrameNorthFactory; |
||
69 | import org.gvsig.app.project.documents.layout.fframes.FFrameOverView; |
||
70 | import org.gvsig.app.project.documents.layout.fframes.FFrameOverViewFactory; |
||
71 | import org.gvsig.app.project.documents.layout.fframes.FFramePicture; |
||
72 | import org.gvsig.app.project.documents.layout.fframes.FFramePictureFactory; |
||
73 | import org.gvsig.app.project.documents.layout.fframes.FFrameScaleBar; |
||
74 | import org.gvsig.app.project.documents.layout.fframes.FFrameScaleBarFactory; |
||
75 | import org.gvsig.app.project.documents.layout.fframes.FFrameSymbol; |
||
76 | import org.gvsig.app.project.documents.layout.fframes.FFrameSymbolFactory; |
||
77 | import org.gvsig.app.project.documents.layout.fframes.FFrameTable; |
||
78 | import org.gvsig.app.project.documents.layout.fframes.FFrameTableFactory; |
||
79 | import org.gvsig.app.project.documents.layout.fframes.FFrameText; |
||
80 | import org.gvsig.app.project.documents.layout.fframes.FFrameTextFactory; |
||
81 | import org.gvsig.app.project.documents.layout.fframes.FFrameView; |
||
82 | import org.gvsig.app.project.documents.layout.fframes.FFrameViewFactory; |
||
83 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameBoxDialog; |
||
84 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameGraphicsDialog; |
||
85 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameGridDialog; |
||
86 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameGroupDialog; |
||
87 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameLegendDialog; |
||
88 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameNorthDialog; |
||
89 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameOverViewDialog; |
||
90 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFramePictureDialog; |
||
91 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameScaleBarDialog; |
||
92 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameTextDialog; |
||
93 | import org.gvsig.app.project.documents.layout.fframes.gui.dialogs.FFrameViewDialog; |
||
94 | import org.gvsig.app.project.documents.layout.gui.LayoutPanel; |
||
95 | 1756 | fdiaz | import org.gvsig.filedialogchooser.FileDialogChooser; |
96 | import org.gvsig.filedialogchooser.FileDialogChooserManager; |
||
97 | 5 | jldominguez | import org.gvsig.gui.beans.swing.JFileChooser; |
98 | 109 | jldominguez | import org.gvsig.i18n.Messages; |
99 | 5 | jldominguez | import org.gvsig.tools.ToolsLocator; |
100 | import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
||
101 | 605 | jjdelcerro | import org.gvsig.tools.i18n.I18nManager; |
102 | 5 | jldominguez | import org.gvsig.tools.persistence.PersistenceManager; |
103 | import org.gvsig.tools.persistence.PersistentState; |
||
104 | import org.gvsig.tools.persistence.exception.PersistenceException; |
||
105 | 1756 | fdiaz | import org.gvsig.tools.util.ToolsUtilLocator; |
106 | 5 | jldominguez | import org.gvsig.utils.GenericFileFilter; |
107 | 326 | cmartinez | import org.slf4j.Logger; |
108 | import org.slf4j.LoggerFactory; |
||
109 | 5 | jldominguez | |
110 | /**
|
||
111 | * Extension que proporciona controles para crear proyectos nuevos, abrirlos y
|
||
112 | 402 | mcompany | * guardarlos. Adem?s los tipos de tabla que soporta el proyecto son a?adidos en
|
113 | * esta clase.
|
||
114 | 5 | jldominguez | *
|
115 | 1714 | fdiaz | * @author gvSIG team
|
116 | 5 | jldominguez | */
|
117 | public class LayoutMainExtension extends Extension { |
||
118 | 402 | mcompany | |
119 | 326 | cmartinez | private static final Logger logger = LoggerFactory |
120 | .getLogger(FFrameView.class); |
||
121 | 402 | mcompany | |
122 | public static final String LAYOUT_TEMPLATE_FILECHOOSER_ID = "LAYOUT_TEMPLATE_FILECHOOSER_ID"; |
||
123 | |||
124 | 5 | jldominguez | private void registerIcons() { |
125 | 402 | mcompany | |
126 | 24 | jldominguez | IconThemeHelper.registerIcon("action",
|
127 | 402 | mcompany | "application-layout-template-open", this); |
128 | 606 | jjdelcerro | IconThemeHelper.registerIcon("action",
|
129 | "application-layout-new", this); |
||
130 | |||
131 | 5 | jldominguez | } |
132 | |||
133 | 605 | jjdelcerro | @Override
|
134 | 5 | jldominguez | public void initialize() { |
135 | 10 | jldominguez | registerIcons(); |
136 | 5 | jldominguez | } |
137 | |||
138 | 605 | jjdelcerro | @Override
|
139 | 5 | jldominguez | public void postInitialize() { |
140 | super.postInitialize();
|
||
141 | initializeDocumentActionsExtensionPoint(); |
||
142 | registerDocuments(); |
||
143 | registerFFrames(); |
||
144 | registerContextMenuOptions(); |
||
145 | } |
||
146 | |||
147 | 605 | jjdelcerro | |
148 | @Override
|
||
149 | 5 | jldominguez | public void execute(String actionCommand) { |
150 | 24 | jldominguez | if ("application-layout-template-open".equals(actionCommand)) { |
151 | 5 | jldominguez | openLayout(); |
152 | 605 | jjdelcerro | } else if ("application-layout-new".equals(actionCommand)) { |
153 | newLayout(); |
||
154 | 5 | jldominguez | } |
155 | } |
||
156 | |||
157 | 605 | jjdelcerro | private void newLayout() { |
158 | ApplicationManager application = ApplicationLocator.getManager(); |
||
159 | ProjectManager projectManager = ApplicationLocator.getProjectManager(); |
||
160 | I18nManager i18nManager = ToolsLocator.getI18nManager(); |
||
161 | Project project = projectManager.getCurrentProject(); |
||
162 | |||
163 | Iterator<? extends Document> documents = |
||
164 | projectManager.createDocumentsByUser(LayoutManager.TYPENAME);
|
||
165 | for (; (documents != null) && (documents.hasNext());) { |
||
166 | try {
|
||
167 | Document document = documents.next();
|
||
168 | project.addDocument(document); |
||
169 | IWindow window = document.getFactory().getMainWindow(document); |
||
170 | if (window == null) { |
||
171 | application.messageDialog( |
||
172 | i18nManager.getTranslation("error_opening_the_document"),
|
||
173 | i18nManager.getTranslation("warning"),
|
||
174 | JOptionPane.WARNING_MESSAGE
|
||
175 | ); |
||
176 | continue;
|
||
177 | } |
||
178 | application.getUIManager().addWindow( |
||
179 | window, |
||
180 | MDIManager.ALIGN_FIRST_LINE_END_CASCADE |
||
181 | ); |
||
182 | 606 | jjdelcerro | try {
|
183 | application.getUIManager().setMaximum(window, true);
|
||
184 | } catch (PropertyVetoException e) { |
||
185 | logger.info("Can't maximize layout.", e);
|
||
186 | } |
||
187 | |||
188 | 605 | jjdelcerro | } catch (Exception e) { |
189 | logger.warn("Problems creating a Layout document.",e);
|
||
190 | } |
||
191 | } |
||
192 | } |
||
193 | |||
194 | |||
195 | 5 | jldominguez | private void openLayout() { |
196 | LayoutPanel layout = null;
|
||
197 | |||
198 | 1756 | fdiaz | I18nManager i18n = ToolsLocator.getI18nManager(); |
199 | FileDialogChooserManager manager = ToolsUtilLocator.getFileDialogChooserManager(); |
||
200 | FileDialogChooser fc = manager.create("_Last_layout_template_folder");
|
||
201 | GenericFileFilter layoutMainFilter = new GenericFileFilter(
|
||
202 | LayoutManager.TEMPLATE_FILE_POINTEXT,
|
||
203 | i18n.getTranslation("_Layout_template") + " (*" |
||
204 | + LayoutManager.TEMPLATE_FILE_POINTEXT + ")"); |
||
205 | 5 | jldominguez | |
206 | 1756 | fdiaz | fc.addChoosableFileFilter(layoutMainFilter); |
207 | fc.setFileFilter(layoutMainFilter); |
||
208 | ApplicationManager application = ApplicationLocator.getApplicationManager(); |
||
209 | |||
210 | File projectfile = application.getCurrentProject().getFile();
|
||
211 | 5 | jldominguez | |
212 | 1756 | fdiaz | JPanel accesory = new LayoutExtension.AccesoryPanelForTemplates(projectfile, fc); |
213 | fc.setAccessory(accesory); |
||
214 | |||
215 | if (fc.showOpenDialog((Component) PluginServices.getMainFrame()) == JFileChooser.APPROVE_OPTION) { |
||
216 | File file = fc.getSelectedFile();
|
||
217 | 5 | jldominguez | try {
|
218 | 109 | jldominguez | if (!file.exists()) {
|
219 | /*
|
||
220 | 402 | mcompany | * The user has written a file name instead of clicking on
|
221 | * one and it does not exist
|
||
222 | 109 | jldominguez | */
|
223 | 402 | mcompany | File auxfile = new File(file.getPath() |
224 | + LayoutManager.TEMPLATE_FILE_POINTEXT);
|
||
225 | 109 | jldominguez | if (!auxfile.exists()) {
|
226 | /*
|
||
227 | * Not even this one exists: error
|
||
228 | */
|
||
229 | 402 | mcompany | throw new IOException("File does not exist: " |
230 | + file.getName()); |
||
231 | } |
||
232 | else {
|
||
233 | 109 | jldominguez | file = auxfile; |
234 | } |
||
235 | } |
||
236 | |||
237 | 5 | jldominguez | File xmlFile = new File(file.getAbsolutePath()); |
238 | FileInputStream is = new FileInputStream(xmlFile); |
||
239 | |||
240 | 402 | mcompany | PersistenceManager persistenceManager = ToolsLocator |
241 | .getPersistenceManager(); |
||
242 | PersistentState persistentState = persistenceManager |
||
243 | .loadState(is); |
||
244 | layout = (LayoutPanel) persistenceManager |
||
245 | .create(persistentState); |
||
246 | 5 | jldominguez | |
247 | 402 | mcompany | } |
248 | catch (Exception e) { |
||
249 | 109 | jldominguez | String tit = Messages.getText("_Layout_template"); |
250 | 605 | jjdelcerro | String msg;
|
251 | 402 | mcompany | |
252 | 109 | jldominguez | if (e instanceof PersistenceException) { |
253 | msg = Messages.getText("_Bad_format_in_layout_template");
|
||
254 | 402 | mcompany | } |
255 | else {
|
||
256 | 109 | jldominguez | msg = Messages.getText("_Cant_load_layout_template");
|
257 | } |
||
258 | 402 | mcompany | |
259 | 109 | jldominguez | msg = msg + ": " + file.getPath();
|
260 | msg = msg + "\n" + e.getMessage();
|
||
261 | 326 | cmartinez | logger.warn(msg, e); |
262 | 402 | mcompany | JOptionPane.showMessageDialog(ApplicationLocator.getManager()
|
263 | .getRootComponent(), msg, tit, |
||
264 | JOptionPane.ERROR_MESSAGE);
|
||
265 | 5 | jldominguez | } |
266 | 402 | mcompany | |
267 | 109 | jldominguez | if (layout == null) { |
268 | return;
|
||
269 | } |
||
270 | 5 | jldominguez | |
271 | 402 | mcompany | LayoutDocument layoutDocument = (LayoutDocument) layout |
272 | .getDocument(); |
||
273 | 119 | jldominguez | /*
|
274 | 402 | mcompany | * (LayoutDocument) ProjectManager.getInstance().createDocument(
|
275 | * DefaultLayoutManager.TYPENAME, file.getName());
|
||
276 | */
|
||
277 | |||
278 | 119 | jldominguez | Project p = ApplicationLocator.getManager().getProjectManager() |
279 | 5 | jldominguez | .getCurrentProject(); |
280 | 326 | cmartinez | p.addDocument(layoutDocument); |
281 | 402 | mcompany | |
282 | 33 | jldominguez | layout.getLayoutControl().setTool("layoutselect");
|
283 | 402 | mcompany | |
284 | 119 | jldominguez | LayoutManager lm = (LayoutManager) layoutDocument.getFactory(); |
285 | layout.setLayoutManager(lm); |
||
286 | 402 | mcompany | |
287 | 5 | jldominguez | PluginServices.getMDIManager().addWindow(layout); |
288 | |||
289 | } |
||
290 | } |
||
291 | |||
292 | private void registerDocuments() { |
||
293 | DefaultLayoutManager.register(); |
||
294 | } |
||
295 | 402 | mcompany | |
296 | 5 | jldominguez | private void registerFFrames() { |
297 | 402 | mcompany | DefaultLayoutManager layoutManager = (DefaultLayoutManager) ProjectManager |
298 | .getInstance() |
||
299 | 5 | jldominguez | .getDocumentManager(DefaultLayoutManager.TYPENAME); |
300 | 402 | mcompany | |
301 | 5 | jldominguez | // Register Frames
|
302 | layoutManager.registerFrameFactory(new FFrameBasicFactory());
|
||
303 | layoutManager.registerFrameFactory(new FFrameGraphicsFactory());
|
||
304 | layoutManager.registerFrameFactory(new FFrameGroupFactory());
|
||
305 | layoutManager.registerFrameFactory(new FFrameLegendFactory());
|
||
306 | layoutManager.registerFrameFactory(new FFrameNorthFactory());
|
||
307 | layoutManager.registerFrameFactory(new FFrameOverViewFactory());
|
||
308 | layoutManager.registerFrameFactory(new FFramePictureFactory());
|
||
309 | layoutManager.registerFrameFactory(new FFrameScaleBarFactory());
|
||
310 | layoutManager.registerFrameFactory(new FFrameSymbolFactory());
|
||
311 | layoutManager.registerFrameFactory(new FFrameTableFactory());
|
||
312 | layoutManager.registerFrameFactory(new FFrameTextFactory());
|
||
313 | layoutManager.registerFrameFactory(new FFrameViewFactory());
|
||
314 | layoutManager.registerFrameFactory(new FFrameGridFactory());
|
||
315 | |||
316 | // Register FFrameDialogs forms
|
||
317 | layoutManager.registerFFrameDialog( |
||
318 | 402 | mcompany | FFrameGraphics.PERSISTENCE_DEFINITION_NAME, |
319 | FFrameGraphicsDialog.class); |
||
320 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
321 | 402 | mcompany | FFrameSymbol.PERSISTENCE_DEFINITION_NAME, |
322 | FFrameGraphicsDialog.class); |
||
323 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
324 | 402 | mcompany | FFrameGroup.PERSISTENCE_DEFINITION_NAME, |
325 | FFrameGroupDialog.class); |
||
326 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
327 | 402 | mcompany | FFrameTable.PERSISTENCE_DEFINITION_NAME, FFrameBoxDialog.class); |
328 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
329 | 402 | mcompany | FFrameLegend.PERSISTENCE_DEFINITION_NAME, |
330 | FFrameLegendDialog.class); |
||
331 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
332 | 402 | mcompany | FFramePicture.PERSISTENCE_DEFINITION_NAME, |
333 | FFramePictureDialog.class); |
||
334 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
335 | 402 | mcompany | FFrameNorth.PERSISTENCE_DEFINITION_NAME, |
336 | FFrameNorthDialog.class); |
||
337 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
338 | 402 | mcompany | FFrameScaleBar.PERSISTENCE_DEFINITION_NAME, |
339 | FFrameScaleBarDialog.class); |
||
340 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
341 | 402 | mcompany | FFrameText.PERSISTENCE_DEFINITION_NAME, FFrameTextDialog.class); |
342 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
343 | 402 | mcompany | FFrameView.PERSISTENCE_DEFINITION_NAME, FFrameViewDialog.class); |
344 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
345 | 402 | mcompany | FFrameOverView.PERSISTENCE_DEFINITION_NAME, |
346 | FFrameOverViewDialog.class); |
||
347 | 5 | jldominguez | layoutManager.registerFFrameDialog( |
348 | 402 | mcompany | FFrameGrid.PERSISTENCE_DEFINITION_NAME, FFrameGridDialog.class); |
349 | |||
350 | 5 | jldominguez | FFrame.initializeIcons(); |
351 | FFrameTable.initializeIcons(); |
||
352 | } |
||
353 | 402 | mcompany | |
354 | 5 | jldominguez | private void registerContextMenuOptions() { |
355 | 402 | mcompany | LayoutManager layoutManager = (LayoutManager) ProjectManager |
356 | .getInstance().getDocumentManager("project.document.layout");
|
||
357 | |||
358 | layoutManager.registerLayoutMenuAction("Terminate",
|
||
359 | TerminateLayoutMenuEntry.class); |
||
360 | layoutManager.registerLayoutMenuAction("Cancel",
|
||
361 | CancelLayoutMenuEntry.class); |
||
362 | layoutManager.registerLayoutMenuAction("Copy",
|
||
363 | CopyLayoutMenuEntry.class); |
||
364 | 5 | jldominguez | layoutManager.registerLayoutMenuAction("Cut", CutLayoutMenuEntry.class);
|
365 | 402 | mcompany | layoutManager.registerLayoutMenuAction("Paste",
|
366 | PasteLayoutMenuEntry.class); |
||
367 | layoutManager.registerLayoutMenuAction("Simplify",
|
||
368 | SimplifyLayoutMenuEntry.class); |
||
369 | layoutManager.registerLayoutMenuAction("Property",
|
||
370 | PropertyLayoutMenuEntry.class); |
||
371 | layoutManager.registerLayoutMenuAction("SelectAll",
|
||
372 | SelectAllLayoutMenuEntry.class); |
||
373 | layoutManager.registerLayoutMenuAction("Behind",
|
||
374 | BehindLayoutMenuEntry.class); |
||
375 | layoutManager.registerLayoutMenuAction("Before",
|
||
376 | BeforeLayoutMenuEntry.class); |
||
377 | layoutManager.registerLayoutMenuAction("Position",
|
||
378 | PositionLayoutMenuEntry.class); |
||
379 | layoutManager.registerLayoutMenuAction("Refresh",
|
||
380 | RefreshLayoutMenuEntry.class); |
||
381 | |||
382 | 5 | jldominguez | } |
383 | |||
384 | private void initializeDocumentActionsExtensionPoint() { |
||
385 | ExtensionPointManager epMan = ToolsLocator.getExtensionPointManager(); |
||
386 | 402 | mcompany | epMan.add( |
387 | "DocumentActions_Map",
|
||
388 | "Context menu options of the map document list"
|
||
389 | + " in the project window "
|
||
390 | + "(register instances of "
|
||
391 | + "org.gvsig.app.project.AbstractDocumentContextMenuAction)");
|
||
392 | 5 | jldominguez | } |
393 | |||
394 | 605 | jjdelcerro | @Override
|
395 | 5 | jldominguez | public boolean isEnabled() { |
396 | return true; |
||
397 | } |
||
398 | |||
399 | 605 | jjdelcerro | @Override
|
400 | 5 | jldominguez | public boolean isVisible() { |
401 | return true; |
||
402 | } |
||
403 | } |