Revision: 4328 http://sourceforge.net/p/jump-pilot/code/4328 Author: michaudm Date: 2015-02-28 07:57:07 +0000 (Sat, 28 Feb 2015) Log Message: ----------- FR 215 : don't open a new ViewAttributesFrame if there is already one open for the selected layer Layer
Modified Paths: -------------- core/trunk/ChangeLog core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/ViewAttributesPlugIn.java Modified: core/trunk/ChangeLog =================================================================== --- core/trunk/ChangeLog 2015-02-27 23:59:43 UTC (rev 4327) +++ core/trunk/ChangeLog 2015-02-28 07:57:07 UTC (rev 4328) @@ -1,6 +1,10 @@ # for display continuity sake please use 2 spaces instead of tabs 2015-02-28 mmichaud <m.michael.mich...@orange.fr> + * FR 215 : don't open a new ViewAttributesFrame if there is already one + open for the selected layer Layer + +2015-02-28 mmichaud <m.michael.mich...@orange.fr> * Fix bug #388 shrinking columns in infoFrame and attributeTable when the schema has changed. Modified: core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/ViewAttributesPlugIn.java =================================================================== --- core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/ViewAttributesPlugIn.java 2015-02-27 23:59:43 UTC (rev 4327) +++ core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/ViewAttributesPlugIn.java 2015-02-28 07:57:07 UTC (rev 4328) @@ -28,8 +28,7 @@ import java.awt.BorderLayout; -import javax.swing.ImageIcon; -import javax.swing.JFrame; +import javax.swing.*; import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; @@ -95,6 +94,19 @@ @Override public boolean execute(final PlugInContext context) throws Exception { reportNothingToUndoYet(context); + // If the AttributeTable for the currently selected layer is already open, + // don't create a new ViewAttributesFrame + for (JInternalFrame iFrame : context.getWorkbenchFrame().getInternalFrames()) { + if (iFrame instanceof ViewAttributesFrame) { + if (((ViewAttributesFrame)iFrame) + .getOneLayerAttributeTab() + .getLayer() + .equals(context.getSelectedLayer(0))) { + iFrame.toFront(); + return true; + } + } + } // Don't add GeometryInfoFrame because the HTML will probably be too // much for the editor pane (too many features). [Jon Aquino] final ViewAttributesFrame frame = new ViewAttributesFrame( @@ -199,6 +211,10 @@ I18N.get("ui.plugin.ViewAttributesPlugIn.there-can-be-no-other-views-on-the-InfoModels")); } + public OneLayerAttributeTab getOneLayerAttributeTab() { + return attributeTab; + } + public LayerViewPanel getLayerViewPanel() { return getTaskFrame().getLayerViewPanel(); } ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel