public TreeSelectionEditor(
      AppTemplateWizardAppearance appearance, SelectionItemProperties props) {
    TreeStore<SelectionItem> store = new TreeStore<SelectionItem>(props.id());

    tree = new SelectionItemTree(store, props.display());
    //        if (presenter.isEditingMode()) {
    //            /*
    //             * KLUDGE CORE-4653 JDS Set selection model to locked. This is to prevent the user
    // from
    //             * making any selections due to the issue described in CORE-4653.
    //             */
    //            tree.getSelectionModel().setLocked(true);
    //            tree.setCore4653Kludge();
    //        }
    tree.setHeight(appearance.getDefaultTreeSelectionHeight());

    tree.addValueChangeHandler(new TreeValueChangeHandler());
    selectionItemsEditor = new MyTreeStoreEditor(store, this);

    // This handler must be added after the store is added to the tree, since the tree adds its own
    // handlers that must trigger before this one.
    // Restore the tree's Checked state from each item's isDefault field after it's filtered.
    store.addStoreFilterHandler(new MyStoreFilterHandler());

    VerticalLayoutContainer vlc = new VerticalLayoutContainer();
    vlc.add(buildFilter(store), new VerticalLayoutData(1, -1));
    vlc.add(tree);

    argumentLabel = new FieldLabel(vlc);
    argumentLabel.setLabelAlign(TOP);
    argumentLabel.addDomHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            TreeSelectionEditor.this.fireEvent(new ArgumentSelectedEvent(model));
          }
        },
        ClickEvent.getType());

    labelLeafEditor = new LabelLeafEditor<String>(argumentLabel, this, appearance);
    idEditor = SimpleEditor.<String>of();
    typeEditor = SimpleEditor.<ArgumentType>of();
    requiredEditor = new LabelLeafEditor<Boolean>(argumentLabel, this, appearance);
    descriptionEditor = new LabelLeafEditor<String>(argumentLabel, this, appearance);

    initWidget(argumentLabel);
    visibilityEditor = new VisibilityEditor(this);
  }
Esempio n. 2
0
  public MyJobsPanel() {
    this.setHeadingHtml(
        StyleGenerator.defaultFontStyle(AppPropertiesManager.CONSTANTS.myjobs_panel_head()));

    VerticalLayoutContainer mainContainer = new VerticalLayoutContainer();

    List<ColumnConfig<MyJobsModel, ?>> myJobsConfigs = createColumnConfig();
    ColumnModel<MyJobsModel> myJobsColumnModel = new ColumnModel<MyJobsModel>(myJobsConfigs);
    myJobsStore = new ListStore<MyJobsModel>(props.key());

    ToolBar myJobsToolBar = createToolBar();
    mainContainer.add(myJobsToolBar, new VerticalLayoutData(1, -1, new Margins(0)));

    myJobsGrid = createJobsGrid(myJobsColumnModel);
    mainContainer.add(myJobsGrid, new VerticalLayoutData(1, 1, new Margins(0)));

    this.setWidget(mainContainer);

    initializeEventsListeners();
  }
  public ErrorDialog3(SafeHtml errorMsg, String description) {

    setHeadingText(I18N.DISPLAY.error());
    this.setMinHeight(300);
    this.setMinWidth(350);
    this.setResizable(false);

    add(uiBinder.createAndBindUi(this));
    detailsPanel.setHeadingText(I18N.DISPLAY.details());
    detailsPanel.setSize("330", "150");

    if (errorMsg != null) {
      this.errorMsg.setHTML(errorMsg);
    }

    detailsContainer.setScrollMode(ScrollMode.AUTO);
    descriptionArea.setText(description);
    detailsPanel.setCollapsible(true);
    detailsPanel.expand();
  }
  private FramedPanel panelMain() {

    FramedPanel panel = new FramedPanel();
    panel.setHeadingText("Monitoring Lunas QA 1");
    panel.setBodyStyle("background: none; padding: 5px");
    panel.setWidth(650);

    // panel Title="Pilih Referensi"

    VerticalLayoutContainer p = new VerticalLayoutContainer();
    panel.add(p);

    ComboUnits cbUnit = new ComboUnits();
    p.add(cbUnit);

    DateField dfTopTanggalAwal = new DateField();
    p.add(new FieldLabel(dfTopTanggalAwal, "Tanggal Awal"));

    DateField dfTopTanggalAkhir = new DateField();
    p.add(new FieldLabel(dfTopTanggalAkhir, "Tanggal Akhir"));

    p.add(new TextButton("Filter"));

    // panel "Data CN"

    IconDynamicGrid GdMonitoringLunasQA1 = new IconDynamicGrid();
    GdMonitoringLunasQA1.setGridHeader("Data Lunas QA 1");
    GdMonitoringLunasQA1.setGridDimension(620, 200);
    GdMonitoringLunasQA1.setStoreUrl("BasicProject/thuGetString.json?name=store1");

    GdMonitoringLunasQA1.addColumn("BOOL", 100);

    p.add(GdMonitoringLunasQA1);

    return panel;
  }
