private Label buildSecondaryMenuOption(final String title, boolean selected) { Label tmp = new Label(title); tmp.setTitle(title); tmp.setWrap(false); tmp.setValign(VerticalAlignment.BOTTOM); tmp.setAlign(Alignment.CENTER); tmp.setPadding(10); tmp.setShowRollOver(true); tmp.setCursor(Cursor.POINTER); String style; if (selected) { style = "secondaryMenuText-selected"; selectedSecondaryMenuOption = tmp; } else { style = "secondaryMenuText"; } tmp.setBaseStyle(style); tmp.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Object o = event.getSource(); if (o instanceof Label) { Label lbl = (Label) o; if (!lbl.getTitle().equals(selectedSecondaryMenuOption.getTitle())) { selectedSecondaryMenuOption.setBaseStyle("secondaryMenuText"); lbl.setBaseStyle("secondaryMenuText-selected"); selectedSecondaryMenuOption = lbl; BLCMain.setCurrentPageKey(lbl.getTitle()); buildHistoryNewItem( lbl.getTitle(), BLCLaunch.getSelectedModule(History.getToken()), null); } } } }); return tmp; }
public SavePanel( String saveTitle, ClickHandler saveClicked, String cancelTitle, ClickHandler cancelClicked) { if (saveTitle == null || saveTitle.trim().length() == 0) saveTitle = "OK"; // ClientSession.getInstance().getCaption("save"); if (cancelTitle == null || cancelTitle.trim().length() == 0) cancelTitle = "Close"; // ClientSession.getInstance().getCaption("cancel"); hl = new HLayout(); hl.setAlign(Alignment.RIGHT); saveBtn = new IButton(saveTitle); saveBtn.addClickHandler(saveClicked); cancelBtn = new IButton(cancelTitle); cancelBtn.addClickHandler(cancelClicked); hl.addMember(saveBtn); hl.addMember(cancelBtn); hl.setWidth100(); hl.setMembersMargin(10); hl.setHeight("30"); Label l = new Label(); l.setTitle(""); l.setContents(""); l.setWidth(0); hl.addMember(l); addMember(hl); }