Java Code Examples for com.google.gwt.user.client.ui.DeckPanel#add()
The following examples show how to use
com.google.gwt.user.client.ui.DeckPanel#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleForm.java From core with GNU Lesser General Public License v2.1 | 4 votes |
private Widget build() { deck = new DeckPanel(); deck.setStyleName("fill-layout-width"); // ---------------------- // view panel VerticalPanel viewPanel = new VerticalPanel(); viewPanel.setStyleName("fill-layout-width"); viewPanel.addStyleName("form-view-panel"); deck.add(viewPanel.asWidget()); // ---------------------- // edit panel VerticalPanel editPanel = new VerticalPanel(); editPanel.setStyleName("fill-layout-width"); editPanel.addStyleName("form-edit-panel"); RenderMetaData metaData = new RenderMetaData(); metaData.setNumColumns(numColumns); GroupRenderer groupRenderer = new DefaultGroupRenderer();; Map<String, FormItem> groupItems = new LinkedHashMap<String, FormItem>(); for(FormItem item : items) { groupItems.put(item.getName(), item); } // edit view Widget widget = groupRenderer.render(metaData, "default", groupItems); editPanel.add(widget); // plain view PlainFormView plainView = new PlainFormView(items); plainView.setNumColumns(numColumns); plainViews.add(plainView); viewPanel.add(groupRenderer.renderPlain(metaData, "default", plainView)); deck.add(editPanel); // toggle default view toggleViews(); refreshPlainView(); // make sureit's build, even empty... return deck; }
Example 2
Source File: NewStackWizard.java From core with GNU Lesser General Public License v2.1 | 3 votes |
Widget asWidget() { deck = new DeckPanel(); deck.add(new StackStep1(this).asWidget()); step2 = new StackStep2(this); deck.add(step2.asWidget()); deck.showWidget(0); return deck; }
Example 3
Source File: ConnectorOverview.java From core with GNU Lesser General Public License v2.1 | 2 votes |
Widget asWidget() { LayoutPanel layout = new LayoutPanel(); VerticalPanel panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); ScrollPanel scroll = new ScrollPanel(panel); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); serverName = new HTML("Replace me"); serverName.setStyleName("content-header-label"); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("fill-layout-width"); header.add(serverName); final DeckPanel deck = new DeckPanel(); deck.addStyleName("fill-layout"); final ListBox selector = new ListBox(); selector.addItem("Type: Remote"); selector.addItem("Type: In-VM"); selector.addItem("Type: Generic"); selector.addChangeHandler(changeEvent -> deck.showWidget(selector.getSelectedIndex())); header.add(selector); selector.getElement().getParentElement().setAttribute("align", "right"); panel.add(header); panel.add(new ContentDescription(Console.CONSTANTS.jmsConnectorDescription())); genericConnectors = new ConnectorList(presenter, ConnectorType.GENERIC); remoteConnectors = new ConnectorList(presenter, ConnectorType.REMOTE); invmConnectors = new ConnectorList(presenter, ConnectorType.INVM); deck.add(remoteConnectors.asWidget()); deck.add(invmConnectors.asWidget()); deck.add(genericConnectors.asWidget()); deck.showWidget(0); panel.add(deck); return layout; }
Example 4
Source File: AcceptorOverview.java From core with GNU Lesser General Public License v2.1 | 2 votes |
Widget asWidget() { LayoutPanel layout = new LayoutPanel(); VerticalPanel panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); ScrollPanel scroll = new ScrollPanel(panel); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); serverName = new HTML(Console.CONSTANTS.replace_me()); serverName.setStyleName("content-header-label"); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("fill-layout-width"); header.add(serverName); final DeckPanel deck = new DeckPanel(); deck.addStyleName("fill-layout"); final ListBox selector = new ListBox(); selector.addItem("Type: Remote"); selector.addItem("Type: In-VM"); selector.addItem("Type: Generic"); selector.addChangeHandler(changeEvent -> deck.showWidget(selector.getSelectedIndex())); header.add(selector); selector.getElement().getParentElement().setAttribute("align", "right"); panel.add(header); panel.add(new ContentDescription(Console.CONSTANTS.hornetq_acceptor_type_desc())); genericAcceptors = new AcceptorList(presenter, AcceptorType.GENERIC); remoteAcceptors = new AcceptorList(presenter, AcceptorType.REMOTE); invmAcceptors = new AcceptorList(presenter, AcceptorType.INVM); deck.add(remoteAcceptors.asWidget()); deck.add(invmAcceptors.asWidget()); deck.add(genericAcceptors.asWidget()); deck.showWidget(0); panel.add(deck); return layout; }
Example 5
Source File: ConnectorOverview.java From core with GNU Lesser General Public License v2.1 | 2 votes |
Widget asWidget() { LayoutPanel layout = new LayoutPanel(); VerticalPanel panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); ScrollPanel scroll = new ScrollPanel(panel); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); // --- serverName = new HTML("Replace me"); serverName.setStyleName("content-header-label"); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("fill-layout-width"); header.add(serverName); // ---- final DeckPanel deck = new DeckPanel(); deck.addStyleName("fill-layout"); final ListBox selector = new ListBox(); selector.addItem("Type: Remote"); selector.addItem("Type: In-VM"); selector.addItem("Type: Generic"); selector.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent changeEvent) { deck.showWidget(selector.getSelectedIndex()); } }); header.add(selector); selector.getElement().getParentElement().setAttribute("align", "right"); panel.add(header); panel.add(new ContentDescription(Console.CONSTANTS.jmsConnectorDescription())); genericConnectors = new ConnectorList(presenter, ConnectorType.GENERIC); remoteConnectors = new ConnectorList(presenter, ConnectorType.REMOTE); invmConnectors = new ConnectorList(presenter, ConnectorType.INVM); deck.add(remoteConnectors.asWidget()); deck.add(invmConnectors.asWidget()); deck.add(genericConnectors.asWidget()); deck.showWidget(0); panel.add(deck); return layout; }
Example 6
Source File: AcceptorOverview.java From core with GNU Lesser General Public License v2.1 | 2 votes |
Widget asWidget() { LayoutPanel layout = new LayoutPanel(); VerticalPanel panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); ScrollPanel scroll = new ScrollPanel(panel); layout.add(scroll); layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT); // --- serverName = new HTML(Console.CONSTANTS.replace_me()); serverName.setStyleName("content-header-label"); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("fill-layout-width"); header.add(serverName); // ---- final DeckPanel deck = new DeckPanel(); deck.addStyleName("fill-layout"); final ListBox selector = new ListBox(); selector.addItem("Type: Remote"); selector.addItem("Type: In-VM"); selector.addItem("Type: Generic"); selector.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent changeEvent) { deck.showWidget(selector.getSelectedIndex()); } }); header.add(selector); selector.getElement().getParentElement().setAttribute("align", "right"); panel.add(header); panel.add(new ContentDescription(Console.CONSTANTS.hornetq_acceptor_type_desc())); genericAcceptors = new AcceptorList(presenter, AcceptorType.GENERIC); remoteAcceptors = new AcceptorList(presenter, AcceptorType.REMOTE); invmAcceptors = new AcceptorList(presenter, AcceptorType.INVM); deck.add(remoteAcceptors.asWidget()); deck.add(invmAcceptors.asWidget()); deck.add(genericAcceptors.asWidget()); deck.showWidget(0); panel.add(deck); return layout; }