Skip to main content
summaryrefslogtreecommitdiffstats
blob: beeeb6c275eadf9532cb7d4e07d46bf17a3bf1d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.column;

import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.world.WorldXViewerFactory;

/**
 * @author Donald G. Dunne
 */
public class RemainingPointsTotalColumn extends AbstractNumericTotalColumn {

   private static final String CALCULATION_STR =
      "Points - (Points * (Percent Complete from Workflow Rollup (Team Wf, Tasks and Reviews) / 100))";
   private static RemainingPointsTotalColumn instance = new RemainingPointsTotalColumn();

   public static RemainingPointsTotalColumn getInstance() {
      return instance;
   }

   private RemainingPointsTotalColumn() {
      super(WorldXViewerFactory.COLUMN_NAMESPACE + ".remainingPointsTotal", "Remaining Points - Total",
         "Points that remain to complete the changes based on percent complete from workflow rollup.", CALCULATION_STR,
         AtsAttributeTypes.Points);
   }

   /**
    * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
    * XViewerValueColumn MUST extend this constructor so the correct sub-class is created
    */
   @Override
   public RemainingPointsTotalColumn copy() {
      RemainingPointsTotalColumn newXCol = new RemainingPointsTotalColumn();
      super.copy(this, newXCol);
      return newXCol;
   }

   @Override
   protected int getPercentComplete(IAtsWorkItem workItem)  {
      return PercentCompleteTotalUtil.getPercentCompleteTotal(workItem, AtsClientService.get());
   }

}

Back to the top