summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-11 15:14:22 (EDT)
committerRoberto E. Escobar2011-10-11 15:14:22 (EDT)
commitc60b79e3aca19db0d32628f2806ed0fb0be2d0b0 (patch)
treef2a5f9de0998bdb14f29bc39606ba49017070cf3
parent0d038ed5dfb1179f67146093194fcfc348ac64ed (diff)
downloadorg.eclipse.osee-c60b79e3aca19db0d32628f2806ed0fb0be2d0b0.zip
org.eclipse.osee-c60b79e3aca19db0d32628f2806ed0fb0be2d0b0.tar.gz
org.eclipse.osee-c60b79e3aca19db0d32628f2806ed0fb0be2d0b0.tar.bz2
feature[ats_Q9NLC]: Convert SearchHeaderComp to be singleton
-rw-r--r--plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java90
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java1
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java21
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java11
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsArtifactView.java34
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java14
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java10
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java7
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java44
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java12
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java18
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java18
12 files changed, 153 insertions, 127 deletions
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 2836520..a57f287 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
@@ -36,12 +36,6 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
private static final AtsSearchPresenter<AtsSearchHeaderComponentInterface> atsBackend =
new MockAtsWebSearchPresenter();
- private String url = "";
-
- private WebId program = new WebId("", "");
- private WebId build = new WebId("", "");
- private boolean nameOnly = false;
- private String searchPhrase = "";
// *** TEST DATA ***
WebId build0 = new WebId("baseline_guid", "Baseline");
@@ -96,17 +90,6 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
artifact.setAttr_Subsystm("Communications");
artifact.setAttr_TechPerfParam("False");
}
-
- // Create a large list of artifacts
- // for (int i = 0; i < 20; i++) {
- // WebArtifact art =
- // new WebArtifact(String.format("SWReq_GUID_%d", i),
- // String.format("SW Req Bulk Artifact (%d)", i),
- // "Software Requirement", Arrays.asList(swreqs), new
- // WebId(String.format("branch_id_bulk_", i),
- // String.format("branch_id_bulk_", i)));
- // artifacts.put(art.getGuid(), art);
- // }
}
@Override
@@ -140,8 +123,6 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
headerComponent.addProgram(entry.getKey());
}
}
- setSearchHeaderCriteria(headerComponent);
- // headerComponent.setProgram(program0);
}
}
@@ -153,13 +134,6 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
@Override
public void initArtifactPage(String url, AtsSearchHeaderComponentInterface searchHeaderComp, ArtifactHeaderComponent artHeaderComp, RelationComponent relComp, AttributeComponent attrComp) {
- this.url = url;
- updateSearchHeaderCriteria(url);
- try {
- initSearchHome(searchHeaderComp);
- } catch (Exception e) {
- System.out.println("AtsWebSearchPresenter_TestBackend.initArtifactPage - CRITICAL ERROR: cast threw exception.");
- }
artHeaderComp.clearAll();
Map<String, String> params = requestStringToParameterMap(url);
if (params != null && params.size() > 0) {
@@ -218,42 +192,40 @@ public class MockAtsWebSearchPresenter implements AtsSearchPresenter<AtsSearchHe
}
}
- private void updateSearchHeaderCriteria(String url) {
- Map<String, String> params = requestStringToParameterMap(url);
-
- 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;
- }
- }
- }
-
- private void setSearchHeaderCriteria(AtsSearchHeaderComponentInterface searchHeaderComponent) {
- if (searchHeaderComponent != null) {
- this.selectProgram(program, searchHeaderComponent);
- searchHeaderComponent.setSearchCriteria(program, build, nameOnly, searchPhrase);
- }
- }
+ // private void updateAndSetSearchHeaderCriteria(String url, AtsSearchHeaderComponentInterface searchHeaderComponent) {
+ // Map<String, String> params = requestStringToParameterMap(url);
+ // WebId program = new WebId("", "");
+ // WebId build = new WebId("", "");
+ // 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, AtsSearchHeaderComponentInterface searchHeaderComponent, SearchResultsListComponent resultsComponent) {
- this.url = url;
- updateSearchHeaderCriteria(url);
- initSearchHome(searchHeaderComponent);
if (resultsComponent != null) {
resultsComponent.clearAll();
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 d58c829..3873319 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
@@ -18,6 +18,7 @@ import org.eclipse.osee.vaadin.widgets.Navigator;
/**
* @author Shawn F. Cook
*/
+@SuppressWarnings("serial")
public class AtsNavigator extends Navigator implements SearchNavigator {
@Override
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 ccaae23..53847d7 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
@@ -11,6 +11,8 @@
package org.eclipse.osee.ats.view.web;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
+import org.eclipse.osee.ats.view.web.components.AtsSearchHeaderComponent;
+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;
@@ -42,7 +44,7 @@ public class AtsUiApplication extends OseeUiApplication {
try {
nav = (AtsNavigator) this.navigator;
} catch (Exception e) {
- System.out.println("AtsUiApplication.getAtsNavigator() - CRITICAL ERROR: (AtsNavigator) this.navigator threw an exception.");
+ System.out.println("AtsUiApplication.getAtsNavigator() - CRITICAL ERROR: cast threw an exception.");
}
return nav;
}
@@ -52,7 +54,7 @@ public class AtsUiApplication extends OseeUiApplication {
try {
pres = (AtsSearchPresenter) this.searchPresenter;
} catch (Exception e) {
- System.out.println("AtsUiApplication.getAtsWebSearchPresenter() - CRITICAL ERROR: (AtsWebSearchPresenter) this.searchPresenter threw an exception.");
+ System.out.println("AtsUiApplication.getAtsWebSearchPresenter() - CRITICAL ERROR: cast threw an exception.");
}
return pres;
}
@@ -61,4 +63,19 @@ public class AtsUiApplication extends OseeUiApplication {
protected SearchNavigator createNavigator() {
return new AtsNavigator();
}
+
+ @Override
+ protected SearchHeaderComponent createSearchHeaderComponent() {
+ return new AtsSearchHeaderComponent();
+ }
+
+ public AtsSearchHeaderComponent getAtsSearchHeaderComponent() {
+ AtsSearchHeaderComponent searchHeader = null;
+ try {
+ searchHeader = (AtsSearchHeaderComponent) 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/components/AtsSearchHeaderComponent.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
index b32afa3..7f267f0 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java
@@ -45,7 +45,6 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
private final ComboBox buildCombo;
private final CheckBox nameOnlyCheckBox;
private final TextField searchTextField;
- private final boolean showOseeTitleAbove;
private AtsSearchPresenter searchPresenter;
private AtsNavigator navigator;
private boolean lockProgramCombo = false;
@@ -57,11 +56,11 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
AtsUiApplication app = (AtsUiApplication) this.getApplication();
searchPresenter = app.getAtsWebSearchPresenter();
navigator = app.getAtsNavigator();
- createLayout();
} catch (Exception e) {
System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
}
}
+ createLayout();
populated = true;
}
@@ -80,7 +79,6 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
if (programCombo != null) {
programCombo.setNullSelectionAllowed(false);
- final AtsSearchHeaderComponentInterface me = this;
programCombo.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
@@ -98,8 +96,13 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
searchTextField.setImmediate(true);
}
+ public AtsSearchHeaderComponent() {
+ this(true);
+ }
+
@Override
- protected void createLayout() {
+ public void createLayout() {
+ this.removeAllComponents();
setHeight(null);
setWidth(100, UNITS_PERCENTAGE);
setStyleName(CssConstants.OSEE_SEARCH_HEADER_COMPONENT);
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 7089d4a..588ddce 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
@@ -10,18 +10,44 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web.search;
-import org.eclipse.osee.ats.view.web.components.AtsSearchHeaderComponent;
+import org.eclipse.osee.ats.view.web.AtsUiApplication;
import org.eclipse.osee.display.view.web.search.OseeArtifactView;
-import org.eclipse.osee.display.view.web.search.OseeSearchHeaderComponent;
/**
* @author Shawn F. Cook
*/
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.");
+ }
+ }
+ populated = true;
+ }
+
@Override
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new AtsSearchHeaderComponent(false);
+ 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);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java
index e79c44a..f9d40af 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java
@@ -13,7 +13,6 @@ 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.AtsSearchHeaderComponent;
-import org.eclipse.osee.display.view.web.search.OseeSearchHeaderComponent;
import org.eclipse.osee.display.view.web.search.OseeSearchHomeView;
/**
@@ -29,8 +28,9 @@ public class AtsSearchHomeView extends OseeSearchHomeView {
public void attach() {
if (!populated) {
try {
- AtsUiApplication app = (AtsUiApplication) getApplication();
- searchPresenter = app.getAtsWebSearchPresenter();
+ AtsUiApplication atsApp = (AtsUiApplication) getApplication();
+ searchPresenter = atsApp.getAtsWebSearchPresenter();
+ searchHeader = atsApp.getAtsSearchHeaderComponent();
callInitSearchHome();
createLayout();
} catch (Exception e) {
@@ -40,15 +40,10 @@ public class AtsSearchHomeView extends OseeSearchHomeView {
populated = true;
}
- @Override
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new AtsSearchHeaderComponent(true);
- }
-
private void callInitSearchHome() {
if (searchPresenter != null) {
try {
- AtsSearchHeaderComponent atsSearchHeaderComp = (AtsSearchHeaderComponent) oseeSearchHeader;
+ AtsSearchHeaderComponent atsSearchHeaderComp = (AtsSearchHeaderComponent) searchHeader;
searchPresenter.initSearchHome(atsSearchHeaderComp);
} catch (Exception e) {
System.out.println("OseeArtifactNameLinkComponent.navigateTo - CRITICAL ERROR: casting threw an exception.");
@@ -58,6 +53,7 @@ public class AtsSearchHomeView extends OseeSearchHomeView {
@Override
public void navigateTo(String requestedDataId) {
+ super.navigateTo(requestedDataId);
callInitSearchHome();
}
}
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 27d6c4e..d59842b 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
@@ -27,13 +27,15 @@ public class AtsSearchResultsView extends OseeSearchResultsView {
private boolean populated = false;
private AtsSearchPresenter searchPresenter;
+ private String requestedDataId = "";
@Override
public void attach() {
if (!populated) {
try {
- AtsUiApplication app = (AtsUiApplication) this.getApplication();
- searchPresenter = app.getAtsWebSearchPresenter();
+ AtsUiApplication atsApp = (AtsUiApplication) this.getApplication();
+ searchPresenter = atsApp.getAtsWebSearchPresenter();
+ searchHeader = atsApp.getAtsSearchHeaderComponent();
callInitSearchHome();
createLayout();
} catch (Exception e) {
@@ -51,17 +53,17 @@ public class AtsSearchResultsView extends OseeSearchResultsView {
private void callInitSearchHome() {
if (searchPresenter != null) {
try {
- searchPresenter.initSearchResults(requestedDataId, (AtsSearchHeaderComponentInterface) oseeSearchHeader,
+ searchPresenter.initSearchResults(requestedDataId, (AtsSearchHeaderComponentInterface) searchHeader,
searchResultsListComponent);
} catch (Exception e) {
System.out.println("AtsSearchResultsView.callInitSearchHome - CRITICAL ERROR: casting threw an exception.");
}
}
}
- private String requestedDataId = "";
@Override
public void navigateTo(String requestedDataId) {
+ super.navigateTo(requestedDataId);
this.requestedDataId = requestedDataId;
callInitSearchHome();
}
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 ac18522..3cd2ca1 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
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.display.view.web;
+import org.eclipse.osee.display.api.components.SearchHeaderComponent;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
+import org.eclipse.osee.display.view.web.search.OseeSearchHeaderComponent;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import com.vaadin.Application;
@@ -23,6 +25,7 @@ public class OseeUiApplication extends Application {
protected final SearchNavigator navigator = createNavigator();
protected SearchPresenter searchPresenter;
+ protected SearchHeaderComponent searchHeaderComponent = createSearchHeaderComponent();
public OseeUiApplication(SearchPresenter searchPresenter) {
this.searchPresenter = searchPresenter;
@@ -54,4 +57,8 @@ public class OseeUiApplication extends Application {
public SearchPresenter 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/search/OseeArtifactView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
index d3eaf67..7366f60 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
@@ -13,7 +13,6 @@ package org.eclipse.osee.display.view.web.search;
import org.eclipse.osee.display.api.components.ArtifactHeaderComponent;
import org.eclipse.osee.display.api.data.WebArtifact;
import org.eclipse.osee.display.api.search.SearchPresenter;
-import org.eclipse.osee.display.view.web.OseeUiApplication;
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;
@@ -32,9 +31,8 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeArtifactView extends CustomComponent implements Navigator.View, ArtifactHeaderComponent {
- private boolean populated = false;
protected SearchPresenter searchPresenter = null;
- protected OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
+ protected OseeSearchHeaderComponent searchHeader;
protected OseeRelationsComponent relationsComp = new OseeRelationsComponent();
protected OseeAttributeComponent attributeComp = new OseeAttributeComponent();
private final OseeBreadcrumbComponent breadcrumbComp = new OseeBreadcrumbComponent(null);
@@ -45,7 +43,7 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
//TODO: remove?
}
- private void createLayout() {
+ protected void createLayout() {
setSizeFull();
HorizontalLayout leftMarginAndBody = new HorizontalLayout();
@@ -88,10 +86,10 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
}
final VerticalLayout vertLayout = new VerticalLayout();
- vertLayout.addComponent(oseeSearchHeader);
- vertLayout.setComponentAlignment(oseeSearchHeader, Alignment.TOP_LEFT);
- oseeSearchHeader.setWidth(100, UNITS_PERCENTAGE);
- oseeSearchHeader.setHeight(null);
+ vertLayout.addComponent(searchHeader);
+ vertLayout.setComponentAlignment(searchHeader, Alignment.TOP_LEFT);
+ searchHeader.setWidth(100, UNITS_PERCENTAGE);
+ searchHeader.setHeight(null);
vertLayout.addComponent(leftMarginAndBody);
vertLayout.setExpandRatio(leftMarginAndBody, 1.0f);
@@ -105,32 +103,10 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
}
@Override
- public void navigateTo(String requestedDataId) {
- if (!populated) {
- try {
- OseeUiApplication app = (OseeUiApplication) this.getApplication();
- searchPresenter = app.getSearchPresenter();
- } catch (Exception e) {
- System.out.println("OseeArtifactView.attach - CRITICAL ERROR: (OseeUiApplication) this.getApplication() threw an exception.");
- }
- }
- populated = true;
-
- if (searchPresenter != null) {
- searchPresenter.initArtifactPage(requestedDataId, oseeSearchHeader, this, relationsComp, attributeComp);
- }
- createLayout();
- }
-
- @Override
public String getWarningForNavigatingFrom() {
return null;
}
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new OseeSearchHeaderComponent();
- }
-
@Override
public void clearAll() {
this.artifact = null;
@@ -147,4 +123,12 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
public void setErrorMessage(String message) {
//TODO:
}
+
+ @Override
+ public void navigateTo(String requestedDataId) {
+ if (searchHeader != null) {
+ searchHeader.createLayout();
+ }
+ createLayout();
+ }
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
index cb8d27c..6451e16 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHeaderComponent.java
@@ -19,12 +19,14 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeSearchHeaderComponent extends VerticalLayout implements SearchHeaderComponent {
+ protected boolean showOseeTitleAbove;
+
@Override
public void attach() {
createLayout();
}
- protected void createLayout() {
+ public void createLayout() {
//Do nothing.
}
@@ -38,4 +40,12 @@ public class OseeSearchHeaderComponent extends VerticalLayout implements SearchH
//Do nothing.
}
+ public boolean isShowOseeTitleAbove() {
+ return showOseeTitleAbove;
+ }
+
+ public void setShowOseeTitleAbove(boolean showOseeTitleAbove) {
+ this.showOseeTitleAbove = showOseeTitleAbove;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java
index 64a3240..0230a42 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java
@@ -22,7 +22,7 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeSearchHomeView extends CustomComponent implements Navigator.View {
- protected final OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
+ protected OseeSearchHeaderComponent searchHeader;
protected void createLayout() {
this.setSizeFull();
@@ -30,19 +30,21 @@ public class OseeSearchHomeView extends CustomComponent implements Navigator.Vie
final VerticalLayout vertLayout = new VerticalLayout();
vertLayout.setSizeFull();
- vertLayout.addComponent(oseeSearchHeader);
- vertLayout.setComponentAlignment(oseeSearchHeader, Alignment.MIDDLE_CENTER);
+ if (searchHeader != null) {
+ searchHeader.setShowOseeTitleAbove(true);
+ vertLayout.addComponent(searchHeader);
+ vertLayout.setComponentAlignment(searchHeader, Alignment.MIDDLE_CENTER);
+ }
setCompositionRoot(vertLayout);
}
- protected OseeSearchHeaderComponent getOseeSearchHeader() {
- return new OseeSearchHeaderComponent();
- }
-
@Override
public void navigateTo(String requestedDataId) {
- //Do nothing
+ if (searchHeader != null) {
+ searchHeader.createLayout();
+ }
+ createLayout();
}
@Override
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
index 80578ee..3b13a7d 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
@@ -25,7 +25,7 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeSearchResultsView extends CustomComponent implements Navigator.View {
- protected final OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
+ protected OseeSearchHeaderComponent searchHeader;
protected final OseeSearchResultsListComponent searchResultsListComponent = new OseeSearchResultsListComponent();
protected void createLayout() {
@@ -43,10 +43,13 @@ public class OseeSearchResultsView extends CustomComponent implements Navigator.
leftMarginAndBody.setExpandRatio(searchResultsListComponent, 1.0f);
final VerticalLayout vertLayout = new VerticalLayout();
- vertLayout.addComponent(oseeSearchHeader);
- vertLayout.setComponentAlignment(oseeSearchHeader, Alignment.TOP_LEFT);
- oseeSearchHeader.setWidth(100, UNITS_PERCENTAGE);
- oseeSearchHeader.setHeight(null);
+ 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(leftMarginAndBody);
vertLayout.setExpandRatio(leftMarginAndBody, 1.0f);
@@ -65,7 +68,10 @@ public class OseeSearchResultsView extends CustomComponent implements Navigator.
@Override
public void navigateTo(String requestedDataId) {
- //Do nothing
+ if (searchHeader != null) {
+ searchHeader.createLayout();
+ }
+ createLayout();
}
@Override