X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FTabChangeEvent.java;fp=bundles%2Forg.simantics.selectionview%2Fsrc%2Forg%2Fsimantics%2Fselectionview%2FTabChangeEvent.java;h=b68fec9cc5d3857e889bdcc9dd4c2013d6fcf391;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git
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
index 000000000..b68fec9cc
--- /dev/null
+++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/TabChangeEvent.java
@@ -0,0 +1,62 @@
+package org.simantics.selectionview;
+
+
+/**
+ * @author Tuukka Lehtonen
+ */
+public class TabChangeEvent {
+
+ private final IPropertyTab oldTab;
+ private final String oldTabLabel;
+ private final IPropertyTab newTab;
+ private final String newTabLabel;
+
+ /**
+ * @param oldTab
+ * @param oldTabLabel
+ * @param newTab
+ * @param newTabLabel
+ */
+ public TabChangeEvent(IPropertyTab oldTab, String oldTabLabel, IPropertyTab newTab, String newTabLabel) {
+ this.oldTab = oldTab;
+ this.oldTabLabel = oldTabLabel;
+ this.newTab = newTab;
+ this.newTabLabel = newTabLabel;
+ }
+
+ /**
+ * @return null
if no tab is currently selected or no tabs
+ * exist
+ */
+ public IPropertyTab getNewTab() {
+ return newTab;
+ }
+
+ /**
+ * @return null
if no tab is currently selected or no tabs
+ * exist
+ */
+ public String getNewTabLabel() {
+ return newTabLabel;
+ }
+
+ /**
+ * @return null
if no tab was previously selected
+ */
+ public IPropertyTab getOldTab() {
+ return oldTab;
+ }
+
+ /**
+ * @return null
if no tab was previously selected
+ */
+ public String getOldTabLabel() {
+ return oldTabLabel;
+ }
+
+ @Override
+ public String toString() {
+ return getClass().getSimpleName() + "(" + oldTabLabel + " - " + oldTab + " => " + newTabLabel + " - " + newTab + ")";
+ }
+
+}