Пример #1
0
  public void actionPerformed(ActionEvent e) {
    if (task.isLocal()) {
      task.getTaskRepository().remove(task);
    } else {
      TaskEditorFactory factory = Lookup.getDefault().lookup(TaskEditorFactory.class);
      factory.save(task);
      task.getTaskRepository().revert(task);

      factory.refresh(task);
    }
  }
Пример #2
0
 public RevertChangesAction(TracTask task) {
   this.task = task;
   if (task.isLocal()) {
     putValue(NAME, NbBundle.getMessage(RevertChangesAction.class, "LBL_Delete_Local_Task"));
     putValue(
         SHORT_DESCRIPTION,
         NbBundle.getMessage(RevertChangesAction.class, "LBL_Delete_Local_Task"));
   } else {
     putValue(NAME, NbBundle.getMessage(RevertChangesAction.class, "LBL_Revert_Local_Changes"));
     putValue(
         SHORT_DESCRIPTION,
         NbBundle.getMessage(RevertChangesAction.class, "LBL_Revert_Local_Changes"));
   }
 }