Esempio n. 1
0
  /**
   * Checks if this combination is forbidden, if true than no selection is allowed.
   *
   * @param lastSelected
   * @param selected
   * @return boolean
   */
  private boolean isForbiddenCombo(DroppedElement lastSelected, DroppedElement selected) {

    if (lastSelected.getParent().equals(selected.getParent())) {
      return false;
    } else if ((lastSelected instanceof EncryptedFileDob)
        && (selected instanceof EncryptedFileDob)) {
      return false;
    }

    return true;
  }
Esempio n. 2
0
  /**
   * Returns true if oldSelection contains element, false if not.
   *
   * @param oldSelection
   * @param element
   * @return boolean
   */
  private boolean selectionContains(IStructuredSelection oldSelection, DroppedElement element) {

    for (Iterator<?> iterator = oldSelection.iterator(); iterator.hasNext(); ) {
      DroppedElement oldElement = (DroppedElement) iterator.next();

      if (oldElement.getName().equals(element.getName())) {
        return true;
      }
    }

    return false;
  }