layout.setWidgetTopHeight(titleBar, 0, Style.Unit.PX, 28, Style.Unit.PX);
layout.setWidgetTopHeight(panel, 35, Style.Unit.PX, 100, Style.Unit.PCT);
// ---------------------------------------------
final ToolStrip toolStrip = new ToolStrip();
edit = new ToolButton("Edit");
edit.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent clickEvent) {
if(edit.getText().equals("Edit"))
{
onEdit();
}
else
{
onSave();
}
}
});
toolStrip.addToolButton(edit);
ToolButton delete = new ToolButton("Delete");
delete.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent clickEvent) {
Feedback.confirm(
"Delete Server Group",
"Do you want to delete server group '"+form.getEditedEntity().getGroupName()+"'?",
new Feedback.ConfirmationHandler() {
@Override
public void onConfirmation(boolean isConfirmed) {
if(isConfirmed)
presenter.deleteCurrentRecord();
}
});
}
});
toolStrip.addToolButton(delete);
nameLabel = new ContentHeaderLabel("Name here ...");
HorizontalPanel horzPanel = new HorizontalPanel();
horzPanel.getElement().setAttribute("style", "width:100%;");
Image image = new Image(Icons.INSTANCE.serverGroup());
horzPanel.add(image);
horzPanel.add(nameLabel);
horzPanel.add(toolStrip);
toolStrip.getElement().getParentElement().setAttribute("width", "50%");
image.getElement().getParentElement().setAttribute("width", "25");
panel.add(horzPanel);
// ---------------------------------------------------