]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.selectionview;\r
2 \r
3 \r
4 /**\r
5  * @author Tuukka Lehtonen\r
6  */\r
7 public class TabChangeEvent {\r
8 \r
9     private final IPropertyTab oldTab;\r
10     private final String       oldTabLabel;\r
11     private final IPropertyTab newTab;\r
12     private final String       newTabLabel;\r
13 \r
14     /**\r
15      * @param oldTab\r
16      * @param oldTabLabel\r
17      * @param newTab\r
18      * @param newTabLabel\r
19      */\r
20     public TabChangeEvent(IPropertyTab oldTab, String oldTabLabel, IPropertyTab newTab, String newTabLabel) {\r
21         this.oldTab = oldTab;\r
22         this.oldTabLabel = oldTabLabel;\r
23         this.newTab = newTab;\r
24         this.newTabLabel = newTabLabel;\r
25     }\r
26 \r
27     /**\r
28      * @return <code>null</code> if no tab is currently selected or no tabs\r
29      *         exist\r
30      */\r
31     public IPropertyTab getNewTab() {\r
32         return newTab;\r
33     }\r
34 \r
35     /**\r
36      * @return <code>null</code> if no tab is currently selected or no tabs\r
37      *         exist\r
38      */\r
39     public String getNewTabLabel() {\r
40         return newTabLabel;\r
41     }\r
42 \r
43     /**\r
44      * @return <code>null</code> if no tab was previously selected\r
45      */\r
46     public IPropertyTab getOldTab() {\r
47         return oldTab;\r
48     }\r
49 \r
50     /**\r
51      * @return <code>null</code> if no tab was previously selected\r
52      */\r
53     public String getOldTabLabel() {\r
54         return oldTabLabel;\r
55     }\r
56 \r
57     @Override\r
58     public String toString() {\r
59         return getClass().getSimpleName() + "(" + oldTabLabel + " - " + oldTab + " => " + newTabLabel + " - " + newTab + ")";\r
60     }\r
61 \r
62 }\r