summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-20 10:25:43 (EDT)
committerRoberto E. Escobar2011-10-20 10:25:43 (EDT)
commit512215fcfe255ae9945115964a6cb293bdd13383 (patch)
tree6aefb1c38f9edda3668b744c5f807a09486ee953
parent2c27c258431ba1725b28f381ac15c7b5f2603562 (diff)
downloadorg.eclipse.osee-512215fcfe255ae9945115964a6cb293bdd13383.zip
org.eclipse.osee-512215fcfe255ae9945115964a6cb293bdd13383.tar.gz
org.eclipse.osee-512215fcfe255ae9945115964a6cb293bdd13383.tar.bz2
feature[ats_E6W8N]: Polish Web View
Polish AtsHeaderComp code Add 7px top padding Polish and refactor web ui code Implementing singleton SearchParams to save state
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsSearchParameters.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsPresenterFactory.java5
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsSearchPresenter.java5
-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/MockAtsPresenterFactory.java7
-rw-r--r--plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java177
-rw-r--r--plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsPresenterFactoryImpl.java8
-rw-r--r--plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsSearchPresenterImpl.java19
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java11
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java32
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java8
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java57
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java35
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java54
-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/data/ViewSearchParameters.java10
-rw-r--r--plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/search/SearchPresenter.java7
-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/MockSearchPresenter.java27
-rw-r--r--plugins/org.eclipse.osee.display.presenter/src/org/eclipse/osee/display/presenter/SearchPresenterImpl.java5
-rw-r--r--plugins/org.eclipse.osee.display.view.web/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java81
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/CssConstants.java4
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java27
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java73
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeBreadcrumbComponent.java21
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLeftMarginContainer.java34
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseePagingComponent.java205
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java16
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchHeaderComponent.java22
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java210
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java164
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java73
-rw-r--r--plugins/org.eclipse.osee.vaadin.themes/src/VAADIN/themes/osee/styles.css38
34 files changed, 746 insertions, 702 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsSearchParameters.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsSearchParameters.java
index 7f2ceb4..270f7f9 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsSearchParameters.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsSearchParameters.java
@@ -21,7 +21,7 @@ public class AtsSearchParameters extends ViewSearchParameters {
private final ViewId build, program;
- public AtsSearchParameters(String searchString, boolean nameOnly, boolean verboseResults, ViewId build, ViewId program) {
+ public AtsSearchParameters(String searchString, Boolean nameOnly, Boolean verboseResults, ViewId build, ViewId program) {
super(searchString, nameOnly, verboseResults);
this.build = build;
this.program = program;
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsPresenterFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsPresenterFactory.java
index 617446d..d58bb06 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsPresenterFactory.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsPresenterFactory.java
@@ -11,12 +11,13 @@
package org.eclipse.osee.ats.api.search;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.api.data.AtsSearchParameters;
/**
* @author John Misinco
*/
-public interface AtsPresenterFactory<T extends AtsSearchHeaderComponent> {
+public interface AtsPresenterFactory<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> {
- AtsSearchPresenter<T> createInstance();
+ AtsSearchPresenter<T, K> createInstance();
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsSearchPresenter.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsSearchPresenter.java
index a9b851e..61bf4b0 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsSearchPresenter.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/search/AtsSearchPresenter.java
@@ -13,16 +13,13 @@ package org.eclipse.osee.ats.api.search;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.display.api.data.ViewId;
-import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
/*
* @author John Misinco
*/
-public interface AtsSearchPresenter<T extends AtsSearchHeaderComponent> extends SearchPresenter<T> {
+public interface AtsSearchPresenter<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> extends SearchPresenter<T, K> {
void selectProgram(ViewId program, T headerComponent);
- void selectSearch(AtsSearchParameters params, SearchNavigator atsNavigator);
-
}
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 421e3ca..61bc633 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
@@ -82,8 +82,4 @@ public class MockAtsSearchHeaderComponent implements AtsSearchHeaderComponent {
public void setSearchCriteria(AtsSearchParameters params) {
}
- @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/MockAtsPresenterFactory.java b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/MockAtsPresenterFactory.java
index bb2df1c..73c5d6d 100644
--- a/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/MockAtsPresenterFactory.java
+++ b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/MockAtsPresenterFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.presenter.mock;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsPresenterFactory;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
import org.eclipse.osee.ats.presenter.mock.internal.MockAtsWebSearchPresenter;
@@ -18,11 +19,11 @@ import org.eclipse.osee.ats.presenter.mock.internal.MockAtsWebSearchPresenter;
/**
* @author John Misinco
*/
-public class MockAtsPresenterFactory implements AtsPresenterFactory<AtsSearchHeaderComponent> {
+public class MockAtsPresenterFactory implements AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> {
@Override
- public AtsSearchPresenter<AtsSearchHeaderComponent> createInstance() {
- return new MockAtsWebSearchPresenter();
+ public AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> createInstance() {
+ return new MockAtsWebSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters>();
}
}
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 4b9a785..43fc57c 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
@@ -10,12 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.ats.presenter.mock.internal;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -31,14 +29,17 @@ import org.eclipse.osee.display.api.data.SearchResultMatch;
import org.eclipse.osee.display.api.data.StyledText;
import org.eclipse.osee.display.api.data.ViewArtifact;
import org.eclipse.osee.display.api.data.ViewId;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
import org.eclipse.osee.display.api.search.SearchNavigator;
+import org.eclipse.osee.display.presenter.mocks.MockSearchPresenter;
/**
* @author Shawn F. Cook
*/
-public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHeaderComponent> {
+public class MockAtsWebSearchPresenter<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> extends MockSearchPresenter<T, K> implements AtsSearchPresenter<T, K> {
- private static final AtsSearchPresenter<AtsSearchHeaderComponent> atsBackend = new MockAtsWebSearchPresenter();
+ private static final AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> atsBackend =
+ new MockAtsWebSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters>();
// *** TEST DATA ***
ViewId build0 = new ViewId("baseline_guid", "Baseline");
@@ -105,48 +106,81 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
}
@Override
- public void selectSearch(AtsSearchParameters params, SearchNavigator atsNavigator) {
+ public void selectSearch(String url, ViewSearchParameters params, SearchNavigator atsNavigator) {
if (atsNavigator != null && params != null) {
Map<String, String> parameters = new HashMap<String, String>();
- if (params.getProgram() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_PROGRAM, params.getProgram().getGuid());
+ if (params instanceof AtsSearchParameters) {
+ AtsSearchParameters atsParams = (AtsSearchParameters) params;
+
+ if (atsParams.getProgram() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_PROGRAM, atsParams.getProgram().getGuid());
+ }
+ if (atsParams.getBuild() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_BUILD, atsParams.getBuild().getGuid());
+ }
}
- if (params.getBuild() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_BUILD, params.getBuild().getGuid());
+ if (params.isNameOnly() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_NAMEONLY, params.isNameOnly() ? "true" : "false");
}
- parameters.put(UrlParamNameConstants.PARAMNAME_NAMEONLY, params.isNameOnly() ? "true" : "false");
if (params.getSearchString() != null) {
parameters.put(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE, params.getSearchString());
}
- parameters.put(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE, params.isVerboseResults() ? "true" : "false");
+ if (params.isVerboseResults() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE, params.isVerboseResults() ? "true" : "false");
+ }
if (parameters.size() > 0) {
- String url = parameterMapToRequestString(parameters);
- atsNavigator.navigateSearchResults(url);
+ String newurl = parameterMapToRequestString(parameters, url);
+ atsNavigator.navigateSearchResults(newurl);
}
}
}
- // @Override
- // public void initSearchHome(AtsSearchHeaderComponent headerComponent) {
- // if (headerComponent != null) {
- // headerComponent.clearAll();
- // Set<Entry<ViewId, Collection<ViewId>>> entrySet = programsAndBuilds.entrySet();
- // if (entrySet != null) {
- // for (Entry<ViewId, Collection<ViewId>> entry : entrySet) {
- // headerComponent.addProgram(entry.getKey());
- // }
- // }
- // }
- // }
+ private void updateSearchHeader(String url, AtsSearchHeaderComponent searchHeaderComp) {
+ if (searchHeaderComp != null) {
+ searchHeaderComp.clearAll();
+ Set<Entry<ViewId, Collection<ViewId>>> entrySet = programsAndBuilds.entrySet();
+ if (entrySet != null) {
+ for (Entry<ViewId, Collection<ViewId>> entry : entrySet) {
+ searchHeaderComp.addProgram(entry.getKey());
+ }
+ }
+
+ Map<String, String> params = requestStringToParameterMap(url);
+ if (params != null && params.size() > 0) {
+
+ ViewId program, build;
+ program = getProgramWithGuid(params.get(UrlParamNameConstants.PARAMNAME_PROGRAM));
+ build = getBuildWithGuid(UrlParamNameConstants.PARAMNAME_BUILD);
+ String nameOnlyStr = params.get(UrlParamNameConstants.PARAMNAME_NAMEONLY);
+ String verboseStr = params.get(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE);
+ Boolean nameOnly = false;
+ Boolean verbose = false;
+ if (nameOnlyStr != null) {
+ nameOnly = nameOnlyStr.equalsIgnoreCase("true");
+ }
+ if (verboseStr != null) {
+ verbose = verboseStr.equalsIgnoreCase("true");
+ }
+
+ AtsSearchParameters atsParams =
+ new AtsSearchParameters(params.get(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE), nameOnly, verbose,
+ build, program);
+ searchHeaderComp.setSearchCriteria(atsParams);
+ }
+ }
+ }
@Override
- public void selectArtifact(ViewArtifact artifact, SearchNavigator oseeNavigator) {
- String url = String.format("/artifact/%s", artifact.getGuid());
- oseeNavigator.navigateArtifactPage(url);
+ public void selectArtifact(String url, ViewArtifact artifact, SearchNavigator oseeNavigator) {
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("artifact", artifact.getGuid());
+ String newurl = parameterMapToRequestString(params, url);
+ oseeNavigator.navigateArtifactPage(newurl);
}
@Override
public void initArtifactPage(String url, AtsSearchHeaderComponent searchHeaderComp, ArtifactHeaderComponent artHeaderComp, RelationComponent relComp, AttributeComponent attrComp) {
+ updateSearchHeader(url, searchHeaderComp);
artHeaderComp.clearAll();
Map<String, String> params = requestStringToParameterMap(url);
if (params != null && params.size() > 0) {
@@ -220,50 +254,9 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
}
}
- // private void updateAndSetSearchHeaderCriteria(String url, AtsSearchHeaderComponentInterface searchHeaderComponent) {
- // Map<String, String> params = requestStringToParameterMap(url);
- // ViewId program = new ViewId("", "");
- // ViewId build = new ViewId("", "");
- // boolean nameOnly = false;
- // String searchPhrase = "";
- //
- // if (params != null) {
- // String programGuid = params.get(UrlParamNameConstants.PARAMNAME_PROGRAM);
- // if (programGuid != null) {
- // program = getProgramWithGuid(programGuid);
- // }
- // String buildGuid = params.get(UrlParamNameConstants.PARAMNAME_BUILD);
- // if (buildGuid != null) {
- // build = getBuildWithGuid(buildGuid);
- // }
- // String nameOnlyStr = params.get(UrlParamNameConstants.PARAMNAME_NAMEONLY);
- // if (nameOnlyStr != null) {
- // nameOnly = nameOnlyStr.equalsIgnoreCase("true");
- // }
- //
- // String searchPhrase_local = params.get(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE);
- // if (searchPhrase_local != null) {
- // searchPhrase = searchPhrase_local;
- // }
- // }
- // if (searchHeaderComponent != null) {
- // this.selectProgram(program, searchHeaderComponent);
- // searchHeaderComponent.setSearchCriteria(program, build, nameOnly, searchPhrase);
- // }
- // }
-
@Override
public void initSearchResults(String url, AtsSearchHeaderComponent searchHeaderComponent, SearchResultsListComponent resultsComponent) {
-
- if ((url == null || url.isEmpty()) && searchHeaderComponent != null) {
- searchHeaderComponent.clearAll();
- Set<Entry<ViewId, Collection<ViewId>>> entrySet = programsAndBuilds.entrySet();
- if (entrySet != null) {
- for (Entry<ViewId, Collection<ViewId>> entry : entrySet) {
- searchHeaderComponent.addProgram(entry.getKey());
- }
- }
- }
+ updateSearchHeader(url, searchHeaderComponent);
if (resultsComponent != null) {
boolean showVerboseSearchResults = true;
@@ -300,11 +293,9 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
}
searchResultComp.setArtifact(artifact);
if (!nameOnly && !showVerboseSearchResults) {
- List<StyledText> text = new ArrayList<StyledText>();
- text.add(new StyledText("...{", false));
- text.add(new StyledText("COM_PAGE", true));
- text.add(new StyledText("}...", false));
- searchResultComp.addSearchResultMatch(new SearchResultMatch("Word Template Content", 10, text));
+ StyledText matchHintText = new StyledText("...{COM_PAGE}...", true);
+ searchResultComp.addSearchResultMatch(new SearchResultMatch("Word Template Content", 10,
+ Arrays.asList(matchHintText)));
}
}
}
@@ -324,9 +315,11 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
if (tokens.length > 1) {
for (int i = 0; i < tokens.length; i++) {
String paramName = tokens[i];
- i++;
- String paramValue = tokens[i];
- parameters.put(paramName, paramValue);
+ if (paramName != null && !paramName.isEmpty()) {
+ i++;
+ String paramValue = tokens[i];
+ parameters.put(paramName, paramValue);
+ }
}
}
}
@@ -334,22 +327,39 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
return parameters;
}
- private static String parameterMapToRequestString(Map<String, String> parameters) {
+ private static String parameterMapToRequestString(Map<String, String> parameters, String oldurl) {
String requestedDataId = "/";
- // TODO: Need to properly encode the URI parameters here.
+ Map<String, String> oldParameters = requestStringToParameterMap(oldurl);
+
+ Set<Entry<String, String>> oldKeyValuePairs = oldParameters.entrySet();
+ for (Iterator<Entry<String, String>> iter = oldKeyValuePairs.iterator(); iter.hasNext();) {
+ Entry<String, String> pair = iter.next();
+ if (pair.getKey() != null && !pair.getKey().isEmpty() && pair.getValue() != null && !pair.getValue().isEmpty()) {
+ //Check for new state for this key
+ String newValue = parameters.get(pair.getKey());
+ if (newValue == null) {
+ newValue = pair.getValue();
+ }
+ requestedDataId = String.format("%s%s/%s/", requestedDataId, pair.getKey(), newValue);
+ }
+ }
Set<Entry<String, String>> keyValuePairs = parameters.entrySet();
for (Iterator<Entry<String, String>> iter = keyValuePairs.iterator(); iter.hasNext();) {
Entry<String, String> pair = iter.next();
if (pair.getKey() != null && !pair.getKey().isEmpty() && pair.getValue() != null && !pair.getValue().isEmpty()) {
- requestedDataId = String.format("%s%s/%s", requestedDataId, pair.getKey(), pair.getValue());
- if (iter.hasNext()) {
- requestedDataId = String.format("%s/", requestedDataId);
+ //Check for new key value pair that does not yet exist in the old state
+ if (oldParameters.get(pair.getKey()) == null) {
+ requestedDataId = String.format("%s%s/%s/", requestedDataId, pair.getKey(), pair.getValue());
}
}
}
+ if (requestedDataId.endsWith("/")) {
+ requestedDataId.substring(0, requestedDataId.length() - 1);
+ }
+
return requestedDataId;
}
@@ -389,4 +399,5 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
public final static String PARAMNAME_SEARCHPHRASE = "searchphrase";
public final static String PARAMNAME_SHOWVERBOSE = "showverbose";
}
+
}
diff --git a/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsPresenterFactoryImpl.java b/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsPresenterFactoryImpl.java
index 6f31a33..bf7b3e1 100644
--- a/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsPresenterFactoryImpl.java
+++ b/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsPresenterFactoryImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.presenter.internal;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsArtifactProvider;
import org.eclipse.osee.ats.api.search.AtsPresenterFactory;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
@@ -19,7 +20,7 @@ import org.eclipse.osee.orcs.OrcsApi;
/**
* @author John Misinco
*/
-public class AtsPresenterFactoryImpl<T extends AtsSearchHeaderComponent> implements AtsPresenterFactory<T> {
+public class AtsPresenterFactoryImpl<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> implements AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> {
private OrcsApi orcsApi;
@@ -28,9 +29,10 @@ public class AtsPresenterFactoryImpl<T extends AtsSearchHeaderComponent> impleme
}
@Override
- public AtsSearchPresenter<T> createInstance() {
+ public AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> createInstance() {
AtsArtifactProvider provider = new AtsArtifactProviderImpl(orcsApi, null);
- AtsSearchPresenterImpl<T> instance = new AtsSearchPresenterImpl<T>(provider);
+ AtsSearchPresenterImpl<AtsSearchHeaderComponent, AtsSearchParameters> instance =
+ new AtsSearchPresenterImpl<AtsSearchHeaderComponent, AtsSearchParameters>(provider);
return instance;
}
diff --git a/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsSearchPresenterImpl.java b/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsSearchPresenterImpl.java
index 2e86fcf..c3d826c 100644
--- a/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsSearchPresenterImpl.java
+++ b/plugins/org.eclipse.osee.ats.presenter/src/org/eclipse/osee/ats/presenter/internal/AtsSearchPresenterImpl.java
@@ -20,8 +20,13 @@ import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsArtifactProvider;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
+import org.eclipse.osee.display.api.components.ArtifactHeaderComponent;
+import org.eclipse.osee.display.api.components.AttributeComponent;
+import org.eclipse.osee.display.api.components.RelationComponent;
import org.eclipse.osee.display.api.components.SearchResultsListComponent;
+import org.eclipse.osee.display.api.data.ViewArtifact;
import org.eclipse.osee.display.api.data.ViewId;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.presenter.SearchPresenterImpl;
import org.eclipse.osee.display.presenter.Utility;
@@ -42,9 +47,9 @@ public class AtsSearchPresenterImpl<T extends AtsSearchHeaderComponent, K extend
}
@Override
- public void selectSearch(AtsSearchParameters params, SearchNavigator atsNavigator) {
- String url = encode(params, null);
- atsNavigator.navigateSearchResults(url);
+ public void selectSearch(String url, ViewSearchParameters params, SearchNavigator atsNavigator) {
+ // String urllocal = encode(params, null);
+ // atsNavigator.navigateSearchResults(urllocal);
}
private void addProgramsToSearchHeader(T headerComponent) {
@@ -198,4 +203,12 @@ public class AtsSearchPresenterImpl<T extends AtsSearchHeaderComponent, K extend
return new AtsSearchParameters(searchPhrase, nameOnly, verbose, build, program);
}
+ @Override
+ public void selectArtifact(String url, ViewArtifact artifact, SearchNavigator oseeNavigator) {
+ }
+
+ @Override
+ public void initArtifactPage(String url, T searchHeaderComp, ArtifactHeaderComponent artHeaderComp, RelationComponent relComp, AttributeComponent attrComp) {
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
index 3873319..96f915a 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
@@ -12,7 +12,10 @@ package org.eclipse.osee.ats.view.web;
import org.eclipse.osee.ats.view.web.search.AtsArtifactView;
import org.eclipse.osee.ats.view.web.search.AtsSearchResultsView;
+import org.eclipse.osee.display.api.components.SearchHeaderComponent;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
import org.eclipse.osee.display.api.search.SearchNavigator;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
import org.eclipse.osee.vaadin.widgets.Navigator;
/**
@@ -23,13 +26,21 @@ public class AtsNavigator extends Navigator implements SearchNavigator {
@Override
public void navigateSearchResults(String url) {
+ updateGlobalUrlState(url);
String classUri = getUri(AtsSearchResultsView.class);
this.navigateTo(String.format("%s%s", classUri, url));
}
@Override
public void navigateArtifactPage(String url) {
+ updateGlobalUrlState(url);
String classUri = getUri(AtsArtifactView.class);
this.navigateTo(String.format("%s%s", classUri, url));
}
+
+ private void updateGlobalUrlState(String url) {
+ OseeUiApplication<SearchHeaderComponent, ViewSearchParameters> app =
+ (OseeUiApplication<SearchHeaderComponent, ViewSearchParameters>) getApplication();
+ app.setRequestedDataId(url);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java
index 542f840..5453996 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web;
+import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
-import org.eclipse.osee.ats.view.web.components.AtsSearchHeaderImpl;
-import org.eclipse.osee.display.api.components.SearchHeaderComponent;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.view.web.OseeUiApplication;
import org.eclipse.osee.vaadin.widgets.HasViews;
@@ -22,9 +22,9 @@ import com.vaadin.ui.Window;
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class AtsUiApplication extends OseeUiApplication {
+public class AtsUiApplication extends OseeUiApplication<AtsSearchHeaderComponent, AtsSearchParameters> {
- public AtsUiApplication(AtsSearchPresenter searchPresenter) {
+ public AtsUiApplication(AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> searchPresenter) {
super(searchPresenter);
}
@@ -49,11 +49,11 @@ public class AtsUiApplication extends OseeUiApplication {
return nav;
}
- public AtsSearchPresenter getAtsWebSearchPresenter() {
- AtsSearchPresenter pres = null;
- try {
- pres = (AtsSearchPresenter) this.searchPresenter;
- } catch (Exception e) {
+ public AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> getAtsWebSearchPresenter() {
+ AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> pres = null;
+ if (searchPresenter instanceof AtsSearchPresenter<?, ?>) {
+ pres = (AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters>) searchPresenter;
+ } else {
System.out.println("AtsUiApplication.getAtsWebSearchPresenter() - CRITICAL ERROR: cast threw an exception.");
}
return pres;
@@ -64,18 +64,4 @@ public class AtsUiApplication extends OseeUiApplication {
return new AtsNavigator();
}
- @Override
- protected SearchHeaderComponent createSearchHeaderComponent() {
- return new AtsSearchHeaderImpl();
- }
-
- public AtsSearchHeaderImpl getAtsSearchHeaderComponent() {
- AtsSearchHeaderImpl searchHeader = null;
- try {
- searchHeader = (AtsSearchHeaderImpl) this.searchHeaderComponent;
- } catch (Exception e) {
- System.out.println("AtsUiApplication.getAtsSearchHeaderComponent() - CRITICAL ERROR: cast threw an exception.");
- }
- return searchHeader;
- }
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java
index 3d5492e..a12a082 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web;
+import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsPresenterFactory;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
import org.eclipse.osee.vaadin.ApplicationFactory;
@@ -20,11 +22,11 @@ import com.vaadin.Application;
*/
public class AtsUiApplicationFactory implements ApplicationFactory {
- private AtsPresenterFactory presenterFactory;
+ private AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> presenterFactory;
@Override
public Application createInstance() {
- AtsSearchPresenter searchPresenter = null;
+ AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> searchPresenter = null;
if (presenterFactory != null) {
searchPresenter = presenterFactory.createInstance();
}
@@ -36,7 +38,7 @@ public class AtsUiApplicationFactory implements ApplicationFactory {
return AtsUiApplication.class;
}
- public void setPresenterFactory(AtsPresenterFactory presenterFactory) {
+ public void setPresenterFactory(AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> presenterFactory) {
this.presenterFactory = presenterFactory;
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
index fcb2a75..2a3d05e 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
@@ -18,6 +18,8 @@ import org.eclipse.osee.ats.view.web.AtsUiApplication;
import org.eclipse.osee.ats.view.web.search.AtsSearchResultsView;
import org.eclipse.osee.display.api.data.ViewId;
import org.eclipse.osee.display.view.web.CssConstants;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
+import org.eclipse.osee.display.view.web.components.OseeLeftMarginContainer;
import org.eclipse.osee.display.view.web.components.OseeLogoLink;
import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
import com.vaadin.Application;
@@ -28,7 +30,6 @@ import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
@@ -44,7 +45,7 @@ import com.vaadin.ui.Window.Notification;
@SuppressWarnings("serial")
public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements AtsSearchHeaderComponent, Handler {
- private boolean populated = false;
+ private boolean isLayoutComplete = false;
private final ComboBox programCombo = new ComboBox("Program:");
private final ComboBox buildCombo = new ComboBox("Build:");
private final CheckBox nameOnlyCheckBox = new CheckBox("Name Only", true);
@@ -55,7 +56,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
@Override
public void attach() {
- if (!populated) {
+ if (!isLayoutComplete) {
try {
AtsUiApplication app = (AtsUiApplication) this.getApplication();
searchPresenter = app.getAtsWebSearchPresenter();
@@ -65,7 +66,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
}
createLayout();
}
- populated = true;
+ isLayoutComplete = true;
}
private void selectProgram() {
@@ -75,9 +76,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
}
}
- public AtsSearchHeaderImpl(boolean showOseeTitleAbove) {
- this.showOseeTitleAbove = showOseeTitleAbove;
-
+ public AtsSearchHeaderImpl() {
if (programCombo != null) {
programCombo.setNullSelectionAllowed(false);
programCombo.addListener(new Property.ValueChangeListener() {
@@ -97,19 +96,15 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
searchTextField.setImmediate(true);
}
- public AtsSearchHeaderImpl() {
- this(true);
- }
-
protected void selectSearch() {
if (searchPresenter != null && programCombo != null && buildCombo != null && nameOnlyCheckBox != null && searchTextField != null) {
ViewId program = (ViewId) programCombo.getValue();
ViewId build = (ViewId) 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);
+ AtsSearchParameters params = new AtsSearchParameters(searchPhrase, nameOnly, null, build, program);
+ OseeUiApplication app = (OseeUiApplication) getApplication();
+ searchPresenter.selectSearch(app.getRequestedDataId(), params, navigator);
} else {
System.out.println("AtsSearchHeaderComponent.selectSearch - WARNING: null value detected.");
}
@@ -117,14 +112,13 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
@Override
public void createLayout() {
- removeAllComponents();
- setHeight(null);
setWidth(100, UNITS_PERCENTAGE);
setStyleName(CssConstants.OSEE_SEARCH_HEADER_COMPONENT_SMALL);
- HorizontalLayout hLayout_Body = new HorizontalLayout();
HorizontalLayout hLayout_ProgBuildName = new HorizontalLayout();
HorizontalLayout hLayout_SearchTextBtn = new HorizontalLayout();
+ hLayout_ProgBuildName.setSizeUndefined();
+ hLayout_SearchTextBtn.setSizeUndefined();
Label hSpacer_ProgBuild = new Label("");
hSpacer_ProgBuild.setHeight(null);
@@ -140,7 +134,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
hSpacer_SearchTextBtn.setWidth(30, UNITS_PIXELS);
Button searchButton = new Button("Search", new Button.ClickListener() {
@Override
- public void buttonClick(ClickEvent event) {
+ public void buttonClick(Button.ClickEvent event) {
selectSearch();
}
});
@@ -148,19 +142,14 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
OseeLogoLink oseeLogoImg =
new OseeLogoLink(navigator, CssConstants.OSEE_TITLE_MEDIUM_TEXT, AtsSearchResultsView.class);
Label hSpacer_LogoRight = new Label("");
+ oseeLogoImg.setSizeUndefined();
+
hSpacer_LogoRight.setWidth(15, UNITS_PIXELS);
VerticalLayout vLayout_SearchCrit = new VerticalLayout();
vLayout_SearchCrit.setSizeUndefined();
- Label hSpacer_LeftMarg = new Label();
- hSpacer_LeftMarg.setWidth(CssConstants.OSEE_LEFTMARGINWIDTH, UNITS_PIXELS);
-
- Label vSpacer_BotLine = new Label("");
- vSpacer_BotLine.setStyleName(CssConstants.OSEE_SEARCH_HEADER_COMPONENT_FOOTER);
-
- Label vSpacer_TopLine = new Label("");
- vSpacer_TopLine.setStyleName(CssConstants.OSEE_SEARCH_HEADER_COMPONENT_FOOTER);
+ OseeLeftMarginContainer leftMarginContainer = new OseeLeftMarginContainer();
hLayout_ProgBuildName.addComponent(programCombo);
hLayout_ProgBuildName.addComponent(hSpacer_ProgBuild);
@@ -175,14 +164,11 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
vLayout_SearchCrit.addComponent(hLayout_ProgBuildName);
vLayout_SearchCrit.addComponent(hLayout_SearchTextBtn);
- hLayout_Body.addComponent(hSpacer_LeftMarg);
- hLayout_Body.addComponent(oseeLogoImg);
- hLayout_Body.addComponent(hSpacer_LogoRight);
- hLayout_Body.addComponent(vLayout_SearchCrit);
+ leftMarginContainer.addComponent(oseeLogoImg);
+ leftMarginContainer.addComponent(hSpacer_LogoRight);
+ leftMarginContainer.addComponent(vLayout_SearchCrit);
- addComponent(vSpacer_TopLine);
- addComponent(hLayout_Body);
- addComponent(vSpacer_BotLine);
+ setCompositionRoot(leftMarginContainer);
hLayout_ProgBuildName.setComponentAlignment(programCombo, Alignment.MIDDLE_LEFT);
hLayout_ProgBuildName.setComponentAlignment(buildCombo, Alignment.MIDDLE_CENTER);
@@ -190,9 +176,6 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
hLayout_SearchTextBtn.setComponentAlignment(searchTextField, Alignment.MIDDLE_LEFT);
hLayout_SearchTextBtn.setComponentAlignment(searchButton, Alignment.MIDDLE_RIGHT);
-
- hLayout_Body.setComponentAlignment(oseeLogoImg, Alignment.TOP_CENTER);
- hLayout_Body.setComponentAlignment(vLayout_SearchCrit, Alignment.TOP_CENTER);
}
@Override
@@ -206,7 +189,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
@Override
public void clearBuilds() {
- if (buildCombo != null) {
+ if (buildCombo != null && !lockProgramCombo) {
buildCombo.removeAllItems();
}
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java
index 588ddce..1eaf70c 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.view.web.search;
import org.eclipse.osee.ats.view.web.AtsUiApplication;
+import org.eclipse.osee.ats.view.web.components.AtsSearchHeaderImpl;
import org.eclipse.osee.display.view.web.search.OseeArtifactView;
/**
@@ -18,36 +19,20 @@ import org.eclipse.osee.display.view.web.search.OseeArtifactView;
*/
public class AtsArtifactView extends OseeArtifactView {
- private boolean populated = false;
- private String requestedDataId = "";
-
@Override
- public void attach() {
- if (!populated) {
- try {
- AtsUiApplication atsApp = (AtsUiApplication) getApplication();
- searchPresenter = atsApp.getAtsWebSearchPresenter();
- searchHeader = atsApp.getAtsSearchHeaderComponent();
- callInitArtifactPage();
- createLayout();
- } catch (Exception e) {
- System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: casting threw an exception.");
- }
+ protected void initComponents() {
+ try {
+ AtsUiApplication atsApp = (AtsUiApplication) this.getApplication();
+ searchPresenter = atsApp.getAtsWebSearchPresenter();
+ searchHeader = new AtsSearchHeaderImpl();
+ } catch (Exception e) {
+ System.out.println("AtsArtifactView.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
}
- populated = true;
}
@Override
- public void navigateTo(String requestedDataId) {
- super.navigateTo(requestedDataId);
- this.requestedDataId = requestedDataId;
- callInitArtifactPage();
- }
-
- private void callInitArtifactPage() {
- if (searchPresenter != null) {
- searchPresenter.initArtifactPage(requestedDataId, searchHeader, this, relationsComp, attributeComp);
- }
+ protected void callInit(String url) {
+ searchPresenter.initArtifactPage(url, searchHeader, this, relationsComp, attributeComp);
}
}
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 89bf37f..ac0b19e 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
@@ -10,13 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web.search;
-import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
import org.eclipse.osee.ats.view.web.AtsUiApplication;
import org.eclipse.osee.ats.view.web.components.AtsSearchHeaderImpl;
-import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
import org.eclipse.osee.display.view.web.search.OseeSearchResultsView;
-import org.eclipse.osee.vaadin.widgets.Navigator;
-import com.vaadin.Application;
/**
* @author Shawn F. Cook
@@ -24,51 +20,21 @@ import com.vaadin.Application;
@SuppressWarnings("serial")
public class AtsSearchResultsView extends OseeSearchResultsView {
- private boolean populated = false;
- private AtsSearchPresenter searchPresenter;
- private String requestedDataId = "";
+ private boolean isLayoutComplete = false;
@Override
- public void attach() {
- if (!populated) {
- try {
- AtsUiApplication atsApp = (AtsUiApplication) this.getApplication();
- searchPresenter = atsApp.getAtsWebSearchPresenter();
- searchHeader = atsApp.getAtsSearchHeaderComponent();
- searchResultsListComponent.setSearchHeaderComponent(searchHeader);
- callInitSearchHome();
- createLayout();
- } catch (Exception e) {
- System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
- }
+ protected void initComponents() {
+ try {
+ AtsUiApplication atsApp = (AtsUiApplication) this.getApplication();
+ searchPresenter = atsApp.getAtsWebSearchPresenter();
+ searchHeader = new AtsSearchHeaderImpl();
+ } catch (Exception e) {
+ System.out.println("AtsSearchResultsView.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
}
- populated = true;
}
@Override
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new AtsSearchHeaderImpl(false);
- }
-
- private void callInitSearchHome() {
- if (searchPresenter != null) {
- try {
- searchPresenter.initSearchResults(requestedDataId, searchHeader, searchResultsListComponent);
- } catch (Exception e) {
- System.out.println("AtsSearchResultsView.callInitSearchHome - CRITICAL ERROR: casting threw an exception.");
- }
- }
- }
-
- @Override
- public void navigateTo(String requestedDataId) {
- super.navigateTo(requestedDataId);
- this.requestedDataId = requestedDataId;
- callInitSearchHome();
- }
-
- @Override
- public void init(Navigator navigator, Application application) {
- super.init(navigator, application);
+ protected void callInit(String url) {
+ searchPresenter.initSearchResults(url, searchHeader, searchResultsListComponent);
}
}
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 aef45c6..1e7e5e1 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,6 +17,4 @@ 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/data/ViewSearchParameters.java b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/data/ViewSearchParameters.java
index 14c1825..1acf575 100644
--- a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/data/ViewSearchParameters.java
+++ b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/data/ViewSearchParameters.java
@@ -16,10 +16,10 @@ package org.eclipse.osee.display.api.data;
public class ViewSearchParameters {
private final String searchString;
- private final boolean nameOnly;
- private final boolean verboseResults;
+ private final Boolean nameOnly;
+ private final Boolean verboseResults;
- public ViewSearchParameters(String searchString, boolean nameOnly, boolean verboseResults) {
+ public ViewSearchParameters(String searchString, Boolean nameOnly, Boolean verboseResults) {
this.searchString = searchString;
this.nameOnly = nameOnly;
this.verboseResults = verboseResults;
@@ -29,11 +29,11 @@ public class ViewSearchParameters {
return searchString;
}
- public boolean isNameOnly() {
+ public Boolean isNameOnly() {
return nameOnly;
}
- public boolean isVerboseResults() {
+ public Boolean isVerboseResults() {
return verboseResults;
}
diff --git a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/search/SearchPresenter.java b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/search/SearchPresenter.java
index bb31216..a42858c 100644
--- a/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/search/SearchPresenter.java
+++ b/plugins/org.eclipse.osee.display.api/src/org/eclipse/osee/display/api/search/SearchPresenter.java
@@ -17,18 +17,21 @@ import org.eclipse.osee.display.api.components.SearchHeaderComponent;
import org.eclipse.osee.display.api.components.SearchResultsListComponent;
import org.eclipse.osee.display.api.data.ViewArtifact;
import org.eclipse.osee.display.api.data.ViewId;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
/*
* @author John Misinco
*/
-public interface SearchPresenter<T extends SearchHeaderComponent> {
+public interface SearchPresenter<T extends SearchHeaderComponent, K extends ViewSearchParameters> {
void initSearchResults(String url, T searchHeaderComp, SearchResultsListComponent searchResultsComp);
- void selectArtifact(ViewArtifact artifact, SearchNavigator oseeNavigator);
+ void selectArtifact(String url, ViewArtifact artifact, SearchNavigator oseeNavigator);
void initArtifactPage(String url, T searchHeaderComp, ArtifactHeaderComponent artHeaderComp, RelationComponent relComp, AttributeComponent attrComp);
void selectRelationType(ViewArtifact artifact, ViewId relation, RelationComponent relationComponent);
+ void selectSearch(String url, ViewSearchParameters params, SearchNavigator atsNavigator);
+
} \ No newline at end of file
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 167f4ef..1a4c0e5 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,8 +38,4 @@ 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/MockSearchPresenter.java b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchPresenter.java
new file mode 100644
index 0000000..fbfa582
--- /dev/null
+++ b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockSearchPresenter.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) October 21, 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.display.presenter.mocks;
+
+import org.eclipse.osee.display.api.components.SearchHeaderComponent;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
+import org.eclipse.osee.display.api.search.SearchNavigator;
+import org.eclipse.osee.display.api.search.SearchPresenter;
+
+/**
+ * @author Shawn F. Cook
+ */
+public abstract class MockSearchPresenter<T extends SearchHeaderComponent, K extends ViewSearchParameters> implements SearchPresenter<T, K> {
+
+ @Override
+ public void selectSearch(String url, ViewSearchParameters params, SearchNavigator atsNavigator) {
+ System.out.println("");
+ }
+}
diff --git a/plugins/org.eclipse.osee.display.presenter/src/org/eclipse/osee/display/presenter/SearchPresenterImpl.java b/plugins/org.eclipse.osee.display.presenter/src/org/eclipse/osee/display/presenter/SearchPresenterImpl.java
index dc51838..bd5e4af 100644
--- a/plugins/org.eclipse.osee.display.presenter/src/org/eclipse/osee/display/presenter/SearchPresenterImpl.java
+++ b/plugins/org.eclipse.osee.display.presenter/src/org/eclipse/osee/display/presenter/SearchPresenterImpl.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.display.api.data.SearchResultMatch;
import org.eclipse.osee.display.api.data.StyledText;
import org.eclipse.osee.display.api.data.ViewArtifact;
import org.eclipse.osee.display.api.data.ViewId;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
import org.eclipse.osee.display.api.search.ArtifactProvider;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
@@ -49,7 +50,7 @@ import org.eclipse.osee.orcs.search.Match;
/**
* @author John Misinco
*/
-public abstract class SearchPresenterImpl<T extends SearchHeaderComponent, K extends ViewSearchParameters> implements SearchPresenter<T, K> {
+public class SearchPresenterImpl<T extends SearchHeaderComponent> implements SearchPresenter<T> {
protected final ArtifactProvider artifactProvider;
@@ -108,7 +109,7 @@ public abstract class SearchPresenterImpl<T extends SearchHeaderComponent, K ext
}
@Override
- public void selectArtifact(ViewArtifact artifact, SearchNavigator oseeNavigator) {
+ public void selectArtifact(String url, ViewArtifact artifact, SearchNavigator oseeNavigator) {
Map<String, String> params = new HashMap<String, String>();
params.put("branch", artifact.getBranch().getGuid());
params.put("artifact", artifact.getGuid());
diff --git a/plugins/org.eclipse.osee.display.view.web/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.display.view.web/META-INF/MANIFEST.MF
index 0651f0c..4b35491 100644
--- a/plugins/org.eclipse.osee.display.view.web/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.display.view.web/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Import-Package: com.vaadin,
org.eclipse.osee.display.api.components,
org.eclipse.osee.display.api.data,
org.eclipse.osee.display.api.search,
+ org.eclipse.osee.display.presenter.mocks,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.vaadin,
org.eclipse.osee.vaadin.widgets,
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java
new file mode 100644
index 0000000..088ea3b
--- /dev/null
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.display.view.web;
+
+import org.eclipse.osee.display.api.components.SearchHeaderComponent;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
+import org.eclipse.osee.display.api.search.SearchPresenter;
+import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
+import org.eclipse.osee.vaadin.widgets.Navigator;
+import com.vaadin.Application;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * @author Shawn F. Cook
+ */
+@SuppressWarnings("serial")
+public abstract class AbstractCommonView extends VerticalLayout implements Navigator.View {
+
+ protected OseeSearchHeaderComponent searchHeader;
+ protected SearchPresenter searchPresenter;
+ private boolean isLayoutComplete = false;
+
+ @Override
+ public void attach() {
+ if (!isLayoutComplete) {
+ initComponents();
+ if (searchHeader != null) {
+ setSizeFull();
+
+ addComponent(searchHeader);
+ setComponentAlignment(searchHeader, Alignment.TOP_LEFT);
+
+ createLayout();
+
+ callInit("");
+ }
+ isLayoutComplete = true;
+ }
+ }
+
+ @Override
+ public void navigateTo(String requestedDataId) {
+ String url = "";
+ if (searchPresenter != null) {
+ try {
+ OseeUiApplication<SearchHeaderComponent, ViewSearchParameters> app =
+ (OseeUiApplication<SearchHeaderComponent, ViewSearchParameters>) getApplication();
+ url = app.getRequestedDataId();
+ } catch (Exception e) {
+ System.out.println("AbstractCommonView.navigateTo - CRITICAL ERROR: casting threw an exception.");
+ }
+ callInit(url);
+ }
+ }
+
+ protected abstract void callInit(String url);
+
+ protected abstract void createLayout();
+
+ protected abstract void initComponents();
+
+ @Override
+ public void init(Navigator navigator, Application application) {
+ //Do nothing.
+ }
+
+ @Override
+ public String getWarningForNavigatingFrom() {
+ return null;
+ }
+
+}
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 5eb682f..48571e0 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
@@ -33,11 +33,7 @@ public final class CssConstants {
public static final String OSEE_FOOTER_BAR = "osee-footer-bar";
public static final String OSEE_PRODUCT_SUMMARY = "osee-product-summary";
- public static final String OSEE_SEARCH_HEADER_COMPONENT_LARGE = "osee-search-header-component-large";
public static final String OSEE_SEARCH_HEADER_COMPONENT_SMALL = "osee-search-header-component-small";
- public static final String OSEE_SEARCH_HEADER_COMPONENT_FOOTER = "osee-search-header-component-footer";
- public static final String OSEE_TITLE_LARGE = "osee-title-large";
- public static final String OSEE_TITLE_LARGE_TEXT = "osee-title-large-text";
public static final String OSEE_TITLE_MEDIUM_TEXT = "osee-title-medium-text";
public static final String OSEE_SEARCH_TEXTFIELD = "osee-search-textfield";
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java
index 9d69ecd..9861f5b 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.display.view.web;
import org.eclipse.osee.display.api.components.SearchHeaderComponent;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
-import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import com.vaadin.Application;
@@ -22,16 +22,24 @@ import com.vaadin.Application;
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class OseeUiApplication extends Application {
+public class OseeUiApplication<T extends SearchHeaderComponent, K extends ViewSearchParameters> extends Application {
protected final SearchNavigator navigator = createNavigator();
- protected SearchPresenter<?> searchPresenter;
- protected SearchHeaderComponent searchHeaderComponent = createSearchHeaderComponent();
+ protected SearchPresenter<T, K> searchPresenter;
+ protected String requestedDataId = "";
- public OseeUiApplication(SearchPresenter<?> searchPresenter) {
+ public OseeUiApplication(SearchPresenter<T, K> searchPresenter) {
this.searchPresenter = searchPresenter;
}
+ public String getRequestedDataId() {
+ return requestedDataId;
+ }
+
+ public void setRequestedDataId(String requestedDataId) {
+ this.requestedDataId = requestedDataId;
+ }
+
@Override
public void init() {
setTheme("osee");
@@ -47,19 +55,12 @@ public class OseeUiApplication extends Application {
return new OseeNavigator();
}
- protected SearchPresenter<?> createSearchPresenter() {
- return null;
- }
-
public SearchNavigator getNavigator() {
return navigator;
}
- public SearchPresenter<?> getSearchPresenter() {
+ public SearchPresenter<T, K> getSearchPresenter() {
return searchPresenter;
}
- protected SearchHeaderComponent createSearchHeaderComponent() {
- return new OseeSearchHeaderComponent();
- }
}
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 456613e..09f2580 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
@@ -26,50 +26,73 @@ import com.vaadin.ui.Link;
@SuppressWarnings("serial")
public class OseeArtifactNameLinkComponent extends HorizontalLayout {
- private boolean populated = false;
- private SearchPresenter searchPresenter = null;
+ private boolean isLayoutComplete = false;
+ private SearchPresenter<?, ?> searchPresenter = null;
private SearchNavigator navigator = null;
+ private ViewArtifact artifact = null;
+ private final Link artifactNameLink = new Link();
public OseeArtifactNameLinkComponent(ViewArtifact artifact) {
this(artifact, CssConstants.OSEE_SEARCHRESULT_ARTNAME);
}
+ public OseeArtifactNameLinkComponent(final ViewArtifact artifact, String styleName) {
+ this.artifact = artifact;
+ artifactNameLink.setStyleName(styleName);
+
+ addListener(new LayoutClickListener() {
+ @Override
+ public void layoutClick(LayoutClickEvent event) {
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) getApplication();
+ String url = "";
+ if (app != null) {
+ url = app.getRequestedDataId();
+ }
+ searchPresenter.selectArtifact(url, artifact, navigator);
+ }
+ });
+ }
+
+ public OseeArtifactNameLinkComponent() {
+ this(null, CssConstants.OSEE_SEARCHRESULT_ARTNAME);
+ }
+
@Override
public void attach() {
- if (!populated) {
- super.attach();
+ if (!isLayoutComplete) {
try {
- OseeUiApplication app = (OseeUiApplication) this.getApplication();
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) this.getApplication();
searchPresenter = app.getSearchPresenter();
navigator = app.getNavigator();
} catch (Exception e) {
- System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: (OseeUiApplication) this.getApplication() threw an exception.");
+ System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
}
+ createLayout();
+ isLayoutComplete = true;
}
- populated = true;
}
- public OseeArtifactNameLinkComponent(final ViewArtifact artifact, String styleName) {
- super();
-
- Link artifactNameLink = new Link();
- artifactNameLink.setCaption(artifact.getArtifactName());
- artifactNameLink.setStyleName(styleName);
- this.addComponent(artifactNameLink);
+ private void createLayout() {
+ if (artifact != null) {
+ artifactNameLink.setCaption(artifact.getArtifactName());
+ }
- this.addListener(new LayoutClickListener() {
+ addComponent(artifactNameLink);
+ }
- @Override
- public void layoutClick(LayoutClickEvent event) {
- searchPresenter.selectArtifact(artifact, navigator);
- }
- });
+ private void updateLayout() {
+ if (artifact != null) {
+ artifactNameLink.setCaption(artifact.getArtifactName());
+ }
+ }
- // Map<String, String> parameterMap = new HashMap<String, String>();
- // parameterMap.put(OseeRoadMapAndNavigation.ARTIFACT, artifact.getGuid());
- // String paramString = OseeRoadMapAndNavigation.parameterMapToRequestString(parameterMap);
- // Resource artifactLink = new ExternalResource(String.format("ats#AtsArtifactView%s", paramString));
- // artifactNameLink.setResource(artifactLink);
+ public ViewArtifact getArtifact() {
+ return artifact;
+ }
+ public void setArtifact(ViewArtifact artifact) {
+ this.artifact = artifact;
+ updateLayout();
}
+
}
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 d61ac10..afa603f 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
@@ -23,8 +23,17 @@ import com.vaadin.ui.Label;
public class OseeBreadcrumbComponent extends HorizontalLayout {
private ViewArtifact artifact;
- private void init() {
- this.removeAllComponents();
+ public OseeBreadcrumbComponent(ViewArtifact artifact) {
+ this.artifact = artifact;
+ createLayout();
+ }
+
+ public OseeBreadcrumbComponent() {
+ createLayout();
+ }
+
+ private void createLayout() {
+ removeAllComponents();
if (artifact != null && artifact.getAncestry() != null) {
Collection<ViewArtifact> ancestryList = artifact.getAncestry();
@@ -45,14 +54,8 @@ public class OseeBreadcrumbComponent extends HorizontalLayout {
}
}
- public OseeBreadcrumbComponent(ViewArtifact artifact) {
- this.artifact = artifact;
-
- init();
- }
-
public void setArtifact(ViewArtifact artifact) {
this.artifact = artifact;
- init();
+ createLayout();
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLeftMarginContainer.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLeftMarginContainer.java
new file mode 100644
index 0000000..4c07556
--- /dev/null
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLeftMarginContainer.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.display.view.web.components;
+
+import org.eclipse.osee.display.view.web.CssConstants;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+
+/**
+ * @author Shawn F. Cook
+ */
+@SuppressWarnings("serial")
+public class OseeLeftMarginContainer extends HorizontalLayout {
+ private Label hSpacer_LeftMargin = new Label();
+
+ public OseeLeftMarginContainer() {
+ super();
+
+ setSizeUndefined();
+
+ hSpacer_LeftMargin.setWidth(CssConstants.OSEE_LEFTMARGINWIDTH, UNITS_PIXELS);
+
+ addComponent(hSpacer_LeftMargin);
+ }
+
+}
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 e331875..8ae7a0f 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
@@ -35,6 +35,11 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
private int manyPages = 0;
private int currentPage = 0;
private final int MAX_PAGE_NUMBERS_SHOWN = 4;
+ private final Button firstButton = new Button("<< First");
+ private final Button previousButton = new Button("< Prev");
+ private final Button nextButton = new Button("Next >");
+ private final Button lastButton = new Button("Last >>");
+ private final HorizontalLayout hLayout_PageNumbers = new HorizontalLayout();
public OseePagingComponent() {
super();
@@ -49,13 +54,14 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
manyPages += 1; //round up.
}
}
+ updateLayout();
}
@Override
public void setManyItemsTotal(int manyItemsTotal) {
this.manyItemsTotal = manyItemsTotal;
updateManyPages();
- createLayout();
+ // updateLayout();<--Not needed because it is called in updateManyPages()
}
public void setCurrentPage(int currentPage) {
@@ -71,17 +77,104 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
if (manyPages == 0) {
this.currentPage = 0;
}
+ updateLayout();
+ }
+
+ private void createLayout() {
+ setSizeUndefined();
+
+ Label spacer1 = new Label();
+ spacer1.setWidth(15, UNITS_PIXELS);
+
+ Label spacer2 = new Label();
+ spacer2.setWidth(15, UNITS_PIXELS);
+
+ Label spacer3 = new Label();
+ spacer3.setWidth(15, UNITS_PIXELS);
+
+ Label spacer4 = new Label();
+ spacer4.setWidth(15, UNITS_PIXELS);
+
+ firstButton.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ OseePagingComponent.this.setCurrentPage(0);
+ fireEvent(new PageSelectedEvent(OseePagingComponent.this));
+ }
+ });
+
+ previousButton.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ OseePagingComponent.this.setCurrentPage(currentPage - 1);
+ fireEvent(new PageSelectedEvent(OseePagingComponent.this));
+ }
+ });
+
+ nextButton.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ OseePagingComponent.this.setCurrentPage(currentPage + 1);
+ fireEvent(new PageSelectedEvent(OseePagingComponent.this));
+ }
+ });
+
+ lastButton.addListener(new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ OseePagingComponent.this.setCurrentPage(manyPages - 1);
+ fireEvent(new PageSelectedEvent(OseePagingComponent.this));
+ }
+ });
+
+ addComponent(firstButton);
+ addComponent(spacer1);
+ addComponent(previousButton);
+ addComponent(spacer2);
+ addComponent(hLayout_PageNumbers);
+ addComponent(spacer3);
+ addComponent(nextButton);
+ addComponent(spacer4);
+ addComponent(lastButton);
+
+ updateLayout();
}
- private void createPageNumberLayout() {
- if (this.allItemsPerPage) {
+ private void updateLayout() {
+ if (manyPages <= 0) {
+ 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 (currentPage >= manyPages - 1) {
+ nextButton.setEnabled(false);
+ lastButton.setEnabled(false);
+ } else {
+ nextButton.setEnabled(true);
+ lastButton.setEnabled(true);
+ }
+
+ //Update page numbers
+ hLayout_PageNumbers.removeAllComponents();
+ if (allItemsPerPage) {
Label pageLabel = new Label(String.format("1"));
- this.addComponent(pageLabel);
pageLabel.setStyleName(CssConstants.OSEE_CURRENTPAGELABEL);
Label spacer = new Label();
spacer.setWidth(7, UNITS_PIXELS);
- this.addComponent(spacer);
+
+ hLayout_PageNumbers.addComponent(pageLabel);
+ hLayout_PageNumbers.addComponent(spacer);
} else {
int startPage = 0;
int endPage = manyPages - 1;
@@ -100,22 +193,23 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
if (startPage != 0) {
Label pageLabel = new Label("...");
- this.addComponent(pageLabel);
Label spacer = new Label();
spacer.setWidth(7, UNITS_PIXELS);
- this.addComponent(spacer);
+
+ hLayout_PageNumbers.addComponent(pageLabel);
+ hLayout_PageNumbers.addComponent(spacer);
}
for (int i = startPage; i <= endPage; i++) {
if (i == currentPage) {
Label pageLabel = new Label(String.format("%d", i + 1));
- this.addComponent(pageLabel);
pageLabel.setStyleName(CssConstants.OSEE_CURRENTPAGELABEL);
+
+ hLayout_PageNumbers.addComponent(pageLabel);
} else {
Button pageButton = new Button(String.format("%d", i + 1));
pageButton.setStyleName("link");
- this.addComponent(pageButton);
final int index = i;//needs to be 'final' for use with listener below
pageButton.addListener(new Button.ClickListener() {
@Override
@@ -124,108 +218,27 @@ public class OseePagingComponent extends HorizontalLayout implements PagingCompo
fireEvent(new PageSelectedEvent(OseePagingComponent.this));
}
});
+
+ hLayout_PageNumbers.addComponent(pageButton);
}
if (i <= endPage) {
Label spacer = new Label();
spacer.setWidth(7, UNITS_PIXELS);
- this.addComponent(spacer);
+ hLayout_PageNumbers.addComponent(spacer);
}
}
if (endPage != manyPages - 1) {
Label pageLabel = new Label("...");
- this.addComponent(pageLabel);
Label spacer = new Label();
spacer.setWidth(7, UNITS_PIXELS);
- this.addComponent(spacer);
- }
- }
- }
-
- private void createLayout() {
- this.removeAllComponents();
- this.setSizeUndefined();
-
- Button firstButton = new Button("<< First");
- this.addComponent(firstButton);
-
- Label spacer1 = new Label();
- spacer1.setWidth(15, UNITS_PIXELS);
- this.addComponent(spacer1);
-
- Button previousButton = new Button("< Prev");
- this.addComponent(previousButton);
-
- Label spacer2 = new Label();
- spacer2.setWidth(15, UNITS_PIXELS);
- this.addComponent(spacer2);
-
- createPageNumberLayout();
-
- Label spacer3 = new Label();
- spacer3.setWidth(15, UNITS_PIXELS);
- this.addComponent(spacer3);
- Button nextButton = new Button("Next >");
- this.addComponent(nextButton);
-
- Label spacer4 = new Label();
- spacer4.setWidth(15, UNITS_PIXELS);
- this.addComponent(spacer4);
-
- Button lastButton = new Button("Last >>");
- this.addComponent(lastButton);
-
- if (manyPages <= 0) {
- firstButton.setEnabled(false);
- previousButton.setEnabled(false);
- nextButton.setEnabled(false);
- lastButton.setEnabled(false);
- }
-
- if (currentPage <= 0) {
- firstButton.setEnabled(false);
- previousButton.setEnabled(false);
- }
-
- if (currentPage >= manyPages - 1) {
- nextButton.setEnabled(false);
- lastButton.setEnabled(false);
- }
-
- firstButton.addListener(new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- OseePagingComponent.this.setCurrentPage(0);
- fireEvent(new PageSelectedEvent(OseePagingComponent.this));
+ hLayout_PageNumbers.addComponent(pageLabel);
+ hLayout_PageNumbers.addComponent(spacer);
}
- });
-
- previousButton.addListener(new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- OseePagingComponent.this.setCurrentPage(currentPage - 1);
- fireEvent(new PageSelectedEvent(OseePagingComponent.this));
- }
- });
-
- nextButton.addListener(new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- OseePagingComponent.this.setCurrentPage(currentPage + 1);
- fireEvent(new PageSelectedEvent(OseePagingComponent.this));
- }
- });
-
- lastButton.addListener(new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- OseePagingComponent.this.setCurrentPage(manyPages - 1);
- fireEvent(new PageSelectedEvent(OseePagingComponent.this));
- }
- });
+ }
}
public interface PageSelectedListener extends Serializable {
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 1cea7a8..178f166 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,7 +38,7 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
private final ListSelect relTypesSelect = new ListSelect();
private final ListSelect leftSelect = new ListSelect();
private final ListSelect rightSelect = new ListSelect();
- private SearchPresenter<?> searchPresenter = null;
+ private SearchPresenter<?, ?> searchPresenter = null;
private SearchNavigator navigator = null;
private boolean lockRelTypesListener = false;
private boolean lockRelsListener = false;
@@ -112,7 +112,12 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
try {
ViewArtifact artifact = (ViewArtifact) leftSelect.getValue();
if (artifact != null) {
- searchPresenter.selectArtifact(artifact, navigator);
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) getApplication();
+ String url = "";
+ if (app != null) {
+ url = app.getRequestedDataId();
+ }
+ searchPresenter.selectArtifact(url, artifact, navigator);
}
} catch (Exception e) {
System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
@@ -128,7 +133,12 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
try {
ViewArtifact artifact = (ViewArtifact) rightSelect.getValue();
if (artifact != null) {
- searchPresenter.selectArtifact(artifact, navigator);
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) getApplication();
+ String url = "";
+ if (app != null) {
+ url = app.getRequestedDataId();
+ }
+ searchPresenter.selectArtifact(url, artifact, navigator);
}
} catch (Exception e) {
System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchHeaderComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchHeaderComponent.java
index 6e83b83..dc5996c 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchHeaderComponent.java
@@ -11,16 +11,14 @@
package org.eclipse.osee.display.view.web.components;
import org.eclipse.osee.display.api.components.SearchHeaderComponent;
-import com.vaadin.ui.VerticalLayout;
+import org.eclipse.osee.display.api.data.ViewSearchParameters;
+import com.vaadin.ui.CustomComponent;
/**
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class OseeSearchHeaderComponent extends VerticalLayout implements SearchHeaderComponent {
-
- protected boolean showOseeTitleAbove;
- protected boolean showVerboseSearchResults = false;
+public class OseeSearchHeaderComponent extends CustomComponent implements SearchHeaderComponent {
@Override
public void attach() {
@@ -41,18 +39,8 @@ public class OseeSearchHeaderComponent extends VerticalLayout implements SearchH
//Do nothing.
}
- public boolean isShowOseeTitleAbove() {
- return showOseeTitleAbove;
- }
-
- public void setShowOseeTitleAbove(boolean showOseeTitleAbove) {
- this.showOseeTitleAbove = showOseeTitleAbove;
- }
-
- @Override
- public void setShowVerboseSearchResults(boolean showVerboseSearchResults) {
- this.showVerboseSearchResults = showVerboseSearchResults;
- // selectSearch();
+ public void setSearchCriteria(ViewSearchParameters params) {
+ //Do nothing.
}
}
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 6519d6e..54756aa 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,10 +15,13 @@ 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.api.data.ViewSearchParameters;
+import org.eclipse.osee.display.api.search.SearchNavigator;
+import org.eclipse.osee.display.api.search.SearchPresenter;
import org.eclipse.osee.display.view.web.CssConstants;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
import org.eclipse.osee.display.view.web.components.OseePagingComponent.PageSelectedEvent;
import org.eclipse.osee.display.view.web.components.OseePagingComponent.PageSelectedListener;
import com.vaadin.Application;
@@ -41,65 +44,71 @@ import com.vaadin.ui.Window.Notification;
@SuppressWarnings("serial")
public class OseeSearchResultsListComponent extends VerticalLayout implements SearchResultsListComponent, PageSelectedListener {
- private final VerticalLayout mainLayout = new VerticalLayout();
- private final VerticalLayout bottomSpacer = new VerticalLayout();
- private final HorizontalLayout manySearchResultsHorizLayout = new HorizontalLayout();
- private final OseePagingComponent pagingComponent = new OseePagingComponent();
- private final List<OseeSearchResultComponent> resultList = new ArrayList<OseeSearchResultComponent>();
- private SearchHeaderComponent searchHeaderComponent;
+ private VerticalLayout mainLayout = new VerticalLayout();
+ private VerticalLayout bottomSpacer = new VerticalLayout();
+ private HorizontalLayout manySearchResultsHorizLayout = new HorizontalLayout();
+ private OseePagingComponent pagingComponent = new OseePagingComponent();
+ private List<OseeSearchResultComponent> resultList = new ArrayList<OseeSearchResultComponent>();
private final CheckBox showVerboseCheckBox = new CheckBox("Show Detailed Results", false);
private final ComboBox manyResultsComboBox = new ComboBox();
private final int INIT_MANY_RES_PER_PAGE = 15;
+ private final Label manySearchResults = new Label();
+ private boolean isLayoutComplete = false;
+ private SearchPresenter<?, ?> searchPresenter;
+ private SearchNavigator navigator;
- public OseeSearchResultsListComponent() {
- this(null);
+ @Override
+ public void attach() {
+ if (!isLayoutComplete) {
+ try {
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) this.getApplication();
+ searchPresenter = app.getSearchPresenter();
+ navigator = app.getNavigator();
+ } catch (Exception e) {
+ System.out.println("OseeSearchResultsListComponent.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
+ }
+ createLayout();
+ isLayoutComplete = true;
+ }
}
- public OseeSearchResultsListComponent(SearchHeaderComponent searchHeaderComponent) {
- this.setSearchHeaderComponent(searchHeaderComponent);
- this.setSizeFull();
+ @Override
+ public void clearAll() {
+ resultList.clear();
+ pagingComponent.gotoFirstPage();
+ updateManySearchResultsLabel();
+ updateSearchResultsLayout();
+ }
- manySearchResultsHorizLayout.setSizeUndefined();
+ private void createLayout() {
+ setSizeFull();
+ pagingComponent.addListener(this);
+ pagingComponent.setManyItemsPerPage(INIT_MANY_RES_PER_PAGE);
- Label spacer = new Label();
- spacer.setHeight(5, UNITS_PIXELS);
+ manySearchResultsHorizLayout.setSizeUndefined();
mainLayout.setMargin(false, false, false, true);
Panel mainLayoutPanel = new Panel();
mainLayoutPanel.setScrollable(true);
mainLayoutPanel.getContent().setSizeUndefined();
- mainLayoutPanel.setContent(mainLayout);
mainLayoutPanel.setSizeFull();
bottomSpacer.setSizeFull();
- mainLayout.addComponent(bottomSpacer);
- mainLayout.setExpandRatio(bottomSpacer, 1.0f);
-
- pagingComponent.addListener(this);
-
- this.addComponent(manySearchResultsHorizLayout);
- this.addComponent(spacer);
- this.addComponent(mainLayoutPanel);
- this.setExpandRatio(mainLayoutPanel, 1.0f);
- this.addComponent(pagingComponent);
showVerboseCheckBox.setImmediate(true);
- final boolean showVerbose = showVerboseCheckBox.toString().equalsIgnoreCase("true");
showVerboseCheckBox.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
- if (OseeSearchResultsListComponent.this.searchHeaderComponent != null) {
- OseeSearchResultsListComponent.this.searchHeaderComponent.setShowVerboseSearchResults(showVerbose);
+ boolean showVerbose = showVerboseCheckBox.toString().equalsIgnoreCase("true");
+ OseeUiApplication<?, ?> app = (OseeUiApplication<?, ?>) getApplication();
+ String url = "";
+ if (app != null) {
+ url = app.getRequestedDataId();
}
- for (OseeSearchResultComponent resultComp : resultList) {
- resultComp.setShowVerboseSearchResults(showVerbose);
- }
- updateSearchResultsLayout();
+ ViewSearchParameters params = new ViewSearchParameters(null, null, showVerbose);
+ searchPresenter.selectSearch(url, params, navigator);
}
});
- if (searchHeaderComponent != null) {
- searchHeaderComponent.setShowVerboseSearchResults(showVerbose);
- }
manyResultsComboBox.setImmediate(true);
manyResultsComboBox.setTextInputAllowed(false);
@@ -110,7 +119,6 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
manyResultsComboBox.addItem("100");
manyResultsComboBox.addItem("All");
manyResultsComboBox.setValue((new Integer(INIT_MANY_RES_PER_PAGE)).toString());
- pagingComponent.setManyItemsPerPage(INIT_MANY_RES_PER_PAGE);
manyResultsComboBox.setWidth(50, UNITS_PIXELS);
manyResultsComboBox.addListener(new Property.ValueChangeListener() {
@Override
@@ -127,89 +135,79 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
}
}
});
- }
-
- @Override
- public void clearAll() {
- resultList.clear();
- pagingComponent.gotoFirstPage();
- updateManySearchResultsLabel();
- updateSearchResultsLayout();
- }
- private void updateManySearchResultsLabel() {
- int manySearchResultComponents = resultList.size();
-
- Label manySearchResults = new Label(String.format("[%d] ", manySearchResultComponents));
- Label spacer = new Label();
- spacer.setWidth(5, UNITS_PIXELS);
+ Label hSpacer_ManyRes = new Label();
+ hSpacer_ManyRes.setWidth(5, UNITS_PIXELS);
Label manySearchResults_suffix = new Label("Results Found");
manySearchResults.setSizeUndefined();
manySearchResults_suffix.setSizeUndefined();
manySearchResults.setStyleName(CssConstants.OSEE_SEARCHRESULT_MATCH_MANY);
- manySearchResultsHorizLayout.removeAllComponents();
- manySearchResultsHorizLayout.addComponent(manySearchResults);
- manySearchResultsHorizLayout.addComponent(spacer);
- manySearchResultsHorizLayout.addComponent(manySearchResults_suffix);
+ Label hSpacer_ManyResVerbose = new Label();
+ hSpacer_ManyResVerbose.setWidth(30, UNITS_PIXELS);
- 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 hSpacer_VerbosePerPage = new Label();
+ hSpacer_VerbosePerPage.setWidth(30, UNITS_PIXELS);
+ Label hSpacer_PerPage = new Label();
+ hSpacer_PerPage.setWidth(5, UNITS_PIXELS);
Label manyResultsLabel = new Label("Results Per Page");
- manySearchResultsHorizLayout.addComponent(spacer2);
+
+ manySearchResultsHorizLayout.addComponent(manySearchResults);
+ manySearchResultsHorizLayout.addComponent(hSpacer_ManyRes);
+ manySearchResultsHorizLayout.addComponent(manySearchResults_suffix);
+ manySearchResultsHorizLayout.addComponent(hSpacer_ManyResVerbose);
+ manySearchResultsHorizLayout.addComponent(showVerboseCheckBox);
+ manySearchResultsHorizLayout.addComponent(hSpacer_VerbosePerPage);
manySearchResultsHorizLayout.addComponent(manyResultsComboBox);
- manySearchResultsHorizLayout.setComponentAlignment(manyResultsComboBox, Alignment.TOP_CENTER);
- manySearchResultsHorizLayout.addComponent(spacer3);
+ manySearchResultsHorizLayout.addComponent(hSpacer_PerPage);
manySearchResultsHorizLayout.addComponent(manyResultsLabel);
- pagingComponent.setManyItemsTotal(manySearchResultComponents);
+ mainLayoutPanel.setContent(mainLayout);
+ mainLayout.addComponent(bottomSpacer);
+
+ addComponent(manySearchResultsHorizLayout);
+ addComponent(mainLayoutPanel);
+ addComponent(pagingComponent);
+
+ manySearchResultsHorizLayout.setComponentAlignment(manyResultsComboBox, Alignment.TOP_CENTER);
+ mainLayout.setExpandRatio(bottomSpacer, 1.0f);
+ this.setExpandRatio(mainLayoutPanel, 1.0f);
}
- private final Collection<Integer> prevResultListIndices = new ArrayList<Integer>();
+ private void updateManySearchResultsLabel() {
+ 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
- pagingComponent.setManyItemsTotal(resultList.size());
Collection<Integer> resultListIndices = pagingComponent.getCurrentVisibleItemIndices();
- if (!resultListIndices.equals(prevResultListIndices)) {
- //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);
- }
+ boolean showVerbose = showVerboseCheckBox.toString().equalsIgnoreCase("true");
+
+ //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) {
- mainLayout.removeComponent(component);
- }
+ //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'
- int spacerIndex = mainLayout.getComponentIndex(bottomSpacer);
- for (Integer i : resultListIndices) {
- try {
- OseeSearchResultComponent searchResultComp = resultList.get(i);
- mainLayout.addComponent(searchResultComp, 0);
- } catch (IndexOutOfBoundsException e) {
- System.out.println("OseeSearchResultsListComponent.updateSearchResultsLayout - CRITICAL ERROR: IndexOutOfBoundsException e");
- }
+ //Next, add the result components to the layout that are on the current 'page'
+ for (Integer i : resultListIndices) {
+ try {
+ OseeSearchResultComponent searchResultComp = resultList.get(i);
+ searchResultComp.setShowVerboseSearchResults(showVerbose);
+ mainLayout.addComponent(searchResultComp, 0);
+ } catch (IndexOutOfBoundsException e) {
+ System.out.println("OseeSearchResultsListComponent.updateSearchResultsLayout - CRITICAL ERROR: IndexOutOfBoundsException e");
}
-
- //Update prevResultListIndices
- prevResultListIndices.clear();
- prevResultListIndices.addAll(resultListIndices);
}
}
@@ -217,10 +215,10 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
public SearchResultComponent createSearchResult() {
OseeSearchResultComponent searchResultComp = new OseeSearchResultComponent();
resultList.add(searchResultComp);
- // int spacerIndex = mainLayout.getComponentIndex(bottomSpacer);
- // mainLayout.addComponent(searchResultComp, spacerIndex);
updateManySearchResultsLabel();
- updateSearchResultsLayout();
+
+ int lastCompIndex = mainLayout.getComponentIndex(bottomSpacer);
+ mainLayout.addComponent(searchResultComp, lastCompIndex);
return searchResultComp;
}
@@ -244,12 +242,4 @@ 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/OseeArtifactView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
index 1e03fd2..ecf2606 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
@@ -12,40 +12,34 @@ 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.api.search.SearchPresenter;
+import org.eclipse.osee.display.view.web.AbstractCommonView;
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;
import org.eclipse.osee.display.view.web.components.OseeRelationsComponent;
-import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
-import org.eclipse.osee.vaadin.widgets.Navigator;
import com.vaadin.Application;
import com.vaadin.ui.Alignment;
-import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+import com.vaadin.ui.Window.Notification;
/**
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class OseeArtifactView extends CustomComponent implements Navigator.View, ArtifactHeaderComponent {
+public abstract class OseeArtifactView extends AbstractCommonView implements ArtifactHeaderComponent {
- protected SearchPresenter searchPresenter = null;
- protected OseeSearchHeaderComponent searchHeader;
- protected OseeRelationsComponent relationsComp = new OseeRelationsComponent();
- protected OseeAttributeComponent attributeComp = new OseeAttributeComponent();
+ protected final OseeRelationsComponent relationsComp = new OseeRelationsComponent();
+ protected final OseeAttributeComponent attributeComp = new OseeAttributeComponent();
private final OseeBreadcrumbComponent breadcrumbComp = new OseeBreadcrumbComponent(null);
+ private final OseeArtifactNameLinkComponent artifactName = new OseeArtifactNameLinkComponent();
+ private final Label artifactType = new Label("", Label.CONTENT_XHTML);
private ViewArtifact artifact;
private final int LEFTMARGIN_WIDTH = 5;
- @Override
- public void attach() {
- //TODO: remove?
- }
-
protected void createLayout() {
setSizeFull();
@@ -61,115 +55,103 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
leftMarginSpace.setWidth(LEFTMARGIN_WIDTH, UNITS_PIXELS);
hLayout_LeftMargAndBody.addComponent(leftMarginSpace);
- if (artifact != null) {
- VerticalLayout vLayout_OutBody = new VerticalLayout();
- vLayout_OutBody.setSizeFull();
-
- breadcrumbComp.setArtifact(artifact);
-
- Label vSpacer = new Label();
- vSpacer.setHeight(5, UNITS_PIXELS);
-
- OseeArtifactNameLinkComponent artifactName = new OseeArtifactNameLinkComponent(artifact);
- artifactName.setSizeUndefined();
-
- Label spacer1 = new Label();
- spacer1.setWidth(10, UNITS_PIXELS);
- spacer1.setHeight(null);
-
- Label artifactType = new Label(String.format("[%s]", artifact.getArtifactType()), Label.CONTENT_XHTML);
- artifactType.setSizeUndefined();
+ VerticalLayout vLayout_OutBody = new VerticalLayout();
+ vLayout_OutBody.setSizeFull();
- HorizontalLayout hLayout_ArtNameAndType = new HorizontalLayout();
- hLayout_ArtNameAndType.setSizeUndefined();
+ Label vSpacer = new Label();
+ vSpacer.setHeight(5, UNITS_PIXELS);
- VerticalLayout artRelSpacer = new VerticalLayout();
- artRelSpacer.setHeight(15, UNITS_PIXELS);
+ artifactName.setSizeUndefined();
- VerticalLayout vLayout_Body = new VerticalLayout();
- vLayout_Body.setMargin(false, false, false, true);
- vLayout_Body.setSizeFull();
+ Label spacer1 = new Label();
+ spacer1.setWidth(10, UNITS_PIXELS);
+ spacer1.setHeight(null);
- VerticalLayout relAttrSpacer = new VerticalLayout();
- relAttrSpacer.setHeight(15, UNITS_PIXELS);
+ artifactType.setSizeUndefined();
- VerticalLayout bottomSpacer = new VerticalLayout();
+ HorizontalLayout hLayout_ArtNameAndType = new HorizontalLayout();
+ hLayout_ArtNameAndType.setSizeUndefined();
- Panel panel_Body = new Panel();
- panel_Body.setScrollable(true);
- panel_Body.getContent().setSizeUndefined();
- panel_Body.setSizeFull();
+ VerticalLayout artRelSpacer = new VerticalLayout();
+ artRelSpacer.setHeight(15, UNITS_PIXELS);
- hLayout_ArtNameAndType.addComponent(artifactName);
- hLayout_ArtNameAndType.addComponent(spacer1);
- hLayout_ArtNameAndType.addComponent(artifactType);
+ VerticalLayout vLayout_Body = new VerticalLayout();
+ vLayout_Body.setMargin(false, false, false, true);
+ vLayout_Body.setSizeFull();
- vLayout_Body.addComponent(vSpacer);
- vLayout_Body.addComponent(hLayout_ArtNameAndType);
- vLayout_Body.addComponent(artRelSpacer);
- vLayout_Body.addComponent(relationsComp);
- vLayout_Body.addComponent(relAttrSpacer);
- vLayout_Body.addComponent(attributeComp);
- vLayout_Body.addComponent(bottomSpacer);
+ VerticalLayout relAttrSpacer = new VerticalLayout();
+ relAttrSpacer.setHeight(15, UNITS_PIXELS);
- panel_Body.setContent(vLayout_Body);
+ VerticalLayout bottomSpacer = new VerticalLayout();
- vLayout_OutBody.addComponent(breadcrumbComp);
- vLayout_OutBody.addComponent(panel_Body);
+ Panel panel_Body = new Panel();
+ panel_Body.setScrollable(true);
+ panel_Body.getContent().setSizeUndefined();
+ panel_Body.setSizeFull();
- hLayout_LeftMargAndBody.addComponent(vLayout_OutBody);
+ hLayout_ArtNameAndType.addComponent(artifactName);
+ hLayout_ArtNameAndType.addComponent(spacer1);
+ hLayout_ArtNameAndType.addComponent(artifactType);
- hLayout_ArtNameAndType.setComponentAlignment(artifactType, Alignment.BOTTOM_CENTER);
- vLayout_Body.setExpandRatio(bottomSpacer, 1.0f);
- vLayout_OutBody.setExpandRatio(panel_Body, 1.0f);
- hLayout_LeftMargAndBody.setExpandRatio(vLayout_OutBody, 1.0f);
- }
+ vLayout_Body.addComponent(vSpacer);
+ vLayout_Body.addComponent(hLayout_ArtNameAndType);
+ vLayout_Body.addComponent(artRelSpacer);
+ vLayout_Body.addComponent(relationsComp);
+ vLayout_Body.addComponent(relAttrSpacer);
+ vLayout_Body.addComponent(attributeComp);
+ vLayout_Body.addComponent(bottomSpacer);
- final VerticalLayout vertLayout = new VerticalLayout();
- vertLayout.setSizeFull();
+ panel_Body.setContent(vLayout_Body);
- vertLayout.addComponent(searchHeader);
- vertLayout.addComponent(spacer);
- vertLayout.addComponent(hLayout_LeftMargAndBody);
+ vLayout_OutBody.addComponent(breadcrumbComp);
+ vLayout_OutBody.addComponent(panel_Body);
- vertLayout.setComponentAlignment(searchHeader, Alignment.TOP_LEFT);
- vertLayout.setExpandRatio(hLayout_LeftMargAndBody, 1.0f);
+ hLayout_LeftMargAndBody.addComponent(vLayout_OutBody);
- setCompositionRoot(vertLayout);
- }
+ addComponent(searchHeader);
+ addComponent(spacer);
+ addComponent(hLayout_LeftMargAndBody);
- @Override
- public void init(Navigator navigator, Application application) {
- //Do nothing.
+ hLayout_ArtNameAndType.setComponentAlignment(artifactType, Alignment.BOTTOM_CENTER);
+ vLayout_Body.setExpandRatio(bottomSpacer, 1.0f);
+ vLayout_OutBody.setExpandRatio(panel_Body, 1.0f);
+ hLayout_LeftMargAndBody.setExpandRatio(vLayout_OutBody, 1.0f);
+ setComponentAlignment(searchHeader, Alignment.TOP_LEFT);
+ setExpandRatio(hLayout_LeftMargAndBody, 1.0f);
}
- @Override
- public String getWarningForNavigatingFrom() {
- return null;
+ private void updateLayout() {
+ if (artifact != null) {
+ breadcrumbComp.setArtifact(artifact);
+ artifactType.setCaption(String.format("[%s]", artifact.getArtifactType()));
+ artifactName.setArtifact(artifact);
+ }
}
@Override
public void clearAll() {
- this.artifact = null;
- createLayout();
+ artifact = null;
+ updateLayout();
}
@Override
public void setArtifact(ViewArtifact artifact) {
this.artifact = artifact;
- createLayout();
+ updateLayout();
}
@Override
public void setErrorMessage(String message) {
- //TODO:
- }
-
- @Override
- public void navigateTo(String requestedDataId) {
- if (searchHeader != null) {
- searchHeader.createLayout();
+ Application app = this.getApplication();
+ if (app != null) {
+ Window mainWindow = app.getMainWindow();
+ if (mainWindow != null) {
+ mainWindow.showNotification(message, Notification.TYPE_ERROR_MESSAGE);
+ } else {
+ System.out.println("OseeArtifactView.setErrorMessage - ERROR: Application.getMainWindow() returns null value.");
+ }
+ } else {
+ System.out.println("OseeArtifactView.setErrorMessage - ERROR: getApplication() returns null value.");
}
- createLayout();
}
}
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 f574161..feba489 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
@@ -10,82 +10,27 @@
*******************************************************************************/
package org.eclipse.osee.display.view.web.search;
-import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
+import org.eclipse.osee.display.view.web.AbstractCommonView;
+import org.eclipse.osee.display.view.web.components.OseeLeftMarginContainer;
import org.eclipse.osee.display.view.web.components.OseeSearchResultsListComponent;
-import org.eclipse.osee.vaadin.widgets.Navigator;
-import com.vaadin.Application;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.VerticalLayout;
/**
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class OseeSearchResultsView extends CustomComponent implements Navigator.View {
+public abstract class OseeSearchResultsView extends AbstractCommonView {
- protected OseeSearchHeaderComponent searchHeader;
protected OseeSearchResultsListComponent searchResultsListComponent = new OseeSearchResultsListComponent();
- private final int LEFTMARGIN_WIDTH = 5;
protected void createLayout() {
- setSizeFull();
-
- Label spacer = new Label();
- spacer.setHeight(5, UNITS_PIXELS);
-
- HorizontalLayout leftMarginAndBody = new HorizontalLayout();
- leftMarginAndBody.setSizeFull();
- Label leftMarginSpace = new Label("");
- leftMarginSpace.setWidth(LEFTMARGIN_WIDTH, UNITS_PIXELS);
-
+ OseeLeftMarginContainer leftMargContainer = new OseeLeftMarginContainer();
+ leftMargContainer.setSizeFull();
searchResultsListComponent.setSizeFull();
- final VerticalLayout vertLayout = new VerticalLayout();
- vertLayout.setSizeFull();
-
- leftMarginAndBody.addComponent(leftMarginSpace);
- leftMarginAndBody.addComponent(searchResultsListComponent);
-
- if (searchHeader != null) {
- searchHeader.setShowOseeTitleAbove(false);
- vertLayout.addComponent(searchHeader);
- vertLayout.setComponentAlignment(searchHeader, Alignment.TOP_LEFT);
- searchHeader.setWidth(100, UNITS_PERCENTAGE);
- searchHeader.setHeight(null);
- }
-
- vertLayout.addComponent(spacer);
- vertLayout.addComponent(leftMarginAndBody);
-
- leftMarginAndBody.setExpandRatio(searchResultsListComponent, 1.0f);
- vertLayout.setExpandRatio(leftMarginAndBody, 1.0f);
-
- setCompositionRoot(vertLayout);
- }
-
- @Override
- public void init(Navigator navigator, Application application) {
- //Do nothing.
- }
-
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new OseeSearchHeaderComponent();
- }
-
- @Override
- public void navigateTo(String requestedDataId) {
- if (searchHeader != null) {
- searchHeader.createLayout();
- }
- createLayout();
- }
+ leftMargContainer.addComponent(searchResultsListComponent);
+ addComponent(leftMargContainer);
- @Override
- public String getWarningForNavigatingFrom() {
- return null;
+ leftMargContainer.setExpandRatio(searchResultsListComponent, 1.0f);
+ setExpandRatio(leftMargContainer, 1.0f);
}
-
}
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 e75b8a7..c1888e9 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
@@ -60,27 +60,14 @@
text-align: right;
}
-.osee-expand-button {
-
-}
-
-.osee-search-header-component-large {
-}
-
.osee-search-header-component-small {
background: #AAAAAA;
-}
-
-.osee-search-header-component-footer {
- background: #555555;
- height: 1px;
-}
-
-.osee-title-large {
-}
-
-.osee-title-large-text {
- font-size: 100px;
+ border-color: #555555;
+ border-top-style:solid;
+ border-right-style:none;
+ border-bottom-style:solid;
+ border-left-style:none;
+ border-width:1px;
}
.osee-title-medium-text a img {
@@ -109,7 +96,6 @@
}
.osee-searchresult-match-many {
- font-size: 12px;
font-weight: bold;
color: black;
}
@@ -164,4 +150,16 @@
font-size: 14px;
}
+.red {
+ border-color: red;
+ border-style:solid;
+ border-width:2px;
+}
+
+.v-orderedlayout-spacing-on,
+.v-horizontallayout-spacing-on,
+.v-verticallayout-spacing-on {
+ padding-top: 0px;
+ padding-left: 0px;
+}