0001: /*
0002: * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
0003: * for visualizing and manipulating spatial features with geometry and attributes.
0004: *
0005: * Copyright (C) 2003 Vivid Solutions
0006: *
0007: * This program is free software; you can redistribute it and/or
0008: * modify it under the terms of the GNU General Public License
0009: * as published by the Free Software Foundation; either version 2
0010: * of the License, or (at your option) any later version.
0011: *
0012: * This program is distributed in the hope that it will be useful,
0013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0015: * GNU General Public License for more details.
0016: *
0017: * You should have received a copy of the GNU General Public License
0018: * along with this program; if not, write to the Free Software
0019: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
0020: *
0021: * For more information, contact:
0022: *
0023: * Vivid Solutions
0024: * Suite #1A
0025: * 2328 Government Street
0026: * Victoria BC V8T 5G5
0027: * Canada
0028: *
0029: * (250)385-6040
0030: * www.vividsolutions.com
0031: */
0032: package com.vividsolutions.jump.workbench;
0033:
0034: import com.vividsolutions.jts.util.*;
0035: import org.openjump.OpenJumpConfiguration;
0036: import com.vividsolutions.jump.I18N;
0037:
0038: import com.vividsolutions.jump.datastore.*;
0039: import com.vividsolutions.jump.datastore.postgis.*;
0040: import com.vividsolutions.jump.workbench.datasource.*;
0041: import com.vividsolutions.jump.workbench.datastore.*;
0042: import com.vividsolutions.jump.workbench.datasource.LoadDatasetPlugIn;
0043: import com.vividsolutions.jump.workbench.datasource.SaveDatasetAsPlugIn;
0044: import com.vividsolutions.jump.workbench.plugin.*;
0045: import com.vividsolutions.jump.workbench.ui.*;
0046: import com.vividsolutions.jump.workbench.ui.cursortool.*;
0047: import com.vividsolutions.jump.workbench.ui.cursortool.editing.*;
0048: import com.vividsolutions.jump.workbench.ui.plugin.*;
0049: import com.vividsolutions.jump.workbench.ui.plugin.analysis.*;
0050: import com.vividsolutions.jump.workbench.ui.plugin.clipboard.*;
0051: import com.vividsolutions.jump.workbench.ui.plugin.datastore.*;
0052: import com.vividsolutions.jump.workbench.ui.plugin.imagery.AddImageLayerPlugIn;
0053: import com.vividsolutions.jump.workbench.ui.plugin.imagery.ImageLayerManagerPlugIn;
0054: import com.vividsolutions.jump.workbench.ui.plugin.imagery.InstallReferencedImageFactoriesPlugin;
0055: import com.vividsolutions.jump.workbench.ui.plugin.scalebar.*;
0056: import com.vividsolutions.jump.workbench.ui.plugin.skin.InstallSkinsPlugIn;
0057: import com.vividsolutions.jump.workbench.ui.plugin.test.*;
0058: import com.vividsolutions.jump.workbench.ui.plugin.wms.*;
0059: import com.vividsolutions.jump.workbench.ui.renderer.style.*;
0060: import com.vividsolutions.jump.workbench.ui.snap.*;
0061: import com.vividsolutions.jump.workbench.ui.style.*;
0062: import com.vividsolutions.jump.workbench.ui.task.*;
0063: import com.vividsolutions.jump.workbench.ui.warp.*;
0064: import com.vividsolutions.jump.workbench.ui.zoom.*;
0065: import com.vividsolutions.jump.plugin.qa.*;
0066: import com.vividsolutions.jump.plugin.edit.*;
0067:
0068: //import de.latlon.deejump.plugin.style.DeeChangeStylesPlugIn;
0069:
0070: import java.awt.event.*;
0071: import java.lang.reflect.*;
0072: import javax.swing.*;
0073:
0074: /**
0075: * Initializes the Workbench with various menus and cursor tools. Accesses the
0076: * Workbench structure through a WorkbenchContext.
0077: */
0078: public class JUMPConfiguration implements Setup {
0079:
0080: /**
0081: * Built-in plugins must be defined as instance variables, since
0082: * they are located for iniatialization via reflection on this class
0083: */
0084: private InstallScaleBarPlugIn installScaleBarPlugIn = new InstallScaleBarPlugIn();
0085:
0086: private InstallGridPlugIn installGridPlugIn = new InstallGridPlugIn();
0087:
0088: private PersistentBlackboardPlugIn persistentBlackboardPlugIn = new PersistentBlackboardPlugIn();
0089:
0090: //FirstTaskFramePlugIn will be initialized using reflection in
0091: // #initializePlugIns [Jon Aquino]
0092: private FirstTaskFramePlugIn firstTaskFramePlugIn = new FirstTaskFramePlugIn();
0093:
0094: private InstallZoomBarPlugIn installZoomBarPlugIn = new InstallZoomBarPlugIn();
0095:
0096: private MoveLayerablePlugIn moveUpPlugIn = MoveLayerablePlugIn.UP;
0097:
0098: private InstallStandardDataSourceQueryChoosersPlugIn installStandardDataSourceQueryChoosersPlugIn = new InstallStandardDataSourceQueryChoosersPlugIn();
0099:
0100: private InstallStandardFeatureTextWritersPlugIn installStandardFeatureTextWritersPlugIn = new InstallStandardFeatureTextWritersPlugIn();
0101:
0102: private ShortcutKeysPlugIn shortcutKeysPlugIn = new ShortcutKeysPlugIn();
0103:
0104: private ClearSelectionPlugIn clearSelectionPlugIn = new ClearSelectionPlugIn();
0105:
0106: private EditWMSQueryPlugIn editWMSQueryPlugIn = new EditWMSQueryPlugIn();
0107:
0108: private MoveLayerablePlugIn moveDownPlugIn = MoveLayerablePlugIn.DOWN;
0109:
0110: private AddWMSQueryPlugIn addWMSQueryPlugIn = new AddWMSQueryPlugIn();
0111:
0112: private AddNewFeaturesPlugIn addNewFeaturesPlugIn = new AddNewFeaturesPlugIn();
0113:
0114: private OptionsPlugIn optionsPlugIn = new OptionsPlugIn();
0115:
0116: private AddNewCategoryPlugIn addNewCategoryPlugIn = new AddNewCategoryPlugIn();
0117:
0118: private CloneWindowPlugIn cloneWindowPlugIn = new CloneWindowPlugIn();
0119:
0120: private CopySelectedItemsPlugIn copySelectedItemsPlugIn = new CopySelectedItemsPlugIn();
0121:
0122: private CopyThisCoordinatePlugIn copyThisCoordinatePlugIn = new CopyThisCoordinatePlugIn();
0123:
0124: private CopyImagePlugIn copyImagePlugIn = new CopyImagePlugIn();
0125:
0126: private MapToolTipsPlugIn toolTipsPlugIn = new MapToolTipsPlugIn();
0127:
0128: private CopySelectedLayersPlugIn copySelectedLayersPlugIn = new CopySelectedLayersPlugIn();
0129:
0130: private AddNewLayerPlugIn addNewLayerPlugIn = new AddNewLayerPlugIn();
0131:
0132: private AddWMSDemoBoxEasterEggPlugIn addWMSDemoBoxEasterEggPlugIn = new AddWMSDemoBoxEasterEggPlugIn();
0133:
0134: private EditSelectedFeaturePlugIn editSelectedFeaturePlugIn = new EditSelectedFeaturePlugIn();
0135:
0136: private EditingPlugIn editingPlugIn = new EditingPlugIn();
0137:
0138: private EditablePlugIn editablePlugIn = new EditablePlugIn(
0139: editingPlugIn);
0140:
0141: // [Michael Michaud 2007-03-23] Moved BeanShellPlugIn initialization in OpenJUMPConfiguration
0142: // private BeanShellPlugIn beanShellPlugIn = new BeanShellPlugIn();
0143:
0144: private LoadDatasetPlugIn loadDatasetPlugIn = new LoadDatasetPlugIn();
0145: //private LoadDatasetFromFilePlugIn loadDatasetFromFilePlugIn = new LoadDatasetFromFilePlugIn();
0146: private SaveDatasetAsPlugIn saveDatasetAsPlugIn = new SaveDatasetAsPlugIn();
0147: //private SaveDatasetAsFilePlugIn saveDatasetAsFilePlugIn = new SaveDatasetAsFilePlugIn();
0148: private SaveImageAsPlugIn saveImageAsPlugIn = new SaveImageAsPlugIn();
0149:
0150: private GenerateLogPlugIn generateLogPlugIn = new GenerateLogPlugIn();
0151:
0152: private NewTaskPlugIn newTaskPlugIn = new NewTaskPlugIn();
0153:
0154: private OpenProjectPlugIn openProjectPlugIn = new OpenProjectPlugIn();
0155:
0156: private PasteItemsPlugIn pasteItemsPlugIn = new PasteItemsPlugIn();
0157:
0158: private PasteLayersPlugIn pasteLayersPlugIn = new PasteLayersPlugIn();
0159:
0160: private DeleteAllFeaturesPlugIn deleteAllFeaturesPlugIn = new DeleteAllFeaturesPlugIn();
0161:
0162: private DeleteSelectedItemsPlugIn deleteSelectedItemsPlugIn = new DeleteSelectedItemsPlugIn();
0163:
0164: private RemoveSelectedLayersPlugIn removeSelectedLayersPlugIn = new RemoveSelectedLayersPlugIn();
0165:
0166: private RemoveSelectedCategoriesPlugIn removeSelectedCategoriesPlugIn = new RemoveSelectedCategoriesPlugIn();
0167:
0168: private SaveProjectAsPlugIn saveProjectAsPlugIn = new SaveProjectAsPlugIn();
0169:
0170: private SaveProjectPlugIn saveProjectPlugIn = new SaveProjectPlugIn(
0171: saveProjectAsPlugIn);
0172:
0173: private SelectFeaturesInFencePlugIn selectFeaturesInFencePlugIn = new SelectFeaturesInFencePlugIn();
0174:
0175: private ScaleBarPlugIn scaleBarPlugIn = new ScaleBarPlugIn();
0176:
0177: private ZoomBarPlugIn zoomBarPlugIn = new ZoomBarPlugIn();
0178:
0179: // [sstein, 01.08.2006] commented out for test reasons with DeeChangeStylePlugIn
0180: // [sstein, 27.09.2006] comment in - problem with colour theming
0181: private ChangeStylesPlugIn changeStylesPlugIn = new ChangeStylesPlugIn();
0182:
0183: private UndoPlugIn undoPlugIn = new UndoPlugIn();
0184:
0185: private RedoPlugIn redoPlugIn = new RedoPlugIn();
0186:
0187: private ViewAttributesPlugIn viewAttributesPlugIn = new ViewAttributesPlugIn();
0188:
0189: private ViewSchemaPlugIn viewSchemaPlugIn = new ViewSchemaPlugIn(
0190: editingPlugIn);
0191:
0192: private FeatureInfoPlugIn featureInfoPlugIn = new FeatureInfoPlugIn();
0193:
0194: private OutputWindowPlugIn outputWindowPlugIn = new OutputWindowPlugIn();
0195:
0196: private VerticesInFencePlugIn verticesInFencePlugIn = new VerticesInFencePlugIn();
0197:
0198: private ZoomNextPlugIn zoomNextPlugIn = new ZoomNextPlugIn();
0199:
0200: private ZoomToClickPlugIn zoomToClickPlugIn = new ZoomToClickPlugIn(
0201: 0.5);
0202:
0203: private ZoomPreviousPlugIn zoomPreviousPlugIn = new ZoomPreviousPlugIn();
0204:
0205: private ZoomToFencePlugIn zoomToFencePlugIn = new ZoomToFencePlugIn();
0206:
0207: private ZoomToCoordinatePlugIn zoomToCoordinatePlugIn = new ZoomToCoordinatePlugIn();
0208:
0209: private ZoomToFullExtentPlugIn zoomToFullExtentPlugIn = new ZoomToFullExtentPlugIn();
0210:
0211: private ZoomToLayerPlugIn zoomToLayerPlugIn = new ZoomToLayerPlugIn();
0212:
0213: private ZoomToSelectedItemsPlugIn zoomToSelectedItemsPlugIn = new ZoomToSelectedItemsPlugIn();
0214:
0215: private CutSelectedItemsPlugIn cutSelectedItemsPlugIn = new CutSelectedItemsPlugIn();
0216:
0217: private CutSelectedLayersPlugIn cutSelectedLayersPlugIn = new CutSelectedLayersPlugIn();
0218:
0219: private CopyStylesPlugIn copyStylesPlugIn = new CopyStylesPlugIn();
0220:
0221: private PasteStylesPlugIn pasteStylesPlugIn = new PasteStylesPlugIn();
0222:
0223: private CombineSelectedFeaturesPlugIn combineSelectedFeaturesPlugIn = new CombineSelectedFeaturesPlugIn();
0224:
0225: private ExplodeSelectedFeaturesPlugIn explodeSelectedFeaturesPlugIn = new ExplodeSelectedFeaturesPlugIn();
0226:
0227: private InstallSkinsPlugIn installSkinsPlugIn = new InstallSkinsPlugIn();
0228:
0229: //[ssein 01.08.2006] -- added for test reasons
0230: //[sstein, 27.09.2006] comment out - problem with colour theming reported by Ole
0231: //private DeeChangeStylesPlugIn changeStylesPlugIn = new DeeChangeStylesPlugIn();
0232:
0233: private InstallReferencedImageFactoriesPlugin installReferencedImageFactoriesPlugin = new InstallReferencedImageFactoriesPlugin();
0234:
0235: private ImageLayerManagerPlugIn imageLayerManagerPlugIn = new ImageLayerManagerPlugIn();
0236:
0237: private RefreshDataStoreLayerPlugin refreshDataStoreLayerPlugin = new RefreshDataStoreLayerPlugin();
0238:
0239: public void setup(WorkbenchContext workbenchContext)
0240: throws Exception {
0241: configureStyles(workbenchContext);
0242: configureDatastores(workbenchContext);
0243:
0244: workbenchContext.getWorkbench().getBlackboard().put(
0245: SnapToVerticesPolicy.ENABLED_KEY, true);
0246:
0247: EnableCheckFactory checkFactory = new EnableCheckFactory(
0248: workbenchContext);
0249: FeatureInstaller featureInstaller = new FeatureInstaller(
0250: workbenchContext);
0251: configureToolBar(workbenchContext, checkFactory);
0252: configureMainMenus(workbenchContext, checkFactory,
0253: featureInstaller);
0254: configureLayerPopupMenu(workbenchContext, featureInstaller,
0255: checkFactory);
0256: configureAttributePopupMenu(workbenchContext, featureInstaller,
0257: checkFactory);
0258: configureWMSQueryNamePopupMenu(workbenchContext,
0259: featureInstaller, checkFactory);
0260: configureCategoryPopupMenu(workbenchContext, featureInstaller);
0261: configureLayerViewPanelPopupMenu(workbenchContext,
0262: checkFactory, featureInstaller);
0263:
0264: /********************************************
0265: * [sstein] 11.08.2005
0266: * the following line calls the new OpenJump plugins
0267: *******************************************/
0268: OpenJumpConfiguration.loadOpenJumpPlugIns(workbenchContext);
0269:
0270: //Call #initializeBuiltInPlugIns after #configureToolBar so that any
0271: // plug-ins that
0272: //add items to the toolbar will add them to the *end* of the toolbar.
0273: // [Jon Aquino]
0274: initializeBuiltInPlugIns(workbenchContext);
0275: }
0276:
0277: private void configureCategoryPopupMenu(
0278: WorkbenchContext workbenchContext,
0279: FeatureInstaller featureInstaller) {
0280: featureInstaller.addPopupMenuItem(workbenchContext
0281: .getWorkbench().getFrame().getCategoryPopupMenu(),
0282: addNewLayerPlugIn, addNewLayerPlugIn.getName(), false,
0283: null, null);
0284:
0285: //[sstein 20.01.2006] added again after user request
0286: featureInstaller.addPopupMenuItem(workbenchContext
0287: .getWorkbench().getFrame().getCategoryPopupMenu(),
0288: loadDatasetPlugIn, loadDatasetPlugIn.getName() + "...",
0289: false, LoadDatasetPlugIn.getIcon(), LoadDatasetPlugIn
0290: .createEnableCheck(workbenchContext));
0291: //--
0292: /*featureInstaller.addPopupMenuItem(workbenchContext.getWorkbench()
0293: .getFrame().getCategoryPopupMenu(), loadDatasetFromFilePlugIn,
0294: loadDatasetFromFilePlugIn.getName() + "...", false, null,
0295: LoadDatasetPlugIn.createEnableCheck(workbenchContext));*/
0296: featureInstaller.addPopupMenuItem(workbenchContext
0297: .getWorkbench().getFrame().getCategoryPopupMenu(),
0298: addDatastoreLayerPlugIn, addDatastoreLayerPlugIn
0299: .getName()
0300: + "...", false, null, null);
0301: featureInstaller.addPopupMenuItem(workbenchContext
0302: .getWorkbench().getFrame().getCategoryPopupMenu(),
0303: addWMSQueryPlugIn, addWMSQueryPlugIn.getName() + "...",
0304: false, null, null);
0305: featureInstaller.addPopupMenuItem(workbenchContext
0306: .getWorkbench().getFrame().getCategoryPopupMenu(),
0307: addImageLayerPlugIn, addImageLayerPlugIn.getName()
0308: + "...", false, null, null);
0309: featureInstaller.addPopupMenuItem(workbenchContext
0310: .getWorkbench().getFrame().getCategoryPopupMenu(),
0311: pasteLayersPlugIn, pasteLayersPlugIn
0312: .getNameWithMnemonic(), false, null,
0313: pasteLayersPlugIn.createEnableCheck(workbenchContext));
0314: featureInstaller.addPopupMenuItem(workbenchContext
0315: .getWorkbench().getFrame().getCategoryPopupMenu(),
0316: removeSelectedCategoriesPlugIn,
0317: removeSelectedCategoriesPlugIn.getName(), false, null,
0318: removeSelectedCategoriesPlugIn
0319: .createEnableCheck(workbenchContext));
0320: }
0321:
0322: private void configureWMSQueryNamePopupMenu(
0323: final WorkbenchContext workbenchContext,
0324: FeatureInstaller featureInstaller,
0325: EnableCheckFactory checkFactory) {
0326: JPopupMenu wmsLayerNamePopupMenu = workbenchContext
0327: .getWorkbench().getFrame().getWMSLayerNamePopupMenu();
0328: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0329: editWMSQueryPlugIn, editWMSQueryPlugIn.getName()
0330: + "...", false, null, editWMSQueryPlugIn
0331: .createEnableCheck(workbenchContext));
0332: wmsLayerNamePopupMenu.addSeparator(); // ===================
0333: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0334: moveUpPlugIn, moveUpPlugIn.getName(), false, null,
0335: moveUpPlugIn.createEnableCheck(workbenchContext));
0336: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0337: moveDownPlugIn, moveDownPlugIn.getName(), false, null,
0338: moveDownPlugIn.createEnableCheck(workbenchContext));
0339: wmsLayerNamePopupMenu.addSeparator(); // ===================
0340: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0341: cutSelectedLayersPlugIn, cutSelectedLayersPlugIn
0342: .getNameWithMnemonic(), false, null,
0343: cutSelectedLayersPlugIn
0344: .createEnableCheck(workbenchContext));
0345: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0346: copySelectedLayersPlugIn, copySelectedLayersPlugIn
0347: .getNameWithMnemonic(), false, null,
0348: copySelectedLayersPlugIn
0349: .createEnableCheck(workbenchContext));
0350: featureInstaller.addPopupMenuItem(wmsLayerNamePopupMenu,
0351: removeSelectedLayersPlugIn, removeSelectedLayersPlugIn
0352: .getName(), false, null,
0353: removeSelectedLayersPlugIn
0354: .createEnableCheck(workbenchContext));
0355: }
0356:
0357: private void configureAttributePopupMenu(
0358: final WorkbenchContext workbenchContext,
0359: FeatureInstaller featureInstaller,
0360: EnableCheckFactory checkFactory) {
0361: AttributeTab.addPopupMenuItem(workbenchContext, editablePlugIn,
0362: editablePlugIn.getName(), true, null, editablePlugIn
0363: .createEnableCheck(workbenchContext));
0364: AttributeTab.addPopupMenuItem(workbenchContext,
0365: featureInfoPlugIn, featureInfoPlugIn.getName(), false,
0366: GUIUtil.toSmallIcon(FeatureInfoTool.ICON),
0367: FeatureInfoPlugIn.createEnableCheck(workbenchContext));
0368: AttributeTab.addPopupMenuItem(workbenchContext,
0369: viewSchemaPlugIn, viewSchemaPlugIn.getName(), false,
0370: ViewSchemaPlugIn.ICON, ViewSchemaPlugIn
0371: .createEnableCheck(workbenchContext));
0372: AttributeTab.addPopupMenuItem(workbenchContext,
0373: cutSelectedItemsPlugIn, cutSelectedItemsPlugIn
0374: .getName(), false, null, cutSelectedItemsPlugIn
0375: .createEnableCheck(workbenchContext));
0376: AttributeTab.addPopupMenuItem(workbenchContext,
0377: copySelectedItemsPlugIn, copySelectedItemsPlugIn
0378: .getNameWithMnemonic(), false, null,
0379: CopySelectedItemsPlugIn
0380: .createEnableCheck(workbenchContext));
0381: AttributeTab.addPopupMenuItem(workbenchContext,
0382: deleteSelectedItemsPlugIn, deleteSelectedItemsPlugIn
0383: .getName(), false, null,
0384: DeleteSelectedItemsPlugIn
0385: .createEnableCheck(workbenchContext));
0386: }
0387:
0388: private void configureLayerPopupMenu(
0389: final WorkbenchContext workbenchContext,
0390: FeatureInstaller featureInstaller,
0391: EnableCheckFactory checkFactory) {
0392:
0393: JPopupMenu layerNamePopupMenu = workbenchContext.getWorkbench()
0394: .getFrame().getLayerNamePopupMenu();
0395:
0396: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0397: editablePlugIn, editablePlugIn.getName(), true, null,
0398: editablePlugIn.createEnableCheck(workbenchContext));
0399:
0400: layerNamePopupMenu.addSeparator(); // ===================
0401: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0402: zoomToLayerPlugIn, zoomToLayerPlugIn.getName(), false,
0403: null, zoomToLayerPlugIn
0404: .createEnableCheck(workbenchContext));
0405: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0406: changeStylesPlugIn, changeStylesPlugIn.getName()
0407: + "...", false, GUIUtil
0408: .toSmallIcon(changeStylesPlugIn.getIcon()),
0409: changeStylesPlugIn.createEnableCheck(workbenchContext));
0410: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0411: copyStylesPlugIn, copyStylesPlugIn.getName(), false,
0412: null, CopyStylesPlugIn
0413: .createEnableCheck(workbenchContext));
0414: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0415: pasteStylesPlugIn, pasteStylesPlugIn.getName(), false,
0416: null, PasteStylesPlugIn
0417: .createEnableCheck(workbenchContext));
0418:
0419: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0420: viewAttributesPlugIn, viewAttributesPlugIn.getName(),
0421: false, GUIUtil.toSmallIcon(viewAttributesPlugIn
0422: .getIcon()), viewAttributesPlugIn
0423: .createEnableCheck(workbenchContext));
0424: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0425: viewSchemaPlugIn, viewSchemaPlugIn.getName(), false,
0426: ViewSchemaPlugIn.ICON, ViewSchemaPlugIn
0427: .createEnableCheck(workbenchContext));
0428:
0429: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0430: imageLayerManagerPlugIn, imageLayerManagerPlugIn
0431: .getName()
0432: + "...", false, null, ImageLayerManagerPlugIn
0433: .createEnableCheck(workbenchContext));
0434:
0435: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0436: refreshDataStoreLayerPlugin,
0437: refreshDataStoreLayerPlugin.getName() + "...", false,
0438: null, RefreshDataStoreLayerPlugin
0439: .createEnableCheck(workbenchContext));
0440:
0441: layerNamePopupMenu.addSeparator(); // ===================
0442: /*featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0443: saveDatasetAsFilePlugIn, saveDatasetAsFilePlugIn.getName() + "...",
0444: false, null, AbstractSaveDatasetAsPlugIn
0445: .createEnableCheck(workbenchContext));*/
0446: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0447: saveDatasetAsPlugIn, saveDatasetAsPlugIn.getName()
0448: + "...", false, null,
0449: AbstractSaveDatasetAsPlugIn
0450: .createEnableCheck(workbenchContext));
0451:
0452: layerNamePopupMenu.addSeparator(); // ===================
0453: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0454: moveUpPlugIn, moveUpPlugIn.getName(), false, null,
0455: moveUpPlugIn.createEnableCheck(workbenchContext));
0456: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0457: moveDownPlugIn, moveDownPlugIn.getName(), false, null,
0458: moveDownPlugIn.createEnableCheck(workbenchContext));
0459:
0460: layerNamePopupMenu.addSeparator(); // ===================
0461: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0462: cutSelectedLayersPlugIn, cutSelectedLayersPlugIn
0463: .getNameWithMnemonic(), false, null,
0464: cutSelectedLayersPlugIn
0465: .createEnableCheck(workbenchContext));
0466: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0467: copySelectedLayersPlugIn, copySelectedLayersPlugIn
0468: .getNameWithMnemonic(), false, null,
0469: copySelectedLayersPlugIn
0470: .createEnableCheck(workbenchContext));
0471: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0472: removeSelectedLayersPlugIn, removeSelectedLayersPlugIn
0473: .getName(), false, null,
0474: removeSelectedLayersPlugIn
0475: .createEnableCheck(workbenchContext));
0476:
0477: layerNamePopupMenu.addSeparator(); // ===================
0478: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0479: addNewFeaturesPlugIn, addNewFeaturesPlugIn.getName()
0480: + "...", false, null, AddNewFeaturesPlugIn
0481: .createEnableCheck(workbenchContext));
0482:
0483: //<<TODO:REFACTORING>> JUMPConfiguration is polluted with a lot of
0484: // EnableCheck
0485: //logic. This logic should simply be moved to the individual PlugIns.
0486: // [Jon Aquino]
0487: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0488: pasteItemsPlugIn, pasteItemsPlugIn
0489: .getNameWithMnemonic(), false, null,
0490: PasteItemsPlugIn.createEnableCheck(workbenchContext));
0491: featureInstaller.addPopupMenuItem(layerNamePopupMenu,
0492: deleteAllFeaturesPlugIn, deleteAllFeaturesPlugIn
0493: .getName(), false, null,
0494: deleteAllFeaturesPlugIn
0495: .createEnableCheck(workbenchContext));
0496: }
0497:
0498: private void configureLayerViewPanelPopupMenu(
0499: WorkbenchContext workbenchContext,
0500: EnableCheckFactory checkFactory,
0501: FeatureInstaller featureInstaller) {
0502: JPopupMenu popupMenu = LayerViewPanel.popupMenu();
0503: featureInstaller.addPopupMenuItem(popupMenu, featureInfoPlugIn,
0504: featureInfoPlugIn.getName(), false, GUIUtil
0505: .toSmallIcon(FeatureInfoTool.ICON),
0506: FeatureInfoPlugIn.createEnableCheck(workbenchContext));
0507: featureInstaller
0508: .addPopupMenuItem(
0509: popupMenu,
0510: verticesInFencePlugIn,
0511: verticesInFencePlugIn.getName(),
0512: false,
0513: null,
0514: new MultiEnableCheck()
0515: .add(
0516: checkFactory
0517: .createWindowWithLayerViewPanelMustBeActiveCheck())
0518: .add(
0519: checkFactory
0520: .createFenceMustBeDrawnCheck()));
0521: popupMenu.addSeparator(); // ===================
0522: featureInstaller
0523: .addPopupMenuItem(
0524: popupMenu,
0525: zoomToFencePlugIn,
0526: I18N.get("JUMPConfiguration.fence"),
0527: false,
0528: GUIUtil
0529: .toSmallIcon(zoomToFencePlugIn
0530: .getIcon()),
0531: new MultiEnableCheck()
0532: .add(
0533: checkFactory
0534: .createWindowWithLayerViewPanelMustBeActiveCheck())
0535: .add(
0536: checkFactory
0537: .createFenceMustBeDrawnCheck()));
0538: featureInstaller.addPopupMenuItem(popupMenu,
0539: zoomToSelectedItemsPlugIn, zoomToSelectedItemsPlugIn
0540: .getName(), false, GUIUtil
0541: .toSmallIcon(zoomToSelectedItemsPlugIn
0542: .getIcon()), ZoomToSelectedItemsPlugIn
0543: .createEnableCheck(workbenchContext));
0544: featureInstaller.addPopupMenuItem(popupMenu, zoomToClickPlugIn,
0545: I18N.get("JUMPConfiguration.zoom-out"), false, null,
0546: null);
0547: popupMenu.addSeparator(); // ===================
0548: featureInstaller.addPopupMenuItem(popupMenu,
0549: selectFeaturesInFencePlugIn,
0550: selectFeaturesInFencePlugIn.getName(), false, null,
0551: SelectFeaturesInFencePlugIn
0552: .createEnableCheck(workbenchContext));
0553: featureInstaller.addPopupMenuItem(popupMenu,
0554: cutSelectedItemsPlugIn, cutSelectedItemsPlugIn
0555: .getName(), false, null, cutSelectedItemsPlugIn
0556: .createEnableCheck(workbenchContext));
0557: featureInstaller.addPopupMenuItem(popupMenu,
0558: copySelectedItemsPlugIn, copySelectedItemsPlugIn
0559: .getNameWithMnemonic(), false, null,
0560: CopySelectedItemsPlugIn
0561: .createEnableCheck(workbenchContext));
0562: featureInstaller.addPopupMenuItem(popupMenu,
0563: copyThisCoordinatePlugIn, copyThisCoordinatePlugIn
0564: .getName(), false, null,
0565: CopyThisCoordinatePlugIn
0566: .createEnableCheck(workbenchContext));
0567: featureInstaller.addPopupMenuItem(popupMenu,
0568: editSelectedFeaturePlugIn, editSelectedFeaturePlugIn
0569: .getName(), false, null,
0570: EditSelectedFeaturePlugIn
0571: .createEnableCheck(workbenchContext));
0572: featureInstaller.addPopupMenuItem(popupMenu,
0573: deleteSelectedItemsPlugIn, deleteSelectedItemsPlugIn
0574: .getName(), false, null,
0575: DeleteSelectedItemsPlugIn
0576: .createEnableCheck(workbenchContext));
0577: featureInstaller.addPopupMenuItem(popupMenu,
0578: combineSelectedFeaturesPlugIn,
0579: combineSelectedFeaturesPlugIn.getName(), false, null,
0580: combineSelectedFeaturesPlugIn
0581: .createEnableCheck(workbenchContext));
0582: featureInstaller.addPopupMenuItem(popupMenu,
0583: explodeSelectedFeaturesPlugIn,
0584: explodeSelectedFeaturesPlugIn.getName(), false, null,
0585: explodeSelectedFeaturesPlugIn
0586: .createEnableCheck(workbenchContext));
0587: }
0588:
0589: private void configureMainMenus(
0590: final WorkbenchContext workbenchContext,
0591: final EnableCheckFactory checkFactory,
0592: //-- FILE
0593: FeatureInstaller featureInstaller) throws Exception {
0594: /*featureInstaller.addMainMenuItemWithJava14Fix(loadDatasetFromFilePlugIn, new String[] {MenuNames.FILE},
0595: loadDatasetFromFilePlugIn.getName() + "...", false, null, AbstractLoadDatasetPlugIn
0596: .createEnableCheck(workbenchContext));
0597: featureInstaller.addMainMenuItemWithJava14Fix(saveDatasetAsFilePlugIn, new String[] {MenuNames.FILE},
0598: saveDatasetAsFilePlugIn.getName() + "...", false, null,
0599: AbstractSaveDatasetAsPlugIn.createEnableCheck(workbenchContext));*/
0600: featureInstaller.addMainMenuItemWithJava14Fix(
0601: loadDatasetPlugIn, new String[] { MenuNames.FILE },
0602: loadDatasetPlugIn.getName() + "...", false,
0603: LoadDatasetPlugIn.getIcon(), LoadDatasetPlugIn
0604: .createEnableCheck(workbenchContext));
0605: featureInstaller
0606: .addMainMenuItemWithJava14Fix(saveDatasetAsPlugIn,
0607: new String[] { MenuNames.FILE },
0608: saveDatasetAsPlugIn.getName() + "...", false,
0609: null, SaveDatasetAsPlugIn
0610: .createEnableCheck(workbenchContext));
0611: featureInstaller.addMenuSeparator(MenuNames.FILE); // ===================
0612: featureInstaller.addMainMenuItemWithJava14Fix(newTaskPlugIn,
0613: new String[] { MenuNames.FILE }, newTaskPlugIn
0614: .getName()
0615: + "...", false, NewTaskPlugIn.getIcon(), null);
0616: featureInstaller.addMainMenuItemWithJava14Fix(
0617: openProjectPlugIn, new String[] { MenuNames.FILE },
0618: openProjectPlugIn.getName() + "...", false, null,
0619: new MultiEnableCheck());
0620: featureInstaller.addMainMenuItemWithJava14Fix(
0621: saveProjectPlugIn, new String[] { MenuNames.FILE },
0622: saveProjectPlugIn.getName(), false, null, checkFactory
0623: .createTaskWindowMustBeActiveCheck());
0624: featureInstaller.addMainMenuItemWithJava14Fix(
0625: saveProjectAsPlugIn, new String[] { MenuNames.FILE },
0626: saveProjectAsPlugIn.getName() + "...", false, null,
0627: checkFactory.createTaskWindowMustBeActiveCheck());
0628: featureInstaller.addMenuSeparator(MenuNames.FILE); // ===================
0629: featureInstaller.addMainMenuItemWithJava14Fix(
0630: saveImageAsPlugIn,
0631: //TODO :unfortunately i am not able to define the menu position
0632: // for sub-menus. so i comment it out [sstein: 12.09.2005]
0633: //new String[] {MenuNames.FILE, MenuNames.FILE_EXPORTLAYERVIEW},
0634: new String[] { MenuNames.FILE }, saveImageAsPlugIn
0635: .getName()
0636: + "...", false, null, SaveImageAsPlugIn
0637: .createEnableCheck(workbenchContext));
0638: //-- EDIT
0639: featureInstaller.addMainMenuItemWithJava14Fix(undoPlugIn,
0640: new String[] { MenuNames.EDIT }, undoPlugIn.getName(),
0641: false, GUIUtil.toSmallIcon(undoPlugIn.getIcon()),
0642: undoPlugIn.createEnableCheck(workbenchContext));
0643: featureInstaller.addMainMenuItemWithJava14Fix(redoPlugIn,
0644: new String[] { MenuNames.EDIT }, redoPlugIn.getName(),
0645: false, GUIUtil.toSmallIcon(redoPlugIn.getIcon()),
0646: redoPlugIn.createEnableCheck(workbenchContext));
0647: featureInstaller.addMenuSeparator(MenuNames.EDIT); // ===================
0648: featureInstaller.addMainMenuItemWithJava14Fix(
0649: addNewFeaturesPlugIn, new String[] { MenuNames.EDIT },
0650: addNewFeaturesPlugIn.getName() + "...", false, null,
0651: AddNewFeaturesPlugIn
0652: .createEnableCheck(workbenchContext));
0653: featureInstaller.addMainMenuItemWithJava14Fix(
0654: editSelectedFeaturePlugIn,
0655: new String[] { MenuNames.EDIT },
0656: editSelectedFeaturePlugIn.getName(), false, null,
0657: EditSelectedFeaturePlugIn
0658: .createEnableCheck(workbenchContext));
0659: featureInstaller.addMainMenuItemWithJava14Fix(
0660: selectFeaturesInFencePlugIn,
0661: new String[] { MenuNames.EDIT },
0662: selectFeaturesInFencePlugIn.getName(), false, null,
0663: SelectFeaturesInFencePlugIn
0664: .createEnableCheck(workbenchContext));
0665: featureInstaller.addMainMenuItemWithJava14Fix(
0666: clearSelectionPlugIn, new String[] { MenuNames.EDIT },
0667: clearSelectionPlugIn.getName(), false, null,
0668: clearSelectionPlugIn
0669: .createEnableCheck(workbenchContext));
0670: featureInstaller.addMenuSeparator(MenuNames.EDIT); // ===================
0671: featureInstaller.addMainMenuItemWithJava14Fix(
0672: cutSelectedItemsPlugIn,
0673: new String[] { MenuNames.EDIT }, cutSelectedItemsPlugIn
0674: .getName(), false, null, cutSelectedItemsPlugIn
0675: .createEnableCheck(workbenchContext));
0676: featureInstaller.addMainMenuItem(copySelectedItemsPlugIn,
0677: new String[] { MenuNames.EDIT },
0678: copySelectedItemsPlugIn.getNameWithMnemonic(), false,
0679: null, CopySelectedItemsPlugIn
0680: .createEnableCheck(workbenchContext));
0681: featureInstaller.addMainMenuItem(pasteItemsPlugIn,
0682: new String[] { MenuNames.EDIT }, pasteItemsPlugIn
0683: .getNameWithMnemonic(), false, null,
0684: PasteItemsPlugIn.createEnableCheck(workbenchContext));
0685: featureInstaller.addMenuSeparator(MenuNames.EDIT); // ===================
0686: featureInstaller.addMainMenuItemWithJava14Fix(
0687: deleteSelectedItemsPlugIn,
0688: new String[] { MenuNames.EDIT },
0689: deleteSelectedItemsPlugIn.getName(), false, null,
0690: DeleteSelectedItemsPlugIn
0691: .createEnableCheck(workbenchContext));
0692: //featureInstaller.addMenuSeparator(MenuNames.EDIT); // ===================
0693: /*//--[sstein 24 march 2007] moved to new customize menu
0694: featureInstaller.addMainMenuItemWithJava14Fix(optionsPlugIn, new String[] {MenuNames.EDIT}, optionsPlugIn
0695: .getName()
0696: + "...", false, null, null);
0697: */
0698: //-- VIEW
0699: editingPlugIn.createMainMenuItem(
0700: new String[] { MenuNames.VIEW }, GUIUtil
0701: .toSmallIcon(EditingPlugIn.ICON),
0702: workbenchContext);
0703: featureInstaller.addMainMenuItemWithJava14Fix(copyImagePlugIn,
0704: new String[] { MenuNames.VIEW }, copyImagePlugIn
0705: .getName(), false, null, CopyImagePlugIn
0706: .createEnableCheck(workbenchContext));
0707: featureInstaller.addMenuSeparator(MenuNames.VIEW); // ===================
0708: featureInstaller.addMainMenuItemWithJava14Fix(
0709: featureInfoPlugIn, new String[] { MenuNames.VIEW },
0710: featureInfoPlugIn.getName(), false, GUIUtil
0711: .toSmallIcon(FeatureInfoTool.ICON),
0712: FeatureInfoPlugIn.createEnableCheck(workbenchContext));
0713: featureInstaller
0714: .addMainMenuItemWithJava14Fix(
0715: verticesInFencePlugIn,
0716: new String[] { MenuNames.VIEW },
0717: verticesInFencePlugIn.getName(),
0718: false,
0719: null,
0720: new MultiEnableCheck()
0721: .add(
0722: checkFactory
0723: .createWindowWithLayerViewPanelMustBeActiveCheck())
0724: .add(
0725: checkFactory
0726: .createFenceMustBeDrawnCheck()));
0727: featureInstaller.addMenuSeparator(MenuNames.VIEW); // ===================
0728: featureInstaller.addMainMenuItemWithJava14Fix(
0729: zoomToFullExtentPlugIn,
0730: new String[] { MenuNames.VIEW }, zoomToFullExtentPlugIn
0731: .getName(), false, GUIUtil
0732: .toSmallIcon(zoomToFullExtentPlugIn.getIcon()),
0733: zoomToFullExtentPlugIn
0734: .createEnableCheck(workbenchContext));
0735: featureInstaller
0736: .addMainMenuItemWithJava14Fix(
0737: zoomToFencePlugIn,
0738: new String[] { MenuNames.VIEW },
0739: zoomToFencePlugIn.getName(),
0740: false,
0741: GUIUtil
0742: .toSmallIcon(zoomToFencePlugIn
0743: .getIcon()),
0744: new MultiEnableCheck()
0745: .add(
0746: checkFactory
0747: .createWindowWithLayerViewPanelMustBeActiveCheck())
0748: .add(
0749: checkFactory
0750: .createFenceMustBeDrawnCheck()));
0751: featureInstaller.addMainMenuItemWithJava14Fix(
0752: zoomToSelectedItemsPlugIn,
0753: new String[] { MenuNames.VIEW },
0754: zoomToSelectedItemsPlugIn.getName(), false, GUIUtil
0755: .toSmallIcon(zoomToSelectedItemsPlugIn
0756: .getIcon()), ZoomToSelectedItemsPlugIn
0757: .createEnableCheck(workbenchContext));
0758: featureInstaller.addMainMenuItemWithJava14Fix(
0759: zoomToCoordinatePlugIn,
0760: new String[] { MenuNames.VIEW }, zoomToCoordinatePlugIn
0761: .getName()
0762: + "...", false, null, zoomToCoordinatePlugIn
0763: .createEnableCheck(workbenchContext));
0764: featureInstaller.addMainMenuItemWithJava14Fix(
0765: zoomPreviousPlugIn, new String[] { MenuNames.VIEW },
0766: zoomPreviousPlugIn.getName(), false, GUIUtil
0767: .toSmallIcon(zoomPreviousPlugIn.getIcon()),
0768: zoomPreviousPlugIn.createEnableCheck(workbenchContext));
0769: featureInstaller.addMainMenuItemWithJava14Fix(zoomNextPlugIn,
0770: new String[] { MenuNames.VIEW }, zoomNextPlugIn
0771: .getName(), false, GUIUtil
0772: .toSmallIcon(zoomNextPlugIn.getIcon()),
0773: zoomNextPlugIn.createEnableCheck(workbenchContext));
0774: featureInstaller.addMenuSeparator(MenuNames.VIEW); // ===================
0775: featureInstaller
0776: .addMainMenuItemWithJava14Fix(
0777: scaleBarPlugIn,
0778: new String[] { MenuNames.VIEW },
0779: scaleBarPlugIn.getName(),
0780: true,
0781: null,
0782: new MultiEnableCheck()
0783: .add(
0784: checkFactory
0785: .createWindowWithLayerViewPanelMustBeActiveCheck())
0786: .add(new EnableCheck() {
0787:
0788: public String check(
0789: JComponent component) {
0790: ((JCheckBoxMenuItem) component)
0791: .setSelected(ScaleBarRenderer
0792: .isEnabled(workbenchContext
0793: .getLayerViewPanel()));
0794:
0795: return null;
0796: }
0797: }));
0798: featureInstaller.addMainMenuItemWithJava14Fix(toolTipsPlugIn,
0799: new String[] { MenuNames.VIEW }, toolTipsPlugIn
0800: .getName(), true, null, MapToolTipsPlugIn
0801: .createEnableCheck(workbenchContext));
0802: zoomBarPlugIn
0803: .createMainMenuItem(new String[] { MenuNames.VIEW },
0804: null, workbenchContext);
0805: //-- LAYER
0806: //-- [sstein: 23.02.2006 new sub method in VividJump]
0807: configLayer(workbenchContext, checkFactory, featureInstaller);
0808:
0809: //-- WINDOW
0810: /*
0811: featureInstaller.addMainMenuItemWithJava14Fix(optionsPlugIn, new String[] {MenuNames.WINDOW}, optionsPlugIn
0812: .getName()
0813: + "...", false, null, null);
0814: */
0815: featureInstaller.addMainMenuItemWithJava14Fix(
0816: outputWindowPlugIn, new String[] { MenuNames.WINDOW },
0817: outputWindowPlugIn.getName(), false, GUIUtil
0818: .toSmallIcon(outputWindowPlugIn.getIcon()),
0819: null);
0820: featureInstaller.addMainMenuItemWithJava14Fix(
0821: generateLogPlugIn, new String[] { MenuNames.WINDOW },
0822: generateLogPlugIn.getName() + "...", false, null, null);
0823: featureInstaller.addMenuSeparator(MenuNames.WINDOW); // ===================
0824:
0825: featureInstaller.addMainMenuItemWithJava14Fix(
0826: cloneWindowPlugIn, new String[] { MenuNames.WINDOW },
0827: cloneWindowPlugIn.getName(), false, null,
0828: new EnableCheck() {
0829:
0830: public String check(JComponent component) {
0831: return (!(workbenchContext.getWorkbench()
0832: .getFrame().getActiveInternalFrame() instanceof CloneableInternalFrame)) ? I18N
0833: .get("JUMPConfiguration.not-available-for-the-current-window")
0834: : null;
0835: }
0836: });
0837:
0838: featureInstaller.addMenuSeparator(MenuNames.WINDOW); // ===================
0839:
0840: //-- TOOLS
0841: //-- [sstein: 23.02.2006 new in VividJump]
0842: configToolsAnalysis(workbenchContext, checkFactory,
0843: featureInstaller);
0844: configToolsEdit(workbenchContext, checkFactory,
0845: featureInstaller);
0846: configToolsQA(workbenchContext, checkFactory, featureInstaller);
0847:
0848: featureInstaller
0849: .addMainMenuItemWithJava14Fix(shortcutKeysPlugIn,
0850: new String[] { MenuNames.HELP },
0851: shortcutKeysPlugIn.getName() + "...", false,
0852: null, null);
0853: new FeatureInstaller(workbenchContext)
0854: .addMainMenuItemWithJava14Fix(new AboutPlugIn(),
0855: new String[] { MenuNames.HELP }, I18N
0856: .get("JUMPConfiguration.about"), false,
0857: null, null);
0858:
0859: //-- CUSTOMIZE
0860: //-- [sstein: 24.03.2007 new menu]
0861: featureInstaller.addMainMenuItemWithJava14Fix(optionsPlugIn,
0862: new String[] { MenuNames.CUSTOMIZE }, optionsPlugIn
0863: .getName()
0864: + "...", false, null, null);
0865: }
0866:
0867: //==== [sstein: 23.02.2006] ======
0868: // this is a new method in VividJump (December 2005) to initialize
0869: // plugins working on layers
0870: //================================
0871: //public static String MENU_LAYER = MenuNames.LAYER;
0872:
0873: private AddDatastoreLayerPlugIn addDatastoreLayerPlugIn = new AddDatastoreLayerPlugIn();
0874: private RunDatastoreQueryPlugIn runDatastoreQueryPlugIn = new RunDatastoreQueryPlugIn();
0875: private InstallDatastoreLayerRendererHintsPlugIn installDatastoreLayerRendererHintsPlugIn = new InstallDatastoreLayerRendererHintsPlugIn();
0876: private AddImageLayerPlugIn addImageLayerPlugIn = new AddImageLayerPlugIn();
0877:
0878: private void configLayer(final WorkbenchContext workbenchContext,
0879: final EnableCheckFactory checkFactory,
0880: FeatureInstaller featureInstaller) throws Exception {
0881:
0882: String MENU_LAYER = MenuNames.LAYER;
0883: featureInstaller.addLayerViewMenuItem(addNewLayerPlugIn,
0884: MENU_LAYER, addNewLayerPlugIn.getName());
0885: featureInstaller.addLayerViewMenuItem(addDatastoreLayerPlugIn,
0886: MENU_LAYER, addDatastoreLayerPlugIn.getName() + "...");
0887: featureInstaller.addLayerViewMenuItem(runDatastoreQueryPlugIn,
0888: MENU_LAYER, runDatastoreQueryPlugIn.getName() + "...");
0889:
0890: featureInstaller.addLayerViewMenuItem(addWMSQueryPlugIn,
0891: MENU_LAYER, addWMSQueryPlugIn.getName() + "...");
0892:
0893: featureInstaller.addLayerViewMenuItem(addImageLayerPlugIn,
0894: MENU_LAYER, addImageLayerPlugIn.getName() + "...");
0895:
0896: featureInstaller.addMainMenuItem(addNewCategoryPlugIn,
0897: MENU_LAYER, addNewCategoryPlugIn.getName(), null,
0898: addNewCategoryPlugIn
0899: .createEnableCheck(workbenchContext));
0900:
0901: featureInstaller.addMenuSeparator(MENU_LAYER); // ===================
0902: featureInstaller.addMainMenuItem(cutSelectedLayersPlugIn,
0903: MENU_LAYER, cutSelectedLayersPlugIn
0904: .getNameWithMnemonic(), null,
0905: cutSelectedLayersPlugIn
0906: .createEnableCheck(workbenchContext));
0907: featureInstaller.addMainMenuItem(copySelectedLayersPlugIn,
0908: MENU_LAYER, copySelectedLayersPlugIn
0909: .getNameWithMnemonic(), null,
0910: copySelectedLayersPlugIn
0911: .createEnableCheck(workbenchContext));
0912: featureInstaller.addMainMenuItem(pasteLayersPlugIn, MENU_LAYER,
0913: pasteLayersPlugIn.getNameWithMnemonic(), null,
0914: pasteLayersPlugIn.createEnableCheck(workbenchContext));
0915:
0916: featureInstaller.addMenuSeparator(MENU_LAYER); // ===================
0917: featureInstaller.addMainMenuItem(removeSelectedLayersPlugIn,
0918: MENU_LAYER, removeSelectedLayersPlugIn.getName(), null,
0919: removeSelectedLayersPlugIn
0920: .createEnableCheck(workbenchContext));
0921: featureInstaller.addMainMenuItem(
0922: removeSelectedCategoriesPlugIn, MENU_LAYER,
0923: removeSelectedCategoriesPlugIn.getName(), null,
0924: removeSelectedCategoriesPlugIn
0925: .createEnableCheck(workbenchContext));
0926: }
0927:
0928: // MD - following is proposed new pattern for defining built-in menus
0929:
0930: //[sstein, 15.07.2006] - don't initialize as "static" (!) class variables because it causes
0931: // that the menu names are not translated into the correct language.
0932: // I have put them now into the method.
0933: //public static String MENU_TOOLS = MenuNames.TOOLS;
0934: //public static String MENU_ANALYSIS = MenuNames.TOOLS_ANALYSIS;
0935: //public static String[] MENU_TOOLS_ANALYSIS = new String[] { MENU_TOOLS, MENU_ANALYSIS};
0936:
0937: // these must be defined as instance vars for initialization to be performed
0938: private SpatialQueryPlugIn spatialQueryPlugIn = new SpatialQueryPlugIn();
0939: private AttributeQueryPlugIn attrQueryPlugIn = new AttributeQueryPlugIn();
0940: private SpatialJoinPlugIn spatialJoinPlugIn = new SpatialJoinPlugIn();
0941: private UnionPlugIn unionPlugIn = new UnionPlugIn();
0942: private UnionByAttributePlugIn unionByAttributePlugIn = new UnionByAttributePlugIn();
0943: private GeometryFunctionPlugIn geometryFunctionPlugIn = new GeometryFunctionPlugIn();
0944: private OverlayPlugIn overlayPlugIn = new OverlayPlugIn();
0945: private ConvexHullPlugIn convexHullPI = new ConvexHullPlugIn();
0946: private BufferPlugIn bufferPlugIn = new BufferPlugIn();
0947: private CalculateAreasAndLengthsPlugIn calculateAreasAndLengthsPlugIn = new CalculateAreasAndLengthsPlugIn();
0948:
0949: private void configToolsAnalysis(
0950: final WorkbenchContext workbenchContext,
0951: final EnableCheckFactory checkFactory,
0952: FeatureInstaller featureInstaller) throws Exception {
0953:
0954: String MENU_TOOLS = MenuNames.TOOLS;
0955: String MENU_ANALYSIS = MenuNames.TOOLS_ANALYSIS;
0956: String[] MENU_TOOLS_ANALYSIS = new String[] { MENU_TOOLS,
0957: MENU_ANALYSIS };
0958:
0959: featureInstaller
0960: .addMainMenuItem(
0961: spatialQueryPlugIn,
0962: new String[] { MenuNames.TOOLS,
0963: MenuNames.TOOLS_QUERIES },
0964: spatialQueryPlugIn.getName() + "...",
0965: false,
0966: null,
0967: new MultiEnableCheck()
0968: .add(
0969: checkFactory
0970: .createWindowWithLayerNamePanelMustBeActiveCheck())
0971: .add(
0972: checkFactory
0973: .createAtLeastNLayersMustExistCheck(2)));
0974:
0975: featureInstaller
0976: .addMainMenuItem(
0977: attrQueryPlugIn,
0978: new String[] { MenuNames.TOOLS,
0979: MenuNames.TOOLS_QUERIES },
0980: attrQueryPlugIn.getName() + "...",
0981: false,
0982: null,
0983: new MultiEnableCheck()
0984: .add(
0985: checkFactory
0986: .createWindowWithLayerNamePanelMustBeActiveCheck())
0987: .add(
0988: checkFactory
0989: .createAtLeastNLayersMustExistCheck(1)));
0990:
0991: featureInstaller
0992: .addMainMenuItem(
0993: geometryFunctionPlugIn,
0994: MENU_TOOLS_ANALYSIS,
0995: geometryFunctionPlugIn.getName() + "...",
0996: false,
0997: null,
0998: new MultiEnableCheck()
0999: .add(
1000: checkFactory
1001: .createWindowWithLayerNamePanelMustBeActiveCheck())
1002: .add(
1003: checkFactory
1004: .createAtLeastNLayersMustExistCheck(1)));
1005:
1006: featureInstaller
1007: .addMainMenuItem(
1008: spatialJoinPlugIn,
1009: MENU_TOOLS_ANALYSIS,
1010: spatialJoinPlugIn.getName() + "...",
1011: false,
1012: null,
1013: new MultiEnableCheck()
1014: .add(
1015: checkFactory
1016: .createWindowWithLayerNamePanelMustBeActiveCheck())
1017: .add(
1018: checkFactory
1019: .createAtLeastNLayersMustExistCheck(2)));
1020: //======================================
1021: //featureInstaller.addMenuSeparator(MENU_TOOLS_ANALYSIS);
1022: featureInstaller
1023: .addMainMenuItem(
1024: unionPlugIn,
1025: MENU_TOOLS_ANALYSIS, //maybe move to analysis join (but currently leave)
1026: unionPlugIn.getName() + "...",
1027: false,
1028: null,
1029: new MultiEnableCheck()
1030: .add(
1031: checkFactory
1032: .createWindowWithLayerNamePanelMustBeActiveCheck())
1033: .add(
1034: checkFactory
1035: .createAtLeastNLayersMustExistCheck(1)));
1036: featureInstaller
1037: .addMainMenuItem(
1038: unionByAttributePlugIn,
1039: MENU_TOOLS_ANALYSIS, //maybe move to analysis join (but currently leave)
1040: unionByAttributePlugIn.getName() + "...",
1041: false,
1042: null,
1043: new MultiEnableCheck()
1044: .add(
1045: checkFactory
1046: .createWindowWithLayerNamePanelMustBeActiveCheck())
1047: .add(
1048: checkFactory
1049: .createAtLeastNLayersMustExistCheck(1)));
1050: featureInstaller
1051: .addMainMenuItem(
1052: bufferPlugIn,
1053: new String[] { MenuNames.TOOLS,
1054: MenuNames.TOOLS_GENERATE },
1055: bufferPlugIn.getName() + "...",
1056: false,
1057: null,
1058: new MultiEnableCheck()
1059: .add(
1060: checkFactory
1061: .createWindowWithLayerNamePanelMustBeActiveCheck())
1062: .add(
1063: checkFactory
1064: .createAtLeastNLayersMustExistCheck(1)));
1065:
1066: featureInstaller.addMainMenuItem(convexHullPI, new String[] {
1067: MenuNames.TOOLS, MenuNames.TOOLS_GENERATE },
1068: convexHullPI.getName() + "...", false, null,
1069: ConvexHullPlugIn.getEnableCheck(checkFactory));
1070:
1071: //======================================
1072: //featureInstaller.addMenuSeparator(MENU_TOOLS_ANALYSIS);
1073: featureInstaller
1074: .addMainMenuItem(
1075: overlayPlugIn,
1076: MENU_TOOLS_ANALYSIS,
1077: overlayPlugIn.getName() + "...",
1078: false,
1079: null,
1080: new MultiEnableCheck()
1081: .add(
1082: checkFactory
1083: .createWindowWithLayerNamePanelMustBeActiveCheck())
1084: .add(
1085: checkFactory
1086: .createAtLeastNLayersMustExistCheck(2)));
1087:
1088: //======================================
1089: //featureInstaller.addMenuSeparator(MENU_TOOLS_ANALYSIS);
1090:
1091: featureInstaller.addMainMenuItem(
1092: calculateAreasAndLengthsPlugIn, new String[] {
1093: MenuNames.TOOLS, MenuNames.TOOLS_ANALYSIS },
1094: calculateAreasAndLengthsPlugIn.getName() + "...",
1095: false, null, calculateAreasAndLengthsPlugIn
1096: .createEnableCheck(workbenchContext));
1097:
1098: new WarpingPlugIn().initialize(new PlugInContext(
1099: workbenchContext, null, null, null, null));
1100:
1101: new AffineTransformPlugIn().initialize(new PlugInContext(
1102: workbenchContext, null, null, null, null));
1103:
1104: new RandomTrianglesPlugIn().initialize(new PlugInContext(
1105: workbenchContext, null, null, null, null));
1106: new RandomArrowsPlugIn().initialize(new PlugInContext(
1107: workbenchContext, null, null, null, null));
1108:
1109: }
1110:
1111: private ExtractSegmentsPlugIn extractSegmentsPlugIn = new ExtractSegmentsPlugIn();
1112: private LineNoderPlugIn lineNoderPlugIn = new LineNoderPlugIn();
1113: private PolygonizerPlugIn polygonizerPlugIn = new PolygonizerPlugIn();
1114: private PrecisionReducerPlugIn precisionReducerPlugIn = new PrecisionReducerPlugIn();
1115: private AffineTransformationPlugIn affineTransPlugIn = new AffineTransformationPlugIn();
1116:
1117: private void configToolsEdit(
1118: final WorkbenchContext workbenchContext,
1119: final EnableCheckFactory checkFactory,
1120: FeatureInstaller featureInstaller) throws Exception {
1121:
1122: String MENU_TOOLS = MenuNames.TOOLS;
1123: String MENU_EDIT = MenuNames.TOOLS_EDIT_GEOMETRY;
1124: String[] MENU_TOOLS_EDIT = new String[] { MENU_TOOLS, MENU_EDIT };
1125:
1126: featureInstaller.addMainMenuItem(extractSegmentsPlugIn,
1127: MENU_TOOLS_EDIT, extractSegmentsPlugIn.getName()
1128: + "...", false, null, extractSegmentsPlugIn
1129: .createEnableCheck(workbenchContext));
1130:
1131: featureInstaller.addMainMenuItem(lineNoderPlugIn,
1132: MENU_TOOLS_EDIT, lineNoderPlugIn.getName() + "...",
1133: false, null, lineNoderPlugIn
1134: .createEnableCheck(workbenchContext));
1135:
1136: featureInstaller.addMainMenuItem(polygonizerPlugIn,
1137: MENU_TOOLS_EDIT, polygonizerPlugIn.getName() + "...",
1138: false, null, polygonizerPlugIn
1139: .createEnableCheck(workbenchContext));
1140:
1141: featureInstaller.addMainMenuItem(precisionReducerPlugIn,
1142: MENU_TOOLS_EDIT, precisionReducerPlugIn.getName()
1143: + "...", false, null, precisionReducerPlugIn
1144: .createEnableCheck(workbenchContext));
1145:
1146: featureInstaller.addMainMenuItem(affineTransPlugIn,
1147: MENU_TOOLS_EDIT, affineTransPlugIn.getName() + "...",
1148: false, null, affineTransPlugIn
1149: .createEnableCheck(workbenchContext));
1150:
1151: }
1152:
1153: private ValidateSelectedLayersPlugIn validateSelectedLayersPlugIn = new ValidateSelectedLayersPlugIn();
1154: private LayerStatisticsPlugIn layerStatisticsPlugIn = new LayerStatisticsPlugIn();
1155: private FeatureStatisticsPlugIn featureStatisticsPlugIn = new FeatureStatisticsPlugIn();
1156: private DiffGeometryPlugIn diffGeometryPlugIn = new DiffGeometryPlugIn();
1157:
1158: private void configToolsQA(final WorkbenchContext workbenchContext,
1159: final EnableCheckFactory checkFactory,
1160: FeatureInstaller featureInstaller) throws Exception {
1161:
1162: String MENU_TOOLS = MenuNames.TOOLS;
1163: String MENU_QA = MenuNames.TOOLS_QA;
1164: String[] MENU_TOOLS_QA = new String[] { MENU_TOOLS, MENU_QA };
1165:
1166: featureInstaller
1167: .addMainMenuItem(
1168: validateSelectedLayersPlugIn,
1169: MENU_TOOLS_QA,
1170: validateSelectedLayersPlugIn.getName() + "...",
1171: false,
1172: null,
1173: new MultiEnableCheck()
1174: .add(
1175: checkFactory
1176: .createWindowWithLayerNamePanelMustBeActiveCheck())
1177: .add(
1178: checkFactory
1179: .createAtLeastNLayersMustBeSelectedCheck(1)));
1180: featureInstaller
1181: .addMainMenuItem(
1182: layerStatisticsPlugIn,
1183: MENU_TOOLS_QA,
1184: layerStatisticsPlugIn.getName(),
1185: false,
1186: null,
1187: new MultiEnableCheck()
1188: .add(
1189: checkFactory
1190: .createWindowWithLayerNamePanelMustBeActiveCheck())
1191: .add(
1192: checkFactory
1193: .createAtLeastNLayersMustBeSelectedCheck(1)));
1194: featureInstaller
1195: .addMainMenuItem(
1196: featureStatisticsPlugIn,
1197: MENU_TOOLS_QA,
1198: featureStatisticsPlugIn.getName(),
1199: false,
1200: null,
1201: new MultiEnableCheck()
1202: .add(
1203: checkFactory
1204: .createWindowWithLayerNamePanelMustBeActiveCheck())
1205: .add(
1206: checkFactory
1207: .createAtLeastNLayersMustBeSelectedCheck(1)));
1208:
1209: featureInstaller
1210: .addMainMenuItem(
1211: diffGeometryPlugIn,
1212: MENU_TOOLS_QA,
1213: diffGeometryPlugIn.getName() + "...",
1214: false,
1215: null,
1216: new MultiEnableCheck()
1217: .add(
1218: checkFactory
1219: .createWindowWithLayerNamePanelMustBeActiveCheck())
1220: .add(
1221: checkFactory
1222: .createAtLeastNLayersMustExistCheck(2)));
1223:
1224: }
1225:
1226: public void configureDatastores(final WorkbenchContext context)
1227: throws Exception {
1228:
1229: context.getRegistry().createEntry(
1230: DataStoreDriver.REGISTRY_CLASSIFICATION,
1231: new PostgisDataStoreDriver());
1232:
1233: // update exit handler
1234: final ApplicationExitHandler oldApplicationExitHandler = context
1235: .getWorkbench().getFrame().getApplicationExitHandler();
1236: context.getWorkbench().getFrame().setApplicationExitHandler(
1237: new ApplicationExitHandler() {
1238: public void exitApplication(JFrame mainFrame) {
1239: try {
1240: ConnectionManager.instance(context)
1241: .closeConnections();
1242: } catch (DataStoreException e) {
1243: throw new RuntimeException(e);
1244: }
1245: oldApplicationExitHandler
1246: .exitApplication(mainFrame);
1247: }
1248: });
1249: }
1250:
1251: private void configureStyles(WorkbenchContext workbenchContext) {
1252: WorkbenchFrame frame = workbenchContext.getWorkbench()
1253: .getFrame();
1254: frame
1255: .addChoosableStyleClass(VertexXYLineSegmentStyle.VertexXY.class);
1256: frame
1257: .addChoosableStyleClass(VertexIndexLineSegmentStyle.VertexIndex.class);
1258: frame
1259: .addChoosableStyleClass(MetricsLineStringSegmentStyle.LengthAngle.class);
1260: frame
1261: .addChoosableStyleClass(ArrowLineStringSegmentStyle.Open.class);
1262: frame
1263: .addChoosableStyleClass(ArrowLineStringSegmentStyle.Solid.class);
1264: frame
1265: .addChoosableStyleClass(ArrowLineStringSegmentStyle.NarrowSolid.class);
1266: frame
1267: .addChoosableStyleClass(ArrowLineStringEndpointStyle.FeathersStart.class);
1268: frame
1269: .addChoosableStyleClass(ArrowLineStringEndpointStyle.FeathersEnd.class);
1270: frame
1271: .addChoosableStyleClass(ArrowLineStringEndpointStyle.OpenStart.class);
1272: frame
1273: .addChoosableStyleClass(ArrowLineStringEndpointStyle.OpenEnd.class);
1274: frame
1275: .addChoosableStyleClass(ArrowLineStringEndpointStyle.SolidStart.class);
1276: frame
1277: .addChoosableStyleClass(ArrowLineStringEndpointStyle.SolidEnd.class);
1278: frame
1279: .addChoosableStyleClass(ArrowLineStringEndpointStyle.NarrowSolidStart.class);
1280: frame
1281: .addChoosableStyleClass(ArrowLineStringEndpointStyle.NarrowSolidEnd.class);
1282: frame
1283: .addChoosableStyleClass(CircleLineStringEndpointStyle.Start.class);
1284: frame
1285: .addChoosableStyleClass(CircleLineStringEndpointStyle.End.class);
1286: }
1287:
1288: private QuasimodeTool add(CursorTool tool, WorkbenchContext context) {
1289: return context.getWorkbench().getFrame().getToolBar()
1290: .addCursorTool(tool).getQuasimodeTool();
1291: }
1292:
1293: private void configureToolBar(
1294: final WorkbenchContext workbenchContext,
1295: EnableCheckFactory checkFactory) {
1296: WorkbenchFrame frame = workbenchContext.getWorkbench()
1297: .getFrame();
1298: frame.getToolBar().addPlugIn(NewTaskPlugIn.getIcon(),
1299: newTaskPlugIn,
1300: NewTaskPlugIn.createEnableCheck(workbenchContext),
1301: workbenchContext);
1302: frame.getToolBar().addPlugIn(LoadDatasetPlugIn.getIcon(),
1303: loadDatasetPlugIn,
1304: LoadDatasetPlugIn.createEnableCheck(workbenchContext),
1305: workbenchContext);
1306: frame.getToolBar().addSeparator();
1307: add(new ZoomTool(), workbenchContext);
1308: add(new PanTool(), workbenchContext);
1309: frame.getToolBar().addSeparator();
1310: frame.getToolBar().addPlugIn(
1311: zoomToFullExtentPlugIn.getIcon(),
1312: zoomToFullExtentPlugIn,
1313: zoomToFullExtentPlugIn
1314: .createEnableCheck(workbenchContext),
1315: workbenchContext);
1316: frame.getToolBar().addPlugIn(
1317: zoomToSelectedItemsPlugIn.getIcon(),
1318: zoomToSelectedItemsPlugIn,
1319: ZoomToSelectedItemsPlugIn
1320: .createEnableCheck(workbenchContext),
1321: workbenchContext);
1322: frame
1323: .getToolBar()
1324: .addPlugIn(
1325: zoomToFencePlugIn.getIcon(),
1326: zoomToFencePlugIn,
1327: new MultiEnableCheck()
1328: .add(
1329: checkFactory
1330: .createWindowWithLayerViewPanelMustBeActiveCheck())
1331: .add(
1332: checkFactory
1333: .createFenceMustBeDrawnCheck()),
1334: workbenchContext);
1335: frame.getToolBar().addPlugIn(zoomPreviousPlugIn.getIcon(),
1336: zoomPreviousPlugIn,
1337: zoomPreviousPlugIn.createEnableCheck(workbenchContext),
1338: workbenchContext);
1339: frame.getToolBar().addPlugIn(zoomNextPlugIn.getIcon(),
1340: zoomNextPlugIn,
1341: zoomNextPlugIn.createEnableCheck(workbenchContext),
1342: workbenchContext);
1343: frame.getToolBar().addPlugIn(changeStylesPlugIn.getIcon(),
1344: changeStylesPlugIn,
1345: changeStylesPlugIn.createEnableCheck(workbenchContext),
1346: workbenchContext);
1347: frame.getToolBar().addPlugIn(
1348: viewAttributesPlugIn.getIcon(),
1349: viewAttributesPlugIn,
1350: viewAttributesPlugIn
1351: .createEnableCheck(workbenchContext),
1352: workbenchContext);
1353: frame.getToolBar().addSeparator();
1354:
1355: //Null out the quasimodes for [Ctrl] because the Select tools will
1356: // handle that case. [Jon Aquino]
1357: add(new QuasimodeTool(new SelectFeaturesTool()).add(
1358: new QuasimodeTool.ModifierKeySpec(true, false, false),
1359: null), workbenchContext);
1360: frame.getToolBar().addPlugIn(
1361: ClearSelectionPlugIn.getIcon(),
1362: clearSelectionPlugIn,
1363: clearSelectionPlugIn
1364: .createEnableCheck(workbenchContext),
1365: workbenchContext);
1366: add(new OrCompositeTool() {
1367:
1368: public String getName() {
1369: return I18N.get("JUMPConfiguration.fence");
1370: }
1371: }.add(new DrawRectangleFenceTool()).add(
1372: new DrawPolygonFenceTool()), workbenchContext);
1373: add(new FeatureInfoTool(), workbenchContext);
1374: frame.getToolBar().addSeparator();
1375: configureEditingButton(workbenchContext);
1376: frame.getToolBar().addSeparator();
1377: add(new MeasureTool(), workbenchContext);
1378: frame.getToolBar().addSeparator();
1379: frame.getToolBar().addPlugIn(undoPlugIn.getIcon(), undoPlugIn,
1380: undoPlugIn.createEnableCheck(workbenchContext),
1381: workbenchContext);
1382: frame.getToolBar().addPlugIn(redoPlugIn.getIcon(), redoPlugIn,
1383: redoPlugIn.createEnableCheck(workbenchContext),
1384: workbenchContext);
1385: frame.getToolBar().addSeparator();
1386: workbenchContext.getWorkbench().getFrame().getOutputFrame()
1387: .setButton(
1388: frame.getToolBar().addPlugIn(
1389: outputWindowPlugIn.getIcon(),
1390: outputWindowPlugIn,
1391: new MultiEnableCheck(),
1392: workbenchContext));
1393: //Last of all, add a separator because some plug-ins may add
1394: // CursorTools.
1395: //[Jon Aquino]
1396: frame.getToolBar().addSeparator();
1397: }
1398:
1399: private void configureEditingButton(
1400: final WorkbenchContext workbenchContext) {
1401: final JToggleButton toggleButton = new JToggleButton();
1402: workbenchContext.getWorkbench().getFrame().getToolBar().add(
1403: toggleButton,
1404: editingPlugIn.getName(),
1405: EditingPlugIn.ICON,
1406: AbstractPlugIn.toActionListener(editingPlugIn,
1407: workbenchContext, new TaskMonitorManager()),
1408: null);
1409: workbenchContext.getWorkbench().getFrame()
1410: .addComponentListener(new ComponentAdapter() {
1411:
1412: public void componentShown(ComponentEvent e) {
1413: //Can't #getToolbox before Workbench is thrown.
1414: // Otherwise, get
1415: //IllegalComponentStateException. Thus, do it inside
1416: // #componentShown. [Jon Aquino]
1417: editingPlugIn.getToolbox(workbenchContext)
1418: .addComponentListener(
1419: new ComponentAdapter() {
1420:
1421: //There are other ways to show/hide the
1422: // toolbox. Track 'em. [Jon Aquino]
1423: public void componentShown(
1424: ComponentEvent e) {
1425: toggleButton
1426: .setSelected(true);
1427: }
1428:
1429: public void componentHidden(
1430: ComponentEvent e) {
1431: toggleButton
1432: .setSelected(false);
1433: }
1434: });
1435: }
1436: });
1437: }
1438:
1439: /**
1440: * Call each PlugIn's #initialize() method. Uses reflection to build a list
1441: * of plug-ins.
1442: *
1443: * @param workbenchContext
1444: * Description of the Parameter
1445: * @exception Exception
1446: * Description of the Exception
1447: */
1448: private void initializeBuiltInPlugIns(
1449: WorkbenchContext workbenchContext) throws Exception {
1450: Field[] fields = getClass().getDeclaredFields();
1451:
1452: for (int i = 0; i < fields.length; i++) {
1453: Object field = null;
1454:
1455: try {
1456: field = fields[i].get(this );
1457: } catch (IllegalAccessException e) {
1458: Assert.shouldNeverReachHere();
1459: }
1460:
1461: if (!(field instanceof PlugIn)) {
1462: continue;
1463: }
1464:
1465: PlugIn plugIn = (PlugIn) field;
1466: plugIn.initialize(new PlugInContext(workbenchContext, null,
1467: null, null, null));
1468: }
1469: }
1470: }
|