public ViewAttributesFrame(final Layer layer, final PlugInContext context) { this.layerManager = context.getLayerManager(); addInternalFrameListener( new InternalFrameAdapter() { public void internalFrameClosed(InternalFrameEvent e) { // Assume that there are no other views on the model [Jon // Aquino] attributeTab.getModel().dispose(); } }); setResizable(true); setClosable(true); setMaximizable(true); setIconifiable(true); getContentPane().setLayout(new BorderLayout()); attributeTab = new OneLayerAttributeTab( context.getWorkbenchContext(), ((TaskFrameProxy) context.getActiveInternalFrame()).getTaskFrame(), this) .setLayer(layer); addInternalFrameListener( new InternalFrameAdapter() { public void internalFrameOpened(InternalFrameEvent e) { attributeTab.getToolBar().updateEnabledState(); } }); getContentPane().add(attributeTab, BorderLayout.CENTER); setSize(500, 300); updateTitle(attributeTab.getLayer()); context .getLayerManager() .addLayerListener( new LayerListener() { public void layerChanged(LayerEvent e) { if (attributeTab.getLayer() != null) { updateTitle(attributeTab.getLayer()); } // Layer REMOVE [mmichaud 2012-01-05] if (e.getType() == LayerEventType.REMOVED) { if (e.getLayerable() == attributeTab.getLayer()) { attributeTab.getModel().dispose(); context.getLayerManager().removeLayerListener(this); context.getWorkbenchFrame().removeInternalFrame(ViewAttributesFrame.this); dispose(); } } } public void categoryChanged(CategoryEvent e) {} public void featuresChanged(FeatureEvent e) {} }); Assert.isTrue( !(this instanceof CloneableInternalFrame), I18N.get("ui.plugin.ViewAttributesPlugIn.there-can-be-no-other-views-on-the-InfoModels")); }
public SelectionManager getSelectionManager() { return attributeTab.getPanel().getSelectionManager(); }
public TaskFrame getTaskFrame() { return attributeTab.getTaskFrame(); }