コード例 #1
0
  protected Widget createCurrentSelectionWidget() {
    if (!displayerSettings.isFilterEnabled()) return null;

    Set<String> columnFilters = filterColumns();
    if (columnFilters.isEmpty()) return null;

    HorizontalPanel panel = new HorizontalPanel();
    panel.getElement().setAttribute("cellpadding", "2");

    for (String columnId : columnFilters) {
      List<Interval> selectedValues = filterIntervals(columnId);
      DataColumn column = dataSet.getColumnById(columnId);
      for (Interval interval : selectedValues) {
        String formattedValue = formatInterval(interval, column);
        panel.add(new Label(formattedValue));
      }
    }

    Anchor anchor = new Anchor(GoogleDisplayerConstants.INSTANCE.googleDisplayer_resetAnchor());
    panel.add(anchor);
    anchor.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            filterReset();

            // Update the chart view in order to reflect the current selection
            // (only if not has already been redrawn in the previous filterUpdate() call)
            if (!displayerSettings.isFilterSelfApplyEnabled()) {
              updateVisualization();
            }
          }
        });
    return panel;
  }
コード例 #2
0
 protected Widget createNoDataMsgPanel() {
   return new Label(GoogleDisplayerConstants.INSTANCE.common_noData());
 }