Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8ec394b71c4d15d692bf18de53149c852b124ed6 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
 * Copyright (c) 2012 Robert Bosch Engineering and Business Solutions Ltd India. 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
 */
package org.eclipse.osee.ats.reports.split.ui;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.ats.AtsImage;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.reports.AtsReport;
import org.eclipse.osee.ats.reports.ReportTabFactory;
import org.eclipse.osee.ats.reports.split.Activator;
import org.eclipse.osee.ats.util.widgets.dialog.TeamVersionListDialog;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorProvider;
import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorTab;
import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
import org.eclipse.osee.framework.ui.swt.KeyedImage;

/**
 * @author Praveen Joseph
 */
public class DistributionAtsReport implements AtsReport<IAtsVersion, Object> {

   @Override
   public String getName() {
      return "Distribution Reports";
   }

   @Override
   public KeyedImage getKeyedImage() {
      return AtsImage.REPORT;
   }

   @Override
   public IAtsVersion getInputParameters() {
      IAtsVersion param = null;
      TeamVersionListDialog dlg = new TeamVersionListDialog(Active.Both);
      int open = dlg.open();
      if (open == 0) {
         param = dlg.getSelectedVersion();
      }
      return param;
   }

   @Override
   public IOperation createReportOperation(IAtsVersion input, Object output, TableLoadOption... tableLoadOptions) {
      return new LoadDistributionDataOperation(input);
   }

   @Override
   public Object createOutputParameters() {
      // None using a static shared object
      return null;
   }

   @Override
   public void displayResults(Object output) {
      ResultsEditor.open(new IResultsEditorProvider() {

         @Override
         public String getEditorName() {
            return getName();
         }

         @Override
         public List<IResultsEditorTab> getResultsEditorTabs() {
            List<IResultsEditorTab> tabs = new ArrayList<IResultsEditorTab>();
            tabs.add(createTab("Actionable Item", "reports/aiDistribution.rptdesign"));
            tabs.add(createTab("Team-Work", "reports/teamWorkDistribution.rptdesign"));
            tabs.add(createTab("Workflow State", "reports/stateWorkDistribution.rptdesign"));
            return tabs;
         }
      });
   }

   private IResultsEditorTab createTab(String name, String rptDesingName) {
      return ReportTabFactory.createBirtReportTab(Activator.PLUGIN_ID, name, rptDesingName);
   }
}

Back to the top