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("A connector can be used by a client to define how it connects to a server."));
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;
}