Exemple #1
0
  @Override
  public void redo() {
    fParent.getFolders().add(fFolder);

    // Select
    UIRequestManager.INSTANCE.fireRequest(
        new TreeSelectionRequest(this, new StructuredSelection(fFolder), true));
  }
Exemple #2
0
  @Override
  public void undo() {
    fParent.getFolders().remove(fFolder);

    // Select the parent node if no node is selected (this happens when the node is deleted)
    TreeSelectionRequest request =
        new TreeSelectionRequest(this, new StructuredSelection(fParent), true) {
          @Override
          public boolean shouldSelect(Viewer viewer) {
            return viewer.getSelection().isEmpty();
          }
        };
    UIRequestManager.INSTANCE.fireRequest(request);
  }