Esempio n. 5
0
  @Override
  public Widget asWidget() {
    final ListStore<Data> store = new ListStore<Data>(dataAccess.nameKey());
    store.addAll(TestData.getData(12, 20, 100));

    final Chart<Data> chart = new Chart<Data>();
    chart.setStore(store);
    chart.setShadowChart(true);

    NumericAxis<Data> axis = new NumericAxis<Data>();
    axis.setPosition(Position.BOTTOM);
    axis.addField(dataAccess.data1());
    axis.addField(dataAccess.data2());
    axis.addField(dataAccess.data3());
    TextSprite title = new TextSprite("Number of Hits");
    title.setFontSize(18);
    axis.setTitleConfig(title);
    axis.setDisplayGrid(true);
    axis.setMinimum(0);
    axis.setMaximum(100);
    chart.addAxis(axis);

    CategoryAxis<Data, String> catAxis = new CategoryAxis<Data, String>();
    catAxis.setPosition(Position.LEFT);
    catAxis.setField(dataAccess.name());
    title = new TextSprite("Month of the Year");
    title.setFontSize(18);
    catAxis.setTitleConfig(title);
    chart.addAxis(catAxis);

    final BarSeries<Data> bar = new BarSeries<Data>();
    bar.setYAxisPosition(Position.BOTTOM);
    bar.addYField(dataAccess.data1());
    bar.addYField(dataAccess.data2());
    bar.addYField(dataAccess.data3());
    bar.addColor(new RGB(148, 174, 10));
    bar.addColor(new RGB(17, 95, 166));
    bar.addColor(new RGB(166, 17, 32));
    chart.addSeries(bar);

    final Legend<Data> legend = new Legend<Data>();
    legend.setPosition(Position.RIGHT);
    legend.setItemHighlighting(true);
    legend.setItemHiding(true);
    chart.setLegend(legend);

    TextButton regenerate = new TextButton("Reload Data");
    regenerate.addSelectHandler(
        new SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            store.clear();
            store.addAll(TestData.getData(12, 0, 100));
            chart.redrawChart();
          }
        });

    ToggleButton animation = new ToggleButton("Animate");
    animation.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            chart.setAnimated(event.getValue());
          }
        });
    animation.setValue(true, true);
    ToggleButton shadow = new ToggleButton("Shadow");
    shadow.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            chart.setShadowChart(event.getValue());
            chart.redrawChart();
          }
        });
    shadow.setValue(true);

    ToolBar toolBar = new ToolBar();
    toolBar.add(regenerate);
    toolBar.add(animation);
    toolBar.add(shadow);

    ContentPanel panel = new FramedPanel();
    panel.getElement().getStyle().setMargin(10, Unit.PX);
    panel.setCollapsible(true);
    panel.setHeadingText("Grouped Bar Chart");
    panel.setPixelSize(620, 500);
    panel.setBodyBorder(true);

    final Resizable resize = new Resizable(panel, Dir.E, Dir.SE, Dir.S);
    resize.setMinHeight(400);
    resize.setMinWidth(400);

    panel.addExpandHandler(
        new ExpandHandler() {
          @Override
          public void onExpand(ExpandEvent event) {
            resize.setEnabled(true);
          }
        });
    panel.addCollapseHandler(
        new CollapseHandler() {
          @Override
          public void onCollapse(CollapseEvent event) {
            resize.setEnabled(false);
          }
        });

    new Draggable(panel, panel.getHeader()).setUseProxy(false);

    VerticalLayoutContainer layout = new VerticalLayoutContainer();
    panel.add(layout);

    toolBar.setLayoutData(new VerticalLayoutData(1, -1));
    layout.add(toolBar);

    chart.setLayoutData(new VerticalLayoutData(1, 1));
    layout.add(chart);

    return panel;
  }
