diff options
author | afinkbein | 2008-05-26 00:20:11 +0000 |
---|---|---|
committer | afinkbein | 2008-05-26 00:20:11 +0000 |
commit | ad5b3fbf426caf91b163b0bb0d963b923e68b99b (patch) | |
tree | 7f3ed608011ca51fd29a0a8ec900431c0dfda883 /org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui | |
parent | 1022a5d4700cbab2d0605745c62f70276f968aa0 (diff) | |
download | org.eclipse.osee-ad5b3fbf426caf91b163b0bb0d963b923e68b99b.tar.gz org.eclipse.osee-ad5b3fbf426caf91b163b0bb0d963b923e68b99b.tar.xz org.eclipse.osee-ad5b3fbf426caf91b163b0bb0d963b923e68b99b.zip |
Diffstat (limited to 'org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui')
12 files changed, 129 insertions, 507 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java index bae1294f4ef..0af68922c60 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactDragDropSupport.java @@ -20,10 +20,10 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTransfer; import org.eclipse.osee.framework.skynet.core.artifact.WorkspaceFileArtifact; import org.eclipse.osee.framework.skynet.core.artifact.WorkspaceURL; -import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup; import org.eclipse.osee.framework.skynet.core.relation.RelationManager; import org.eclipse.osee.framework.skynet.core.relation.RelationSide; import org.eclipse.osee.framework.skynet.core.relation.RelationType; +import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; import org.eclipse.osee.framework.ui.plugin.util.AWorkspace; import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow; import org.eclipse.swt.dnd.DropTargetEvent; @@ -56,9 +56,9 @@ public class ArtifactDragDropSupport { } } - private static void ensureLinkValidity(RelationLinkGroup group, Artifact artifact) throws SQLException { - RelationType relationType = group.getDescriptor(); - Artifact otherArtifact = group.getLinkManager().getOwningArtifact(); + private static void ensureLinkValidity(RelationTypeSide group, Artifact artifact) throws SQLException { + RelationType relationType = group.getRelationType(); + Artifact otherArtifact = group.getArtifact(); Artifact artifactA = group.getSide() == RelationSide.SIDE_A ? artifact : otherArtifact; Artifact artifactB = group.getSide() == RelationSide.SIDE_A ? otherArtifact : artifact; @@ -66,18 +66,23 @@ public class ArtifactDragDropSupport { } private static void addArtifacts(Artifact[] artifacts, RelationExplorerWindow window) throws SQLException { - RelationLinkGroup group = window.getRelationGroup(); - RelationSide relationSide = group.isSideA() ? RelationSide.SIDE_A : RelationSide.SIDE_B; - RelationType relationType = group.getDescriptor(); + RelationTypeSide group = window.getRelationGroup(); + RelationSide relationSide = group.getSide(); + RelationType relationType = group.getRelationType(); try { - RelationManager.ensureSideWillSupport(group.getLinkManager().getOwningArtifact(), relationType, - relationSide.oppositeSide(), artifacts[0].getArtifactType(), artifacts.length); - for (Artifact artifact : artifacts) { try { - RelationManager.ensureSideWillSupport(artifact, relationType, relationSide, - group.getLinkManager().getOwningArtifact().getArtifactType(), artifacts.length); + Artifact artA = null; + Artifact artB = null; + if (relationSide == RelationSide.SIDE_A) { + artA = artifact; + artB = group.getArtifact(); + } else { + artA = group.getArtifact(); + artB = artifact; + } + RelationManager.ensureRelationCanBeAdded(relationType, artA, artB); window.addValid(artifact); } catch (IllegalArgumentException ex) { @@ -90,7 +95,7 @@ public class ArtifactDragDropSupport { } private static void addFiles(String[] fileNames, RelationExplorerWindow window, Shell shell) throws SQLException { - RelationLinkGroup group = window.getRelationGroup(); + RelationTypeSide group = window.getRelationGroup(); IFile iFile; Artifact artifact; @@ -131,7 +136,7 @@ public class ArtifactDragDropSupport { } private static void addURL(String url, RelationExplorerWindow window, Shell shell) throws SQLException { - RelationLinkGroup group = window.getRelationGroup(); + RelationTypeSide group = window.getRelationGroup(); Artifact artifact; String location; diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java index fe4898f015b..e50b7448f68 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java @@ -1183,13 +1183,11 @@ public class ArtifactExplorer extends ViewPart implements IEventReceiver, IActio if (aArt != null && !aArt.isDeleted() && !aArt.isReadOnly()) {
// make sure his linkmanager is loaded
- aArt.getLinkManager();
treeViewer.refresh(aArt, false);
}
if (bArt != null && !bArt.isDeleted() && !bArt.isReadOnly()) {
// make sure his linkmanager is loaded
- bArt.getLinkManager();
treeViewer.refresh(bArt, false);
}
} else if (event instanceof ArtifactVersionIncrementedEvent) {
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java index 600d45b4e6b..c6d8b93d3ce 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/RootAndAttributeBasedArtifactResolver.java @@ -16,7 +16,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; -import java.util.Set; +import java.util.List; import org.eclipse.osee.framework.jdk.core.type.HashCollection; import org.eclipse.osee.framework.skynet.core.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -93,7 +93,7 @@ public class RootAndAttributeBasedArtifactResolver extends NewArtifactImportReso } public Artifact resolve(RoughArtifact roughArtifact) throws SQLException, IllegalStateException, IOException, OseeCoreException { - Set<Artifact> siblings = roughArtifact.getRoughParent().getAssociatedArtifact().getChildren(); + List<Artifact> siblings = roughArtifact.getRoughParent().getAssociatedArtifact().getChildren(); Collection<Artifact> candidates = new LinkedList<Artifact>(); for (Artifact artifact : siblings) { diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java index 7c979caea3c..9c590ae8b81 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java @@ -89,8 +89,8 @@ public class RelationContentProvider implements ITreeContentProvider { RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_A); int sideBMax = RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_B); - RelationTypeSide sideA = new RelationTypeSide(relationType, RelationSide.SIDE_A); - RelationTypeSide sideB = new RelationTypeSide(relationType, RelationSide.SIDE_B); + RelationTypeSide sideA = new RelationTypeSide(relationType, RelationSide.SIDE_A, artifact); + RelationTypeSide sideB = new RelationTypeSide(relationType, RelationSide.SIDE_B, artifact); boolean onSideA = sideBMax > 0; boolean onSideB = sideAMax > 0; if (onSideA && onSideB) { diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java index 2382cc7c097..5ec29b9f369 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java @@ -20,7 +20,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; -import java.util.logging.Level; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.CellEditor; import org.eclipse.jface.viewers.DoubleClickEvent; @@ -35,15 +34,13 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData; import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager; import org.eclipse.osee.framework.skynet.core.relation.RelationLink; -import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup; import org.eclipse.osee.framework.skynet.core.relation.RelationManager; import org.eclipse.osee.framework.skynet.core.relation.RelationModifiedEvent; import org.eclipse.osee.framework.skynet.core.relation.RelationSide; import org.eclipse.osee.framework.skynet.core.relation.RelationType; -import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; +import org.eclipse.osee.framework.skynet.core.util.ArtifactDoesNotExist; import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver; -import org.eclipse.osee.framework.ui.skynet.artifact.RelationGroupDialog; import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor; import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor; import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow; @@ -56,7 +53,6 @@ import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.DropTargetEvent; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.MenuAdapter; import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener; import org.eclipse.swt.events.MouseEvent; @@ -67,11 +63,9 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; @@ -94,7 +88,6 @@ public class RelationsComposite extends Composite implements IEventReceiver { private MenuItem openMenuItem; private MenuItem editMenuItem; - private MenuItem newMenuItem; private MenuItem viewRelationTreeItem; private MenuItem deleteRelationMenuItem; private MenuItem deleteArtifactMenuItem; @@ -177,12 +170,8 @@ public class RelationsComposite extends Composite implements IEventReceiver { if (e1 instanceof RelationLink && e2 instanceof RelationLink) { RelationLink link1 = (RelationLink) e1; RelationLink link2 = (RelationLink) e2; - - float val; - if (link1.getArtifactA() == artifact) - val = link1.getAOrder() - link2.getAOrder(); - else - val = link1.getBOrder() - link2.getBOrder(); + RelationSide side = link1.getSide(artifact); + float val = link1.getOrder(side) - link2.getOrder(side); if (val > 0) return 1; @@ -258,8 +247,6 @@ public class RelationsComposite extends Composite implements IEventReceiver { createMassEditMenuItem(popupMenu); } new MenuItem(popupMenu, SWT.SEPARATOR); - createNewMenuItem(popupMenu); - new MenuItem(popupMenu, SWT.SEPARATOR); createViewRelationTreeMenuItem(popupMenu); new MenuItem(popupMenu, SWT.SEPARATOR); createDeleteRelationMenuItem(popupMenu); @@ -279,54 +266,6 @@ public class RelationsComposite extends Composite implements IEventReceiver { } } - private class CreateNewRelationSelectedListener implements Listener { - private Shell shell; - - public CreateNewRelationSelectedListener(Shell shell) { - this.shell = shell; - } - - public void widgetDefaultSelected(SelectionEvent e) { - } - - public void handleEvent(Event event) { - try { - boolean isNewRelationCreated = false; - RelationType selectedDescriptor = (RelationType) ((MenuItem) event.widget).getData(); - - boolean canBeOnSideA = canBeOnSide(selectedDescriptor, RelationSide.SIDE_A); - boolean canBeOnSideB = canBeOnSide(selectedDescriptor, RelationSide.SIDE_B); - - if (canBeOnSideA && canBeOnSideB) { - RelationGroupDialog dialog = - new RelationGroupDialog(shell, "Select New Relation Side", null, - "Please select the relation side onto which you intend to drag related artifacts.", - selectedDescriptor, artifact); - int response = dialog.open(); - if (response == 0) isNewRelationCreated = true; - - } else if (canBeOnSideA || canBeOnSideB) { - // artifact.getLinkManager().ensureRelationGroupExists(selectedDescriptor, canBeOnSideB); - isNewRelationCreated = true; - } - - if (isNewRelationCreated) { - treeViewer.refresh(); - treeViewer.expandToLevel(selectedDescriptor, 1); - editor.onDirtied(); - } - - packColumnData(); - } catch (SQLException ex) { - SkynetGuiPlugin.getLogger().log(Level.SEVERE, ex.getLocalizedMessage(), ex); - } - } - } - - private boolean canBeOnSide(RelationType relationType, RelationSide relationSide) throws SQLException { - return RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), relationSide) > 0; - } - private void createDeleteRelationMenuItem(final Menu parentMenu) { deleteRelationMenuItem = new MenuItem(parentMenu, SWT.CASCADE); deleteRelationMenuItem.setText("&Delete Relation"); @@ -388,68 +327,6 @@ public class RelationsComposite extends Composite implements IEventReceiver { }); } - private void createNewMenuItem(final Menu parentMenu) { - newMenuItem = new MenuItem(parentMenu, SWT.CASCADE); - newMenuItem.setText("&New Relation"); - Menu newMenu = new Menu(parentMenu.getShell(), SWT.DROP_DOWN); - boolean isRelatable = false; - - try { - for (RelationType relationDescriptor : RelationTypeManager.getValidTypes(artifact.getArtifactType(), - artifact.getBranch())) { - MenuItem mItem = new MenuItem(newMenu, SWT.PUSH); - mItem.setData(relationDescriptor); - mItem.setText(relationDescriptor.getTypeName()); - mItem.addListener(SWT.Selection, new CreateNewRelationSelectedListener(parentMenu.getShell())); - - isRelatable = true; - } - } catch (SQLException ex) { - OSEELog.logException(SkynetGuiPlugin.class, ex, true); - } - - if (isRelatable) { - newMenuItem.setText("&New Relation"); - } else { - newMenuItem.setText("New Relation - No valid relations"); - } - - newMenuItem.setEnabled(isRelatable); - newMenuItem.setMenu(newMenu); - - newMenu.addMenuListener(new MenuAdapter() { - - public void menuShown(MenuEvent e) { - try { - Menu dropDown = (Menu) e.getSource(); - MenuItem[] items = dropDown.getItems(); - boolean canBeOnSideA; - boolean canBeOnSideB; - - for (MenuItem item : items) { - RelationType descriptor = (RelationType) item.getData(); - canBeOnSideA = canBeOnSide(descriptor, RelationSide.SIDE_A); - canBeOnSideB = canBeOnSide(descriptor, RelationSide.SIDE_B); - - String title = descriptor.getTypeName(); - if (canBeOnSideA && canBeOnSideB) - title += "..."; - else if (canBeOnSideA) - title += " (" + descriptor.getSideBName() + ")"; - else if (canBeOnSideB) title += " (" + descriptor.getSideAName() + ")"; - - item.setText(title); - - item.setEnabled(canBeOnSideA || canBeOnSideB); - } - } catch (SQLException ex) { - SkynetGuiPlugin.getLogger().log(Level.SEVERE, ex.getLocalizedMessage(), ex); - } - } - - }); - } - private void createOpenMenuItem(Menu parentMenu) { openMenuItem = new MenuItem(parentMenu, SWT.PUSH); openMenuItem.setText("Open"); @@ -466,12 +343,17 @@ public class RelationsComposite extends Composite implements IEventReceiver { private void openViewer(IStructuredSelection selection) { // TODO: check permission Object object = selection.getFirstElement(); - Artifact selectedArtifact; + Artifact selectedArtifact = null; if (object instanceof RelationLink) { RelationLink link = (RelationLink) object; - selectedArtifact = (link.getArtifactA() == artifact) ? link.getArtifactB() : link.getArtifactA(); - + try { + selectedArtifact = link.getArtifactOnOtherSide(artifact); + } catch (ArtifactDoesNotExist ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } catch (SQLException ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } ArtifactEditor.editArtifact(selectedArtifact); } } @@ -484,7 +366,13 @@ public class RelationsComposite extends Composite implements IEventReceiver { Object object = iter.next(); if (object instanceof RelationLink) { RelationLink link = (RelationLink) object; - selectedArtifacts.add(link.getArtifactB()); + try { + selectedArtifacts.add(link.getArtifactB()); + } catch (ArtifactDoesNotExist ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } catch (SQLException ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } } } MassArtifactEditor.editArtifacts("Mass Edit", selectedArtifacts); @@ -646,9 +534,13 @@ public class RelationsComposite extends Composite implements IEventReceiver { } else if (object instanceof RelationType) { RelationType relationType = (RelationType) object; RelationManager.deleteRelations(artifact, relationType, null); - } else if (object instanceof RelationLinkGroup) { - RelationLinkGroup group = (RelationLinkGroup) object; - RelationManager.deleteRelations(artifact, group.getDescriptor(), group.getSide()); + } else if (object instanceof RelationTypeSide) { + RelationTypeSide group = (RelationTypeSide) object; + try { + RelationManager.deleteRelations(artifact, group.getRelationType(), group.getSide()); + } catch (SQLException ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } } refresh(); @@ -718,8 +610,16 @@ public class RelationsComposite extends Composite implements IEventReceiver { for (int index = 0; index < objects.length; index++) { RelationLink link = (RelationLink) objects[index]; - Artifact selectedArtifact = - artifact.equals(link.getArtifactA()) ? link.getArtifactB() : link.getArtifactA(); + Artifact selectedArtifact = null; + try { + selectedArtifact = link.getArtifactOnOtherSide(artifact); + } catch (ArtifactDoesNotExist ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, false); + } catch (SQLException ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, false); + } + // Artifact selectedArtifact = + // artifact.equals(link.getArtifactA()) ? link.getArtifactB() : link.getArtifactA(); artifacts[index] = selectedArtifact; artifactToLinkMap.put(selectedArtifact.getArtId(), link); } @@ -735,7 +635,7 @@ public class RelationsComposite extends Composite implements IEventReceiver { event.feedback = DND.FEEDBACK_EXPAND; event.detail = DND.DROP_NONE; - if (selected != null && selected.getData() instanceof RelationLinkGroup) { + if (selected != null && selected.getData() instanceof RelationTypeSide) { event.detail = DND.DROP_COPY; tree.setInsertMark(null, false); } else if (selected != null && selected.getData() instanceof RelationLink) { @@ -780,23 +680,16 @@ public class RelationsComposite extends Composite implements IEventReceiver { public void performDrop(DropTargetEvent event) { TreeItem selected = treeViewer.getTree().getItem(treeViewer.getTree().toControl(event.x, event.y)); Object object = selected.getData(); - try { - if (object instanceof RelationLink) { + if (object instanceof RelationLink) {//used for ordering RelationLink targetLink = (RelationLink) object; - Artifact transferredArtifact = ((ArtifactData) event.data).getArtifacts()[0]; - RelationLink dropLink = artifactToLinkMap.remove(transferredArtifact.getArtId()); - RelationLinkGroup group; - - group = - artifact.getLinkManager().getSideGroup(dropLink.getRelationType(), - transferredArtifact.equals(dropLink.getArtifactA())); - - group.moveLink(targetLink, dropLink, !isFeedbackAfter); + RelationManager.addRelationAndModifyOrder(artifact, targetLink.getArtifactOnOtherSide(artifact), + ((ArtifactData) event.data).getArtifacts(), targetLink.getRelationType(), true); treeViewer.refresh(); editor.onDirtied(); } else if (object instanceof RelationTypeSide) { - RelationLinkGroup group = (RelationLinkGroup) selected.getData(); + RelationTypeSide group = (RelationTypeSide) object; + RelationExplorerWindow window = new RelationExplorerWindow(treeViewer, group); ArtifactDragDropSupport.performDragDrop(event, window, @@ -805,6 +698,8 @@ public class RelationsComposite extends Composite implements IEventReceiver { } } catch (SQLException ex) { OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } catch (ArtifactDoesNotExist ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); } isFeedbackAfter = false; diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/RelationGroupDialog.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/RelationGroupDialog.java deleted file mode 100644 index c5961582699..00000000000 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/RelationGroupDialog.java +++ /dev/null @@ -1,280 +0,0 @@ -/******************************************************************************* - * 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.artifact; - -import java.sql.SQLException; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.relation.RelationType; -import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; -import org.eclipse.osee.framework.ui.skynet.util.OSEELog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; - -public class RelationGroupDialog extends MessageDialog { - - public final static int NONE = 0; - public final static int ERROR = 1; - public final static int INFORMATION = 2; - public final static int QUESTION = 3; - public final static int WARNING = 4; - private String title; - private Image titleImage; - private Image image = null; - private Label errorLabel; - private Composite composite; - private RelationType descriptor; - private Artifact artifact; - private String sideName; - - String validationRegularExpression = null; - String validationErrorString = ""; - - /** - * The custom dialog area. - */ - private Control customArea; - - /** - * Create a message dialog. Note that the dialog will have no visual representation (no widgets) until it is told to - * open. - * <p> - * The labels of the buttons to appear in the button bar are supplied in this constructor as an array. The - * <code>open</code> method will return the index of the label in this array corresponding to the button that was - * pressed to close the dialog. If the dialog was dismissed without pressing a button (ESC, etc.) then -1 is - * returned. Note that the <code>open</code> method blocks. - * </p> - * - * @param parentShell the parent shell - * @param dialogTitle the dialog title, or <code>null</code> if none - * @param dialogTitleImage the dialog title image, or <code>null</code> if none - * @param dialogMessage the dialog message - * @param descriptor - - * @param artifact - - */ - public RelationGroupDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, RelationType descriptor, Artifact artifact) { - super(parentShell, dialogMessage, dialogTitleImage, dialogMessage, MessageDialog.INFORMATION, new String[] {"OK", - "Cancel"}, 0); - this.title = dialogTitle; - this.titleImage = dialogTitleImage; - this.message = dialogMessage; - this.descriptor = descriptor; - this.artifact = artifact; - } - - /** - * Calling will enable dialog to loose focus - */ - public void setModeless() { - setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS); - setBlockOnOpen(false); - } - - /** - * override this method to make own checks on entry this will be called with every keystroke - * - * @return true if entry is valid - */ - public boolean isEntryValid() { - if (validationRegularExpression == null) { - return true; - } - return true; - } - - public void setValidationRegularExpression(String regExp) { - validationRegularExpression = regExp; - } - - public void setValidationErrorString(String errorText) { - validationErrorString = errorText; - } - - /* - * (non-Javadoc) Method declared on Dialog. - */ - protected void buttonPressed(int buttonId) { - if (buttonId == 0) okPressed(); - setReturnCode(buttonId); - close(); - } - - /* - * (non-Javadoc) Method declared in Window. - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - if (title != null) shell.setText(title); - if (titleImage != null) shell.setImage(titleImage); - } - - /** - * Creates and returns the contents of an area of the dialog which appears below the message and above the button - * bar. - * <p> - * The default implementation of this framework method returns <code>null</code>. Subclasses may override. - * </p> - * - * @param parent parent composite to contain the custom area - * @return Control custom area control, or <code>null</code> - */ - protected Control createCustomArea(Composite parent) { - return null; - } - - /** - * This implementation of the <code>Dialog</code> framework method creates and lays out a composite and calls - * <code>createMessageArea</code> and <code>createCustomArea</code> to populate it. Subclasses should override - * <code>createCustomArea</code> to add contents below the message. - */ - protected Control createDialogArea(Composite parent) { - - // create message area - createMessageArea(parent); - - // create the top level composite for the dialog area - composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - - // Create error label - errorLabel = new Label(composite, SWT.NONE); - errorLabel.setSize(errorLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT)); - errorLabel.setText(""); - - Button radioButtonA = new Button(composite, SWT.RADIO); - radioButtonA.setText(descriptor.getSideAName()); - radioButtonA.setData(descriptor.getSideAName()); - radioButtonA.setBounds(10, 5, 75, 30); - radioButtonA.setSelection(true); - radioButtonA.addListener(SWT.Selection, new selectionListener()); - - Button radioButtonB = new Button(composite, SWT.RADIO); - radioButtonB.setText(descriptor.getSideBName()); - radioButtonB.setData(descriptor.getSideBName()); - radioButtonB.setBounds(10, 5, 75, 30); - radioButtonB.addListener(SWT.Selection, new selectionListener()); - - sideName = (String) radioButtonA.getData(); - - GridData data = new GridData(GridData.FILL_BOTH); - data.horizontalSpan = 2; - - composite.setLayoutData(data); - composite.setFont(parent.getFont()); - - // allow subclasses to add custom controls - customArea = createCustomArea(composite); - - // If it is null create a dummy label for spacing purposes - if (customArea == null) customArea = new Label(composite, SWT.NULL); - - return composite; - } - - private class selectionListener implements Listener { - - public void handleEvent(Event event) { - sideName = (String) ((Button) event.widget).getData(); - } - - } - - /** - * Returns the minimum message area width in pixels This determines the minimum width of the dialog. - * <p> - * Subclasses may override. - * </p> - * - * @return the minimum message area width (in pixels) - */ - protected int getMinimumMessageWidth() { - return convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); - } - - /* - * (non-Javadoc) Method declared on Dialog. Sets a return code of -1 since none of the dialog - * buttons were pressed to close the dialog. - */ - protected void handleShellCloseEvent() { - super.handleShellCloseEvent(); - setReturnCode(-1); - } - - /** - * Convenience method to open a simple confirm (OK/Cancel) dialog. - * - * @param parent the parent shell of the dialog, or <code>null</code> if none - * @param title the dialog's title, or <code>null</code> if none - * @param message the message - * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise - */ - public static boolean openTextEntry(Shell parent, String title, String message) { - MessageDialog dialog = new MessageDialog(parent, title, null, - // accept the default window icon - message, QUESTION, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); - // OK is the default - return dialog.open() == 0; - } - - public void setEntry(String entry) { - // text.setText(entry); - } - - /** - * Return whether or not we should apply the workaround where we take focus for the default button or if that should - * be determined by the dialog. By default only return true if the custom area is a label or CLabel that cannot take - * focus. - * - * @return boolean - */ - protected boolean customShouldTakeFocus() { - if (customArea instanceof Label) return false; - - if (customArea instanceof CLabel) return (customArea.getStyle() & SWT.NO_FOCUS) > 0; - - return true; - } - - /* - * @see IconAndMessageDialog#getImage() - */ - public Image getImage() { - return image; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ - @Override - protected void okPressed() { - try { - artifact.getLinkManager().ensureRelationGroupExists(descriptor, sideName); - } catch (SQLException ex) { - OSEELog.logException(SkynetGuiPlugin.class, ex, true); - } - } -} diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java index 21a0dd4fa2e..20f6815118d 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java @@ -38,9 +38,9 @@ import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager; import org.eclipse.osee.framework.skynet.core.event.TransactionEvent; import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData; import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration; +import org.eclipse.osee.framework.skynet.core.relation.RelationManager; import org.eclipse.osee.framework.skynet.core.relation.RelationPersistenceManager; import org.eclipse.osee.framework.skynet.core.relation.RelationPersistenceManager.Direction; -import org.eclipse.osee.framework.skynet.core.relation.RelationPersistenceManager.InsertLocation; import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate; import org.eclipse.osee.framework.ui.plugin.event.Event; import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver; @@ -620,6 +620,8 @@ public class GroupExplorer extends ViewPart implements IEventReceiver, IActionab if (event.data instanceof ArtifactData) { + GroupExplorerItem parentUnivGroupItem = null; + Artifact[] artifactsToInsert = null; // Drag item came from inside Group Explorer if (((ArtifactData) event.data).getSource().equals(VIEW_ID)) { IStructuredSelection selectedItem = (IStructuredSelection) treeViewer.getSelection(); @@ -631,26 +633,20 @@ public class GroupExplorer extends ViewPart implements IEventReceiver, IActionab insertArts.add(((GroupExplorerItem) obj).getArtifact()); } } - GroupExplorerItem parentUnivGroupItem = - ((GroupExplorerItem) selectedItem.getFirstElement()).getParentItem(); - Artifact parentArtifact = parentUnivGroupItem.getArtifact(); - Artifact targetArtifact = dragOverExplorerItem.getArtifact(); - - RelationPersistenceManager.getInstance().insertObjectsOnSideB(parentArtifact, targetArtifact, - insertArts, CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS, - isFeedbackAfter ? InsertLocation.AfterTarget : InsertLocation.BeforeTarget); + parentUnivGroupItem = ((GroupExplorerItem) selectedItem.getFirstElement()).getParentItem(); + artifactsToInsert = insertArts.toArray(new Artifact[insertArts.size()]); } // Drag item came from outside Group Explorer else { List<Artifact> insertArts = Arrays.asList(((ArtifactData) event.data).getArtifacts()); - GroupExplorerItem parentUnivGroupItem = dragOverExplorerItem.getParentItem(); - Artifact parentArtifact = parentUnivGroupItem.getArtifact(); - Artifact targetArtifact = dragOverExplorerItem.getArtifact(); - - RelationPersistenceManager.getInstance().insertObjectsOnSideB(parentArtifact, targetArtifact, - insertArts, CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS, - isFeedbackAfter ? InsertLocation.AfterTarget : InsertLocation.BeforeTarget); + parentUnivGroupItem = dragOverExplorerItem.getParentItem(); + artifactsToInsert = insertArts.toArray(new Artifact[insertArts.size()]); } + Artifact parentArtifact = parentUnivGroupItem.getArtifact(); + Artifact targetArtifact = dragOverExplorerItem.getArtifact(); + + RelationManager.addRelationAndModifyOrder(parentArtifact, targetArtifact, artifactsToInsert, + CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS.getRelationType(), !isFeedbackAfter); } } treeViewer.refresh(dragOverExplorerItem); diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/httpRequests/ArtifactTreeRequest.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/httpRequests/ArtifactTreeRequest.java index 2a8225e4f49..a07ca0e7480 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/httpRequests/ArtifactTreeRequest.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/httpRequests/ArtifactTreeRequest.java @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.httpRequests; import java.sql.SQLException; -import java.util.Set; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.eclipse.osee.framework.jdk.core.util.Strings; @@ -100,7 +100,7 @@ public class ArtifactTreeRequest implements IHttpServerRequest { private void buildArtifactTree(Document doc, Element element, Artifact artifact, final int level) { if (level > 0) { - Set<Artifact> children; + List<Artifact> children; try { children = artifact.getChildren(); diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/RelationExplorerWindow.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/RelationExplorerWindow.java index b0f990a334d..d0ef6e1d748 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/RelationExplorerWindow.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/relation/explorer/RelationExplorerWindow.java @@ -13,15 +13,13 @@ package org.eclipse.osee.framework.ui.skynet.relation.explorer; import java.io.File; import java.sql.SQLException; import java.util.ArrayList; -import java.util.logging.Level; import org.eclipse.core.resources.IFile; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager; import org.eclipse.osee.framework.skynet.core.artifact.WorkspaceURL; import org.eclipse.osee.framework.skynet.core.attribute.ArtifactType; -import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; +import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; import org.eclipse.osee.framework.ui.skynet.util.OSEELog; import org.eclipse.swt.SWT; @@ -46,7 +44,7 @@ import org.eclipse.swt.widgets.Table; public class RelationExplorerWindow { private RelationTableViewer relationTableViewer; - private RelationLinkGroup relationGroup; + private RelationTypeSide relationGroup; private boolean persistOnOk; private boolean cancelled = false; @@ -77,7 +75,7 @@ public class RelationExplorerWindow { public static final int NAME_NUM = 0; public static final int REASON_NUM = 1; - public RelationExplorerWindow(StructuredViewer viewer, RelationLinkGroup group, boolean persistOnOk) { + public RelationExplorerWindow(StructuredViewer viewer, RelationTypeSide group, boolean persistOnOk) { this.validArtifacts = new ArrayList<Artifact>(); this.invalidArtifacts = new ArrayList<Artifact>(); @@ -94,7 +92,7 @@ public class RelationExplorerWindow { } - public RelationExplorerWindow(StructuredViewer viewer, RelationLinkGroup group) { + public RelationExplorerWindow(StructuredViewer viewer, RelationTypeSide group) { this(viewer, group, false); } @@ -313,17 +311,20 @@ public class RelationExplorerWindow { if (artifact != null) { try { - relationGroup.addArtifact(artifact); - if (persistOnOk) { - relationGroup.getLinkManager().getOwningArtifact().persistRelations(); - } + relationGroup.getArtifact().addRelation(relationGroup, artifact); } catch (SQLException ex) { - AWorkbench.popup("ERROR", ex.getLocalizedMessage()); - SkynetGuiPlugin.getLogger().log(Level.SEVERE, ex.getLocalizedMessage(), ex); + OSEELog.logException(SkynetGuiPlugin.class, ex, true); } } } } + if (persistOnOk) { + try { + relationGroup.getArtifact().persistRelations(); + } catch (SQLException ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, true); + } + } shell.dispose(); viewer.refresh(); @@ -345,7 +346,7 @@ public class RelationExplorerWindow { /** * @return Returns the relationGroup. */ - public RelationLinkGroup getRelationGroup() { + public RelationTypeSide getRelationGroup() { return relationGroup; } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java index 81368252c76..d39ef46bfd5 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphContentProvider.java @@ -22,8 +22,10 @@ import java.util.logging.Logger; import org.eclipse.jface.viewers.Viewer; import org.eclipse.osee.framework.plugin.core.config.ConfigUtil; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.relation.LinkManager; -import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup; +import org.eclipse.osee.framework.skynet.core.exception.OseeDataStoreException; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; +import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; +import org.eclipse.osee.framework.skynet.core.util.ArtifactDoesNotExist; import org.eclipse.zest.core.viewers.IGraphEntityContentProvider; /** @@ -53,22 +55,27 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider // Don't want to create any links to artifacts that are NOT in displayArtifacts try { - LinkManager linkManager = ((Artifact) entity).getLinkManager(); - for (RelationLinkGroup linkGroup : linkManager.getGroups()) { - if (!options.isFilterEnabled()) { - for (Artifact art : linkGroup.getArtifacts()) { - if (displayArtifacts.contains(art)) otherItems.add(art); + Artifact artifact = (Artifact) entity; + List<RelationType> validTypes = + RelationTypeManager.getValidTypes(artifact.getArtifactType(), artifact.getBranch()); + for (RelationType relationType : validTypes) { + if (options.isValidRelationType(relationType)) { + for (Artifact art : artifact.getRelatedArtifacts(relationType)) { + if (options.isValidArtifactType(art.getArtifactType()) && displayArtifacts.contains(art)) { + otherItems.add(art); + } } - } else if (options.isValidRelationLinkGroup(linkGroup)) for (Artifact art : linkGroup.getArtifacts()) - if (options.isValidArtifactType(art) && displayArtifacts.contains(art)) otherItems.add(art); + } } } catch (SQLException ex) { logger.log(Level.SEVERE, ex.toString(), ex); + } catch (ArtifactDoesNotExist ex) { + logger.log(Level.SEVERE, ex.toString(), ex); + } catch (OseeDataStoreException ex) { + logger.log(Level.SEVERE, ex.toString(), ex); } return otherItems.toArray(); - } - private Set<Artifact> displayArtifacts = new HashSet<Artifact>(); /* @@ -93,16 +100,12 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider return; } else { try { - LinkManager linkManager = artifact.getLinkManager(); - for (RelationLinkGroup linkGroup : linkManager.getGroups()) { - if (!options.isFilterEnabled()) { - for (Artifact art : linkGroup.getArtifacts()) { - displayArtifacts.add(art); - getDescendants(displayArtifacts, art, level - 1); - } - } else if (options.isValidRelationLinkGroup(linkGroup)) { - for (Artifact art : linkGroup.getArtifacts()) { - if (options.isValidArtifactType(art)) { + List<RelationType> validTypes = + RelationTypeManager.getValidTypes(artifact.getArtifactType(), artifact.getBranch()); + for (RelationType relationType : validTypes) { + if (options.isValidRelationType(relationType)) { + for (Artifact art : artifact.getRelatedArtifacts(relationType)) { + if (options.isValidArtifactType(art.getArtifactType())) { displayArtifacts.add(art); getDescendants(displayArtifacts, art, level - 1); } @@ -111,6 +114,10 @@ public class ArtifactGraphContentProvider implements IGraphEntityContentProvider } } catch (SQLException ex) { logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex); + } catch (ArtifactDoesNotExist ex) { + logger.log(Level.SEVERE, ex.toString(), ex); + } catch (OseeDataStoreException ex) { + logger.log(Level.SEVERE, ex.toString(), ex); } } } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphLabelProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphLabelProvider.java index a669094a081..4b1daf0c57a 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphLabelProvider.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/ArtifactGraphLabelProvider.java @@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.osee.framework.jdk.core.util.Collections; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.relation.RelationLink; +import org.eclipse.osee.framework.skynet.core.util.ArtifactDoesNotExist; import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerOptions.LinkName; import org.eclipse.osee.framework.ui.skynet.util.OSEELog; @@ -100,6 +101,8 @@ public class ArtifactGraphLabelProvider implements ILabelProvider { } catch (SQLException ex) { OSEELog.logException(SkynetGuiPlugin.class, ex, false); return ex.getLocalizedMessage(); + } catch (ArtifactDoesNotExist ex) { + OSEELog.logException(SkynetGuiPlugin.class, ex, false); } return null; } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java index 1ba1d250902..44293737d8e 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/skywalker/SkyWalkerOptions.java @@ -29,11 +29,9 @@ import org.eclipse.osee.framework.skynet.core.attribute.AttributeType; import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager; import org.eclipse.osee.framework.skynet.core.relation.RelationType; -import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin; import org.eclipse.osee.framework.ui.skynet.skywalker.ISkyWalkerOptionsChangeListener.ModType; -import org.eclipse.osee.framework.ui.skynet.skywalker.RelTypeContentProvider.RelationLinkDescriptorSide; import org.eclipse.osee.framework.ui.skynet.util.OSEELog; import org.eclipse.zest.layouts.LayoutStyles; import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm; @@ -294,15 +292,14 @@ public class SkyWalkerOptions { notifyListeners(ModType.Artifact); } - public boolean isValidArtifactType(Artifact artifact) { + public boolean isValidArtifactType(ArtifactType type) { if (!isFilterEnabled()) return true; - return getSelectedArtTypes().contains(artifact.getArtifactType()); + return getSelectedArtTypes().contains(type); } - public boolean isValidRelationLinkGroup(RelationLinkGroup linkGroup) { + public boolean isValidRelationType(RelationType type) { if (!isFilterEnabled()) return true; - return getSelectedRelTypes().contains(linkGroup.getDescriptor()) || getSelectedRelTypes().contains( - new RelationLinkDescriptorSide(linkGroup.getDescriptor(), linkGroup.isSideA())); + return getSelectedRelTypes().contains(type); } /** |