Esempio n. 1
0
  private void validatorActions() {
    Toolbar tb = new Toolbar();

    layout.setCellHeight(editor, "95%");
    layout.add(tb);

    ToolbarButton viewSource = new ToolbarButton();
    viewSource.setText("View source");
    viewSource.addListener(
        new ButtonListenerAdapter() {
          public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
            doViewsource();
          }
        });
    tb.addButton(viewSource);

    tb.addSeparator();

    ToolbarButton validate = new ToolbarButton();
    validate.setText("Validate");
    validate.addListener(
        new ButtonListenerAdapter() {
          public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
            doValidate();
          }
        });
    tb.addButton(validate);
  }
 protected void createToolbarButtons() {
   Toolbar toolbar = getTopToolbar();
   toolbar.addFill();
   toolbar.addButton(getAddPortletButton());
   toolbar.addSpacer();
   toolbar.addButton(getAddTabButton());
   toolbar.addSpacer();
   toolbar.addButton(getSaveConfigurationButton());
 }
Esempio n. 3
0
  private Toolbar getFilterToolbar() {
    final Toolbar filterToolbar = new Toolbar();
    ToolbarButton funnelButton = new ToolbarButton();

    funnelButton.setTooltip(
        "Tree filtering is currently OFF<br>Click to turn Tree filtering <b>ON</b>");
    funnelButton.setCls("x-btn-icon filter-btn");
    funnelButton.setEnableToggle(true);
    funnelButton.addListener(
        new ButtonListenerAdapter() {
          public void onToggle(Button button, boolean pressed) {
            if (pressed) {
              DOM.setStyleAttribute(
                  button.getButtonElement(), "backgroundImage", "url(images/funnel_X.gif)");
              button.setTooltip(
                  "Tree filtering is currently ON<br>Click to turn Tree filtering <b>OFF</b>");
              onSearchChange(true);
            } else {
              DOM.setStyleAttribute(
                  button.getButtonElement(), "backgroundImage", "url(images/funnel_plus.gif)");
              button.setTooltip(
                  "Tree filtering is currently OFF<br>Click to turn Tree filtering <b>ON</b>");
              treeFilter.clear();
              onSearchChange(false);
            }
          }
        });
    filterToolbar.addButton(funnelButton);

    searchField = new TextField();
    searchField.setWidth(120);
    searchField.setMaxLength(40);
    searchField.setGrow(false);
    searchField.setSelectOnFocus(true);

    searchField.addListener(
        new TextFieldListenerAdapter() {
          public void onRender(Component component) {
            searchField
                .getEl()
                .addListener(
                    "keyup",
                    new EventCallback() {
                      public void execute(EventObject e) {
                        delayedTask.delay(
                            500,
                            new Function() {
                              public void execute() {
                                onSearchChange(false);
                              }
                            });
                      }
                    });
          }
        });

    filterToolbar.addField(searchField);
    filterToolbar.addFill();

    ToolbarButton expandButton = new ToolbarButton();
    expandButton.setCls("x-btn-icon expand-all-btn");
    expandButton.setTooltip("Expand All");
    expandButton.addListener(
        new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            treePanel.expandAll();
          }
        });
    filterToolbar.addButton(expandButton);

    ToolbarButton collapseButton = new ToolbarButton();
    collapseButton.setCls("x-btn-icon collapse-all-btn");
    collapseButton.setTooltip("Collapse All");
    collapseButton.addListener(
        new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            treePanel.collapseAll();
          }
        });

    filterToolbar.addButton(collapseButton);
    return filterToolbar;
  }