18
18
import com .vaadin .annotations .PreserveOnRefresh ;
19
19
import com .vaadin .annotations .Push ;
20
20
import com .vaadin .annotations .Theme ;
21
- import com .vaadin .annotations .Title ;
22
21
import com .vaadin .data .HasValue ;
23
22
import com .vaadin .data .provider .ListDataProvider ;
24
23
import com .vaadin .server .Page ;
73
72
/**
74
73
* The UI class
75
74
*/
76
- @ Title ("Tiny Pounder" )
77
75
@ Theme ("tinypounder" )
78
76
@ Push
79
77
@ SpringUI
@@ -83,6 +81,7 @@ public class TinyPounderMainUI extends UI {
83
81
private static final int MIN_SERVER_GRID_COLS = 3 ;
84
82
private static final int DATAROOT_PATH_COLUMN = 2 ;
85
83
private static final File HOME = new File (System .getProperty ("user.home" ));
84
+ private static final String VERSION = getVersion ();
86
85
87
86
@ Autowired
88
87
private CacheManagerBusiness cacheManagerBusiness ;
@@ -141,6 +140,7 @@ public class TinyPounderMainUI extends UI {
141
140
@ Override
142
141
protected void init (VaadinRequest vaadinRequest ) {
143
142
VaadinSession .getCurrent ().getSession ().setMaxInactiveInterval (-1 );
143
+ Page .getCurrent ().setTitle ("Tiny Pounder (" + VERSION + ")" );
144
144
145
145
setupLayout ();
146
146
addKitControls ();
@@ -161,7 +161,7 @@ private void addExitCloseTab() {
161
161
VerticalLayout exitLayout = new VerticalLayout ();
162
162
exitLayout .addComponentsAndExpand (new Label ("We hope you had fun using the TinyPounder, it is now shutdown, " +
163
163
"as well as all the DatasetManagers, CacheManagers, and Terracotta servers you started with it" ));
164
- TabSheet .Tab tab = mainLayout .addTab (exitLayout , "EXIT : Close TinyPounder" );
164
+ TabSheet .Tab tab = mainLayout .addTab (exitLayout , "EXIT : Close TinyPounder " + VERSION );
165
165
tab .setStyleName ("tab-absolute-right" );
166
166
mainLayout .addSelectedTabChangeListener (tabEvent -> {
167
167
if (tabEvent .getTabSheet ().getSelectedTab ().equals (tab .getComponent ())) {
@@ -1682,5 +1682,14 @@ public final String getMinimizedValueAsHTML() {
1682
1682
}
1683
1683
}
1684
1684
1685
+ private static String getVersion () {
1686
+ Package p = TinyPounderMainUI .class .getPackage ();
1687
+ if (p == null ) {
1688
+ return "dev" ;
1689
+ }
1690
+ String v = p .getImplementationVersion ();
1691
+ return v == null ? "dev" : v ;
1692
+ }
1693
+
1685
1694
1686
1695
}
0 commit comments