minInput.setText(Integer.toString((int) eventFilter.getMinDuration()));
refreshEventTypeSelect(model);
}
private void buildFilterPanel(Container parent, SluggishnessModel model) {
Div row1 = new Div(parent);
Container row1Container = new DefaultContainerImpl(row1.getElement());
Document doc = parent.getDocument();
// Min Duration: ________
Element minLabel = doc.createSpanElement();
row1.getElement().appendChild(minLabel);
minLabel.setInnerText("Minimum duration: ");
minInput = new InputText(row1Container);
minInput.setStyleName(css.filterPanelMinInput());
minInput.addKeyUpListener(new KeyUpListener() {
public void onKeyUp(KeyUpEvent event) {
int minValue = 0;
boolean exceptionEncountered = false;
try {
minValue = Integer.valueOf(minInput.getText());
} catch (NumberFormatException ex) {
// leave the filter alone
exceptionEncountered = true;
minInput.getElement().getStyle().setBackgroundColor("#ebb");
}
if (!exceptionEncountered && minValue >= 0) {
eventFilter.setMinDuration(minValue);
minInput.getElement().getStyle().setBackgroundColor("#fff");
eventTable.renderTable();
}
}
});
// Event Type ======== %
Element eventTypeLabel = doc.createSpanElement();
row1.getElement().appendChild(eventTypeLabel);
eventTypeLabel.getStyle().setPropertyPx("marginLeft", 10);
eventTypeLabel.setInnerText("Event Type: ");
createEventTypeSelect(row1Container, model);
createEventTypePercentSelect(row1Container);
// Always show events with: o logs o hintlets
Element alwaysShowLabel = doc.createSpanElement();
alwaysShowLabel.setInnerText("Always show: ");
alwaysShowLabel.getStyle().setPropertyPx("marginLeft", 10);
row1.getElement().appendChild(alwaysShowLabel);
final CheckBox logsCheckBox = new CheckBox(row1Container);
logsCheckBox.setChecked(true);
Element logsLabel = doc.createSpanElement();
logsLabel.setInnerText("Logs");
row1.getElement().appendChild(logsLabel);
logsCheckBox.addClickListener(new ClickListener() {
public void onClick(ClickEvent event) {
eventFilter.setFilterUserLogs(!logsCheckBox.isChecked());
eventTable.renderTable();
}
});
final CheckBox hintletsCheckBox = new CheckBox(row1Container);
hintletsCheckBox.setChecked(true);
Element hintletsLabel = doc.createSpanElement();
hintletsLabel.setInnerText("Hints");
row1.getElement().appendChild(hintletsLabel);
hintletsCheckBox.addClickListener(new ClickListener() {
public void onClick(ClickEvent event) {
eventFilter.setFilterHints(!hintletsCheckBox.isChecked());
eventTable.renderTable();
}