Esempio n. 6
0
  private ContentPanel createContent() {
    TEXT_AREA.setReadOnly(true);

    final TextButton refreshButton = new TextButton("Refresh");
    refreshButton.addSelectHandler(
        new SelectEvent.SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            refresh();
          }
        });

    final TextButton newPatButton = new TextButton("Obtain new PAT token");
    newPatButton.addSelectHandler(
        new SelectEvent.SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            final ProgressDialog progressDialog = new ProgressDialog("Perform operation...");
            progressDialog.show();
            getService()
                .obtainNewPat(
                    new AsyncCallback<String>() {
                      @Override
                      public void onFailure(Throwable caught) {
                        progressDialog.hide();
                        handleException(caught);
                        GwtUtils.showError("Unable to obtain new PAT token.");
                        refresh();
                      }

                      @Override
                      public void onSuccess(String result) {
                        progressDialog.hide();
                        GwtUtils.showInformation("PAT token is obtained successfully.");
                        refresh();
                      }
                    });
          }
        });

    final TextButton clearButton = new TextButton("Clear");
    clearButton.addSelectHandler(
        new SelectEvent.SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            getService()
                .clearLogs(
                    new AsyncCallback<Void>() {
                      @Override
                      public void onFailure(Throwable p_throwable) {
                        handleException(p_throwable);
                        GwtUtils.showError("Unable to clear logs.");
                      }

                      @Override
                      public void onSuccess(Void p_void) {
                        TEXT_AREA.setValue("");
                      }
                    });
          }
        });

    final HBoxLayoutContainer h = new HBoxLayoutContainer();
    h.add(refreshButton, new BoxLayoutContainer.BoxLayoutData(DEFAULT_MARGINS));
    h.add(clearButton, new BoxLayoutContainer.BoxLayoutData(DEFAULT_MARGINS));
    h.add(newPatButton, new BoxLayoutContainer.BoxLayoutData(DEFAULT_MARGINS));

    final VerticalLayoutContainer v = new VerticalLayoutContainer();
    v.add(h, new VerticalLayoutContainer.VerticalLayoutData(1, -1, DEFAULT_MARGINS));
    v.add(TEXT_AREA, new VerticalLayoutContainer.VerticalLayoutData(1, 1, DEFAULT_MARGINS));

    final ContentPanel cp = new ContentPanel();
    cp.setHeadingText("Resource Server Monitor");
    cp.add(v);
    return cp;
  }
  protected FramedPanel panelMain() {

    FramedPanel panel = new FramedPanel();
    panel.setHeadingText("Batal Transaksi Nota Buku");
    panel.setBodyStyle("background: none; padding: 5px");
    //        panel.setWidth(650);

    VerticalLayoutContainer p = new VerticalLayoutContainer();
    panel.add(p);

    // panel "Batal Nota Buku"
    FramedPanel panelBatalNotaBuku = new FramedPanel();
    panelBatalNotaBuku.setHeadingText("Pembatalan Transaksi Nota Buku");
    panelBatalNotaBuku.setBodyStyle("background: none; padding: 5px");
    //        panelAnggotaNotaBuku.setWidth(623);
    //        panelAnggotaNotaBuku.setHeight(400);

    VerticalLayoutContainer vlcBatalNotaBuku = new VerticalLayoutContainer();
    panelBatalNotaBuku.add(vlcBatalNotaBuku);

    hlcBatalNotaBuku = new HorizontalPanel();

    // panel " batal data"
    FramedPanel panelBatalData = new FramedPanel();
    FieldSet fsPembatalan = new FieldSet();
    panelBatalData.setHeadingText("Tambah Data");
    panelBatalData.setBodyStyle("background: none; padding: 5px");
    //        panelTambahData.setWidth(400);
    //        panelTambahData.setHeight(250);

    //        VerticalLayoutContainer vlcTambahData= new VerticalLayoutContainer();
    HorizontalPanel hlcPembatalan = new HorizontalPanel();

    Label lbl01 = new Label("Pilih Kode Kolektif: ");
    //        lbl01.getElement().getStyle().setMarginLeft(5, Style.Unit.PX);
    //        lbl01.getElement().getStyle().setMarginRight(5, Style.Unit.PX);
    //        lbl01.getElement().getStyle().setMarginTop(3, Style.Unit.PX);
    hlcPembatalan.add(lbl01);

    IconComboBox cbPilihKode = new IconComboBox();
    //         cbPilihKode.setComboWidth(20);
    hlcPembatalan.add(cbPilihKode);

    TextField txKodeKolektif = new TextField();
    hlcPembatalan.add(txKodeKolektif);
    TextButton btnKodeKolektif = new TextButton("Ambil Data");
    hlcPembatalan.add(btnKodeKolektif);

    fsPembatalan.add(hlcPembatalan);
    panelBatalData.add(fsPembatalan);

    //        hlcNota.add(panelTambahData);

    vlcBatalNotaBuku.add(panelBatalData);

    //        vlcAnggotaNotaBuku.add(fs);

    p.add(panelBatalNotaBuku);

    // panel "Data CN"

    IconDynamicGrid gpDataCN = new IconDynamicGrid();
    gpDataCN.setGridHeader("Data Tagihan");
    gpDataCN.setGridDimension(623, 200);
    gpDataCN.setStoreUrl("BasicProject/thuGetString.json?name=store1");
    gpDataCN.addColumn("CEK", 100);
    gpDataCN.addColumn("KDPP", 100);
    gpDataCN.addColumn("NO_BATULV06", 100);
    gpDataCN.addColumn("TGLTRANSAKSI", 100);
    gpDataCN.addColumn("TRANSAKSIID", 100);
    gpDataCN.addColumn("TRANSAKSIBY", 100);
    gpDataCN.addColumn("TGL_PELUNASAN", 100);
    gpDataCN.addColumn("TGL_SETOR", 100);
    gpDataCN.addColumn("RPTOTAL", 100);

    p.add(gpDataCN);

    FieldSet fs = new FieldSet();
    VerticalLayoutContainer vclBk = new VerticalLayoutContainer();
    TextField txRpTagihan = new TextField();
    vclBk.add(new FieldLabel(txRpTagihan, "RP Tagihan"));

    TextField txRpBk = new TextField();
    vclBk.add(new FieldLabel(txRpBk, "RP BK"));
    fs.add(vclBk);

    p.add(fs);
    HorizontalPanel hlcButton = new HorizontalPanel();
    TextButton btnProses = new TextButton("Proses");
    TextButton btnReset = new TextButton("Reset");
    //        btnProses.setIconAlign(ButtonCell.IconAlign.LEFT);
    hlcButton.add(btnProses);
    hlcButton.add(btnReset);

    p.add(hlcButton);
    return panel;
  }
  @Override
  public Widget asWidget() {
    if (panel == null) {
      panel = new ContentPanel();
      panel.setHeadingText("Cell Action Tree");
      panel.setPixelSize(315, 400);
      panel.addStyleName("margin-10");

      VerticalLayoutContainer con = new VerticalLayoutContainer();
      panel.add(con);

      TreeStore<BaseDto> store = new TreeStore<BaseDto>(new KeyProvider());

      FolderDto root = TestData.getMusicRootFolder();
      for (BaseDto base : root.getChildren()) {
        store.add(base);
        if (base instanceof FolderDto) {
          processFolder(store, (FolderDto) base);
        }
      }

      SimpleSafeHtmlCell<String> cell =
          new SimpleSafeHtmlCell<String>(SimpleSafeHtmlRenderer.getInstance(), "click") {
            @Override
            public void onBrowserEvent(
                Context context,
                Element parent,
                String value,
                NativeEvent event,
                ValueUpdater<String> valueUpdater) {
              super.onBrowserEvent(context, parent, value, event, valueUpdater);
              if ("click".equals(event.getType())) {
                Info.display("Click", "You clicked \"" + value + "\"!");
              }
            }
          };

      final Tree<BaseDto, String> tree =
          new Tree<BaseDto, String>(
              store,
              new ValueProvider<BaseDto, String>() {

                @Override
                public String getValue(BaseDto object) {
                  return object.getName();
                }

                @Override
                public void setValue(BaseDto object, String value) {}

                @Override
                public String getPath() {
                  return "name";
                }
              });
      tree.setCell(cell);
      tree.setWidth(300);
      tree.getStyle().setLeafIcon(ExampleImages.INSTANCE.music());

      ToolBar buttonBar = new ToolBar();

      buttonBar.add(
          new TextButton(
              "Expand All",
              new SelectHandler() {

                @Override
                public void onSelect(SelectEvent event) {
                  tree.expandAll();
                }
              }));
      buttonBar.add(
          new TextButton(
              "Collapse All",
              new SelectHandler() {
                @Override
                public void onSelect(SelectEvent event) {
                  tree.collapseAll();
                }
              }));

      con.add(buttonBar, new VerticalLayoutData(1, -1));
      con.add(tree, new VerticalLayoutData(1, 1));
    }

    return panel;
  }
 @Override
 public void fireEvent(GwtEvent<?> event) {
   con.fireEvent(event);
 }
