Source:
void setupSearchTabPanel() { final int indexDate = 0; final int indexId = 1; final int indexTag = 2; allTags(); tagFilterBox = new TagBox(); tagButton = new Button("..."); tagButton.setSize("30px","22px"); tagButton.setEnabled(allTagsLoadComplete); tagButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { tagNames.clear(); tagFilterBox.popUpForFilter(allTags, tagNames); } }); Label from = new Label("From "); Label to = new Label(" to "); from.setStyleName(JaggerResources.INSTANCE.css().searchPanel()); to.setStyleName(JaggerResources.INSTANCE.css().searchPanel()); setPanel(datesPanel, from, sessionsFrom, to, sessionsTo); datesPanel.setBorderWidth(0); sessionsFrom.setSize("95%","18px"); sessionsTo.setSize("95%","18px"); setPanel(tagsPanel, sessionTagsTextBox, tagButton); idsPanel.setBorderWidth(0); sessionTagsTextBox.setSize("98%","18px"); setPanel(idsPanel, sessionIdsTextBox); tagsPanel.setBorderWidth(0); sessionIdsTextBox.setSize("98%", "18px"); searchTabPanel.selectTab(0); searchTabPanel.getTabWidget(0).setTitle("Search by an session's id"); searchTabPanel.getTabWidget(1).setTitle("Search by a date of sessions"); searchTabPanel.getTabWidget(2).setTitle("Search by session's tags"); searchTabPanel.setTitle("A search bar"); searchTabPanel.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { int selected = event.getSelectedItem(); switch (selected) { case indexDate: onDateSearchTabSelected(); break; case indexId: onIdSearchTabSelected(); break; case indexTag: onTagSearchTabSelected(); break; default: } } }); }

Target:
void setupSearchTabPanel() { final int indexId = 0; final int indexTag = 1; final int indexDate = 2; allTags(); tagFilterBox = new TagBox(); tagButton = new Button("..."); tagButton.setSize("30px","22px"); tagButton.setEnabled(allTagsLoadComplete); tagButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { tagNames.clear(); tagFilterBox.popUpForFilter(allTags, tagNames); } }); Label from = new Label("From "); Label to = new Label(" to "); from.setStyleName(JaggerResources.INSTANCE.css().searchPanel()); to.setStyleName(JaggerResources.INSTANCE.css().searchPanel()); setPanel(datesPanel, from, sessionsFrom, to, sessionsTo); datesPanel.setBorderWidth(0); sessionsFrom.setSize("95%","18px"); sessionsTo.setSize("95%","18px"); setPanel(tagsPanel, sessionTagsTextBox, tagButton); idsPanel.setBorderWidth(0); sessionTagsTextBox.setSize("98%","18px"); setPanel(idsPanel, sessionIdsTextBox); tagsPanel.setBorderWidth(0); sessionIdsTextBox.setSize("98%", "18px"); searchTabPanel.selectTab(indexId); searchTabPanel.getTabWidget(indexId).setTitle("Search by an session's id"); searchTabPanel.getTabWidget(indexTag).setTitle("Search by session's tags"); searchTabPanel.getTabWidget(indexDate).setTitle("Search by a date of sessions"); searchTabPanel.setTitle("A search bar"); searchTabPanel.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { int selected = event.getSelectedItem(); switch (selected) { case indexId: onIdSearchTabSelected(); break; case indexTag: onTagSearchTabSelected(); break; case indexDate: onDateSearchTabSelected(); break; default: } } }); }