toolStrip.addToolButton(new ToolButton("Delete", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
final HttpConnector connector = form.getEditedEntity();
Feedback.confirm("Remove Connector", "Really remove connector '" + connector.getName() + "'?",
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed) {
presenter.onDeleteConnector(connector.getName());
}
}
});
}
}));
toolStrip.addToolButtonRight(new ToolButton("Add", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.launchConnectorDialogue();
}
}));
layout.add(toolStrip);
// ----
connectorTable = new DefaultCellTable<HttpConnector>(10);
Column<HttpConnector, String> nameColumn = new Column<HttpConnector, String>(new TextCell()) {
@Override
public String getValue(HttpConnector object) {
return object.getName();
}
};
Column<HttpConnector, String> protocolColumn = new Column<HttpConnector, String>(new TextCell()) {
@Override
public String getValue(HttpConnector object) {
return object.getProtocol();
}
};
Column<HttpConnector, ImageResource> statusColumn =
new Column<HttpConnector, ImageResource>(new ImageResourceCell()) {
@Override
public ImageResource getValue(HttpConnector connector) {
ImageResource res = null;
if(connector.isEnabled())
res = Icons.INSTANCE.statusGreen_small();
else
res = Icons.INSTANCE.statusRed_small();
return res;