mainTabSet.setWidth100();
mainTabSet.setHeight100();
mainTabSet.addTabSelectedHandler(new TabSelectedHandler() {
public void onTabSelected(TabSelectedEvent event) {
Tab selectedTab = event.getTab();
String historyToken = selectedTab.getAttribute("historyToken");
if (historyToken != null) {
History.newItem(historyToken, false);
} else {
History.newItem("main", false);
}
}
});
LayoutSpacer layoutSpacer = new LayoutSpacer();
layoutSpacer.setWidth(5);
SelectItem selectItem = new SelectItem();
selectItem.setHeight(21);
selectItem.setWidth(130);
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
valueMap.put("EnterpriseBlue", "Enterprise Blue");
valueMap.put("Enterprise", "Enterprise Gray");
valueMap.put("Graphite", "Graphite");
valueMap.put("Simplicity", "Simplicity");
selectItem.setValueMap(valueMap);
final String skinCookieName = "skin_name_2_4";
String currentSkin = Cookies.getCookie(skinCookieName);
if (currentSkin == null) {
currentSkin = "Enterprise";
}
selectItem.setDefaultValue(currentSkin);
selectItem.setShowTitle(false);
selectItem.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
Cookies.setCookie(skinCookieName, (String) event.getValue());
com.google.gwt.user.client.Window.Location.reload();
}
});
DynamicForm form = new DynamicForm();
form.setPadding(0);
form.setMargin(0);
form.setCellPadding(1);
form.setNumCols(1);
form.setFields(selectItem);
mainTabSet.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, layoutSpacer, form);
contextMenu = createContextMenu();
Tab tab = new Tab();
tab.setTitle("Home ");
tab.setIcon("pieces/16/cube_green.png", 16);
tab.setWidth(80);
HLayout mainPanel = new HLayout();
mainPanel.setHeight100();
mainPanel.setWidth100();
TileView tileView = new TileView(mainPanel);
mainPanel.addMember(tileView);
tab.setPane(mainPanel);
mainTabSet.addTab(tab);
Canvas canvas = new Canvas();
canvas.setBackgroundImage("[SKIN]/shared/background.gif");