}
@Override
public Widget createWidget() {
LayoutPanel layout = new LayoutPanel();
TitleBar titleBar = new TitleBar(Console.CONSTANTS.common_label_serverInstances());
layout.add(titleBar);
VerticalPanel vpanel = new VerticalPanel();
vpanel.setStyleName("rhs-content-panel");
// ----------------------------------------------------------------------
nameLabel = new ContentHeaderLabel(Console.CONSTANTS.common_label_serverStatus());
HorizontalPanel horzPanel = new HorizontalPanel();
horzPanel.getElement().setAttribute("style", "width:100%;");
Image image = new Image(Icons.INSTANCE.serverInstance());
horzPanel.add(image);
horzPanel.add(nameLabel);
image.getElement().getParentElement().setAttribute("width", "25");
vpanel.add(horzPanel);
// ----------------------------------------------------------------------
vpanel.add(new ContentGroupLabel("Server Instances"));
HorizontalPanel tableOptions = new HorizontalPanel();
tableOptions.getElement().setAttribute("cellpadding", "2px");
groupFilter = new ComboBox();
groupFilter.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
presenter.onFilterByGroup(event.getValue());
}
});
Widget typeFilterWidget = groupFilter.asWidget();
typeFilterWidget.getElement().setAttribute("width", "200px;");
tableOptions.add(new Label(Console.CONSTANTS.common_label_serverGroup()+":"));
tableOptions.add(typeFilterWidget);
tableOptions.getElement().setAttribute("style", "float:right;");
vpanel.add(tableOptions);
// ----------------------------------------------------------------------
instanceTable = new DefaultCellTable<ServerInstance>(10);
instanceProvider = new ListDataProvider<ServerInstance>();
instanceProvider.addDataDisplay(instanceTable);
// Create columns
Column<ServerInstance, String> nameColumn = new Column<ServerInstance, String>(new TextCell()) {
@Override
public String getValue(ServerInstance object) {
return object.getName();
}
};
Column<ServerInstance, String> groupColumn = new Column<ServerInstance, String>(new TextCell()) {
@Override
public String getValue(ServerInstance object) {
return object.getGroup();
}
};
Column<ServerInstance, ImageResource> statusColumn =
new Column<ServerInstance, ImageResource>(new ImageResourceCell()) {
@Override
public ImageResource getValue(ServerInstance instance) {
ImageResource res = null;
if(instance.isRunning())
res = Icons.INSTANCE.statusGreen_small();
else
res = Icons.INSTANCE.statusRed_small();
return res;
}
};
instanceTable.addColumn(nameColumn, Console.CONSTANTS.common_label_server());
instanceTable.addColumn(groupColumn, Console.CONSTANTS.common_label_serverGroup());
instanceTable.addColumn(statusColumn, Console.CONSTANTS.common_label_status());
vpanel.add(instanceTable);
// scroll enabled
ScrollPanel scroll = new ScrollPanel();
scroll.add(vpanel);
layout.add(scroll);
layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 28, Style.Unit.PX);
layout.setWidgetTopHeight(scroll, 28, Style.Unit.PX, 100, Style.Unit.PCT);
// ----------------------------------------------------------------------
VerticalPanel formPanel = new VerticalPanel();