Ejemplo n.º 1
0
  private void fireSearchEvent() {

    if (this.searchHandlerList != null) {
      String searchValue = (String) this.searchItem.getValue();
      if (GWTUtil.hasText(searchValue)) {
        this.searchValues = searchValue.split(" ");
      } else {
        this.searchValues = null;
      }
      for (SearchHandler handler : this.searchHandlerList) {
        handler.onSearch(this.searchFields, this.searchValues);
      }
    }
  }
Ejemplo n.º 2
0
    /**
     * Is new name empty or the same as before?
     *
     * @param event
     * @return
     */
    private boolean checkInput(EditorExitEvent event) {

      // only completion event ENTER is accepted
      if (!EditCompletionEvent.ENTER.equals(event.getEditCompletionEvent())) {
        return false;
      }
      String newName = event.getNewValue() != null ? event.getNewValue().toString() : null;
      String oldName = ((TreeNode) event.getRecord()).getName();
      if (!GWTUtil.hasText(newName) || newName.equalsIgnoreCase(oldName)) {
        this.alreadyDiscarded = true;
        tree.discardAllEdits();
        return false;
      }

      return true;
    }