summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-17 18:48:53 (EDT)
committer Roberto E. Escobar2011-10-17 18:48:53 (EDT)
commit586ccdb0c7647860db429bf505b4f4182b07e253 (patch)
tree35540a7acf57daa4dbb741e39a028c63b72ad72b
parentcc0ee91f7a08ceea392255ebfc2989e4903b439f (diff)
downloadorg.eclipse.osee-586ccdb0c7647860db429bf505b4f4182b07e253.zip
org.eclipse.osee-586ccdb0c7647860db429bf505b4f4182b07e253.tar.gz
org.eclipse.osee-586ccdb0c7647860db429bf505b4f4182b07e253.tar.bz2
feature[ats_MQ8YD]: Implement search result format options
-rw-r--r--plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockAtsSearchHeaderComponent.java4
-rw-r--r--plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java11
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java36
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java1
-rw-r--r--plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/PagingComponent.java4
-rw-r--r--plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchHeaderComponent.java2
-rw-r--r--plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchResultComponent.java2
-rw-r--r--plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchHeaderComponent.java4
-rw-r--r--plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchResultComponent.java4
-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/OseePagingComponent.java13
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultComponent.java62
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java94
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java11
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java2
-rw-r--r--plugins/org.eclipse.osee.support.config/launchConfig/UI.launch2
-rw-r--r--plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css5
17 files changed, 206 insertions, 52 deletions
diff --git a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockAtsSearchHeaderComponent.java b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockAtsSearchHeaderComponent.java
index 2f7277f..b38f134 100644
--- a/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockAtsSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.ats.mocks/src/org/eclipse/osee/ats/mocks/MockAtsSearchHeaderComponent.java
@@ -91,4 +91,8 @@ public class MockAtsSearchHeaderComponent implements AtsSearchHeaderComponentInt
selectedBuild = build;
}
+ @Override
+ public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
+ }
+
} \ No newline at end of file
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 5dfcf20..f6ceede 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
@@ -116,6 +116,7 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
if (params.getSearchString() != null) {
parameters.put(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE, params.getSearchString());
}
+ parameters.put(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE, params.isVerboseResults() ? "true" : "false");
if (parameters.size() > 0) {
String url = parameterMapToRequestString(parameters);
atsNavigator.navigateSearchResults(url);
@@ -238,12 +239,21 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
public void initSearchResults(String url, AtsSearchHeaderComponentInterface searchHeaderComponent, SearchResultsListComponent resultsComponent) {
if (resultsComponent != null) {
+ boolean showVerboseSearchResults = true;
+ Map<String, String> params = requestStringToParameterMap(url);
+ if (params != null && params.size() > 0) {
+ String showVerbose_str = params.get(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE);
+ if (showVerbose_str != null && !showVerbose_str.isEmpty()) {
+ showVerboseSearchResults = showVerbose_str.equalsIgnoreCase("true");
+ }
+ }
resultsComponent.clearAll();
Set<Entry<String, WebArtifact>> entrySet = artifacts.entrySet();
for (Entry<String, WebArtifact> artifactEntry : entrySet) {
SearchResultComponent searchResultComp = resultsComponent.createSearchResult();
if (searchResultComp != null) {
WebArtifact artifact = artifactEntry.getValue();
+ searchResultComp.setShowVerboseSearchResults(showVerboseSearchResults);
searchResultComp.setArtifact(artifact);
searchResultComp.addSearchResultMatch(new SearchResultMatch("Word Template Content", "...{COM_PAGE}...",
10));
@@ -326,5 +336,6 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
public final static String PARAMNAME_BUILD = "build";
public final static String PARAMNAME_NAMEONLY = "nameonly";
public final static String PARAMNAME_SEARCHPHRASE = "searchphrase";
+ public final static String PARAMNAME_SHOWVERBOSE = "showverbose";
}
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
index fbced7a..a440813 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
@@ -68,9 +68,11 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
populated = true;
}
- private void selectSearch() {
- WebId program = (WebId) programCombo.getValue();
- searchPresenter.selectProgram(program, this);
+ private void selectProgram() {
+ if (programCombo != null) {
+ WebId program = (WebId) programCombo.getValue();
+ searchPresenter.selectProgram(program, this);
+ }
}
public AtsSearchHeaderComponent(boolean showOseeTitleAbove) {
@@ -87,7 +89,7 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
@Override
public void valueChange(ValueChangeEvent event) {
if (!lockProgramCombo) {
- selectSearch();
+ selectProgram();
}
}
});
@@ -104,6 +106,20 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
this(true);
}
+ protected void selectSearch() {
+ if (searchPresenter != null && programCombo != null && buildCombo != null && nameOnlyCheckBox != null && searchTextField != null) {
+ WebId program = (WebId) programCombo.getValue();
+ WebId build = (WebId) buildCombo.getValue();
+ boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
+ String searchPhrase = (String) searchTextField.getValue();
+ AtsSearchParameters params =
+ new AtsSearchParameters(searchPhrase, nameOnly, showVerboseSearchResults, build, program);
+ searchPresenter.selectSearch(params, navigator);
+ } else {
+ System.out.println("AtsSearchHeaderComponent.selectSearch - WARNING: null value detected.");
+ }
+ }
+
@Override
public void createLayout() {
this.removeAllComponents();
@@ -140,15 +156,7 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
Button searchButton = new Button("Search", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- WebId program = (WebId) programCombo.getValue();
- WebId build = (WebId) buildCombo.getValue();
- boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
- String searchPhrase = (String) searchTextField.getValue();
- boolean verbose = false;
- AtsSearchParameters params = new AtsSearchParameters(searchPhrase, nameOnly, verbose, build, program);
- if (searchPresenter != null) {
- searchPresenter.selectSearch(params, navigator);
- }
+ selectSearch();
}
});
hLayoutRow2.addComponent(searchTextField);
@@ -308,7 +316,7 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
@Override
public void handleAction(Action action, Object sender, Object target) {
if (sender == searchTextField && action == action_enter) {
- selectSearch();
+ selectProgram();
}
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java
index d59842b..323646c 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java
@@ -36,6 +36,7 @@ public class AtsSearchResultsView extends OseeSearchResultsView {
AtsUiApplication atsApp = (AtsUiApplication) this.getApplication();
searchPresenter = atsApp.getAtsWebSearchPresenter();
searchHeader = atsApp.getAtsSearchHeaderComponent();
+ searchResultsListComponent.setSearchHeaderComponent(searchHeader);
callInitSearchHome();
createLayout();
} catch (Exception e) {
diff --git a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/PagingComponent.java b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/PagingComponent.java
index 7e8e940..e006f5e 100644
--- a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/PagingComponent.java
+++ b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/PagingComponent.java
@@ -21,4 +21,8 @@ public interface PagingComponent {
public Collection<Integer> getCurrentVisibleItemIndices();
+ public void setManyItemsPerPage(int manyItemsPerPage);
+
+ public int getManyItemsPerPage();
+
}
diff --git a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchHeaderComponent.java b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchHeaderComponent.java
index 1e7e5e1..aef45c6 100644
--- a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchHeaderComponent.java
@@ -17,4 +17,6 @@ public interface SearchHeaderComponent extends DisplaysErrorComponent {
void clearAll();
+ void setShowVerboseSearchResults(boolean showVerboseSearchResults);
+
}
diff --git a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchResultComponent.java b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchResultComponent.java
index 40c63bb..bfe0454 100644
--- a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchResultComponent.java
+++ b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/components/SearchResultComponent.java
@@ -18,6 +18,8 @@ import org.eclipse.osee.display.api.data.WebArtifact;
*/
public interface SearchResultComponent extends DisplaysErrorComponent {
+ void setShowVerboseSearchResults(boolean showVerboseSearchResults);
+
void setArtifact(WebArtifact artifact);
void addSearchResultMatch(SearchResultMatch match);
diff --git a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchHeaderComponent.java b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchHeaderComponent.java
index 1a4c0e5..167f4ef 100644
--- a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchHeaderComponent.java
@@ -38,4 +38,8 @@ public class MockSearchHeaderComponent implements SearchHeaderComponent {
clearAllCalled = true;
}
+ @Override
+ public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchResultComponent.java b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchResultComponent.java
index d194c1a..433f988 100644
--- a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchResultComponent.java
+++ b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchResultComponent.java
@@ -45,4 +45,8 @@ public class MockSearchResultComponent implements SearchResultComponent {
@Override
public void setErrorMessage(String message) {
}
+
+ @Override
+ public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
+ }
} \ No newline at end of file
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 6922605..6d498d0 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
@@ -39,6 +39,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_MANYRESULTSFIELD = "osee-searchresults-manyresultsfield";
public static final String OSEE_SEARCHRESULT_ARTNAME = "osee-searchresult-artname";
public static final String OSEE_SEARCHRESULT_ARTTYPE = "osee-searchresult-arttype";
public static final String OSEE_SEARCHRESULT_MATCH = "osee-searchresult-match";
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 e10afec..4247425 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
@@ -30,7 +30,7 @@ import com.vaadin.ui.Label;
public class OseePagingComponent extends HorizontalLayout implements PagingComponent {
private int manyItemsTotal = 0;
- private final int manyItemsPerPage = 10;
+ private int manyItemsPerPage = 10;
private int manyPages = 0;
private int currentPage = 0;
private final int MAX_PAGE_NUMBERS_SHOWN = 10;
@@ -284,4 +284,15 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
}
return ret;
}
+
+ @Override
+ public void setManyItemsPerPage(int manyItemsPerPage) {
+ this.manyItemsPerPage = manyItemsPerPage;
+ createLayout();
+ }
+
+ @Override
+ public int getManyItemsPerPage() {
+ return this.manyItemsPerPage;
+ }
}
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 229a4d2..dbd814e 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
@@ -29,6 +29,7 @@ public class OseeSearchResultComponent extends VerticalLayout implements SearchR
private WebArtifact artifact;
private final Collection<SearchResultMatch> matches = new ArrayList<SearchResultMatch>();
+ private boolean showVerboseSearchResults = true;
public OseeSearchResultComponent() {
//Stupid hack. Web layout is driving me crazy.
@@ -47,32 +48,36 @@ public class OseeSearchResultComponent extends VerticalLayout implements SearchR
HorizontalLayout row0 = new HorizontalLayout();
- OseeArtifactNameLinkComponent artifactName =
- new OseeArtifactNameLinkComponent(artifact, CssConstants.OSEE_SEARCHRESULT_ARTNAME);
- Label spacer1 = new Label("");
- spacer1.setHeight(null);
- spacer1.setWidth(15, UNITS_PIXELS);
- Label artifactType = new Label(String.format("[%s]", artifact.getArtifactType()), Label.CONTENT_XHTML);
- artifactType.setStyleName(CssConstants.OSEE_SEARCHRESULT_ARTTYPE);
- row0.addComponent(artifactName);
- row0.addComponent(spacer1);
- row0.addComponent(artifactType);
- row0.setComponentAlignment(artifactName, Alignment.BOTTOM_LEFT);
- row0.setComponentAlignment(artifactType, Alignment.MIDDLE_LEFT);
-
- OseeBreadcrumbComponent breadcrumbComp = new OseeBreadcrumbComponent(artifact);
-
- addComponent(row0);
- addComponent(breadcrumbComp);
-
- for (SearchResultMatch match : matches) {
- OseeSearchResultMatchComponent matchComp = new OseeSearchResultMatchComponent(match);
- addComponent(matchComp);
+ if (artifact != null) {
+ OseeArtifactNameLinkComponent artifactName =
+ new OseeArtifactNameLinkComponent(artifact, CssConstants.OSEE_SEARCHRESULT_ARTNAME);
+ Label spacer1 = new Label("");
+ spacer1.setHeight(null);
+ spacer1.setWidth(15, UNITS_PIXELS);
+ Label artifactType = new Label(String.format("[%s]", artifact.getArtifactType()), Label.CONTENT_XHTML);
+ artifactType.setStyleName(CssConstants.OSEE_SEARCHRESULT_ARTTYPE);
+ row0.addComponent(artifactName);
+ row0.addComponent(spacer1);
+ row0.addComponent(artifactType);
+ row0.setComponentAlignment(artifactName, Alignment.BOTTOM_LEFT);
+ row0.setComponentAlignment(artifactType, Alignment.MIDDLE_LEFT);
+ addComponent(row0);
+
+ if (showVerboseSearchResults) {
+ OseeBreadcrumbComponent breadcrumbComp = new OseeBreadcrumbComponent(artifact);
+
+ addComponent(breadcrumbComp);
+
+ for (SearchResultMatch match : matches) {
+ OseeSearchResultMatchComponent matchComp = new OseeSearchResultMatchComponent(match);
+ addComponent(matchComp);
+ }
+ }
+
+ Label spacer2 = new Label("");
+ spacer2.setHeight(15, UNITS_PIXELS);
+ addComponent(spacer2);
}
-
- Label spacer2 = new Label("");
- spacer2.setHeight(15, UNITS_PIXELS);
- addComponent(spacer2);
}
@Override
@@ -112,4 +117,11 @@ public class OseeSearchResultComponent extends VerticalLayout implements SearchR
@Override
public void setErrorMessage(String message) {
}
+
+ @Override
+ public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
+ this.showVerboseSearchResults = showVerboseSearchResults;
+ removeAllComponents();
+ createLayout();
+ }
}
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 c8fcf72..45c6dc2 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
@@ -15,16 +15,22 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.osee.display.api.components.SearchHeaderComponent;
import org.eclipse.osee.display.api.components.SearchResultComponent;
import org.eclipse.osee.display.api.components.SearchResultsListComponent;
import org.eclipse.osee.display.view.web.CssConstants;
import org.eclipse.osee.display.view.web.components.OseePagingComponent.PageSelectedEvent;
import org.eclipse.osee.display.view.web.components.OseePagingComponent.PageSelectedListener;
import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.Notification;
@@ -40,28 +46,69 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
private HorizontalLayout manySearchResultsHorizLayout = new HorizontalLayout();
private OseePagingComponent pagingComponent = new OseePagingComponent();
private List<OseeSearchResultComponent> resultList = new ArrayList<OseeSearchResultComponent>();
+ private SearchHeaderComponent searchHeaderComponent;
+ private final CheckBox showVerboseCheckBox = new CheckBox("Show Verbose Search Results", true);
+ private final TextField manyResultsTextField = new TextField();
public OseeSearchResultsListComponent() {
+ this(null);
+ }
+
+ public OseeSearchResultsListComponent(SearchHeaderComponent searchHeaderComponent) {
+ this.setSearchHeaderComponent(searchHeaderComponent);
this.setSizeFull();
- this.addComponent(manySearchResultsHorizLayout);
manySearchResultsHorizLayout.setSizeUndefined();
+ Label spacer = new Label();
+ spacer.setHeight(5, UNITS_PIXELS);
+
mainLayout.setMargin(false, false, false, true);
Panel mainLayoutPanel = new Panel();
mainLayoutPanel.setScrollable(true);
mainLayoutPanel.getContent().setSizeUndefined();
mainLayoutPanel.setContent(mainLayout);
- this.addComponent(mainLayoutPanel);
mainLayoutPanel.setSizeFull();
- this.setExpandRatio(mainLayoutPanel, 1.0f);
bottomSpacer.setSizeFull();
mainLayout.addComponent(bottomSpacer);
mainLayout.setExpandRatio(bottomSpacer, 1.0f);
- this.addComponent(pagingComponent);
pagingComponent.addListener(this);
+
+ this.addComponent(manySearchResultsHorizLayout);
+ this.addComponent(spacer);
+ this.addComponent(mainLayoutPanel);
+ this.setExpandRatio(mainLayoutPanel, 1.0f);
+ this.addComponent(pagingComponent);
+
+ showVerboseCheckBox.setImmediate(true);
+ showVerboseCheckBox.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean showVerbose = showVerboseCheckBox.toString().equalsIgnoreCase("true");
+ OseeSearchResultsListComponent.this.searchHeaderComponent.setShowVerboseSearchResults(showVerbose);
+ for (OseeSearchResultComponent resultComp : resultList) {
+ resultComp.setShowVerboseSearchResults(showVerbose);
+ }
+ updateSearchResultsLayout();
+ }
+ });
+
+ manyResultsTextField.setImmediate(true);
+ manyResultsTextField.setStyleName(CssConstants.OSEE_SEARCHRESULTS_MANYRESULTSFIELD);
+ manyResultsTextField.setValue(pagingComponent.getManyItemsPerPage());
+ manyResultsTextField.addListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (pagingComponent != null) {
+ String manyItemsPerPage_str = manyResultsTextField.toString();
+ int manyItemsPerPage = Integer.parseInt(manyItemsPerPage_str);
+ pagingComponent.setManyItemsPerPage(manyItemsPerPage);
+ updateSearchResultsLayout();
+ }
+ }
+ });
}
@Override
@@ -74,20 +121,41 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
private void updateManySearchResultsLabel() {
int manySearchResultComponents = resultList.size();
- manySearchResultsHorizLayout.removeAllComponents();
Label manySearchResults = new Label(String.format("[%d] ", manySearchResultComponents));
+ Label spacer = new Label();
+ spacer.setWidth(5, UNITS_PIXELS);
Label manySearchResults_suffix = new Label("search result(s) found.");
- manySearchResultsHorizLayout.addComponent(manySearchResults);
- manySearchResultsHorizLayout.addComponent(manySearchResults_suffix);
manySearchResults.setSizeUndefined();
manySearchResults_suffix.setSizeUndefined();
manySearchResults.setStyleName(CssConstants.OSEE_SEARCHRESULT_MATCH_MANY);
- pagingComponent.setManyItemsTotal(manySearchResultComponents);
+ manySearchResultsHorizLayout.removeAllComponents();
+ manySearchResultsHorizLayout.addComponent(manySearchResults);
+ manySearchResultsHorizLayout.addComponent(spacer);
+ manySearchResultsHorizLayout.addComponent(manySearchResults_suffix);
- }
+ if (manySearchResultComponents > 0 && searchHeaderComponent != null) {
+ searchHeaderComponent.setShowVerboseSearchResults(showVerboseCheckBox.toString().equalsIgnoreCase("true"));
+ Label spacer1 = new Label();
+ spacer1.setWidth(30, UNITS_PIXELS);
+ manySearchResultsHorizLayout.addComponent(spacer1);
+ manySearchResultsHorizLayout.addComponent(showVerboseCheckBox);
+ }
+
+ Label spacer2 = new Label();
+ spacer2.setWidth(30, UNITS_PIXELS);
+ Label spacer3 = new Label();
+ spacer3.setWidth(5, UNITS_PIXELS);
+ Label manyResultsLabel = new Label("Many Results Per Page");
+ manySearchResultsHorizLayout.addComponent(spacer2);
+ manySearchResultsHorizLayout.addComponent(manyResultsTextField);
+ manySearchResultsHorizLayout.setComponentAlignment(manyResultsTextField, Alignment.TOP_CENTER);
+ manySearchResultsHorizLayout.addComponent(spacer3);
+ manySearchResultsHorizLayout.addComponent(manyResultsLabel);
+ pagingComponent.setManyItemsTotal(manySearchResultComponents);
+ }
private Collection<Integer> prevResultListIndices = new ArrayList<Integer>();
private void updateSearchResultsLayout() {
@@ -157,4 +225,12 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
public void pageSelected(PageSelectedEvent source) {
updateSearchResultsLayout();
}
+
+ public SearchHeaderComponent getSearchHeaderComponent() {
+ return searchHeaderComponent;
+ }
+
+ public void setSearchHeaderComponent(SearchHeaderComponent searchHeaderComponent) {
+ this.searchHeaderComponent = searchHeaderComponent;
+ }
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
index 6451e16..be6683e 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
@@ -20,6 +20,7 @@ import com.vaadin.ui.VerticalLayout;
public class OseeSearchHeaderComponent extends VerticalLayout implements SearchHeaderComponent {
protected boolean showOseeTitleAbove;
+ protected boolean showVerboseSearchResults = true;
@Override
public void attach() {
@@ -48,4 +49,14 @@ public class OseeSearchHeaderComponent extends VerticalLayout implements SearchH
this.showOseeTitleAbove = showOseeTitleAbove;
}
+ @Override
+ public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
+ this.showVerboseSearchResults = showVerboseSearchResults;
+ // selectSearch();
+ }
+
+ protected void selectSearch() {
+ //Do nothing. Needs override
+ }
+
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
index 7349d45..60ba58d 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
@@ -26,7 +26,7 @@ import com.vaadin.ui.VerticalLayout;
public class OseeSearchResultsView extends CustomComponent implements Navigator.View {
protected OseeSearchHeaderComponent searchHeader;
- protected final OseeSearchResultsListComponent searchResultsListComponent = new OseeSearchResultsListComponent();
+ protected OseeSearchResultsListComponent searchResultsListComponent = new OseeSearchResultsListComponent();
protected void createLayout() {
setSizeFull();
diff --git a/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch b/plugins/org.eclipse.osee.support.config/launchConfig/UI.launch
index bec53b7..97f46e6 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.mocks@default:default,org.eclipse.osee.ats.presenter@default:default,org.eclipse.osee.ats.view.web.test@default:false,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.mock@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.mocks@default:default,org.eclipse.osee.ats.presenter.mock@default:default,org.eclipse.osee.ats.view.web.test@default:false,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.mock@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>
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 38ecde9..db15c4a 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
@@ -96,7 +96,6 @@
}
.osee-search-textfield {
- width: 350px;
}
.osee-searchresult-artname {
@@ -120,6 +119,10 @@
color: black;
}
+.osee-searchresults-manyresultsfield {
+ width: 20px;
+}
+
.osee-horizontal-line {
background-image:url('linespacer.png');
background-repeat:repeat-x;