private void initFiltersBar() {
    HorizontalPanel filtersBar = new HorizontalPanel();

    parentLink = new Button();
    parentLink.setIcon(IconType.BACKWARD);
    parentLink.setSize(ButtonSize.SMALL);
    parentLink.setText(constants.Parent());
    parentLink.setEnabled(true);
    parentLink.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) {
              parentDocEvent.fire(new DocumentsParentSearchEvent());
              pathLink.setText(presenter.currentCMSContentSummary.getParent().getPath());
            }
          }
        });

    homeLink = new Button();
    homeLink.setIcon(IconType.HOME);
    homeLink.setSize(ButtonSize.SMALL);
    homeLink.setText(constants.Home());
    homeLink.setEnabled(true);
    homeLink.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) {
              homeDocEvent.fire(new DocumentsHomeSearchEvent());
              pathLink.setText("/");
            }
          }
        });

    newLink = new Button();
    newLink.setIcon(IconType.PLUS);
    newLink.setSize(ButtonSize.SMALL);
    newLink.setText(constants.New());
    newLink.setEnabled(true);
    newLink.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            DefaultPlaceRequest req = new DefaultPlaceRequest("New Document");
            String folder =
                (presenter.currentCMSContentSummary == null)
                    ? "/"
                    : presenter.currentCMSContentSummary.getPath();
            req.addParameter("folder", folder);
            placeManager.goTo(req);
          }
        });

    filtersButtonGroup = new ButtonGroup(parentLink, homeLink, newLink);

    filtersBar.add(filtersButtonGroup);
    listGrid.getCenterToolbar().add(filtersBar);
  }
 public void enableFinishButton(final boolean enabled) {
   btnFinish.setEnabled(enabled);
   if (enabled) {
     btnFinish.setType(ButtonType.PRIMARY);
   } else {
     btnFinish.setType(ButtonType.DEFAULT);
   }
 }
Ejemplo n.º 3
0
 @Override
 public void afterRenderRows() {
   dataProvider.refresh();
   boolean enableItem = table.getRowCount() > 0;
   pager.setVisible(table.getRowCount() > Table.DEFAULT_PAGESIZE);
   downloadDictionary.setEnabled(enableItem);
   exportData.setDisabled(!enableItem);
   copyData.setDisabled(!enableItem);
   table.hideLoadingIndicator();
 }
 @Override
 public void setCancelEnabled(final boolean enabled) {
   cancel.setEnabled(enabled);
 }
 @Override
 public void setCloneEnabled(final boolean enabled) {
   clone.setEnabled(enabled);
 }
 public void enableNextButton(final boolean enabled) {
   btnNext.setEnabled(enabled);
 }
 public void enablePreviousButton(final boolean enabled) {
   btnPrevious.setEnabled(enabled);
 }