summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbouthillie2011-08-19 09:26:59 (EDT)
committerjbouthillie2011-08-19 09:35:17 (EDT)
commitab176cbf08b955755516cea8cc70dbcb59cb3ab6 (patch)
treed874d8ba7f37975382deeda468b8e24bf6e20bdb
parent07e9b3eaf0240e3e031252245f633d6dc3c2b3e5 (diff)
downloadorg.eclipse.mylyn.reviews.r4e-ab176cbf08b955755516cea8cc70dbcb59cb3ab6.zip
org.eclipse.mylyn.reviews.r4e-ab176cbf08b955755516cea8cc70dbcb59cb3ab6.tar.gz
org.eclipse.mylyn.reviews.r4e-ab176cbf08b955755516cea8cc70dbcb59cb3ab6.tar.bz2
Bug 348903 R4E review selection user interface
- Add handling for the report menu
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/plugin.xml15
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ModelContributionItems.java51
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ReportElementHandler.java140
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/IR4EUIModelElement.java22
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelController.java28
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelElement.java35
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewBasic.java49
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewGroup.java10
-rw-r--r--org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/utils/R4EUIConstants.java26
10 files changed, 345 insertions, 34 deletions
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.reviews.r4e.ui/META-INF/MANIFEST.MF
index e1f74b8..03d6650 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.reviews.r4e.ui/META-INF/MANIFEST.MF
@@ -26,7 +26,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.mylyn.versions.core;bundle-version="0.8.0",
org.eclipse.mylyn.versions.ui;bundle-version="0.8.0",
org.eclipse.mylyn.reviews.ldap;bundle-version="0.2.0";resolution:=optional,
- org.eclipse.mylyn.reviews.notifications;bundle-version="0.8.0";resolution:=optional
+ org.eclipse.mylyn.reviews.notifications;bundle-version="0.8.0";resolution:=optional,
+ org.eclipse.mylyn.reviews.r4e.report;bundle-version="0.9.0";resolution:=optional
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.apache.commons.io;version="1.4.0",
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/plugin.xml b/org.eclipse.mylyn.reviews.r4e.ui/plugin.xml
index 5072db8..f1e5371 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/plugin.xml
+++ b/org.eclipse.mylyn.reviews.r4e.ui/plugin.xml
@@ -619,6 +619,12 @@
</command>
<command
categoryId="org.eclipse.mylyn.reviews.r4e.ui.commands.navigatorElementCategory"
+ description="Report Element"
+ id="org.eclipse.mylyn.reviews.r4e.ui.commands.reportElement"
+ name="Report Element">
+ </command>
+ <command
+ categoryId="org.eclipse.mylyn.reviews.r4e.ui.commands.navigatorElementCategory"
description="Add a New Child Element"
id="org.eclipse.mylyn.reviews.r4e.ui.commands.NewChildElement"
name="New Child Element">
@@ -1020,6 +1026,15 @@
</test>
</enabledWhen>
</handler>
+ <handler
+ class="org.eclipse.mylyn.reviews.r4e.ui.internal.commands.ReportElementHandler"
+ commandId="org.eclipse.mylyn.reviews.r4e.ui.commands.reportElement">
+ <enabledWhen>
+ <test
+ property="org.eclipse.mylyn.reviews.r4e.ui.commands.dialog.dialogOpen">
+ </test>
+ </enabledWhen>
+ </handler>
</extension>
<extension
point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ModelContributionItems.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ModelContributionItems.java
index 8cb54c4..909904c 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ModelContributionItems.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ModelContributionItems.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add contribution element for Report
*
******************************************************************************/
package org.eclipse.mylyn.reviews.r4e.ui.internal.commands;
@@ -57,22 +58,20 @@ public class ModelContributionItems extends CompoundContributionItem {
if (element.isOpenElementCmd()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.OPEN_ELEMENT_COMMAND, R4EUIConstants.OPEN_ELEMENT_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.OPEN_ELEMENT_ICON_FILE)), null, null,
- element.getOpenElementCmdName(), R4EUIConstants.OPEN_ELEMENT_COMMAND_MNEMONIC,
- element.getOpenElementCmdTooltip(), CommandContributionItem.STYLE_PUSH, null, true);
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.OPEN_ELEMENT_ICON_FILE)), null, null, element.getOpenElementCmdName(),
+ R4EUIConstants.OPEN_ELEMENT_COMMAND_MNEMONIC, element.getOpenElementCmdTooltip(),
+ CommandContributionItem.STYLE_PUSH, null, true);
list.add(new CommandContributionItem(params));
}
if (element.isCloseElementCmd()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.CLOSE_ELEMENT_COMMAND, R4EUIConstants.CLOSE_ELEMENT_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.CLOSE_ELEMENT_ICON_FILE)), null, null,
- element.getCloseElementCmdName(), R4EUIConstants.CLOSE_ELEMENT_COMMAND_MNEMONIC,
- element.getCloseElementCmdTooltip(), CommandContributionItem.STYLE_PUSH, null, true);
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.CLOSE_ELEMENT_ICON_FILE)), null, null, element.getCloseElementCmdName(),
+ R4EUIConstants.CLOSE_ELEMENT_COMMAND_MNEMONIC, element.getCloseElementCmdTooltip(),
+ CommandContributionItem.STYLE_PUSH, null, true);
list.add(new CommandContributionItem(params));
}
@@ -106,9 +105,8 @@ public class ModelContributionItems extends CompoundContributionItem {
if (element.isOpenEditorCmd() && R4EUIModelController.getNavigatorView().isEditorLinked()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.OPEN_EDITOR_COMMAND, R4EUIConstants.OPEN_EDITOR_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.OPEN_EDITOR_ICON_FILE)), null, null,
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.OPEN_EDITOR_ICON_FILE)), null, null,
R4EUIConstants.OPEN_EDITOR_COMMAND_NAME, R4EUIConstants.OPEN_EDITOR_COMMAND_MNEMONIC,
R4EUIConstants.OPEN_EDITOR_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true);
list.add(new CommandContributionItem(params));
@@ -117,10 +115,8 @@ public class ModelContributionItems extends CompoundContributionItem {
if (element.isChangeUserReviewStateCmd()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.CHANGE_REVIEW_STATE_COMMAND, R4EUIConstants.CHANGE_REVIEW_STATE_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.CHANGE_REVIEW_STATE_ICON_FILE)), null, null,
- element.isUserReviewed()
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.CHANGE_REVIEW_STATE_ICON_FILE)), null, null, element.isUserReviewed()
? R4EUIConstants.UNMARK_REVIEW_STATE_COMMAND_NAME
: R4EUIConstants.MARK_REVIEW_STATE_COMMAND_NAME,
R4EUIConstants.CHANGE_REVIEW_STATE_COMMAND_MNEMONIC, element.isUserReviewed()
@@ -143,9 +139,8 @@ public class ModelContributionItems extends CompoundContributionItem {
if (element.isSendEmailCmd()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.SEND_EMAIL_COMMAND, R4EUIConstants.SEND_EMAIL_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.SEND_EMAIL_ICON_FILE)), null, null,
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.SEND_EMAIL_ICON_FILE)), null, null,
R4EUIConstants.SEND_EMAIL_COMMAND_NAME, R4EUIConstants.SEND_EMAIL_COMMAND_MNEMONIC,
R4EUIConstants.SEND_EMAIL_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true);
list.add(new CommandContributionItem(params));
@@ -154,13 +149,23 @@ public class ModelContributionItems extends CompoundContributionItem {
if (element.isImportPostponedCmd()) {
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
R4EUIConstants.IMPORT_POSTPONED_COMMAND, R4EUIConstants.IMPORT_POSTPONED_COMMAND, null,
- ImageDescriptor.createFromURL(R4EUIPlugin.getDefault()
- .getBundle()
- .getEntry(R4EUIConstants.IMPORT_POSTPONED_ICON_FILE)), null, null,
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.IMPORT_POSTPONED_ICON_FILE)), null, null,
R4EUIConstants.IMPORT_POSTPONED_COMMAND_NAME, R4EUIConstants.IMPORT_POSTPONED_COMMAND_MNEMONIC,
R4EUIConstants.IMPORT_POSTPONED_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true);
list.add(new CommandContributionItem(params));
}
+
+ if (element.isReportElementCmd()) {
+ params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
+ R4EUIConstants.REPORT_ELEMENT_COMMAND, R4EUIConstants.REPORT_ELEMENT_COMMAND, null,
+ ImageDescriptor.createFromURL(R4EUIPlugin.getDefault().getBundle().getEntry(
+ R4EUIConstants.REPORT_ELEMENT_ICON_FILE)), null, null,
+ element.getReportElementCmdName(), R4EUIConstants.REPORT_ELEMENT_COMMAND_MNEMONIC,
+ element.getReportElementCmdTooltip(), CommandContributionItem.STYLE_PUSH, null, true);
+ list.add(new CommandContributionItem(params));
+ }
+
} else {
//When no element is selected, contribute add review group command
params = new CommandContributionItemParameter(R4EUIModelController.getNavigatorView().getSite(),
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ReportElementHandler.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ReportElementHandler.java
new file mode 100644
index 0000000..f46c5e9
--- /dev/null
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/commands/ReportElementHandler.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Ericsson Research Canada
+ *
+ * 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
+ *
+ * Description:
+ *
+ * This class implements the review navigator view toolbar command used
+ * to refresh (i.e. sychronize with serialization model) the review/review group data
+ *
+ * Contributors:
+ * Jacques Bouthillier - Created for Mylyn Review R4E project
+ *
+ ******************************************************************************/
+package org.eclipse.mylyn.reviews.r4e.ui.internal.commands;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.mylyn.reviews.r4e.ui.R4EUIPlugin;
+import org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement;
+import org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIReviewBasic;
+import org.eclipse.mylyn.reviews.r4e.ui.internal.model.R4EUIReviewGroup;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.progress.UIJob;
+
+/**
+ * @author lmcbout
+ * @version $Revision: 1.0 $
+ */
+public class ReportElementHandler extends AbstractHandler {
+
+ // ------------------------------------------------------------------------
+ // Methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Method execute.
+ *
+ * @param event
+ * ExecutionEvent
+ * @return Object
+ * @throws ExecutionException
+ * @see org.eclipse.core.commands.IHandler#execute(ExecutionEvent)
+ */
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+
+ final UIJob job = new UIJob("Reporting Element...") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ final ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ if (!selection.isEmpty()) {
+ IR4EUIModelElement element = null;
+ R4EUIReviewGroup group = null;
+ IStructuredSelection structSelection = (IStructuredSelection) selection;
+ int size = structSelection.size();
+ File[] listSelectReviews = new File[size];
+ Iterator<?> iter = structSelection.iterator();
+
+ int i = 0;
+ while (iter.hasNext()) {
+ element = (IR4EUIModelElement) iter.next();
+ if (element instanceof R4EUIReviewBasic) {
+ R4EUIReviewBasic extentElement = (R4EUIReviewBasic) element;
+ R4EUIPlugin.Ftracer.traceInfo("Review name element " //$NON-NLS-1$
+ + extentElement.getReview().getName());
+ listSelectReviews[i] = new File(extentElement.getReview().getName());
+ i++;
+
+ } else if (element instanceof R4EUIReviewGroup) {
+ group = (R4EUIReviewGroup) element;
+ R4EUIPlugin.Ftracer.traceInfo("Group file: " + group.getReviewGroup().getFolder()); //$NON-NLS-1$
+ }
+ }
+
+ org.eclipse.mylyn.reviews.r4e.report.impl.IR4EReport reportGen = org.eclipse.mylyn.reviews.r4e.report.impl.R4EReportFactory.getInstance();
+
+ reportGen.setReviewListSelection(listSelectReviews);
+// reportGen.setReportType(reportGen.SINGLE_REPORT_TYPE);
+
+ String groupFile = groupReview((IR4EUIModelElement) structSelection.getFirstElement());
+ R4EUIPlugin.Ftracer.traceInfo("Info: " + "Group file: " + groupFile); //$NON-NLS-1$//$NON-NLS-2$
+ reportGen.handleReportGeneration(groupFile);
+
+ }
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setUser(true);
+ job.schedule();
+ return null;
+ }
+
+ /**
+ * Method refreshReview.
+ *
+ * @param element
+ * IR4EUIModelElement
+ */
+ private String groupReview(IR4EUIModelElement element) {
+ IR4EUIModelElement searchElement = element;
+ R4EUIReviewGroup group = null;
+ if (element != null) {
+ searchElement = element;
+ while (searchElement != null) {
+ if (searchElement instanceof R4EUIReviewBasic) {
+ searchElement = searchElement.getParent();
+ R4EUIPlugin.Ftracer.traceInfo("Info: " + "Review element: " + searchElement.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (searchElement instanceof R4EUIReviewGroup) {
+ group = (R4EUIReviewGroup) searchElement;
+ R4EUIPlugin.Ftracer.traceInfo("Info: " + "Group file: " + group.getGroupFile()); //$NON-NLS-1$//$NON-NLS-2$
+ break;
+ } else {
+ //Should not reach this point unless we did not find the group
+ R4EUIPlugin.Ftracer.traceInfo("Info: " + "Group search file: " + searchElement.getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ searchElement = searchElement.getParent();
+ }
+ }
+ }
+
+ if (group != null) {
+ return group.getGroupFile();
+ }
+ return ""; //$NON-NLS-1$
+
+ }
+}
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/IR4EUIModelElement.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/IR4EUIModelElement.java
index cc3b7fa..27d4226 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/IR4EUIModelElement.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/IR4EUIModelElement.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add method definition for Report
*
******************************************************************************/
@@ -355,6 +356,27 @@ public interface IR4EUIModelElement {
String getOpenElementCmdTooltip();
/**
+ * Method isReportElementCmd.
+ *
+ * @return boolean
+ */
+ boolean isReportElementCmd();
+
+ /**
+ * Method getReportElementCmdName.
+ *
+ * @return String
+ */
+ String getReportElementCmdName();
+
+ /**
+ * Method getReportElementCmdTooltip.
+ *
+ * @return String
+ */
+ public String getReportElementCmdTooltip();
+
+ /**
* Method isCloseElementCmd.
*
* @return boolean
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelController.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelController.java
index 34602e8..bae3697 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelController.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelController.java
@@ -14,6 +14,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add method definition for Report package availability
*
******************************************************************************/
@@ -70,7 +71,7 @@ public class R4EUIModelController {
/**
* Field MAIL_CONNECTOR_IDS.
*/
- private static final String[] MAIL_CONNECTOR_IDS = { "reviews.r4e.mail.outlook.connector" };
+ private static final String[] MAIL_CONNECTOR_IDS = { "reviews.r4e.mail.outlook.connector" }; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Member variables
@@ -388,9 +389,8 @@ public class R4EUIModelController {
//Adjust review group paths in preferences
if (changePrefsPaths) {
- R4EUIPlugin.getDefault()
- .getPreferenceStore()
- .setValue(PreferenceConstants.P_GROUP_FILE_PATH, buildReviewGroupsStr(newGroupPaths));
+ R4EUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.P_GROUP_FILE_PATH,
+ buildReviewGroupsStr(newGroupPaths));
}
}
@@ -437,9 +437,8 @@ public class R4EUIModelController {
//Adjust review group paths in preferences
if (changePrefsPaths) {
- R4EUIPlugin.getDefault()
- .getPreferenceStore()
- .setValue(PreferenceConstants.P_RULE_SET_FILE_PATH, buildReviewGroupsStr(newRuleSetPaths));
+ R4EUIPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.P_RULE_SET_FILE_PATH,
+ buildReviewGroupsStr(newRuleSetPaths));
}
}
@@ -542,7 +541,20 @@ public class R4EUIModelController {
*/
public static boolean isUserQueryAvailable() {
//Verify if the LDAP bundle is available
- if (null != Platform.getBundle("org.eclipse.mylyn.reviews.ldap")) {
+ if (null != Platform.getBundle("org.eclipse.mylyn.reviews.ldap")) { //$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method isUserReportAvailable.
+ *
+ * @return boolean\
+ */
+ public static boolean isUserReportAvailable() {
+ //Verify if the Report bundle is available
+ if (null != Platform.getBundle("org.eclipse.mylyn.reviews.r4e.report")) { //$NON-NLS-1$
return true;
}
return false;
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelElement.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelElement.java
index 62ebd5e..f7d3c29 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelElement.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIModelElement.java
@@ -14,6 +14,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add method definition for Report
*
******************************************************************************/
@@ -51,12 +52,12 @@ public abstract class R4EUIModelElement implements IR4EUIModelElement, // $codep
/**
* Field REVIEWED_OVERLAY_ICON_FILE.
*/
- public static final String REVIEWED_OVERLAY_ICON_FILE = "icons/ovr16/revovr_tsk.gif";
+ public static final String REVIEWED_OVERLAY_ICON_FILE = "icons/ovr16/revovr_tsk.gif"; //$NON-NLS-1$
/**
* Field DISABLED_OVERLAY_ICON_FILE.
*/
- public static final String DISABLED_OVERLAY_ICON_FILE = "icons/ovr16/dsbldovr_tsk.gif";
+ public static final String DISABLED_OVERLAY_ICON_FILE = "icons/ovr16/dsbldovr_tsk.gif"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Member variables
@@ -595,6 +596,36 @@ public abstract class R4EUIModelElement implements IR4EUIModelElement, // $codep
}
/**
+ * Method isReportElementCmd.
+ *
+ * @return boolean
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#isReportElementCmd()
+ */
+ public boolean isReportElementCmd() {
+ return false; //default implementation
+ }
+
+ /**
+ * Method getReportElementCmdName.
+ *
+ * @return String
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#getReportElementCmdName()
+ */
+ public String getReportElementCmdName() {
+ return R4EUIConstants.REPORT_ELEMENT_COMMAND_NAME; //default implementation
+ }
+
+ /**
+ * Method getReportElementCmdTooltip.
+ *
+ * @return String
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#getReportElementCmdTooltip()
+ */
+ public String getReportElementCmdTooltip() {
+ return R4EUIConstants.REPORT_ELEMENT_COMMAND_TOOLTIP; //default implementation
+ }
+
+ /**
* Method isCloseElementCmd.
*
* @return boolean
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewBasic.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewBasic.java
index 317f156..315ffe8 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewBasic.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewBasic.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add definition for Report
*
*******************************************************************************/
@@ -123,6 +124,16 @@ public class R4EUIReviewBasic extends R4EUIModelElement {
+ "its Parent Review Group";
/**
+ * Field REPORT_ELEMENT_COMMAND_NAME. (value is ""Report Review"")
+ */
+ private static final String REPORT_ELEMENT_COMMAND_NAME = "Report Review"; //$NON-NLS-1$
+
+ /**
+ * Field REPORT_ELEMENT_COMMAND_TOOLTIP. (value is ""Create a report for this Review"")
+ */
+ private static final String REPORT_ELEMENT_COMMAND_TOOLTIP = "Create a report for this Review"; //$NON-NLS-1$
+
+ /**
* Field REVIEW_PHASE_STARTED. (value is ""PLANNING"")
*/
private static final String REVIEW_PHASE_STARTED = "STARTED";
@@ -1247,6 +1258,44 @@ public class R4EUIReviewBasic extends R4EUIModelElement {
}
/**
+ * Method isReportElementCmd.
+ *
+ * @return boolean
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#isReportElementCmd()
+ */
+ @Override
+ public boolean isReportElementCmd() {
+ //Any type of review, is allowed
+ if (R4EUIModelController.isUserReportAvailable()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Method getReportElementCmdName.
+ *
+ * @return String
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#getOpenElementCmdName()
+ */
+ @Override
+ public String getReportElementCmdName() {
+ return REPORT_ELEMENT_COMMAND_NAME;
+ }
+
+ /**
+ * Method getReportElementCmdTooltip.
+ *
+ * @return String
+ * @see org.eclipse.mylyn.reviews.r4e.ui.internal.model.IR4EUIModelElement#getOpenElementCmdTooltip()
+ */
+ @Override
+ public String getReportElementCmdTooltip() {
+ return REPORT_ELEMENT_COMMAND_TOOLTIP;
+ }
+
+ /**
* Method isCloseElementCmd.
*
* @return boolean
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewGroup.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewGroup.java
index 1f4af8e..d42df85 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewGroup.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/model/R4EUIReviewGroup.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add method to read the group path file for Report
*
******************************************************************************/
@@ -208,6 +209,15 @@ public class R4EUIReviewGroup extends R4EUIModelElement {
}
/**
+ * Method getGroupFile.
+ *
+ * @return R4EReviewGroup
+ */
+ public String getGroupFile() {
+ return fGroupFileURI.toFileString();
+ }
+
+ /**
* Method getRuleSets.
*
* @return List<R4EUIRuleSet>
diff --git a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/utils/R4EUIConstants.java b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/utils/R4EUIConstants.java
index f094020..a79319c 100644
--- a/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/utils/R4EUIConstants.java
+++ b/org.eclipse.mylyn.reviews.r4e.ui/src/org/eclipse/mylyn/reviews/r4e/ui/internal/utils/R4EUIConstants.java
@@ -13,6 +13,7 @@
*
* Contributors:
* Sebastien Dubois - Created for Mylyn Review R4E project
+ * Jacques Bouthillier - Add definition for Report
*
******************************************************************************/
package org.eclipse.mylyn.reviews.r4e.ui.internal.utils;
@@ -1172,6 +1173,31 @@ public class R4EUIConstants { // $codepro.audit.disable convertClassToInterface
public static final String OPEN_ELEMENT_COMMAND_MNEMONIC = "o";
/**
+ * Field REPORT_ELEMENT_COMMAND. (value is ""org.eclipse.mylyn.reviews.r4e.ui.commands.reportElement"")
+ */
+ public static final String REPORT_ELEMENT_COMMAND = "org.eclipse.mylyn.reviews.r4e.ui.commands.reportElement";
+
+ /**
+ * Field REPORT_ELEMENT_ICON_FILE. (value is ""icons/obj16/report_tsk.gif"")
+ */
+ public static final String REPORT_ELEMENT_ICON_FILE = "icons/obj16/report_tsk.gif";
+
+ /**
+ * Field REPORT_ELEMENT_COMMAND_NAME. (value is ""Report element"")
+ */
+ public static final String REPORT_ELEMENT_COMMAND_NAME = "Report Element";
+
+ /**
+ * Field REPORT_ELEMENT_COMMAND_TOOLTIP. (value is ""Report for this Element"")
+ */
+ public static final String REPORT_ELEMENT_COMMAND_TOOLTIP = "Report Data for this Element";
+
+ /**
+ * Field REPORT_ELEMENT_COMMAND_MNEMONIC. (value is ""r"")
+ */
+ public static final String REPORT_ELEMENT_COMMAND_MNEMONIC = "r";
+
+ /**
* Field CLOSE_ELEMENT_COMMAND. (value is ""org.eclipse.mylyn.reviews.r4e.ui.commands.closeElement"")
*/
public static final String CLOSE_ELEMENT_COMMAND = "org.eclipse.mylyn.reviews.r4e.ui.commands.closeElement";