// -----
menuButton = new ToolButton("Open", new ClickHandler()
{
public void onClick(ClickEvent clickEvent) {
controller.handleEvent(new Event(GetProcessDefinitionsAction.ID, null));
}
});
toolBar.add(menuButton);
// -----
title = new HTML();
title.getElement().setAttribute("style", "font-size:24px; font-weight:BOLD");
// ------------
BoxLayout boxLayout = new BoxLayout(BoxLayout.Orientation.HORIZONTAL);
timespanPanel = new LayoutPanel(boxLayout);
timespanPanel.setPadding(0);
timespan = new HTML();
timespan.getElement().setAttribute("style", "padding-left:10px;padding-top:2px; color:#C8C8C8;font-size:16px;text-align:left;");
timespanButton = new ToolButton();
timespanButton.setStyle(ToolButton.ToolButtonStyle.MENU);
timespanButton.getElement().setAttribute("style", "padding-right:0px;background-image:none;");
timespanButton.setVisible(false);
final PopupMenu timeBtnMenu = new PopupMenu();
for(final TimespanValues ts : TimespanValues.values())
{
timeBtnMenu.addItem(ts.getCanonicalName(), new Command()
{
public void execute()
{
LoadDatasetEvent theEvent = new LoadDatasetEvent();
String theDefinitionId = getDefinitionId(currentProcDef);
if (theDefinitionId == null) {
return ;
}
theEvent.setDefinitionId(theDefinitionId);
theEvent.setTimespan(ts);
currentTimespan = ts;
if (includeFailed.getValue()) {
theEvent.setIncludedFailed(true);
} else {
theEvent.setIncludedFailed(false);
}
LoadingOverlay.on(chartArea, true);
controller.handleEvent(new Event(LoadDatasetsAction.ID, theEvent));
}
});
};
timespanButton.setMenu(timeBtnMenu);
timespanPanel.add(timespanButton, new BoxLayoutData("20px", "20px"));
timespanPanel.add(timespan, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
// ------------
final LayoutPanel contents = new LayoutPanel(new RowLayout());
LayoutPanel headerPanel = new LayoutPanel(new ColumnLayout());
headerPanel.setPadding(0);
headerPanel.add(title, new ColumnLayoutData("55%"));
headerPanel.add(timespanPanel, new ColumnLayoutData("45%"));
// ------------
chartArea = new LayoutPanel();
chartArea.setPadding(15);
chartArea.setLayout(new BorderLayout());
instancePanel = new LayoutPanel();
listBox = new org.gwt.mosaic.ui.client.ListBox(new String[]{"Process Instance"});
instancePanel.add(listBox);
contents.add(headerPanel, new RowLayoutData("100"));
contents.add(chartArea, new RowLayoutData(true));
// ------------
includeFailed = new CheckBox("Incl. failed / terminated?");
includeFailed.setValue(false);
includeFailed.addValueChangeHandler(new ValueChangeHandler<Boolean>()
{
public void onValueChange(ValueChangeEvent<Boolean> isEnabled) {
LoadDatasetEvent theEvent = new LoadDatasetEvent();
String theDefinitionId = getDefinitionId(currentProcDef);
if (theDefinitionId == null) {
return ;
}
theEvent.setDefinitionId(theDefinitionId);
theEvent.setTimespan(currentTimespan);
if (includeFailed.getValue()) {
theEvent.setIncludedFailed(true);
} else {
theEvent.setIncludedFailed(false);
}
LoadingOverlay.on(chartArea, true);
controller.handleEvent(new Event(LoadDatasetsAction.ID, theEvent));
}
});
buttonPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
buttonPanel.add(includeFailed);