Skip to content

Commit c479906

Browse files
Merge pull request #26 from mathieucarbou/improvements
show tiny pounder version
2 parents a5a2080 + e1bf129 commit c479906

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/main/java/org/terracotta/tinypounder/TinyPounderMainUI.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.vaadin.annotations.PreserveOnRefresh;
1919
import com.vaadin.annotations.Push;
2020
import com.vaadin.annotations.Theme;
21-
import com.vaadin.annotations.Title;
2221
import com.vaadin.data.HasValue;
2322
import com.vaadin.data.provider.ListDataProvider;
2423
import com.vaadin.server.Page;
@@ -73,7 +72,6 @@
7372
/**
7473
* The UI class
7574
*/
76-
@Title("Tiny Pounder")
7775
@Theme("tinypounder")
7876
@Push
7977
@SpringUI
@@ -83,6 +81,7 @@ public class TinyPounderMainUI extends UI {
8381
private static final int MIN_SERVER_GRID_COLS = 3;
8482
private static final int DATAROOT_PATH_COLUMN = 2;
8583
private static final File HOME = new File(System.getProperty("user.home"));
84+
private static final String VERSION = getVersion();
8685

8786
@Autowired
8887
private CacheManagerBusiness cacheManagerBusiness;
@@ -141,6 +140,7 @@ public class TinyPounderMainUI extends UI {
141140
@Override
142141
protected void init(VaadinRequest vaadinRequest) {
143142
VaadinSession.getCurrent().getSession().setMaxInactiveInterval(-1);
143+
Page.getCurrent().setTitle("Tiny Pounder (" + VERSION + ")");
144144

145145
setupLayout();
146146
addKitControls();
@@ -161,7 +161,7 @@ private void addExitCloseTab() {
161161
VerticalLayout exitLayout = new VerticalLayout();
162162
exitLayout.addComponentsAndExpand(new Label("We hope you had fun using the TinyPounder, it is now shutdown, " +
163163
"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);
165165
tab.setStyleName("tab-absolute-right");
166166
mainLayout.addSelectedTabChangeListener(tabEvent -> {
167167
if (tabEvent.getTabSheet().getSelectedTab().equals(tab.getComponent())) {
@@ -1682,5 +1682,14 @@ public final String getMinimizedValueAsHTML() {
16821682
}
16831683
}
16841684

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+
16851694

16861695
}

0 commit comments

Comments
 (0)