@Override protected EnhancedVLayout buildContentPane() { EnhancedVLayout contentPane = new EnhancedVLayout(); contentPane.setWidth100(); contentPane.setHeight100(); contentPane.setOverflow(Overflow.AUTO); EnhancedDynamicForm form = buildForm(); setForm(form); EnhancedVLayout topPane = new EnhancedVLayout(); topPane.setWidth100(); topPane.setHeight(80); topPane.addMember(form); contentPane.addMember(topPane); TabSet tabSet = new TabSet(); tabSet.setWidth100(); tabSet.setHeight100(); this.bundlesTab = buildBundlesTab(tabSet); tabSet.addTab(bundlesTab); contentPane.addMember(tabSet); return contentPane; }
public Tab searchTab(JcrExplorer jackrabbitExplorer) { Tab searchTab = new Tab(); searchTab.setTitle("Search"); TabSet searchTabSet = new TabSet(); searchTabSet.setTitle("SearchSet"); searchTabSet.setTabs( fullTextSearchTab(jackrabbitExplorer), xpathSearchTab(jackrabbitExplorer), sqlSearchTab(jackrabbitExplorer)); searchTabSet.setWidth100(); searchTabSet.setHeight100(); VLayout vlLayout = new VLayout(); vlLayout.addChild(searchTabSet); searchTab.setPane(vlLayout); return searchTab; }
@Override public void init() { Criteria criteria = null; if (parentRecord != null) { criteria = new Criteria(); criteria.setAttribute("Class_id", (Long) parentRecord.getAttributeAsLong("Class_id")); } else { Record rec = this.selectedRecord; criteria = new Criteria(); criteria.setAttribute("Class_id", (Long) rec.getAttributeAsLong("Class_id")); } tabs.setHeight100(); tabs.setWidth100(); final ClassModelMessages ClassMessagesd = (ClassModelMessages) GWT.create(ClassModelMessages.class); // let First tab be the Detail page of the current row, ie. the form thing. Tab tab_details = new Tab(ClassMessagesd.name_single()); tab_details.addTabDeselectedHandler( detailView); // has to respond with a form save, when we select a different tab tab_details.setPane(detailView); tabs.addTab(tab_details); tab_details.addTabSelectedHandler( new TabSelectedHandler() { @Override public void onTabSelected(TabSelectedEvent event) { getBreadcrumbs().removeAfter("Class_single"); } }); if (userDetails.hasAuthority("CAN_READ_TEAM_TAB") || userDetails.hasAuthority("CAN_READ_TAB_TEAM") || userDetails.hasAuthority("CAN_READ_CLASS_TAB_REF")) { Log.debug("Detected rights: CAN_READ_TEAM_TAB, showing tab"); teamsInClass_Team_Widget teamsInClass_Team = new teamsInClass_Team_Widget(criteria, userDetails); this.refs.add(teamsInClass_Team); final TeamModelMessages TeamMessages = (TeamModelMessages) GWT.create(TeamModelMessages.class); Tab tab_teamsInClass_Team_Widget = new Tab(TeamMessages.tab_name_TeamModel()); tab_teamsInClass_Team_Widget.setPane(teamsInClass_Team); modelToTitleMap.put("Team", TeamMessages.tab_name_TeamModel()); tab_teamsInClass_Team_Widget.addTabSelectedHandler( new TabSelectedHandler() { @Override public void onTabSelected(TabSelectedEvent event) { // if the last element's key doesn't end with _single, pop it first if (!getBreadcrumbs().lastCrumbIsSingle()) { getBreadcrumbs().popLast(); } // then add the target's normal crumb getBreadcrumbs().addCrumb("Team", TeamMessages.tab_name_TeamModel()); } }); tabs.addTab(tab_teamsInClass_Team_Widget); } else { Log.debug("No rights: CAN_READ_TEAM_TAB detected, not showing tab"); } attachToCanvas(); }
public void onModuleLoad() { /* * SmartGWT components */ topTabSet.setTabBarPosition(Side.TOP); topTabSet.setTabBarAlign(Side.LEFT); topTabSet.setHeight100(); topTabSet.setWidth100(); topTabSet.addTab(loadTab); topTabSet.addTab(editTab); topTabSet.addTab(errorTab); topTabSet.setTabBarControls( TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER, suggestCanvasItem, confirmFactorValues, exportIDFButton, exportSDRFButton, revalidateButton); RootPanel.get("contentsarea").add(topTabSet); /* * Buttons */ // Confirm Factor Values confirmFactorValues.setWidth(150); confirmFactorValues.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { guiMediator.showIDFFactorValue_ValidatorWindow(); } }); // Export SDRF exportSDRFButton.setIcon("[SKIN]actions/download.png"); exportSDRFButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (!guiMediator.getCurrentSDRFTitle().equals("null")) { logger.log(Level.INFO, "Export SDRF Button was pressed"); fileService.writeFile( guiMediator.getCurrentSDRFTitle(), guiMediator.getSDRFAsString(), new FileServiceCallback(guiMediator.getCurrentSDRFTitle())); } } }); // Export IDF exportIDFButton.setIcon("[SKIN]actions/download.png"); exportIDFButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (!guiMediator.getCurrentIDFTitle().equals("null")) { logger.log(Level.INFO, "Export IDF Button was pressed"); fileService.writeFile( guiMediator.getCurrentIDFTitle(), guiMediator.getIDFAsString(), new FileServiceCallback(guiMediator.getCurrentIDFTitle())); } } }); // Revalidate Button revalidateButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (!guiMediator.getCurrentSDRFTitle().equals("null") && !guiMediator.getCurrentIDFTitle().equals("null")) { validationService.validate( guiMediator.getCurrentIDFTitle(), guiMediator.getIDFAsString(), guiMediator.getCurrentSDRFTitle(), guiMediator.getSDRFAsString(), new ValidationServiceCallback(guiMediator)); } } }); // ***************************** // Layout // ***************************** TagCloudWindow tagCloudWindow = new TagCloudWindow(guiMediator); tagCloudWindow.show(); tagCloudWindow.moveTo(250, 85); // tagCloudWindow.moveAbove(canvas) // mainLayout.setHtmlElement(DOM.getElementById("webapp")); // mainLayout.show(); // topTabSet.setHtmlElement(DOM.getElementById("webapp")); Window.addWindowClosingHandler( new Window.ClosingHandler() { public void onWindowClosing(Window.ClosingEvent closingEvent) { closingEvent.setMessage("Do you really want to leave the page?"); } }); }