| author | shawn.f.cook | 2011-10-28 11:55:52 (EDT) |
|---|---|---|
| committer | Roberto E. Escobar | 2011-10-28 11:55:52 (EDT) |
| commit | 6b72acacfff7209893da66cd9592fb51d9fcc191 (patch) (side-by-side diff) | |
| tree | ef00b33d69b0aea8029f86aac41f04e3e62e4747 | |
| parent | 2bea94a8222b071175ee9cc187ba7831c09f89a1 (diff) | |
| download | org.eclipse.osee-6b72acacfff7209893da66cd9592fb51d9fcc191.zip org.eclipse.osee-6b72acacfff7209893da66cd9592fb51d9fcc191.tar.gz org.eclipse.osee-6b72acacfff7209893da66cd9592fb51d9fcc191.tar.bz2 | |
feature[ats_E6W8N]: Improve ResultsListComponent
4 files changed, 47 insertions, 30 deletions
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 dd47b14..ce378ec 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 @@ -37,6 +37,7 @@ public final class CssConstants { public static final String OSEE_TITLE_MEDIUM_TEXT = "osee-title-medium-text"; public static final String OSEE_SEARCH_TEXTFIELD = "osee-search-textfield"; + public static final String OSEE_SEARCHRESULTS_NORESULTS = "osee-searchresults-noresults"; public static final String OSEE_SEARCHRESULTS_MANYRESULTSFIELD = "osee-searchresults-manyresultsfield"; public static final String OSEE_SEARCHRESULT_ARTNAME = "osee-searchresult-artname"; public static final String OSEE_SEARCHRESULT_ARTTYPE = "osee-searchresult-arttype"; @@ -65,4 +66,5 @@ public final class CssConstants { public static final String OSEE_WORKING_LABEL_1 = "osee-working-label-1"; public static final String OSEE_WORKING_LABEL_2 = "osee-working-label-2"; public static final String OSEE_WORKING_LABEL_3 = "osee-working-label-3"; + } 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 8518a5a..bf532f9 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,6 +49,7 @@ 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(); @Override public void attach() { @@ -87,6 +88,11 @@ 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); + vSpacer_noResults.setHeight(8, UNITS_PIXELS); + manyResultsComboBox.setImmediate(true); manyResultsComboBox.setTextInputAllowed(false); manyResultsComboBox.setNullSelectionAllowed(false); @@ -118,7 +124,7 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se Label manySearchResults_suffix = new Label("Results Found"); manySearchResults.setSizeUndefined(); manySearchResults_suffix.setSizeUndefined(); - manySearchResults.setStyleName(CssConstants.OSEE_SEARCHRESULT_MATCH_MANY); + // manySearchResults.setStyleName(CssConstants.OSEE_SEARCHRESULT_MATCH_MANY); Label hSpacer_ManyResVerbose = new Label(); hSpacer_ManyResVerbose.setWidth(30, UNITS_PIXELS); @@ -129,6 +135,9 @@ 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); + manySearchResultsHorizLayout.addComponent(manySearchResults); manySearchResultsHorizLayout.addComponent(hSpacer_ManyRes); manySearchResultsHorizLayout.addComponent(manySearchResults_suffix); @@ -152,42 +161,46 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se } private void updateManySearchResultsLabel() { - String manyResults = String.format("[%d]", resultList.size()); + String manyResults = String.format("%d", resultList.size()); manySearchResults.setCaption(manyResults); pagingComponent.setManyItemsTotal(resultList.size()); } private void updateSearchResultsLayout() { - //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); + 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) { - synchronized (getApplication()) { + //Second, remove the search result components + for (Component component : removeTheseComponents) { mainLayout.removeComponent(component); } - } - //Next, add the result components to the layout that are on the current 'page' - for (Integer i : resultListIndices) { - try { - OseeSearchResultComponent searchResultComp = resultList.get(i); - synchronized (getApplication()) { - mainLayout.addComponent(searchResultComp, 0); + 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 { + OseeSearchResultComponent searchResultComp = resultList.get(i); + int bottomIndex = mainLayout.getComponentIndex(bottomSpacer); + mainLayout.addComponent(searchResultComp, bottomIndex); + } catch (IndexOutOfBoundsException e) { + ComponentUtility.logError( + "OseeSearchResultsListComponent.updateSearchResultsLayout - CRITICAL ERROR: IndexOutOfBoundsException", + this); + } } - } catch (IndexOutOfBoundsException e) { - ComponentUtility.logError( - "OseeSearchResultsListComponent.updateSearchResultsLayout - CRITICAL ERROR: IndexOutOfBoundsException", - this); + } else { + mainLayout.addComponent(vLayout_noResults); } } } 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 cc29bf4..a15f615 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 @@ -13,7 +13,6 @@ package org.eclipse.osee.display.view.web.search; import org.eclipse.osee.display.api.components.ArtifactHeaderComponent; import org.eclipse.osee.display.api.data.ViewArtifact; import org.eclipse.osee.display.view.web.AbstractCommonView; -import org.eclipse.osee.display.view.web.components.ComponentUtility; import org.eclipse.osee.display.view.web.components.OseeArtifactNameLinkComponent; import org.eclipse.osee.display.view.web.components.OseeAttributeComponent; import org.eclipse.osee.display.view.web.components.OseeBreadcrumbComponent; @@ -125,8 +124,6 @@ public abstract class OseeArtifactView extends AbstractCommonView implements Art breadcrumbComp.setArtifact(artifact); artifactType.setCaption(String.format("[%s]", artifact.getArtifactType())); artifactName.setArtifact(artifact); - } else { - ComponentUtility.logWarn("OseeArtifactView.updateLayout - WARNING: null value detected", this); } } 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 dd007d1..e07992e 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 @@ -81,7 +81,7 @@ } .osee-searchresult-artname { - font-size: 20px; + font-size: 14px; color: blue; } @@ -104,6 +104,11 @@ width: 20px; } +.osee-searchresults-noresults { + font-size: 15px; + font-weight: bold; +} + .osee-horizontal-line { background-image:url('linespacer.png'); background-repeat:repeat-x; |

