public void setActiveToolbar(Integer viewID) { if (activeToolbar == viewID) { return; } activeToolbar = viewID; for (ToolBarW bar : toolbars) { bar.setActiveView(viewID); } }
/** Update toolbars. */ public void updateToolbarPanel() { toolBPanel.clear(); for (ToolBarW toolbar : toolbars) { if (toolbar != null) { toolbar.buildGui(); // TODO // toolbarPanel.add(toolbar, Integer.toString(getViewId(toolbar))); toolBPanel.add(toolbar); } } // TODO // toolbarPanel.show(Integer.toString(activeToolbar)); onResize(); toolBPanel.setVisible(true); }
/** * Initialization of the GGWToolbar. * * @param app1 application */ public void init(AppW app1) { this.inited = true; this.app = app1; toolbars = new ArrayList<ToolBarW>(); toolBar = new ToolBarW(this); toolBPanel = new FlowPanel(); toolBarPanel.add(toolBar); toolBarPanel.add(toolBPanel); toolBarPanel.addStyleName("toolbarPanel"); if (app.isExam()) { toolBarPanel.addStyleName("toolbarPanelExam"); } toolBPanel.setStyleName("toolBPanel"); // toolBarPanel.setSize("100%", "100%"); toolBar.init(app1); addToolbar(toolBar); // Adds the Open and Options Button for SMART addRightButtonPanel(); }
/** * @param toolbar * @return The ID of the dock panel associated with the passed toolbar or -1 */ private static int getViewId(ToolBarW toolbar) { return (toolbar.getDockPanel() != null ? toolbar.getDockPanel().getViewId() : -1); }