Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java8
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java110
-rw-r--r--plugins/org.eclipse.osee.support.config/launchConfig/UI.launch2
3 files changed, 69 insertions, 51 deletions
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
index 2b01cd1dfad..df9ec81535e 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
@@ -184,7 +184,13 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
relComp.addRelationType(swReqRelationType);
attrComp.clearAll();
- attrComp.addAttribute("type", "value");
+ attrComp.addAttribute("Category", "B");
+ attrComp.addAttribute("Developmental Assurance Level", "E");
+ attrComp.addAttribute("Imported Paragraph Number", "3.2.1.1");
+ attrComp.addAttribute("Partition", "CND");
+ attrComp.addAttribute("Qualification Method", "Test");
+ attrComp.addAttribute("Subsystem", "Communications");
+ attrComp.addAttribute("Technical Performance Parameter", "False");
}
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java
index 13b62870dbb..3a77e29d401 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java
@@ -11,12 +11,9 @@ he Eclipse Public License v1.0
*******************************************************************************/
package org.eclipse.osee.display.view.web.components;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.Collection;
import org.eclipse.osee.display.api.components.AttributeComponent;
-import org.eclipse.osee.display.api.data.WebArtifact;
import org.eclipse.osee.display.view.web.CssConstants;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
@@ -29,71 +26,86 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeAttributeComponent extends VerticalLayout implements AttributeComponent {
- private WebArtifact artifact;
+ private Collection<labelValuePair> attributes = new ArrayList<labelValuePair>();
+
+ private class labelValuePair {
+ private final String label;
+ private final String value;
+
+ public labelValuePair(String label, String value) {
+ super();
+ this.label = label;
+ this.value = value;
+ }
+
+ @SuppressWarnings("unused")
+ public String getLabel() {
+ return label;
+ }
+
+ @SuppressWarnings("unused")
+ public String getValue() {
+ return value;
+ }
+ }
private void createLayout() {
removeAllComponents();
- if (artifact != null) {
- final HorizontalLayout attributesLayout = new HorizontalLayout();
- final OseeShowHideButton showHideButton = new OseeShowHideButton("Attributes");
- showHideButton.addListener(new OseeShowHideButton.ClickListener() {
- @Override
- public void buttonClick(OseeShowHideButton.ClickEvent event) {
- attributesLayout.setVisible(showHideButton.isStateShow());
- }
- });
- attributesLayout.setVisible(showHideButton.isStateShow());
-
- Map<String, String> attributes = new HashMap<String, String>();
- attributes.put("Category", artifact.getAttr_Category());
- attributes.put("Developmental Assurance Level", artifact.getAttr_DevAssurLevel());
- attributes.put("Imported Paragraph Number", artifact.getAttr_ImpoParaNum());
- attributes.put("Partition", artifact.getAttr_Partition());
- attributes.put("Qualification Method", artifact.getAttr_QualMethod());
- attributes.put("Subsystem", artifact.getAttr_Subsystm());
- attributes.put("Technical Performance Parameter", artifact.getAttr_TechPerfParam());
- Set<Entry<String, String>> set = attributes.entrySet();
- VerticalLayout attrLabelsLayout = new VerticalLayout();
- VerticalLayout attrValuesLayout = new VerticalLayout();
-
- for (Entry<String, String> entry : set) {
- Label attrLabel = new Label(String.format("%s:", entry.getKey()));
- Label attrValue = new Label(entry.getValue());
- attrLabel.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
- attrValue.setStyleName(CssConstants.OSEE_ATTRIBUTEVALUE);
-
- attrLabelsLayout.addComponent(attrLabel);
- attrValuesLayout.addComponent(attrValue);
-
- attrLabelsLayout.setComponentAlignment(attrLabel, Alignment.MIDDLE_RIGHT);
- attrValuesLayout.setComponentAlignment(attrValue, Alignment.MIDDLE_LEFT);
+ final HorizontalLayout attributesLayout = new HorizontalLayout();
+ final OseeShowHideButton showHideButton = new OseeShowHideButton("Attributes");
+ showHideButton.addListener(new OseeShowHideButton.ClickListener() {
+ @Override
+ public void buttonClick(OseeShowHideButton.ClickEvent event) {
+ attributesLayout.setVisible(showHideButton.isStateShow());
}
+ });
+ attributesLayout.setVisible(showHideButton.isStateShow());
+
+ VerticalLayout attrLabelsLayout = new VerticalLayout();
+ VerticalLayout attrValuesLayout = new VerticalLayout();
- Label spacer = new Label("");
- spacer.setWidth(15, UNITS_PIXELS);
- attributesLayout.addComponent(attrLabelsLayout);
- attributesLayout.addComponent(spacer);
- attributesLayout.addComponent(attrValuesLayout);
+ for (labelValuePair pair : attributes) {
+ Label attrLabel = new Label(String.format("%s:", pair.getLabel()));
+ Label attrValue = new Label(pair.getValue());
+ attrLabel.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
+ attrValue.setStyleName(CssConstants.OSEE_ATTRIBUTEVALUE);
- addComponent(showHideButton);
- addComponent(attributesLayout);
- setExpandRatio(attributesLayout, 1.0f);
+ attrLabelsLayout.addComponent(attrLabel);
+ attrValuesLayout.addComponent(attrValue);
+
+ attrLabelsLayout.setComponentAlignment(attrLabel, Alignment.MIDDLE_RIGHT);
+ attrValuesLayout.setComponentAlignment(attrValue, Alignment.MIDDLE_LEFT);
}
+
+ Label spacer = new Label("");
+ spacer.setWidth(15, UNITS_PIXELS);
+ attributesLayout.addComponent(attrLabelsLayout);
+ attributesLayout.addComponent(spacer);
+ attributesLayout.addComponent(attrValuesLayout);
+
+ addComponent(showHideButton);
+ addComponent(attributesLayout);
+ setExpandRatio(attributesLayout, 1.0f);
}
@Override
public void clearAll() {
- this.artifact = null;
+ attributes.clear();
createLayout();
}
@Override
public void setErrorMessage(String message) {
+ //TODO:
}
@Override
public void addAttribute(String type, String value) {
+ if (type != null && !type.isEmpty() && value != null && !value.isEmpty()) {
+ attributes.add(new labelValuePair(type, value));
+ }
+ createLayout();
}
}
diff --git a/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch b/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
index 3111495e2d7..f7ea83ada17 100644
--- a/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
+++ b/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
@@ -24,5 +24,5 @@
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<stringAttribute key="workspace_bundles" value="com.vaadin@default:default,org.eclipse.osee.ats.api@default:default,org.eclipse.osee.ats.view.web@default:default,org.eclipse.osee.display.api@default:default,org.eclipse.osee.display.presenter.test@default:false,org.eclipse.osee.display.presenter@default:default,org.eclipse.osee.display.view.web@default:default,org.eclipse.osee.event.osgi@default:default,org.eclipse.osee.event@default:default,org.eclipse.osee.framework.core.model.test@default:false,org.eclipse.osee.framework.core.model@default:default,org.eclipse.osee.framework.core.test@default:false,org.eclipse.osee.framework.core@default:default,org.eclipse.osee.framework.jdk.core.test@default:false,org.eclipse.osee.framework.jdk.core@default:default,org.eclipse.osee.framework.logging.test@default:false,org.eclipse.osee.framework.logging@default:default,org.eclipse.osee.logback.config@default:false,org.eclipse.osee.logger.slf4j@default:default,org.eclipse.osee.logger@default:default,org.eclipse.osee.orcs@default:default,org.eclipse.osee.vaadin.themes@default:false,org.eclipse.osee.vaadin.widgets@default:default,org.eclipse.osee.vaadin@default:default"/>
+<stringAttribute key="workspace_bundles" value="com.vaadin@default:default,org.eclipse.osee.ats.api@default:default,org.eclipse.osee.ats.view.web.test@default:default,org.eclipse.osee.ats.view.web@default:default,org.eclipse.osee.display.api@default:default,org.eclipse.osee.display.presenter.mocks@default:default,org.eclipse.osee.display.presenter.test@default:false,org.eclipse.osee.display.presenter@default:default,org.eclipse.osee.display.view.web@default:default,org.eclipse.osee.event.osgi@default:default,org.eclipse.osee.event@default:default,org.eclipse.osee.framework.core.model.test@default:false,org.eclipse.osee.framework.core.model@default:default,org.eclipse.osee.framework.core.test@default:false,org.eclipse.osee.framework.core@default:default,org.eclipse.osee.framework.jdk.core.test@default:false,org.eclipse.osee.framework.jdk.core@default:default,org.eclipse.osee.framework.logging.test@default:false,org.eclipse.osee.framework.logging@default:default,org.eclipse.osee.logback.config@default:false,org.eclipse.osee.logger.slf4j@default:default,org.eclipse.osee.logger@default:default,org.eclipse.osee.orcs@default:default,org.eclipse.osee.vaadin.themes@default:false,org.eclipse.osee.vaadin.widgets@default:default,org.eclipse.osee.vaadin@default:default"/>
</launchConfiguration>

Back to the top