super("Deployment details");
super.setStyleName("bpm-detail-panel");
grid = new PropertyGrid(new String[] {"ID:", "Name:", "Processes:"});
MosaicPanel propLayout = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
propLayout.add(grid, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
suspendBtn = new Button("Retire", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
DeploymentRef deploymentRef = getSelection();
if(deploymentRef!=null)
{
MessageBox.confirm("Retire deployment",
"Do you want to retire this deployment? Any associated process will be suspended.",
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 Button("Activate", new ClickHandler() {
public void onClick(ClickEvent clickEvent)
{
DeploymentRef deploymentRef = getSelection();
if(deploymentRef!=null)
{
MessageBox.confirm("Activate 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");
}
}
}
);
MosaicPanel btnLayout = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
btnLayout.add(suspendBtn, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
btnLayout.add(resumeBtn, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
propLayout.add(btnLayout);
// properties
final DeckLayoutPanel deck = new DeckLayoutPanel();
deck.add(propLayout);
// resource info
ScrollLayoutPanel scrollPanel = new ScrollLayoutPanel();
resourcePanel = new ResourcePanel();
scrollPanel.add(resourcePanel);
deck.add(scrollPanel);
// selection
final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
dropBox.setStyleName("bpm-operation-ui");
dropBox.addItem("Properties");
dropBox.addItem("Resources");
dropBox.addChangeListener(new ChangeListener() {
public void onChange(Widget sender) {
deck.showWidget(dropBox.getSelectedIndex());
deck.layout();
}
});
this.getHeader().add(dropBox, Caption.CaptionRegion.RIGHT);
this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
deck.showWidget(dropBox.getSelectedIndex());
this.add(deck, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
}