summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-27 12:26:21 (EDT)
committer Roberto E. Escobar2011-10-27 12:26:21 (EDT)
commitda2ba81456bdada28f5fa4e48070059441d3a1c5 (patch)
treef4e6a4bb1afce99421609b9bbd27ac49867ccc84
parent0852b12395307ff4c8ac231e55b5421e46d07563 (diff)
downloadorg.eclipse.osee-da2ba81456bdada28f5fa4e48070059441d3a1c5.zip
org.eclipse.osee-da2ba81456bdada28f5fa4e48070059441d3a1c5.tar.gz
org.eclipse.osee-da2ba81456bdada28f5fa4e48070059441d3a1c5.tar.bz2
feature[ats_E6W8N]: Polish paging component
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java37
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java3
2 files changed, 25 insertions, 15 deletions
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java
index 05177c0..d74a11f 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java
@@ -141,27 +141,34 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
}
private void updateLayout() {
- if (manyPages <= 0) {
+ if (allItemsPerPage) {
firstButton.setEnabled(false);
previousButton.setEnabled(false);
nextButton.setEnabled(false);
lastButton.setEnabled(false);
- }
-
- if (currentPage <= 0) {
- firstButton.setEnabled(false);
- previousButton.setEnabled(false);
} else {
- firstButton.setEnabled(true);
- previousButton.setEnabled(true);
- }
+ if (manyPages <= 0) {
+ firstButton.setEnabled(false);
+ previousButton.setEnabled(false);
+ nextButton.setEnabled(false);
+ lastButton.setEnabled(false);
+ }
- if (currentPage >= manyPages - 1) {
- nextButton.setEnabled(false);
- lastButton.setEnabled(false);
- } else {
- nextButton.setEnabled(true);
- lastButton.setEnabled(true);
+ if (currentPage <= 0) {
+ firstButton.setEnabled(false);
+ previousButton.setEnabled(false);
+ } else {
+ firstButton.setEnabled(true);
+ previousButton.setEnabled(true);
+ }
+
+ if (currentPage >= manyPages - 1) {
+ nextButton.setEnabled(false);
+ lastButton.setEnabled(false);
+ } else {
+ nextButton.setEnabled(true);
+ lastButton.setEnabled(true);
+ }
}
//Update page numbers
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 691ea80..ca80747 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
@@ -186,6 +186,9 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
int lastCompIndex = mainLayout.getComponentIndex(bottomSpacer);
mainLayout.addComponent(searchResultComp, lastCompIndex);
+ //This call is needed in order to only show those results which are on the current page.
+ updateSearchResultsLayout();
+
return searchResultComp;
}