Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-10-12 14:41:00 -0400
committerRoberto E. Escobar2012-10-12 14:41:00 -0400
commit05c14f5e1ec08b7fe331998df078d7ad427a2815 (patch)
treee9f3b0b5cf001086ab75231468fab8b76445a9cb /plugins/org.eclipse.osee.ats.reports
parentdc395a039c080b5dc3414dc34fa809bb9d435daf (diff)
downloadorg.eclipse.osee-05c14f5e1ec08b7fe331998df078d7ad427a2815.tar.gz
org.eclipse.osee-05c14f5e1ec08b7fe331998df078d7ad427a2815.tar.xz
org.eclipse.osee-05c14f5e1ec08b7fe331998df078d7ad427a2815.zip
feature[bgz_391218]: Create ats.reports project and reports refactor
Create AtsReport extension point Create common BirtReportViewerTab to reduce code duplication Update code to use operations to prevent locking the UI Update manifest version numbers, (incubation) designation, and dependencies Code clean-up
Diffstat (limited to 'plugins/org.eclipse.osee.ats.reports')
-rw-r--r--plugins/org.eclipse.osee.ats.reports/.classpath7
-rw-r--r--plugins/org.eclipse.osee.ats.reports/.project28
-rw-r--r--plugins/org.eclipse.osee.ats.reports/META-INF/MANIFEST.MF26
-rw-r--r--plugins/org.eclipse.osee.ats.reports/build.properties9
-rw-r--r--plugins/org.eclipse.osee.ats.reports/plugin.xml11
-rw-r--r--plugins/org.eclipse.osee.ats.reports/pom.xml35
-rw-r--r--plugins/org.eclipse.osee.ats.reports/schema/AtsReportItem.exsd102
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/AtsReport.java34
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/ReportTabFactory.java29
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/Activator.java37
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/AtsReportXNavigateItemAction.java59
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/BirtReportViewerTab.java71
-rw-r--r--plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/ProjectModuleReports.java44
13 files changed, 492 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.reports/.classpath b/plugins/org.eclipse.osee.ats.reports/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.ats.reports/.project b/plugins/org.eclipse.osee.ats.reports/.project
new file mode 100644
index 0000000000..c6c33e2b14
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.ats.reports</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.ats.reports/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.reports/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..3802c76213
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: OSEE ATS Reports (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.ats.reports;singleton:=true
+Bundle-Version: 0.10.3.qualifier
+Bundle-Activator: org.eclipse.osee.ats.reports.internal.Activator
+Bundle-Vendor: Eclipse Open System Engineering Environment
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.eclipse.birt.report.viewer.utilities,
+ org.eclipse.core.runtime,
+ org.eclipse.core.runtime.jobs,
+ org.eclipse.osee.ats,
+ org.eclipse.osee.ats.navigate,
+ org.eclipse.osee.framework.core.exception,
+ org.eclipse.osee.framework.core.operation,
+ org.eclipse.osee.framework.logging,
+ org.eclipse.osee.framework.plugin.core.util,
+ org.eclipse.osee.framework.ui.plugin.xnavigate,
+ org.eclipse.osee.framework.ui.skynet.blam,
+ org.eclipse.osee.framework.ui.skynet.results,
+ org.eclipse.osee.framework.ui.swt,
+ org.osgi.framework
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.osee.framework.ui.skynet
+Export-Package: org.eclipse.osee.ats.reports
diff --git a/plugins/org.eclipse.osee.ats.reports/build.properties b/plugins/org.eclipse.osee.ats.reports/build.properties
new file mode 100644
index 0000000000..43a4492a96
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
+additional.bundles = org.eclipse.osee.framework.ui.plugin,\
+ org.eclipse.osee.ats,\
+ org.eclipse.osee.framework.ui.swt,\
+ org.eclipse.osee.framework.core
diff --git a/plugins/org.eclipse.osee.ats.reports/plugin.xml b/plugins/org.eclipse.osee.ats.reports/plugin.xml
new file mode 100644
index 0000000000..9a2483cf0c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/plugin.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="AtsReportItem" name="AtsReportItem" schema="schema/AtsReportItem.exsd"/>
+ <extension
+ point="org.eclipse.osee.ats.AtsNavigateItem">
+ <AtsNavigateItem
+ classname="org.eclipse.osee.ats.reports.internal.ProjectModuleReports">
+ </AtsNavigateItem>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.osee.ats.reports/pom.xml b/plugins/org.eclipse.osee.ats.reports/pom.xml
new file mode 100644
index 0000000000..d969c7439e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/pom.xml
@@ -0,0 +1,35 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.osee</groupId>
+ <artifactId>org.eclipse.osee.client.parent</artifactId>
+ <version>0.10.3-SNAPSHOT</version>
+ <relativePath>../../plugins/org.eclipse.osee.client.parent</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.osee.ats.reports</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>OSEE ATS Reports (Incubation)</name>
+
+ <build>
+ <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
+ <resources>
+ <resource>
+ <directory>src</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.reports/schema/AtsReportItem.exsd b/plugins/org.eclipse.osee.ats.reports/schema/AtsReportItem.exsd
new file mode 100644
index 0000000000..558e94c721
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/schema/AtsReportItem.exsd
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats.reports" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.osee.ats.reports" id="AtsReportItem" name="AtsReportItem"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="AtsReportItem"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsReportItem">
+ <complexType>
+ <attribute name="classname" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.osee.ats.reports.AtsReport"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/AtsReport.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/AtsReport.java
new file mode 100644
index 0000000000..44b888cbac
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/AtsReport.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.reports;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.swt.KeyedImage;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface AtsReport<IN, OUT> {
+
+ String getName();
+
+ KeyedImage getKeyedImage();
+
+ IN getInputParameters() throws OseeCoreException;
+
+ OUT createOutputParameters() throws OseeCoreException;
+
+ IOperation createReportOperation(IN input, OUT output, TableLoadOption... tableLoadOptions) throws OseeCoreException;
+
+ void displayResults(OUT output) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/ReportTabFactory.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/ReportTabFactory.java
new file mode 100644
index 0000000000..d1d7f9d71e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/ReportTabFactory.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.reports;
+
+import org.eclipse.osee.ats.reports.internal.BirtReportViewerTab;
+import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorTab;
+
+/**
+ * @author Roberto Escobar
+ */
+public class ReportTabFactory {
+
+ private ReportTabFactory() {
+ //
+ }
+
+ public static IResultsEditorTab createBirtReportTab(String bundleId, String tabName, String rptDesingPath) {
+ return new BirtReportViewerTab(bundleId, tabName, rptDesingPath);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/Activator.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/Activator.java
new file mode 100644
index 0000000000..7f5184e988
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/Activator.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.reports.internal;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class Activator implements BundleActivator {
+
+ private static BundleContext context;
+
+ static BundleContext getContext() {
+ return context;
+ }
+
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ }
+
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/AtsReportXNavigateItemAction.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/AtsReportXNavigateItemAction.java
new file mode 100644
index 0000000000..903d4e9500
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/AtsReportXNavigateItemAction.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.reports.internal;
+
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.osee.ats.reports.AtsReport;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AtsReportXNavigateItemAction<IN, OUT> extends XNavigateItemAction {
+
+ private final AtsReport<IN, OUT> atsReport;
+
+ public AtsReportXNavigateItemAction(final XNavigateItem parent, AtsReport<IN, OUT> atsReport) {
+ super(parent, atsReport.getName(), atsReport.getKeyedImage());
+ this.atsReport = atsReport;
+ }
+
+ @Override
+ public void run(final TableLoadOption... tableLoadOptions) throws Exception {
+ IN input = atsReport.getInputParameters();
+ if (input != null) {
+ final OUT output = atsReport.createOutputParameters();
+ IOperation operation = atsReport.createReportOperation(input, output, tableLoadOptions);
+ Operations.executeAsJob(operation, true, Job.LONG, new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ super.done(event);
+ try {
+ atsReport.displayResults(output);
+ } catch (OseeCoreException ex) {
+ OseeLog.logf(Activator.class, OseeLevel.SEVERE_POPUP, ex, "Error displaying [%s]",
+ atsReport.getName());
+ }
+ }
+ });
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/BirtReportViewerTab.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/BirtReportViewerTab.java
new file mode 100644
index 0000000000..a3467894f7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/BirtReportViewerTab.java
@@ -0,0 +1,71 @@
+/*
+ * 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.internal;
+
+import java.net.URL;
+import org.eclipse.birt.report.viewer.utilities.WebViewer;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorTab;
+import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Composite;
+import org.osgi.framework.Bundle;
+
+/**
+ * Class that implements IResultsEditorTab to crate the tab in the UI
+ *
+ * @author Praveen Joseph
+ */
+public class BirtReportViewerTab implements IResultsEditorTab {
+
+ private final String tabName;
+ private final String bundleId;
+ private final String rptDesingPath;
+
+ public BirtReportViewerTab(String bundleId, String tabName, String rptDesingPath) {
+ this.tabName = tabName;
+ this.bundleId = bundleId;
+ this.rptDesingPath = rptDesingPath;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public Composite createTab(final Composite parent, final ResultsEditor resultsEditor) {
+ Browser browser = new Browser(parent, SWT.NONE);
+ try {
+ URL reportLocation = getReportPath(bundleId, rptDesingPath);
+ WebViewer.display(reportLocation.getPath(), WebViewer.HTML, browser, "frameset");
+ browser.refresh();
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return browser;
+ }
+
+ @Override
+ public String getTabName() {
+ return tabName;
+ }
+
+ private URL getReportPath(String bundleId, String reportPath) throws OseeCoreException {
+ URL url = null;
+ try {
+ Bundle bundle = Platform.getBundle(bundleId);
+ url = FileLocator.find(bundle, new Path(reportPath), null);
+ url = FileLocator.toFileURL(url);
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ }
+ return url;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/ProjectModuleReports.java b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/ProjectModuleReports.java
new file mode 100644
index 0000000000..3c2f9a9aa3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.reports/src/org/eclipse/osee/ats/reports/internal/ProjectModuleReports.java
@@ -0,0 +1,44 @@
+/*
+ * 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.internal;
+
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.navigate.IAtsNavigateItem;
+import org.eclipse.osee.ats.reports.AtsReport;
+import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+
+/**
+ * Class to create the navigate items
+ *
+ * @author Praveen Joseph
+ */
+public class ProjectModuleReports implements IAtsNavigateItem {
+
+ private static final String EXTENSION_POINT_ID = "org.eclipse.osee.ats.reports.AtsReportItem";
+ private static final String CLASSNAME = "classname";
+ private static final String EXTENSION_POINT_NAME = "AtsReportItem";
+ private static final String PROJECT_REPORTS = "Project Reports";
+
+ @Override
+ public List<XNavigateItem> getNavigateItems(final XNavigateItem parentItem) {
+ XNavigateItem parent = new XNavigateItem(parentItem, PROJECT_REPORTS, AtsImage.REPORT);
+ ExtensionDefinedObjects<AtsReport<?, ?>> atsReports =
+ new ExtensionDefinedObjects<AtsReport<?, ?>>(EXTENSION_POINT_ID, EXTENSION_POINT_NAME,
+ CLASSNAME, true);
+ for (AtsReport<?, ?> reportItem : atsReports.getObjects()) {
+ createReportItem(parent, reportItem);
+ }
+ return Collections.singletonList(parent);
+ }
+
+ private <IN, OUT> XNavigateItem createReportItem(XNavigateItem parent, AtsReport<IN, OUT> atsReport) {
+ return new AtsReportXNavigateItemAction<IN, OUT>(parent, atsReport);
+ }
+
+}

Back to the top