]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.selectionview/src/org/simantics/selectionview/TabChangeEvent.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.selectionview / src / org / simantics / selectionview / TabChangeEvent.java
diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TabChangeEvent.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TabChangeEvent.java
new file mode 100644 (file)
index 0000000..b68fec9
--- /dev/null
@@ -0,0 +1,62 @@
+package org.simantics.selectionview;\r
+\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class TabChangeEvent {\r
+\r
+    private final IPropertyTab oldTab;\r
+    private final String       oldTabLabel;\r
+    private final IPropertyTab newTab;\r
+    private final String       newTabLabel;\r
+\r
+    /**\r
+     * @param oldTab\r
+     * @param oldTabLabel\r
+     * @param newTab\r
+     * @param newTabLabel\r
+     */\r
+    public TabChangeEvent(IPropertyTab oldTab, String oldTabLabel, IPropertyTab newTab, String newTabLabel) {\r
+        this.oldTab = oldTab;\r
+        this.oldTabLabel = oldTabLabel;\r
+        this.newTab = newTab;\r
+        this.newTabLabel = newTabLabel;\r
+    }\r
+\r
+    /**\r
+     * @return <code>null</code> if no tab is currently selected or no tabs\r
+     *         exist\r
+     */\r
+    public IPropertyTab getNewTab() {\r
+        return newTab;\r
+    }\r
+\r
+    /**\r
+     * @return <code>null</code> if no tab is currently selected or no tabs\r
+     *         exist\r
+     */\r
+    public String getNewTabLabel() {\r
+        return newTabLabel;\r
+    }\r
+\r
+    /**\r
+     * @return <code>null</code> if no tab was previously selected\r
+     */\r
+    public IPropertyTab getOldTab() {\r
+        return oldTab;\r
+    }\r
+\r
+    /**\r
+     * @return <code>null</code> if no tab was previously selected\r
+     */\r
+    public String getOldTabLabel() {\r
+        return oldTabLabel;\r
+    }\r
+\r
+    @Override\r
+    public String toString() {\r
+        return getClass().getSimpleName() + "(" + oldTabLabel + " - " + oldTab + " => " + newTabLabel + " - " + newTab + ")";\r
+    }\r
+\r
+}\r