summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-20 16:33:28 (EDT)
committer Roberto E. Escobar2011-10-20 16:33:28 (EDT)
commit5f5f6e962090b613a6002897d0685f54e64d516d (patch)
tree54491b442e24c311d2bcfd7ae21ac0bf4612aa69
parentbc9a33c4b8ff012198d2c394a9aae422b4d58dee (diff)
downloadorg.eclipse.osee-5f5f6e962090b613a6002897d0685f54e64d516d.zip
org.eclipse.osee-5f5f6e962090b613a6002897d0685f54e64d516d.tar.gz
org.eclipse.osee-5f5f6e962090b613a6002897d0685f54e64d516d.tar.bz2
feature[ats_E6W8N]: Implement 3-list relation comp
-rw-r--r--plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java44
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java1
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java194
-rw-r--r--plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css7
-rw-r--r--plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/woodsonArrow_left.pngbin0 -> 362 bytes
5 files changed, 174 insertions, 72 deletions
diff --git a/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
index 11ab6fb..1bb1c0b 100644
--- a/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
+++ b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
@@ -127,9 +127,9 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
// public void initSearchHome(AtsSearchHeaderComponent headerComponent) {
// if (headerComponent != null) {
// headerComponent.clearAll();
- // Set<Entry<WebId, Collection<WebId>>> entrySet = programsAndBuilds.entrySet();
+ // Set<Entry<ViewId, Collection<ViewId>>> entrySet = programsAndBuilds.entrySet();
// if (entrySet != null) {
- // for (Entry<WebId, Collection<WebId>> entry : entrySet) {
+ // for (Entry<ViewId, Collection<ViewId>> entry : entrySet) {
// headerComponent.addProgram(entry.getKey());
// }
// }
@@ -154,11 +154,9 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
artHeaderComp.setArtifact(artifact);
relComp.clearAll();
- ViewId parentRelationType = new ViewId("guid1", "Parent");
- ViewId childRelationType = new ViewId("guid2", "Child");
- ViewId swReqRelationType = new ViewId("guid3", "SW Requirement");
- relComp.addRelationType(parentRelationType);
- relComp.addRelationType(childRelationType);
+ ViewId hierRelationType = new ViewId("guid1", "Default Hierarchy");
+ ViewId swReqRelationType = new ViewId("guid3", "Traceability");
+ relComp.addRelationType(hierRelationType);
relComp.addRelationType(swReqRelationType);
attrComp.clearAll();
@@ -176,12 +174,28 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
@Override
public void selectRelationType(ViewArtifact artifact, ViewId relation, RelationComponent relationComponent) {
- relationComponent.clearRelations();
- Set<Entry<String, ViewArtifact>> artifactsSet = artifacts.entrySet();
- for (Entry<String, ViewArtifact> entry : artifactsSet) {
- ViewArtifact art = entry.getValue();
- relationComponent.addRightRelated(art);
- relationComponent.addLeftRelated(art);
+ if (relationComponent != null && relation != null) {
+ relationComponent.clearRelations();
+ String relGuid = relation.getGuid();
+ if (relGuid.equals("guid1")) {
+ //Default Hierarchy
+ relationComponent.addLeftRelated(crewIntreqs);
+ relationComponent.addRightRelated(commSubSysCrewIntreqs);
+ relationComponent.setLeftName("Parent");
+ relationComponent.setRightName("Child");
+ }
+
+ if (relGuid.equals("guid3")) {
+ //Default Hierarchy
+ relationComponent.addLeftRelated(null);
+ relationComponent.setLeftName(null);
+ relationComponent.setRightName("SW Requirement");
+ Set<Entry<String, ViewArtifact>> entrySet = artifacts.entrySet();
+ for (Entry<String, ViewArtifact> entry : entrySet) {
+ ViewArtifact art = entry.getValue();
+ relationComponent.addRightRelated(art);
+ }
+ }
}
}
@@ -205,8 +219,8 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
// private void updateAndSetSearchHeaderCriteria(String url, AtsSearchHeaderComponentInterface searchHeaderComponent) {
// Map<String, String> params = requestStringToParameterMap(url);
- // WebId program = new WebId("", "");
- // WebId build = new WebId("", "");
+ // ViewId program = new ViewId("", "");
+ // ViewId build = new ViewId("", "");
// boolean nameOnly = false;
// String searchPhrase = "";
//
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java
index edf2c7b..015384c 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java
@@ -51,6 +51,7 @@ public final class CssConstants {
public static final String OSEE_BREADCRUMB_ARTNAME = "osee-breadcrumb-artname";
public static final String OSEE_RIGHTARROW = "osee-rightarrow";
+ public static final String OSEE_LEFTARROW = "osee-leftarrow";
public static final String OSEE_ATTRIBUTELABEL = "osee-attributelabel";
public static final String OSEE_ATTRIBUTEVALUE = "osee-attributevalue";
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java
index b499da9..7cf6491 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java
@@ -35,15 +35,19 @@ import com.vaadin.ui.Window.Notification;
public class OseeRelationsComponent extends VerticalLayout implements RelationComponent {
private boolean populated = false;
- private final ListSelect relationTypesListSelect = new ListSelect();
- private final ListSelect relationsListSelect = new ListSelect();
- private final ListSelect sideBSelect = new ListSelect();
+ private final ListSelect relTypesSelect = new ListSelect();
+ private final ListSelect leftSelect = new ListSelect();
+ private final ListSelect rightSelect = new ListSelect();
private SearchPresenter<?> searchPresenter = null;
private SearchNavigator navigator = null;
private boolean lockRelTypesListener = false;
private boolean lockRelsListener = false;
private ViewArtifact artifact = null;
private final int LISTBOX_MINWIDTH = 100;
+ private final Label leftTitle = new Label("");
+ private final Label relTypesTitleTop = new Label("Relationship");
+ private final Label relTypesTitleBot = new Label("Type");
+ private final Label rightTitle = new Label("");
@Override
public void attach() {
@@ -66,68 +70,118 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
final HorizontalLayout listBoxesLayout = new HorizontalLayout();
- Label titleLabel = new Label("Relationships");
- titleLabel.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+ leftTitle.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+ relTypesTitleTop.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+ relTypesTitleBot.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+ rightTitle.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
- relationTypesListSelect.setNullSelectionAllowed(false);
- relationTypesListSelect.setImmediate(true);
+ //Fixed width lists make for a prettier layout
+ relTypesSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ leftSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ rightSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+
+ relTypesSelect.setNullSelectionAllowed(false);
+ relTypesSelect.setImmediate(true);
+
+ leftSelect.setNullSelectionAllowed(false);
+ leftSelect.setImmediate(true);
- relationsListSelect.setNullSelectionAllowed(false);
- relationsListSelect.setImmediate(true);
+ rightSelect.setNullSelectionAllowed(false);
+ rightSelect.setImmediate(true);
- relationTypesListSelect.addListener(new Property.ValueChangeListener() {
+ relTypesSelect.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (!lockRelTypesListener) {
try {
- ViewId relationType = (ViewId) relationTypesListSelect.getValue();
+ ViewId relationType = (ViewId) relTypesSelect.getValue();
if (relationType != null) {
searchPresenter.selectRelationType(artifact, relationType, OseeRelationsComponent.this);
}
} catch (Exception e) {
- System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
+ System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (ViewArtifact) relationsListSelect.getValue() threw an exception.");
+ }
+ }
+ }
+ });
+
+ leftSelect.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (!lockRelsListener) {
+ try {
+ ViewArtifact artifact = (ViewArtifact) leftSelect.getValue();
+ if (artifact != null) {
+ searchPresenter.selectArtifact(artifact, navigator);
+ }
+ } catch (Exception e) {
+ System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (ViewArtifact) relationsListSelect.getValue() threw an exception.");
}
}
}
});
- relationsListSelect.addListener(new Property.ValueChangeListener() {
+ rightSelect.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (!lockRelsListener) {
try {
- ViewArtifact artifact = (ViewArtifact) relationsListSelect.getValue();
+ ViewArtifact artifact = (ViewArtifact) rightSelect.getValue();
if (artifact != null) {
searchPresenter.selectArtifact(artifact, navigator);
}
} catch (Exception e) {
- System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
+ System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (ViewArtifact) relationsListSelect.getValue() threw an exception.");
}
}
}
});
+ VerticalLayout vLayout_LeftSelect = new VerticalLayout();
+ VerticalLayout vLayout_RelTypesSelect = new VerticalLayout();
+ VerticalLayout vLayout_RightSelect = new VerticalLayout();
+
+ vLayout_LeftSelect.addComponent(leftTitle);
+ vLayout_LeftSelect.addComponent(leftSelect);
+
+ vLayout_RelTypesSelect.addComponent(relTypesTitleTop);
+ vLayout_RelTypesSelect.addComponent(relTypesTitleBot);
+ vLayout_RelTypesSelect.addComponent(relTypesSelect);
+
+ vLayout_RightSelect.addComponent(rightTitle);
+ vLayout_RightSelect.addComponent(rightSelect);
+
Label spacer = new Label();
spacer.setWidth(15, UNITS_PIXELS);
+ Label leftArrow = new Label();
+ leftArrow.setStyleName(CssConstants.OSEE_LEFTARROW);
+
Label rightArrow = new Label();
rightArrow.setStyleName(CssConstants.OSEE_RIGHTARROW);
listBoxesLayout.addComponent(spacer);
- listBoxesLayout.addComponent(relationTypesListSelect);
+ listBoxesLayout.addComponent(vLayout_LeftSelect);
+ listBoxesLayout.addComponent(leftArrow);
+ listBoxesLayout.addComponent(vLayout_RelTypesSelect);
listBoxesLayout.addComponent(rightArrow);
- listBoxesLayout.setComponentAlignment(rightArrow, Alignment.MIDDLE_CENTER);
- listBoxesLayout.addComponent(relationsListSelect);
- listBoxesLayout.addComponent(sideBSelect);
+ listBoxesLayout.addComponent(vLayout_RightSelect);
- addComponent(titleLabel);
addComponent(listBoxesLayout);
- setExpandRatio(listBoxesLayout, 1.0f);
- //Fixed width lists make for a prettier layout
- relationTypesListSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
- relationsListSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
- sideBSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ vLayout_LeftSelect.setComponentAlignment(leftTitle, Alignment.BOTTOM_CENTER);
+ vLayout_LeftSelect.setComponentAlignment(leftSelect, Alignment.BOTTOM_CENTER);
+ vLayout_RelTypesSelect.setComponentAlignment(relTypesSelect, Alignment.BOTTOM_CENTER);
+ vLayout_RelTypesSelect.setComponentAlignment(relTypesTitleBot, Alignment.MIDDLE_CENTER);
+ vLayout_RelTypesSelect.setComponentAlignment(relTypesTitleTop, Alignment.MIDDLE_CENTER);
+ vLayout_RightSelect.setComponentAlignment(rightTitle, Alignment.BOTTOM_CENTER);
+ vLayout_RightSelect.setComponentAlignment(rightSelect, Alignment.BOTTOM_CENTER);
+ listBoxesLayout.setComponentAlignment(vLayout_LeftSelect, Alignment.BOTTOM_CENTER);
+ listBoxesLayout.setComponentAlignment(vLayout_RelTypesSelect, Alignment.BOTTOM_CENTER);
+ listBoxesLayout.setComponentAlignment(vLayout_RightSelect, Alignment.BOTTOM_CENTER);
+ listBoxesLayout.setComponentAlignment(rightArrow, Alignment.MIDDLE_CENTER);
+ listBoxesLayout.setComponentAlignment(leftArrow, Alignment.MIDDLE_CENTER);
+ setExpandRatio(listBoxesLayout, 1.0f);
}
public OseeRelationsComponent() {
@@ -136,47 +190,33 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
@Override
public void clearAll() {
- if (relationTypesListSelect != null) {
- lockRelTypesListener = true;
- relationTypesListSelect.removeAllItems();
- relationTypesListSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
- lockRelTypesListener = false;
- }
- if (relationsListSelect != null) {
- lockRelsListener = true;
- relationsListSelect.removeAllItems();
- relationsListSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
- lockRelsListener = false;
- }
+ this.addRelationType(null);
+ this.clearRelations();
}
@Override
public void addRelationType(ViewId id) {
- if (relationTypesListSelect != null) {
- lockRelTypesListener = true;
- relationTypesListSelect.addItem(id);
- relationTypesListSelect.setWidth(null);
- lockRelTypesListener = false;
+ if (id == null) {
+ relTypesSelect.setEnabled(false);
+ relTypesSelect.removeAllItems();
+ relTypesSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ } else {
+ relTypesSelect.setEnabled(true);
+ if (relTypesSelect != null) {
+ lockRelTypesListener = true;
+ relTypesSelect.addItem(id);
+ relTypesSelect.setWidth(null);
+ lockRelTypesListener = false;
+ }
}
}
@Override
public void clearRelations() {
- if (relationsListSelect != null) {
- lockRelsListener = true;
- relationsListSelect.removeAllItems();
- relationsListSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
- lockRelsListener = false;
- }
- }
-
- public void addRelation(ViewArtifact id) {
- if (relationsListSelect != null) {
- lockRelsListener = true;
- relationsListSelect.addItem(id);
- relationsListSelect.setWidth(null);
- lockRelsListener = false;
- }
+ this.addLeftRelated(null);
+ this.addRightRelated(null);
+ this.setLeftName(null);
+ this.setRightName(null);
}
@Override
@@ -201,17 +241,57 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
@Override
public void addLeftRelated(ViewArtifact id) {
+ if (id == null) {
+ leftSelect.setEnabled(false);
+ leftSelect.removeAllItems();
+ leftSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ } else {
+ leftSelect.setEnabled(true);
+ if (leftSelect != null) {
+ lockRelsListener = true;
+ leftSelect.addItem(id);
+ leftSelect.setWidth(null);
+ lockRelsListener = false;
+ }
+ }
}
@Override
public void addRightRelated(ViewArtifact id) {
+ if (id == null) {
+ rightSelect.setEnabled(false);
+ rightSelect.removeAllItems();
+ rightSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
+ } else {
+ rightSelect.setEnabled(true);
+ if (rightSelect != null) {
+ lockRelsListener = true;
+ rightSelect.addItem(id);
+ rightSelect.setWidth(null);
+ lockRelsListener = false;
+ }
+ }
}
@Override
public void setLeftName(String name) {
+ if (name == null) {
+ leftSelect.setEnabled(false);
+ leftTitle.setCaption("");
+ } else {
+ leftSelect.setEnabled(true);
+ leftTitle.setCaption(name);
+ }
}
@Override
public void setRightName(String name) {
+ if (name == null) {
+ rightSelect.setEnabled(false);
+ rightTitle.setCaption("");
+ } else {
+ rightSelect.setEnabled(true);
+ rightTitle.setCaption(name);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css b/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css
index b806f86..f4bbcfc 100644
--- a/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css
+++ b/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css
@@ -135,6 +135,13 @@
background-repeat:repeat-x;
}
+.osee-leftarrow {
+ background-image:url('woodsonArrow_left.png');
+ width: 35px;
+ height: 35px;
+ background-repeat:no-repeat;
+}
+
.osee-rightarrow {
background-image:url('woodsonArrow.png');
width: 35px;
diff --git a/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/woodsonArrow_left.png b/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/woodsonArrow_left.png
new file mode 100644
index 0000000..1a11452
--- /dev/null
+++ b/plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/woodsonArrow_left.png
Binary files differ