List of usage examples for com.google.gwt.user.client.ui TabPanel TabPanel
public TabPanel()
From source file:org.jboss.as.console.client.shared.subsys.security.AbstractDomainDetailEditor.java
License:Open Source License
Widget asWidget() { VerticalPanel vpanel = new VerticalPanel(); vpanel.setStyleName("rhs-content-panel"); // TODO: in order for the selection to retain we need a distinct key per module. // attributesTable = new DefaultCellTable<T>(4, getKeyProvider()); attributesTable = new DefaultCellTable<T>(4); attributesTable.getElement().setAttribute("style", "margin-top:5px;"); attributesProvider = new ListDataProvider<T>(); attributesProvider.addDataDisplay(attributesTable); headerLabel = new ContentHeaderLabel("TITLE HERE"); vpanel.add(headerLabel);// w ww. j a v a 2s . c o m vpanel.add(new ContentDescription(description)); vpanel.add(new ContentGroupLabel(getStackName())); ToolStrip tableTools = new ToolStrip(); addModule = new ToolButton(Console.CONSTANTS.common_label_add()); addModule.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { openWizard(null); } }); addModule.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_abstractDomainDetailEditor()); tableTools.addToolButtonRight(addModule); tableTools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_remove(), new ClickHandler() { @Override public void onClick(ClickEvent event) { final T policy = getCurrentSelection(); Feedback.confirm(Console.MESSAGES.deleteTitle(getEntityName()), Console.MESSAGES.deleteConfirm(policy.getCode()), new Feedback.ConfirmationHandler() { @Override public void onConfirmation(boolean isConfirmed) { if (isConfirmed) { attributesProvider.getList().remove(policy); if (attributesProvider.getList().size() > 0) { saveData(); } // call remove() on last provider-module instead of save() else { removeData(); } } } }); } })); vpanel.add(tableTools); // ------- Column<T, String> codeColumn = new Column<T, String>(new TextCell()) { @Override public String getValue(T record) { return record.getCode(); } }; attributesTable.addColumn(codeColumn, Console.CONSTANTS.subsys_security_codeField()); addCustomColumns(attributesTable); List<HasCell<T, T>> actionCells = new ArrayList<HasCell<T, T>>(); IdentityColumn<T> actionColumn = new IdentityColumn<T>(new CompositeCell(actionCells)); attributesTable.addColumn(actionColumn, ""); vpanel.add(attributesTable); // ------- DefaultPager pager = new DefaultPager(); pager.setDisplay(attributesTable); vpanel.add(pager); // ------- propertyEditor = new PropertyEditor(this, true); propertyEditor.setHideButtons(false); final SingleSelectionModel<T> ssm = new SingleSelectionModel<T>(); ssm.addSelectionChangeHandler(new SelectionChangeEvent.Handler() { @Override public void onSelectionChange(SelectionChangeEvent event) { T policy = ssm.getSelectedObject(); if (policy == null) // Can this actually happen? { return; } List<PropertyRecord> props = policy.getProperties(); if (props == null) { props = new ArrayList<PropertyRecord>(); policy.setProperties(props); } propertyEditor.setProperties("", policy.getProperties()); wizard.edit(policy); } }); attributesTable.setSelectionModel(ssm); wizard = getWizard(); TabPanel bottomTabs = new TabPanel(); bottomTabs.setStyleName("default-tabpanel"); bottomTabs.add(wizard.asWidget(), "Attributes"); bottomTabs.add(propertyEditor.asWidget(), "Module Options"); propertyEditor.setAllowEditProps(false); vpanel.add(new ContentGroupLabel("Details")); vpanel.add(bottomTabs); bottomTabs.selectTab(0); // ------- ScrollPanel scroll = new ScrollPanel(vpanel); LayoutPanel layout = new LayoutPanel(); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); return layout; }
From source file:org.jboss.as.console.client.shared.subsys.web.WebSubsystemView.java
License:Open Source License
@Override public Widget createWidget() { LayoutPanel layout = new RHSContentPanel("Servlet"); layout.add(new ContentHeaderLabel("Servlet/HTTP Configuration")); layout.add(new ContentDescription(Console.CONSTANTS.subsys_web_desc())); // ----// w w w .ja v a 2s .co m form = new Form(JSPContainerConfiguration.class); form.setNumColumns(2); FormToolStrip toolStrip = new FormToolStrip<JSPContainerConfiguration>(form, new FormToolStrip.FormCallback<JSPContainerConfiguration>() { @Override public void onSave(Map<String, Object> changeset) { presenter.onSaveJSPConfig(changeset); } @Override public void onDelete(JSPContainerConfiguration entity) { } }); toolStrip.providesDeleteOp(false); layout.add(toolStrip.asWidget()); // ---- CheckBoxItem disabled = new CheckBoxItem("disabled", "Disabled?"); CheckBoxItem development = new CheckBoxItem("development", "Development?"); TextBoxItem instanceId = new TextBoxItem("instanceId", "Instance ID", false); CheckBoxItem keepGenerated = new CheckBoxItem("keepGenerated", "Keep Generated?"); NumberBoxItem checkInterval = new NumberBoxItem("checkInterval", "Check Interval"); CheckBoxItem sourceFragment = new CheckBoxItem("displaySource", "Display Source?"); form.setFields(disabled, development, instanceId); form.setFieldsInGroup(Console.CONSTANTS.common_label_advanced(), new DisclosureGroupRenderer(), keepGenerated, checkInterval, sourceFragment); FormHelpPanel helpPanel = new FormHelpPanel(new FormHelpPanel.AddressCallback() { @Override public ModelNode getAddress() { ModelNode address = Baseadress.get(); address.add("subsystem", "web"); address.add("configuration", "jsp-configuration"); return address; } }, form); layout.add(helpPanel.asWidget()); layout.add(form.asWidget()); form.setEnabled(false); // TODO: // ---- TabPanel bottomLayout = new TabPanel(); bottomLayout.addStyleName("default-tabpanel"); bottomLayout.getElement().setAttribute("style", "padding-top:20px;"); connectorList = new ConnectorList(presenter); bottomLayout.add(connectorList.asWidget(), "Connectors"); serverList = new VirtualServerList(presenter); bottomLayout.add(serverList.asWidget(), "Virtual Servers"); bottomLayout.selectTab(0); layout.add(bottomLayout); return layout; }
From source file:org.jboss.as.console.client.shared.viewframework.TabbedFormLayoutPanel.java
License:Open Source License
public TabbedFormLayoutPanel(Class<?> beanType, FormMetaData formMetaData, EnumSet<FrameworkButton> hideButtons, FormItemObserver... observers) { this.beanType = beanType; this.formMetaData = formMetaData; this.observers = observers; this.tabPanel = new TabPanel(); this.tabPanel.setStyleName("default-tabpanel"); this.forms = makeForms(); this.hideButtons = hideButtons; }
From source file:org.jboss.bpm.console.client.process.InstanceDetailView.java
License:Open Source License
private void createDiagramWindow(ProcessInstanceRef inst) { ScrollPanel layout = new ScrollPanel(); layout.setStyleName("bpm-window-layout"); Label header = new Label("Instance: " + inst.getId()); header.setStyleName("bpm-label-header"); layout.add(header);//www . ja va 2 s. co m final TabPanel tabPanel = new TabPanel(); HorizontalPanel diaViewLayout = new HorizontalPanel(); diaViewLayout.add(diagramView); tabPanel.add(diagramView, "View"); processEvents = new CustomizableListBox<String>(new CustomizableListBox.ItemFormatter<String>() { public String format(String item) { return new HTML(item).getHTML(); } }); processEvents.setFirstLine("Process Events"); VerticalPanel sourcePanel = new VerticalPanel(); sourcePanel.add(processEvents); tabPanel.add(sourcePanel, "Source"); tabPanel.selectTab(0); layout.add(tabPanel); diagramWindowPanel = new WidgetWindowPanel("Process Instance Activity", layout, true); controller.handleEvent(new Event(GetProcessInstanceEventsAction.ID, inst.getId())); }
From source file:org.jboss.gwt.circuit.sample.todo.client.App.java
License:Open Source License
@AfterInitialization public void init() { resources.css().ensureInjected();/*from w w w .j a va 2s . com*/ dispatcher.addDiagnostics(diagnosticsView); DockLayoutPanel layout = new DockLayoutPanel(Style.Unit.PX); layout.getElement().setAttribute("style", "width:100%; height:100%"); TabPanel tabs = new TabPanel(); tabs.getElement().setId("app-container"); tabs.getElement().setAttribute("style", "margin:30px;width:100%; height:100%"); tabs.add(todoView, "Todo List"); tabs.add(userView, "User Management"); tabs.selectTab(0); layout.addSouth(diagnosticsView, 50); layout.add(tabs); RootPanel.get().add(layout); // application init dispatcher.dispatch(new LoadUsers()); dispatcher.dispatch(new ListTodos()); }
From source file:org.metawidget.gwt.client.ui.layout.TabPanelLayoutDecorator.java
License:LGPL
@Override protected Panel createSectionWidget(Panel previousSectionWidget, String section, Map<String, String> attributes, Panel container, GwtMetawidget metawidget) { // Whole new tab panel? TabPanel tabPanel;/* ww w .ja v a 2 s . c om*/ if (previousSectionWidget == null) { tabPanel = new TabPanel(); // Add to parent container Map<String, String> tabPanelAttributes = new HashMap<String, String>(); tabPanelAttributes.put(LABEL, ""); tabPanelAttributes.put(LARGE, TRUE); getDelegate().layoutWidget(tabPanel, PROPERTY, tabPanelAttributes, container, metawidget); } else { tabPanel = (TabPanel) previousSectionWidget.getParent().getParent().getParent(); } // New tab final Panel newPanel = new FlowPanel(); // Section name (possibly localized) String localizedSection = metawidget.getLocalizedKey(StringUtils.camelCase(section)); if (localizedSection == null) { localizedSection = section; } tabPanel.add(newPanel, localizedSection); if (previousSectionWidget == null) { tabPanel.selectTab(0); } return newPanel; }
From source file:org.ned.server.nedadminconsole.client.NedMainPage.java
License:Open Source License
@Override public void onModuleLoad() { model = new NedDataModel(); itemEditor = new NedItemEditor(model); treeLibrary = new NedLibraryTree(model); moveButtonsPanel = new VerticalPanel(); RootPanel rootPanel = RootPanel.get(); rootPanel.setStyleName("gwt-DecoratorPanel"); flowPanel = new FlowPanel(); flowPanel.setStyleName("NedMainPanel"); rootPanel.add(flowPanel);/*from ww w. j av a 2 s. c om*/ flowPanel.setHeight(""); Image imageHeader = new Image("images/header.png"); imageHeader.setStyleName("Ned-Image"); flowPanel.add(imageHeader); imageHeader.setSize("842px", "73px"); tabPanelMain = new TabPanel(); tabPanelMain.setStyleName("main-page-background"); flowPanel.add(tabPanelMain); tabPanelMain.setSize("100%", "650px"); librarySelector = new NedLibrarySelectorWidget(model); tabPanelMain.add(librarySelector, NedRes.instance().libDlgSelectLibrary(), false); verticalPanel = new VerticalPanel(); tabPanelMain.add(verticalPanel, NedRes.instance().mainTabLibraryManager(), false); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setSize("100%", "100%"); horizontalPanelMain = new HorizontalPanel(); verticalPanel.add(horizontalPanelMain); horizontalPanelMain.setSize("95%", "560px"); horizontalPanelMain.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanelMain.setStyleName("gwt-Ned-DecoratorPanel"); horizontalPanelMain.add(treeLibrary); horizontalPanelMain.setCellWidth(treeLibrary, "40%"); horizontalPanelMain.setCellHorizontalAlignment(treeLibrary, HasHorizontalAlignment.ALIGN_LEFT); PushButton moveUpButton = new PushButton(new Image("images/up_button_idle.png"), new Image("images/up_button_pressed.png")); moveButtonsPanel.add(moveUpButton); moveUpButton.setSize("52px", "48px"); moveUpButton.setStylePrimaryName("NedDeleteButton"); moveButtonsPanel.setCellVerticalAlignment(moveUpButton, HasVerticalAlignment.ALIGN_TOP); moveButtonsPanel.setCellHeight(moveUpButton, "60px"); moveUpButton.addClickHandler(new MoveItemCommand(true)); PushButton moveDownButton = new PushButton(new Image("images/down_button_idle.png"), new Image("images/down_button_pressed.png")); moveButtonsPanel.add(moveDownButton); moveDownButton.setSize("52px", "48px"); moveDownButton.setStylePrimaryName("NedDeleteButton"); moveButtonsPanel.setCellVerticalAlignment(moveDownButton, HasVerticalAlignment.ALIGN_TOP); moveButtonsPanel.setCellHeight(moveDownButton, "60px"); moveDownButton.addClickHandler(new MoveItemCommand(false)); horizontalPanelMain.add(moveButtonsPanel); horizontalPanelMain.setSize("100%", "100%"); horizontalPanelMain.setCellWidth(moveButtonsPanel, "20%"); horizontalPanelMain.setCellHorizontalAlignment(moveButtonsPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanelMain.add(itemEditor); horizontalPanelMain.setCellWidth(itemEditor, "40%"); horizontalPanelMain.setCellHorizontalAlignment(itemEditor, HasHorizontalAlignment.ALIGN_RIGHT); Widget widgetUserManagement = new NedUserManagementWidget(); tabPanelMain.add(widgetUserManagement, NedRes.instance().userManagement(), false); Widget messageOfTheDay = new NedMotdWidget(); tabPanelMain.add(messageOfTheDay, NedRes.instance().mainMOTD(), false); Widget widgetStatistics = new NedStatisticsWidget(); tabPanelMain.add(widgetStatistics, NedRes.instance().mainStatistics(), false); Widget widgetLanguage = new NedLanguageWidget(); tabPanelMain.add(widgetLanguage, NedRes.instance().mainLanguage(), false); decoratorPanelFill = new SimplePanel(); flowPanel.add(decoratorPanelFill); decoratorPanelFill.setPixelSize(imageHeader.getWidth(), Window.getClientHeight() - imageHeader.getHeight() - flowPanel.getOffsetHeight()); decoratorPanelFill.setStyleName("gwt-DecoratorPanel-gradient"); model.addListener(this); tabPanelMain.selectTab(0); tabPanelMain.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { int selectedIndex = event.getItem().intValue(); if (selectedIndex == 1 && model.getCurrentLibrary() == null) { NedAlert.showAlert(NedRes.instance().msgErrorNoLibrarySelected()); event.cancel(); } else if (tabPanelMain.getWidget(currentTabIndex) instanceof NedUserManagementWidget) { NedUserManagementWidget userManagement = (NedUserManagementWidget) tabPanelMain .getWidget(currentTabIndex); if (userManagement.isBlocked()) { userManagement.tryPersist(selectedIndex, tabPanelMain); event.cancel(); } } } }); tabPanelMain.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { currentTabIndex = event.getSelectedItem().intValue(); if (tabPanelMain.getWidget(currentTabIndex) instanceof NedUserManagementWidget) { ((NedUserManagementWidget) tabPanelMain.getWidget(currentTabIndex)).refreshBlockNavigation(); } } }); }
From source file:org.onecmdb.ui.gwt.itil.client.application.asset.screen.ListHardwareByTypeScreen.java
License:Open Source License
public ListHardwareByTypeScreen() { this.setTitleText("List Incident(s) by Status"); if (tab == null) { tab = new TabPanel(); CIReferenceTableControl unknownHwControl = new CIReferenceTableControl("UnknownHwType", "<$template{Hardware}"); CIReferenceTableControl switchHwControl = new CIReferenceTableControl("SwitchHwType", "<$template{Hardware}"); CIReferenceTableControl desktopHwControl = new CIReferenceTableControl("DesktopHwType", "<$template{Hardware}"); CIReferenceTableControl routerHwControl = new CIReferenceTableControl("RouterHwType", "<$template{Hardware}"); CIReferenceTableControl portableHwControl = new CIReferenceTableControl("PortableHwType", "<$template{Hardware}"); CIReferenceTableControl serverHwControl = new CIReferenceTableControl("ServerHwType", "<$template{Hardware}"); CIReferenceTableControl printerHwControl = new CIReferenceTableControl("PrinterHwType", "<$template{Hardware}"); unkownHwLabel = new LabelCounter("Unknown", unknownHwControl); switchHwLabel = new LabelCounter("Switch", switchHwControl); desktopHwLabel = new LabelCounter("Desktop", desktopHwControl); routerHwLabel = new LabelCounter("Router", routerHwControl); portableHwLabel = new LabelCounter("Portable", portableHwControl); serverHwLabel = new LabelCounter("Server", serverHwControl); printerHwLabel = new LabelCounter("Printer", printerHwControl); tab.add(new ListHardwareScreen(serverHwControl), serverHwLabel); tab.add(new ListHardwareScreen(switchHwControl), switchHwLabel); tab.add(new ListHardwareScreen(desktopHwControl), desktopHwLabel); tab.add(new ListHardwareScreen(routerHwControl), routerHwLabel); tab.add(new ListHardwareScreen(portableHwControl), portableHwLabel); tab.add(new ListHardwareScreen(printerHwControl), printerHwLabel); tab.add(new ListHardwareScreen(unknownHwControl), unkownHwLabel); tab.selectTab(0);/*from w w w.ja va 2s. c om*/ dockPanel.add(tab, DockPanel.CENTER); dockPanel.setCellVerticalAlignment(tab, VerticalPanel.ALIGN_TOP); tab.addTabListener(new TabListener() { public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex) { return true; } public void onTabSelected(SourcesTabEvents sender, int tabIndex) { Widget selected = tab.getWidget(tabIndex); if (selected instanceof ListHardwareScreen) { ((ListHardwareScreen) selected).load(); } } }); initWidget(dockPanel); } }
From source file:org.onecmdb.ui.gwt.itil.client.application.incident.screen.GroupListIncidentScreen.java
License:Open Source License
public GroupListIncidentScreen() { this.setTitleText("List Incidents by Status"); if (tab == null) { tab = new TabPanel(); CIReferenceTableControl refNewControl = new CIReferenceTableControl("incidentStatus_New", "<$template{ITIL_Incident}"); CIReferenceTableControl refUiControl = new CIReferenceTableControl("incidentStatus_UI", "<$template{ITIL_Incident}"); CIReferenceTableControl refProblemControl = new CIReferenceTableControl("incidentStatus_Problem", "<$template{ITIL_Incident}"); CIReferenceTableControl refKnownErrorControl = new CIReferenceTableControl("incidentStatus_KnownError", "<$template{ITIL_Incident}"); CIReferenceTableControl refClosedControl = new CIReferenceTableControl("incidentStatus_Closed", "<$template{ITIL_Incident}"); newIncidentLabel = new LabelCounter("New", refNewControl); uiIncidentLabel = new LabelCounter("Open", refUiControl); problemIncidentLabel = new LabelCounter("Problem", refProblemControl); knownErrorIncidentLabel = new LabelCounter("Known Error", refKnownErrorControl); closedIncidentLabel = new LabelCounter("Closed", refClosedControl); tab.add(new ListIncidentScreen(refNewControl), newIncidentLabel); tab.add(new ListIncidentScreen(refUiControl), uiIncidentLabel); tab.add(new ListIncidentScreen(refProblemControl), problemIncidentLabel); tab.add(new ListIncidentScreen(refKnownErrorControl), knownErrorIncidentLabel); tab.add(new ListIncidentScreen(refClosedControl), closedIncidentLabel); tab.selectTab(0);/*www. j av a2 s . c o m*/ tab.setWidth("100%"); dockPanel.add(tab, DockPanel.CENTER); tab.setHeight("100%"); dockPanel.setCellVerticalAlignment(tab, VerticalPanel.ALIGN_TOP); dockPanel.setCellHeight(tab, "100%"); tab.addTabListener(new TabListener() { public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex) { return true; } public void onTabSelected(SourcesTabEvents sender, int tabIndex) { Widget selected = tab.getWidget(tabIndex); if (selected instanceof ListIncidentScreen) { ((ListIncidentScreen) selected).load(); } } }); initWidget(dockPanel); } }
From source file:org.onecmdb.ui.gwt.itil.client.application.problem.screen.GroupListProblemScreen.java
License:Open Source License
public GroupListProblemScreen() { this.setTitleText("List Problems by Status"); if (tab == null) { tab = new TabPanel(); CIReferenceTableControl refNewProblemControl = new CIReferenceTableControl("problemStatus_New", "<$template{ITIL_Problem}"); CIReferenceTableControl refProblemControl = new CIReferenceTableControl("problemStatus_Problem", "<$template{ITIL_Problem}"); CIReferenceTableControl refKnownErrorControl = new CIReferenceTableControl("problemStatus_KnownError", "<$template{ITIL_Problem}"); newProblemIncidentLabel = new LabelCounter("New", refNewProblemControl); problemIncidentLabel = new LabelCounter("Problem", refProblemControl); knownErrorIncidentLabel = new LabelCounter("Known Error", refKnownErrorControl); tab.add(new ListProblemScreen(refNewProblemControl), newProblemIncidentLabel); tab.add(new ListProblemScreen(refProblemControl), problemIncidentLabel); tab.add(new ListProblemScreen(refKnownErrorControl), knownErrorIncidentLabel); tab.selectTab(0);/*from www. j a v a 2s. co m*/ dockPanel.add(tab, DockPanel.CENTER); tab.setHeight("100%"); dockPanel.setCellVerticalAlignment(tab, VerticalPanel.ALIGN_TOP); dockPanel.setCellHeight(tab, "100%"); tab.addTabListener(new TabListener() { public boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex) { return true; } public void onTabSelected(SourcesTabEvents sender, int tabIndex) { Widget selected = tab.getWidget(tabIndex); if (selected instanceof ListProblemScreen) { ((ListProblemScreen) selected).load(); } } }); initWidget(dockPanel); } }