{
super("Deployment details");
super.setStyleName("bpm-detail-panel");
grid = new PropertyGrid(new String[] {"ID:", "Name:", "Processes:"});
LayoutPanel propLayout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
propLayout.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
suspendBtn = new ToolButton("Suspend", new ClickListener() {
public void onClick(Widget sender) {
DeploymentRef deploymentRef = getSelection();
if(deploymentRef!=null)
{
MessageBox.confirm("Suspend deployment",
"Do you want to suspend this deployment? Any associated process will be suspended aswell.",
new MessageBox.ConfirmationCallback() {
public void onResult(boolean doIt)
{
if(doIt)
{
controller.handleEvent(
new Event(
SuspendDeploymentAction.ID,
getSelection().getId()
)
);
}
}
});
}
else
{
MessageBox.alert("Missing selection", "Please select a deployment");
}
}
}
);
resumeBtn = new ToolButton("Resume", new ClickListener() {
public void onClick(Widget sender) {
DeploymentRef deploymentRef = getSelection();
if(deploymentRef!=null)
{
MessageBox.confirm("Resume deployment",
"Do you want to resume this deployment?",
new MessageBox.ConfirmationCallback() {
public void onResult(boolean doIt)
{
if(doIt)
{
controller.handleEvent(
new Event(
ResumeDeploymentAction.ID,
getSelection().getId()
)
);
}
}
});
}
else
{
MessageBox.alert("Missing selection", "Please select a deployment");
}
}
}
);
propLayout.add(suspendBtn);
propLayout.add(resumeBtn);
// properties
final DeckLayoutPanel deck = new DeckLayoutPanel();
deck.add(propLayout);