コード例 #1
0
ファイル: SprintColumn.java プロジェクト: eclipse/osee
  @Override
  public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
    try {
      if (treeItem.getData() instanceof Artifact) {
        Artifact useArt = (Artifact) treeItem.getData();
        if (!(useArt.isOfType(AtsArtifactTypes.AbstractWorkflowArtifact))) {
          return false;
        }

        boolean modified = promptChangeSprint(useArt, isPersistViewer());

        XViewer xViewer = ((XViewerColumn) treeColumn.getData()).getTreeViewer();
        if (modified && isPersistViewer(xViewer)) {
          useArt.persist("persist sprints via alt-left-click");
        }
        if (modified) {
          xViewer.update(useArt, null);
          return true;
        }
      }
    } catch (OseeCoreException ex) {
      OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
    }

    return false;
  }
コード例 #2
0
ファイル: AssigneeColumnUI.java プロジェクト: eclipse/osee
  @Override
  public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
    try {
      if (treeItem.getData() instanceof Artifact) {
        Artifact useArt = (Artifact) treeItem.getData();
        if (useArt.isOfType(AtsArtifactTypes.Action)) {
          if (ActionManager.getTeams(useArt).size() == 1) {
            useArt = ActionManager.getFirstTeam(useArt);
          } else {
            return false;
          }
        }
        if (!(useArt instanceof AbstractWorkflowArtifact)) {
          return false;
        }
        AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) useArt;
        boolean modified = promptChangeAssignees(Arrays.asList(awa), isPersistViewer());
        XViewer xViewer = ((XViewerColumn) treeColumn.getData()).getTreeViewer();
        if (modified && isPersistViewer(xViewer)) {
          AtsChangeSet.execute("persist assignees via alt-left-click", awa);
        }
        if (modified) {
          xViewer.update(awa, null);
          return true;
        }
      }
    } catch (OseeCoreException ex) {
      OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
    }

    return false;
  }