summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-28 13:46:33 (EDT)
committer Roberto E. Escobar2011-10-28 13:46:33 (EDT)
commit9d7177c900de78c2616b52d0118d198e39c08ba0 (patch)
tree0dfe23760c035215b631cff676d2285b26b20c1b
parenta55deda33677c7fcbdba94166e732052343c4320 (diff)
downloadorg.eclipse.osee-9d7177c900de78c2616b52d0118d198e39c08ba0.zip
org.eclipse.osee-9d7177c900de78c2616b52d0118d198e39c08ba0.tar.gz
org.eclipse.osee-9d7177c900de78c2616b52d0118d198e39c08ba0.tar.bz2
feature[ats_18K4T]: Improve attribute layout
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java2
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeAttributeComponent.java67
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java4
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java31
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java2
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java53
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java4
-rw-r--r--plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css4
8 files changed, 86 insertions, 81 deletions
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java
index 6cb04a1..a37b395 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java
@@ -68,7 +68,7 @@ public class OseeArtifactNameLinkComponent extends HorizontalLayout {
addComponent(artifactNameLink);
}
- private void updateLayout() {
+ public void updateLayout() {
if (artifact != null) {
artifactNameLink.setCaption(artifact.getArtifactName());
}
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 9498f14..267393b 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
@@ -14,7 +14,7 @@ package org.eclipse.osee.display.view.web.components;
import org.eclipse.osee.display.api.components.AttributeComponent;
import org.eclipse.osee.display.view.web.CssConstants;
import com.vaadin.ui.Alignment;
-import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -26,9 +26,8 @@ import com.vaadin.ui.VerticalLayout;
public class OseeAttributeComponent extends VerticalLayout implements AttributeComponent {
private boolean isLayoutComplete = false;
- private final VerticalLayout attrLabelsLayout = new VerticalLayout();
- private final VerticalLayout attrValuesLayout = new VerticalLayout();
- private final VerticalLayout longAttrValuesLayout = new VerticalLayout();
+ private final GridLayout attributesLayout = new GridLayout(3, 1);
+ private int rowIndex = 0;
@Override
public void attach() {
@@ -43,31 +42,13 @@ public class OseeAttributeComponent extends VerticalLayout implements AttributeC
Label titleLabel = new Label("Attributes");
titleLabel.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
- attrLabelsLayout.setWidth(200, UNITS_PIXELS);
- attrValuesLayout.setWidth(500, UNITS_PIXELS);
-
- Label spacer = new Label("");
- spacer.setWidth(15, UNITS_PIXELS);
- Label spacer2 = new Label("");
- spacer2.setWidth(5, UNITS_PIXELS);
-
- HorizontalLayout hLayout_Lists = new HorizontalLayout();
-
- hLayout_Lists.addComponent(spacer);
- hLayout_Lists.addComponent(attrLabelsLayout);
- hLayout_Lists.addComponent(spacer2);
- hLayout_Lists.addComponent(attrValuesLayout);
-
addComponent(titleLabel);
- addComponent(hLayout_Lists);
- addComponent(longAttrValuesLayout);
+ addComponent(attributesLayout);
}
@Override
public void clearAll() {
- attrLabelsLayout.removeAllComponents();
- attrValuesLayout.removeAllComponents();
- longAttrValuesLayout.removeAllComponents();
+ attributesLayout.removeAllComponents();
}
@Override
@@ -79,35 +60,37 @@ public class OseeAttributeComponent extends VerticalLayout implements AttributeC
@Override
public void addAttribute(String type, String value) {
synchronized (getApplication()) {
- if (type != null && !type.isEmpty() && value != null && !value.isEmpty()) {
+ if (type != null && !type.trim().isEmpty() && value != null && !value.trim().isEmpty() && !type.toLowerCase().contains(
+ "name")) {
- if (type.contains("Word") && type.contains("Content") && type.contains("Template")) {
- Label attrLabel = new Label(String.format("%s:", type));
- attrLabel.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL_LONG);
+ Label attrLabel = new Label(String.format("%s:", type));
+ attrLabel.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
+ attributesLayout.setComponentAlignment(attrLabel, Alignment.TOP_RIGHT);
- TextField attrValue = new TextField();
- attrValue.setValue(value);
- attrValue.setWidth(600, UNITS_PIXELS);
- attrValue.setHeight(300, UNITS_PIXELS);
+ Label gridSpacer = new Label();
+ gridSpacer.setWidth(5, UNITS_PIXELS);
+
+ attributesLayout.addComponent(attrLabel, 0, rowIndex);
+ attributesLayout.addComponent(gridSpacer, 1, rowIndex);
- Label vSpacer_bottomAttr = new Label();
- vSpacer_bottomAttr.setHeight(15, UNITS_PIXELS);
+ if (value.length() > 150) {
- longAttrValuesLayout.addComponent(attrLabel);
- longAttrValuesLayout.addComponent(attrValue);
- longAttrValuesLayout.addComponent(vSpacer_bottomAttr);
+ TextField attrValue = new TextField();
+ attrValue.setValue(value);
+ attrValue.setWidth(500, UNITS_PIXELS);
+ attrValue.setHeight(150, UNITS_PIXELS);
- longAttrValuesLayout.setComponentAlignment(attrLabel, Alignment.BOTTOM_LEFT);
+ attributesLayout.setRows(attributesLayout.getRows() + 1);
+ attributesLayout.addComponent(attrValue, 2, rowIndex);
} else {
- Label attrLabel = new Label(String.format("%s:", type));
- attrLabel.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
Label attrValue = new Label(value);
attrValue.setStyleName(CssConstants.OSEE_ATTRIBUTEVALUE);
- attrLabelsLayout.addComponent(attrLabel);
- attrValuesLayout.addComponent(attrValue);
+ attributesLayout.setRows(attributesLayout.getRows() + 1);
+ attributesLayout.addComponent(attrValue, 2, rowIndex);
}
+ rowIndex++;
}
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java
index 8af6c9b..291502d 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java
@@ -56,6 +56,10 @@ public class OseeBreadcrumbComponent extends HorizontalLayout {
}
}
+ public void updateLayout() {
+ createLayout();
+ }
+
public void setArtifact(ViewArtifact artifact) {
this.artifact = artifact;
createLayout();
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 b44454c..4d4b8db 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
@@ -38,8 +38,7 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
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 relTypesTitle = new Label("Relation Type");
private final Label rightTitle = new Label("");
@Override
@@ -48,14 +47,17 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
}
private void createLayout() {
+ setSizeUndefined();
removeAllComponents();
final HorizontalLayout listBoxesLayout = new HorizontalLayout();
- leftTitle.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
- relTypesTitleTop.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
- relTypesTitleBot.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
- rightTitle.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+ Label titleLabel = new Label("Relations");
+ titleLabel.setStyleName(CssConstants.OSEE_ATTRIBUTESTITLELABEL);
+
+ leftTitle.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
+ relTypesTitle.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
+ rightTitle.setStyleName(CssConstants.OSEE_ATTRIBUTELABEL);
//Fixed width lists make for a prettier layout
relTypesSelect.setWidth(LISTBOX_MINWIDTH, UNITS_PIXELS);
@@ -83,7 +85,7 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
}
} catch (Exception e) {
ComponentUtility.logError(
- "OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.",
+ "OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception:" + e.getMessage() + e.getStackTrace(),
OseeRelationsComponent.this);
}
}
@@ -129,8 +131,7 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
vLayout_LeftSelect.addComponent(leftTitle);
vLayout_LeftSelect.addComponent(leftSelect);
- vLayout_RelTypesSelect.addComponent(relTypesTitleTop);
- vLayout_RelTypesSelect.addComponent(relTypesTitleBot);
+ vLayout_RelTypesSelect.addComponent(relTypesTitle);
vLayout_RelTypesSelect.addComponent(relTypesSelect);
vLayout_RightSelect.addComponent(rightTitle);
@@ -152,13 +153,13 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
listBoxesLayout.addComponent(rightArrow);
listBoxesLayout.addComponent(vLayout_RightSelect);
+ addComponent(titleLabel);
addComponent(listBoxesLayout);
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_RelTypesSelect.setComponentAlignment(relTypesTitle, Alignment.MIDDLE_CENTER);
vLayout_RightSelect.setComponentAlignment(rightTitle, Alignment.BOTTOM_CENTER);
vLayout_RightSelect.setComponentAlignment(rightSelect, Alignment.BOTTOM_CENTER);
listBoxesLayout.setComponentAlignment(vLayout_LeftSelect, Alignment.BOTTOM_CENTER);
@@ -264,10 +265,10 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
public void setLeftName(String name) {
if (name == null) {
leftSelect.setEnabled(false);
- leftTitle.setCaption("");
+ leftTitle.setValue("");
} else {
leftSelect.setEnabled(true);
- leftTitle.setCaption(name);
+ leftTitle.setValue(name);
}
}
@@ -275,10 +276,10 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
public void setRightName(String name) {
if (name == null) {
rightSelect.setEnabled(false);
- rightTitle.setCaption("");
+ rightTitle.setValue("");
} else {
rightSelect.setEnabled(true);
- rightTitle.setCaption(name);
+ rightTitle.setValue(name);
}
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java
index 6c44143..e90e7f4 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java
@@ -46,6 +46,8 @@ public class OseeSearchResultComponent extends VerticalLayout implements SearchR
if (!isLayoutComplete) {
createLayout();
isLayoutComplete = true;
+ } else {
+ breadcrumbComp.updateLayout();
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java
index d110172..c17b66f 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java
@@ -49,7 +49,8 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
private final int INIT_MANY_RES_PER_PAGE = 15;
private final Label manySearchResults = new Label();
private boolean isLayoutComplete = false;
- private final VerticalLayout vLayout_noResults = new VerticalLayout();
+ Label searchProgressLabel = new Label("No Results Found");
+ private final VerticalLayout vLayout_searchProgress = new VerticalLayout();
@Override
public void attach() {
@@ -89,8 +90,7 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
bottomSpacer.setSizeFull();
Label vSpacer_noResults = new Label();
- Label noResultsLabel = new Label("No Results Found.");
- noResultsLabel.setStyleName(CssConstants.OSEE_SEARCHRESULTS_NORESULTS);
+ searchProgressLabel.setStyleName(CssConstants.OSEE_SEARCHRESULTS_NORESULTS);
vSpacer_noResults.setHeight(8, UNITS_PIXELS);
manyResultsComboBox.setImmediate(true);
@@ -135,8 +135,8 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
hSpacer_PerPage.setWidth(5, UNITS_PIXELS);
Label manyResultsLabel = new Label("Results Per Page");
- vLayout_noResults.addComponent(vSpacer_noResults);
- vLayout_noResults.addComponent(noResultsLabel);
+ vLayout_searchProgress.addComponent(vSpacer_noResults);
+ vLayout_searchProgress.addComponent(searchProgressLabel);
manySearchResultsHorizLayout.addComponent(manySearchResults);
manySearchResultsHorizLayout.addComponent(hSpacer_ManyRes);
@@ -149,6 +149,7 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
manySearchResultsHorizLayout.addComponent(manyResultsLabel);
mainLayoutPanel.setContent(mainLayout);
+ mainLayout.addComponent(vLayout_searchProgress);
mainLayout.addComponent(bottomSpacer);
addComponent(manySearchResultsHorizLayout);
@@ -163,32 +164,33 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
private void updateManySearchResultsLabel() {
String manyResults = String.format("%d", resultList.size());
synchronized (getApplication()) {
- manySearchResults.setCaption(manyResults);
+ manySearchResults.setValue(manyResults);
}
pagingComponent.setManyItemsTotal(resultList.size());
}
+ private Collection<Component> getSearchResultComponents() {
+ Collection<Component> resComp = new ArrayList<Component>();
+ for (Iterator<Component> iter = mainLayout.getComponentIterator(); iter.hasNext();) {
+ Component component = iter.next();
+ if (component instanceof OseeSearchResultComponent) {
+ resComp.add(component);
+ }
+ }
+ return resComp;
+ }
+
private void updateSearchResultsLayout() {
synchronized (getApplication()) {
//if the list of currently visible items has not changed, then don't bother updating the layout
Collection<Integer> resultListIndices = pagingComponent.getCurrentVisibleItemIndices();
- //First, get a list of all the search results components currently in the layout
- Collection<Component> removeTheseComponents = new ArrayList<Component>();
- for (Iterator<Component> iter = mainLayout.getComponentIterator(); iter.hasNext();) {
- Component component = iter.next();
- if (component.getClass() == OseeSearchResultComponent.class) {
- removeTheseComponents.add(component);
- }
- }
-
- //Second, remove the search result components
- for (Component component : removeTheseComponents) {
+ //First, remove the search result components
+ for (Component component : getSearchResultComponents()) {
mainLayout.removeComponent(component);
}
if (resultList.size() > 0) {
- mainLayout.removeComponent(vLayout_noResults);
//Next, add the result components to the layout that are on the current 'page'
for (Integer i : resultListIndices) {
try {
@@ -201,8 +203,6 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
this);
}
}
- } else {
- mainLayout.addComponent(vLayout_noResults);
}
}
}
@@ -242,12 +242,21 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
@Override
public void searchInProgress() {
displayOptionsComponent.disableDisplayOptions();
+ searchProgressLabel.setValue("Searching");
+ vLayout_searchProgress.setVisible(true);
+ for (Component component : getSearchResultComponents()) {
+ mainLayout.removeComponent(component);
+ }
}
@Override
public void searchCancelled() {
if (resultList.size() > 0) {
displayOptionsComponent.enableDisplayOptions();
+ vLayout_searchProgress.setVisible(false);
+ } else {
+ searchProgressLabel.setValue("Search Cancelled");
+ vLayout_searchProgress.setVisible(true);
}
}
@@ -255,6 +264,10 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
public void searchCompleted() {
if (resultList.size() > 0) {
displayOptionsComponent.enableDisplayOptions();
+ vLayout_searchProgress.setVisible(false);
+ } else {
+ searchProgressLabel.setValue("No Results Found");
+ vLayout_searchProgress.setVisible(true);
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
index a15f615..4bda1c8 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
@@ -76,7 +76,8 @@ public abstract class OseeArtifactView extends AbstractCommonView implements Art
VerticalLayout vLayout_Body = new VerticalLayout();
vLayout_Body.setMargin(false, false, false, true);
- vLayout_Body.setSizeFull();
+ vLayout_Body.setHeight(null);
+ vLayout_Body.setWidth(100, UNITS_PERCENTAGE);
VerticalLayout relAttrSpacer = new VerticalLayout();
relAttrSpacer.setHeight(15, UNITS_PIXELS);
@@ -85,7 +86,6 @@ public abstract class OseeArtifactView extends AbstractCommonView implements Art
Panel panel_Body = new Panel();
panel_Body.setScrollable(true);
- panel_Body.getContent().setSizeUndefined();
panel_Body.setSizeFull();
hLayout_ArtNameAndType.addComponent(artifactName);
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 e07992e..bbe8653 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
@@ -265,4 +265,6 @@ div.v-window-header {
font-weight:bold;
}
- \ No newline at end of file
+.v-textarea {
+ resize: none;
+ } \ No newline at end of file