Esempio n. 10
0
  public Widget getWidget() {
    form2 = new FramedPanel();
    form2.setHeadingText("");
    form2.setWidth("100%");

    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeadingText("Emailing Setting");
    fieldSet.setCollapsible(true);
    fieldSet.setHeight(155);
    form2.add(fieldSet);

    VerticalLayoutContainer p = new VerticalLayoutContainer();
    fieldSet.add(p);
    HorizontalPanel hp = new HorizontalPanel();
    //	    statusButton.setValue(true);
    //	    final TextButton refreshButton = new TextButton();
    //	    refreshButton.setIcon(ressources.loading());
    //	    statusButton.setWidth("60px");
    hp.add(statusButton);
    //	    hp.add(refreshButton);
    p.add(new FieldLabel(hp, "System status"));

    month.setTriggerAction(TriggerAction.ALL);
    month.setEditable(false);
    month.setWidth(100);
    month.add(lFrequency);

    month.addSelectionHandler(
        new SelectionHandler<String>() {

          @Override
          public void onSelection(SelectionEvent<String> event) {}
        });
    p.add(new FieldLabel(month, "Frequency"), new VerticalLayoutData(1, -1));
    date.addParseErrorHandler(
        new ParseErrorHandler() {

          @Override
          public void onParseError(ParseErrorEvent event) {
            Info.display("Parse Error", event.getErrorValue() + " could not be parsed as a date");
          }
        });

    date.addValueChangeHandler(
        new ValueChangeHandler<Date>() {

          @Override
          public void onValueChange(ValueChangeEvent<Date> event) {
            String v =
                event.getValue() == null
                    ? "nothing"
                    : DateTimeFormat.getFormat(PredefinedFormat.DATE_MEDIUM)
                        .format(event.getValue());
          }
        });
    //	    date.addValidator(new MinDateValidator(new Date()));
    p.add(new FieldLabel(date, "Starting date"), new VerticalLayoutData(1, -1));

    time.addParseErrorHandler(
        new ParseErrorHandler() {

          @Override
          public void onParseError(ParseErrorEvent event) {}
        });

    time.setMinValue(new DateWrapper().clearTime().addHours(8).asDate());
    time.setMaxValue(new DateWrapper().clearTime().addHours(18).addSeconds(1).asDate());
    p.add(new FieldLabel(time, "Starting time"), new VerticalLayoutData(1, -1));

    statusButton.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {

          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            statusButton.setText(statusButton.getValue() ? "On" : "Off");
          }
        });
    load();
    form2.addButton(refresh);
    form2.addButton(save);
    refresh.addSelectHandler(
        new SelectHandler() {

          @Override
          public void onSelect(SelectEvent event) {
            refresh.setIcon(ressources.loading());
            refresh.setEnabled(false);
            load();
          }
        });
    save.addSelectHandler(
        new SelectHandler() {

          @Override
          public void onSelect(SelectEvent event) {
            save.setIcon(ressources.loading());
            save.setEnabled(false);
            save();
          }
        });
    return form2;
  }
