Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-07-26 22:18:53 +0000
committerddunne2010-07-26 22:18:53 +0000
commit004f168e7854a5134e071741eb3a29b73e9597ef (patch)
tree5b8173af290d0b8f63d350fa71f2b49dba4804e9 /plugins
parenta3edc5ec380b6d0f47a54221341d71b6e12502ba (diff)
downloadorg.eclipse.osee-004f168e7854a5134e071741eb3a29b73e9597ef.tar.gz
org.eclipse.osee-004f168e7854a5134e071741eb3a29b73e9597ef.tar.xz
org.eclipse.osee-004f168e7854a5134e071741eb3a29b73e9597ef.zip
"Team Workflow" - RV2TM - "Add UI to allow changing the comment of a transaction"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java66
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ITransactionRecordSelectionProvider.java16
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchContentProvider.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchLabelProvider.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java36
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java40
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryContentProvider.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java26
10 files changed, 194 insertions, 41 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java
new file mode 100644
index 00000000000..14f00847b78
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/EditTransactionComment.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.framework.ui.skynet.action;
+
+import java.util.ArrayList;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EditTransactionComment extends Action {
+
+ private final ITransactionRecordSelectionProvider provider;
+
+ public EditTransactionComment(ITransactionRecordSelectionProvider provider) {
+ super("Edit Transaction Comment");
+ this.provider = provider;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return ImageManager.getImageDescriptor(FrameworkImage.EDIT);
+ }
+
+ @Override
+ public void run() {
+ if (provider.getSelectedTransactionRecords().isEmpty()) {
+ AWorkbench.popup("Transaction Record must be selected.");
+ return;
+ }
+ ArrayList<TransactionRecord> records = provider.getSelectedTransactionRecords();
+ EntryDialog ed = new EntryDialog("Edit Transaction Record Comment", "Enter Transaction Record comment");
+ if (ed.open() == 0) {
+ for (TransactionRecord record : records) {
+ try {
+ TransactionManager.setTransactionComment(record, ed.getEntry());
+ record.setComment(ed.getEntry());
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ provider.refreshUI(records);
+ AWorkbench.popup("Transaction Record comment(s) updated.");
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ITransactionRecordSelectionProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ITransactionRecordSelectionProvider.java
new file mode 100644
index 00000000000..c0ae1e39b68
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/action/ITransactionRecordSelectionProvider.java
@@ -0,0 +1,16 @@
+/*
+ * Created on Jul 26, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.ui.skynet.action;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
+
+public interface ITransactionRecordSelectionProvider {
+
+ public ArrayList<TransactionRecord> getSelectedTransactionRecords();
+
+ public void refreshUI(ArrayList<TransactionRecord> records);
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
index 1d4a0292dbd..9915d764b24 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/BranchView.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.framework.ui.skynet.widgets.xBranch;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -25,6 +26,7 @@ import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
@@ -41,6 +43,8 @@ import org.eclipse.osee.framework.skynet.core.event2.filter.IEventFilter;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.action.EditTransactionComment;
+import org.eclipse.osee.framework.ui.skynet.action.ITransactionRecordSelectionProvider;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -54,7 +58,7 @@ import org.eclipse.ui.part.ViewPart;
*
* @author Jeff C. Phillips
*/
-public class BranchView extends ViewPart implements IActionable, IBranchEventListener, ITransactionEventListener, ITransactionsDeletedEventListener {
+public class BranchView extends ViewPart implements IActionable, IBranchEventListener, ITransactionEventListener, ITransactionsDeletedEventListener, ITransactionRecordSelectionProvider {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.widgets.xBranch.BranchView";
private BranchViewPresentationPreferences branchViewPresentationPreferences;
private static String HELP_CONTEXT_ID = "BranchView";
@@ -77,6 +81,7 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
@Override
public void setFocus() {
+ // do nothing
}
@Override
@@ -97,6 +102,7 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
branchViewPresentationPreferences = new BranchViewPresentationPreferences(this);
xBranchWidget.loadData();
+ final BranchView fBranchView = this;
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
@@ -106,6 +112,7 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
MenuManager menuManager = (MenuManager) manager;
xBranchWidget.getXViewer().setColumnMultiEditEnabled(true);
menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menuManager.add(new EditTransactionComment(fBranchView));
menuManager.add(new Separator());
menuManager.add(new TableCustomizationAction(xBranchWidget.getXViewer()));
menuManager.add(new ViewTableReportAction(xBranchWidget.getXViewer()));
@@ -187,6 +194,7 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
@Override
public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ // do nothing
}
@Override
@@ -283,4 +291,14 @@ public class BranchView extends ViewPart implements IActionable, IBranchEventLis
return null;
}
+ @Override
+ public ArrayList<TransactionRecord> getSelectedTransactionRecords() {
+ return xBranchWidget.getSelectedTransactionRecords();
+ }
+
+ @Override
+ public void refreshUI(ArrayList<TransactionRecord> records) {
+ xBranchWidget.getXViewer().update(records.toArray(new TransactionRecord[records.size()]), null);
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchContentProvider.java
index 7ed36c6eba0..5e4da28cea2 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchContentProvider.java
@@ -64,19 +64,17 @@ public class XBranchContentProvider implements ITreeContentProvider {
@Override
public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof BranchManager) {
- return getBranchManagerChildren((BranchManager) parentElement);
-
- } else if (parentElement instanceof Branch) {
+ if (parentElement instanceof Branch) {
return getBranchChildren((Branch) parentElement);
-
} else if (parentElement instanceof Collection<?>) {
return ((Collection<?>) parentElement).toArray();
+ } else if (parentElement instanceof Object[]) {
+ return (Object[]) parentElement;
}
return EMPTY_ARRAY;
}
- private Object[] getBranchChildren(Branch branch) {
+ protected Object[] getBranchChildren(Branch branch) {
try {
if (showChildBranchesUnderParents) {
List<Object> items = new LinkedList<Object>();
@@ -96,7 +94,7 @@ public class XBranchContentProvider implements ITreeContentProvider {
return EMPTY_ARRAY;
}
- private Object[] getBranchManagerChildren(BranchManager branchManager) {
+ protected Object[] getBranchManagerChildren() {
BranchArchivedState branchState = BranchArchivedState.UNARCHIVED;
List<BranchType> branchTypes = new ArrayList<BranchType>(4);
@@ -225,10 +223,12 @@ public class XBranchContentProvider implements ITreeContentProvider {
@Override
public void dispose() {
+ // do nothing
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // do nothing
}
public BranchXViewer getChangeXViewer() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchLabelProvider.java
index 857bc39d2f5..5969606d89a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchLabelProvider.java
@@ -44,7 +44,7 @@ public class XBranchLabelProvider extends XViewerLabelProvider {
}
@Override
- public String getColumnText(Object element, XViewerColumn cCol, int columnIndex) throws OseeCoreException {
+ public String getColumnText(Object element, XViewerColumn cCol, int columnIndex) {
String columnText = "";
try {
if (element instanceof Branch) {
@@ -173,10 +173,12 @@ public class XBranchLabelProvider extends XViewerLabelProvider {
@Override
public void addListener(ILabelProviderListener listener) {
+ // do nothing
}
@Override
public void removeListener(ILabelProviderListener listener) {
+ // do nothing
}
public BranchXViewer getTreeViewer() {
@@ -184,7 +186,7 @@ public class XBranchLabelProvider extends XViewerLabelProvider {
}
@Override
- public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) throws OseeCoreException {
+ public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) {
if (xCol.equals(BranchXViewerFactory.associatedArtifact)) {
if (element instanceof Branch) {
try {
@@ -216,5 +218,6 @@ public class XBranchLabelProvider extends XViewerLabelProvider {
@Override
public void dispose() {
+ // do nothing
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
index 193c932c76f..f9e3b107252 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xBranch/XBranchWidget.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.framework.ui.skynet.widgets.xBranch;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -23,6 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -122,11 +122,7 @@ public class XBranchWidget extends XWidget implements IActionable {
toolkit.paintBordersFor(mainComp);
}
- try {
- createTaskActionBar(mainComp);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
+ createTaskActionBar(mainComp);
branchXViewer =
new BranchXViewer(mainComp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, this, filterRealTime, searchRealTime);
@@ -153,7 +149,7 @@ public class XBranchWidget extends XWidget implements IActionable {
tree.setLinesVisible(true);
}
- public void createTaskActionBar(Composite parent) throws OseeCoreException {
+ public void createTaskActionBar(Composite parent) {
// Button composite for state transitions, etc
Composite composite = new Composite(parent, SWT.NONE);
// composite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_CYAN));
@@ -188,7 +184,6 @@ public class XBranchWidget extends XWidget implements IActionable {
refresh();
}
- @SuppressWarnings("unchecked")
public ArrayList<Branch> getSelectedBranches() {
ArrayList<Branch> items = new ArrayList<Branch>();
if (branchXViewer == null) {
@@ -197,7 +192,7 @@ public class XBranchWidget extends XWidget implements IActionable {
if (branchXViewer.getSelection().isEmpty()) {
return items;
}
- Iterator i = ((IStructuredSelection) branchXViewer.getSelection()).iterator();
+ Iterator<?> i = ((IStructuredSelection) branchXViewer.getSelection()).iterator();
while (i.hasNext()) {
Object obj = i.next();
@@ -208,6 +203,26 @@ public class XBranchWidget extends XWidget implements IActionable {
return items;
}
+ @SuppressWarnings("rawtypes")
+ public ArrayList<TransactionRecord> getSelectedTransactionRecords() {
+ ArrayList<TransactionRecord> items = new ArrayList<TransactionRecord>();
+ if (branchXViewer == null) {
+ return items;
+ }
+ if (branchXViewer.getSelection().isEmpty()) {
+ return items;
+ }
+ Iterator i = ((IStructuredSelection) branchXViewer.getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+
+ if (obj instanceof TransactionRecord) {
+ items.add((TransactionRecord) obj);
+ }
+ }
+ return items;
+ }
+
@Override
public Control getControl() {
return branchXViewer.getTree();
@@ -252,7 +267,7 @@ public class XBranchWidget extends XWidget implements IActionable {
}
public void loadData() {
- loadData(BranchManager.getInstance());
+ loadData(((XBranchContentProvider) branchXViewer.getContentProvider()).getBranchManagerChildren());
}
public void loadData(final Object input) {
@@ -303,6 +318,7 @@ public class XBranchWidget extends XWidget implements IActionable {
@Override
public void setXmlData(String str) {
+ // do nothing
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
index 16663af35cd..5cf985a7d44 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/HistoryView.java
@@ -12,12 +12,14 @@
package org.eclipse.osee.framework.ui.skynet.widgets.xHistory;
+import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
@@ -27,6 +29,7 @@ import org.eclipse.nebula.widgets.xviewer.customize.XViewerCustomMenu;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.IActionable;
@@ -46,6 +49,8 @@ import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.OpenWithMenuListener;
import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.action.EditTransactionComment;
+import org.eclipse.osee.framework.ui.skynet.action.ITransactionRecordSelectionProvider;
import org.eclipse.osee.framework.ui.skynet.change.ChangeUiUtil;
import org.eclipse.osee.framework.ui.skynet.listener.IRebuildMenuListener;
import org.eclipse.osee.framework.ui.skynet.menu.ArtifactDiffMenu;
@@ -53,10 +58,10 @@ import org.eclipse.osee.framework.ui.skynet.util.SkynetViews;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuAdapter;
import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -74,16 +79,13 @@ import org.eclipse.ui.part.ViewPart;
*
* @author Jeff C. Phillips
*/
-public class HistoryView extends ViewPart implements IActionable, IBranchEventListener, IRebuildMenuListener {
+public class HistoryView extends ViewPart implements IActionable, IBranchEventListener, ITransactionRecordSelectionProvider, IRebuildMenuListener {
public static final String VIEW_ID = "org.eclipse.osee.framework.ui.skynet.widgets.xHistory.HistoryView";
private static String HELP_CONTEXT_ID = "HistoryView";
private XHistoryWidget xHistoryWidget;
private Artifact artifact;
- public HistoryView() {
- }
-
public static void open(Artifact artifact) throws OseeArgumentException {
if (artifact == null) {
throw new OseeArgumentException("Artifact can't be null");
@@ -126,6 +128,7 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
@Override
public void setFocus() {
+ // do nothing
}
/*
@@ -176,6 +179,8 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
createChangeReportMenuItem(popupMenu);
ArtifactDiffMenu.createDiffMenuItem(popupMenu, xHistoryWidget.getXViewer(), "Compare two Artifacts");
+ (new ActionContributionItem(new EditTransactionComment(this))).fill(popupMenu, 3);
+
// Setup generic xviewer menu items
XViewerCustomMenu xMenu = new XViewerCustomMenu(xHistoryWidget.getXViewer());
new MenuItem(popupMenu, SWT.SEPARATOR);
@@ -196,11 +201,7 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
final MenuItem changeReportMenuItem = new MenuItem(popupMenu, SWT.CASCADE);
changeReportMenuItem.setText("&Change Report");
changeReportMenuItem.setImage(ImageManager.getImage(FrameworkImage.BRANCH_CHANGE));
- popupMenu.addMenuListener(new MenuListener() {
-
- @Override
- public void menuHidden(MenuEvent e) {
- }
+ popupMenu.addMenuListener(new MenuAdapter() {
@Override
public void menuShown(MenuEvent e) {
@@ -210,11 +211,7 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
});
- changeReportMenuItem.addSelectionListener(new SelectionListener() {
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- }
+ changeReportMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -337,6 +334,7 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
@Override
public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ // do nothing
}
@Override
@@ -347,4 +345,14 @@ public class HistoryView extends ViewPart implements IActionable, IBranchEventLi
return null;
}
+ @Override
+ public ArrayList<TransactionRecord> getSelectedTransactionRecords() {
+ return xHistoryWidget.getSelectedTransactionRecords();
+ }
+
+ @Override
+ public void refreshUI(ArrayList<TransactionRecord> records) {
+ xHistoryWidget.refresh();
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryContentProvider.java
index b1907a71dd3..ea29076145b 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryContentProvider.java
@@ -58,10 +58,12 @@ public class XHistoryContentProvider implements ITreeContentProvider {
@Override
public void dispose() {
+ // do nothing
}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // do nothing
}
/**
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java
index 1f9c0f819aa..26ed9c3ab4f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryLabelProvider.java
@@ -15,7 +15,6 @@ import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.nebula.widgets.xviewer.XViewerCells;
import org.eclipse.nebula.widgets.xviewer.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.XViewerLabelProvider;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.change.Change;
import org.eclipse.osee.framework.skynet.core.change.RelationChange;
@@ -36,7 +35,7 @@ public class XHistoryLabelProvider extends XViewerLabelProvider {
}
@Override
- public String getColumnText(Object element, XViewerColumn cCol, int columnIndex) throws OseeCoreException {
+ public String getColumnText(Object element, XViewerColumn cCol, int columnIndex) {
try {
if (!(element instanceof Change)) {
return "";
@@ -74,6 +73,7 @@ public class XHistoryLabelProvider extends XViewerLabelProvider {
@Override
public void dispose() {
+ // do nothing
}
@Override
@@ -83,10 +83,12 @@ public class XHistoryLabelProvider extends XViewerLabelProvider {
@Override
public void addListener(ILabelProviderListener listener) {
+ // do nothing
}
@Override
public void removeListener(ILabelProviderListener listener) {
+ // do nothing
}
public HistoryXViewer getTreeViewer() {
@@ -94,7 +96,7 @@ public class XHistoryLabelProvider extends XViewerLabelProvider {
}
@Override
- public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) throws OseeCoreException {
+ public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) {
try {
if (!(element instanceof Change)) {
return null;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
index 525b63372f1..e4f14454eaa 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xHistory/XHistoryWidget.java
@@ -23,6 +23,7 @@ import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.TransactionRecord;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -165,7 +166,6 @@ public class XHistoryWidget extends XWidget implements IActionable {
refresh();
}
- @SuppressWarnings("unchecked")
public ArrayList<Branch> getSelectedBranches() {
ArrayList<Branch> items = new ArrayList<Branch>();
if (xHistoryViewer == null) {
@@ -174,7 +174,7 @@ public class XHistoryWidget extends XWidget implements IActionable {
if (xHistoryViewer.getSelection().isEmpty()) {
return items;
}
- Iterator i = ((IStructuredSelection) xHistoryViewer.getSelection()).iterator();
+ Iterator<?> i = ((IStructuredSelection) xHistoryViewer.getSelection()).iterator();
while (i.hasNext()) {
Object obj = i.next();
items.add((Branch) obj);
@@ -280,7 +280,9 @@ public class XHistoryWidget extends XWidget implements IActionable {
@Override
public void setXmlData(String str) {
+ // do nothing
}
+
public class HistoryDragAndDrop extends SkynetDragAndDrop {
public HistoryDragAndDrop(Tree tree, String viewId) {
@@ -326,4 +328,24 @@ public class XHistoryWidget extends XWidget implements IActionable {
return artifact;
}
+ @SuppressWarnings("rawtypes")
+ public ArrayList<TransactionRecord> getSelectedTransactionRecords() {
+ ArrayList<TransactionRecord> items = new ArrayList<TransactionRecord>();
+ if (xHistoryViewer == null) {
+ return items;
+ }
+ if (xHistoryViewer.getSelection().isEmpty()) {
+ return items;
+ }
+ Iterator i = ((IStructuredSelection) xHistoryViewer.getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+
+ if (obj instanceof Change) {
+ items.add(((Change) obj).getTxDelta().getEndTx());
+ }
+ }
+ return items;
+ }
+
}

Back to the top