private void switchNodeInLookup(boolean includeDataNodeLookup) { if (settingLookup) { return; } Lookup[] lookups = lookup.getSubLookups(); int index = lookups.length - 1; boolean dataNodeLookup = (lookups[index] != Lookup.EMPTY); if (includeDataNodeLookup != dataNodeLookup) { lookups[index] = includeDataNodeLookup ? dataObject.getNodeDelegate().getLookup() : Lookup.EMPTY; try { settingLookup = true; // avoid re-entrant call lookup.setSubLookups(lookups); } finally { settingLookup = false; } } }
private void initLookup() { Lookup explorerLookup; // lookup for EpxlorerManager Lookup plainContentLookup; // general util using ic Lookup dataObjectLookup; // to make sure DO is in lookup WHEN no node selected if (lookup == null) { lookup = new FormProxyLookup(); explorerLookup = null; // general utility content // add itself (for satellite view) ic.add(this); // add calibrated zoom ic.add(new FixCenterCalibratedZoom(0.1)); ic.add(new FixCenterCalibratedZoom(0.25)); ic.add(new FixCenterCalibratedZoom(0.5)); ic.add(new FixCenterCalibratedZoom(0.75)); ic.add(new FixCenterCalibratedZoom(1)); ic.add(new FixCenterCalibratedZoom(2)); ic.add(new FixCenterCalibratedZoom(4)); ic.add(new FixCenterCalibratedZoom(8)); ic.add(new FixCenterCalibratedZoom(16)); plainContentLookup = new AbstractLookup(ic); dataObjectLookup = null; } else { Lookup[] lookups = lookup.getSubLookups(); explorerLookup = lookups[0]; plainContentLookup = lookups[1]; dataObjectLookup = lookups[2]; } if (dataObjectLookup == null) { dataObjectLookup = dataObject.getNodeDelegate().getLookup(); } if (explorerLookup == null) { ActionMap map = new ActionMap(); explorerLookup = ExplorerUtils.createLookup(layerController.getExplorerManager(), map); } lookup.setSubLookups(new Lookup[] {explorerLookup, plainContentLookup, dataObjectLookup}); }