Esempio n. 11
0
  public Widget asWidget() {
    final Chart<Site> chart = new Chart<Site>(600, 400);
    chart.setDefaultInsets(20);

    final ListStore<Site> store = new ListStore<Site>(siteAccess.nameKey());
    Date initial = f.parse("Feb 1");
    for (int i = 0; i < 7; i++) {
      store.add(
          new Site(initial, Math.random() * 20 + 80, Math.random() * 20 + 40, Math.random() * 20));
      initial = CalendarUtil.copyDate(initial);
      CalendarUtil.addDaysToDate(initial, 1);
    }
    chart.setStore(store);

    NumericAxis<Site> axis = new NumericAxis<Site>();
    axis.setPosition(Position.LEFT);
    axis.addField(siteAccess.visits());
    TextSprite title = new TextSprite("Number of Hits");
    title.setFontSize(18);
    axis.setTitleConfig(title);
    axis.setDisplayGrid(true);
    axis.setMinimum(0);
    axis.setMaximum(100);
    chart.addAxis(axis);

    final TimeAxis<Site> time = new TimeAxis<Site>();
    time.setField(siteAccess.date());
    time.setStartDate(f.parse("Feb 1"));
    time.setEndDate(f.parse("Feb 7"));
    time.setLabelProvider(
        new LabelProvider<Date>() {
          @Override
          public String getLabel(Date item) {
            return f.format(item);
          }
        });
    chart.addAxis(time);

    LineSeries<Site> series = new LineSeries<Site>();
    series.setYAxisPosition(Position.LEFT);
    series.setYField(siteAccess.visits());
    series.setStroke(new RGB(148, 174, 10));
    series.setShowMarkers(true);
    series.setMarkerIndex(1);
    Sprite marker = Primitives.circle(0, 0, 6);
    marker.setFill(new RGB(148, 174, 10));
    series.setMarkerConfig(marker);
    chart.addSeries(series);

    series = new LineSeries<Site>();
    series.setYAxisPosition(Position.LEFT);
    series.setYField(siteAccess.views());
    series.setStroke(new RGB(17, 95, 166));
    series.setShowMarkers(true);
    series.setMarkerIndex(1);
    marker = Primitives.cross(0, 0, 6);
    marker.setFill(new RGB(17, 95, 166));
    series.setMarkerConfig(marker);
    chart.addSeries(series);

    series = new LineSeries<Site>();
    series.setYAxisPosition(Position.LEFT);
    series.setYField(siteAccess.veins());
    series.setStroke(new RGB(166, 17, 32));
    series.setShowMarkers(true);
    series.setMarkerIndex(1);
    marker = Primitives.diamond(0, 0, 6);
    marker.setFill(new RGB(166, 17, 32));
    series.setMarkerConfig(marker);
    chart.addSeries(series);

    update =
        new Timer() {
          @Override
          public void run() {
            Date startDate = CalendarUtil.copyDate(time.getStartDate());
            Date endDate = CalendarUtil.copyDate(time.getEndDate());
            CalendarUtil.addDaysToDate(startDate, 1);
            CalendarUtil.addDaysToDate(endDate, 1);
            chart
                .getStore()
                .add(
                    new Site(
                        endDate,
                        Math.random() * 20 + 80,
                        Math.random() * 20 + 40,
                        Math.random() * 20));
            time.setStartDate(startDate);
            time.setEndDate(endDate);
            chart.redrawChart();
          }
        };

    update.scheduleRepeating(1000);

    ToggleButton animation = new ToggleButton("Animate");
    animation.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            chart.setAnimated(event.getValue());
          }
        });
    animation.setValue(true, true);

    ToolBar toolBar = new ToolBar();
    toolBar.add(animation);

    ContentPanel panel = new FramedPanel();
    panel.getElement().getStyle().setMargin(10, Unit.PX);
    panel.setCollapsible(true);
    panel.setHeadingText("Live Chart");
    panel.setPixelSize(620, 500);
    panel.setBodyBorder(true);

    VerticalLayoutContainer layout = new VerticalLayoutContainer();
    panel.add(layout);

    toolBar.setLayoutData(new VerticalLayoutData(1, -1));
    layout.add(toolBar);

    chart.setLayoutData(new VerticalLayoutData(1, 1));
    layout.add(chart);

    panel.addAttachHandler(
        new AttachEvent.Handler() {
          @Override
          public void onAttachOrDetach(AttachEvent event) {
            if (event.isAttached() == false) {
              update.cancel();
            }
          }
        });

    return panel;
  }