summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-10 16:59:54 (EDT)
committerRoberto E. Escobar2011-10-10 16:59:54 (EDT)
commita48a846162f067ce98267265991f6d9180dd69d6 (patch)
tree6ec1266bcd1b38edd7ac1cd99a0ffc04d2956905
parent7336e2869f37285384361636efe8b93212298397 (diff)
downloadorg.eclipse.osee-a48a846162f067ce98267265991f6d9180dd69d6.zip
org.eclipse.osee-a48a846162f067ce98267265991f6d9180dd69d6.tar.gz
org.eclipse.osee-a48a846162f067ce98267265991f6d9180dd69d6.tar.bz2
feature[ats_Q9NLC]: Move AppData into Application. Fix NPE
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java47
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java69
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java82
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java3
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderComponent.java35
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchHomeView.java40
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/search/AtsSearchResultsView.java49
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java82
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeFooter.java16
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java53
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeArtifactNameLinkComponent.java22
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeRelationsComponent.java44
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeSearchResultsListComponent.java7
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java33
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchHomeView.java22
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java18
16 files changed, 321 insertions, 301 deletions
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java
deleted file mode 100644
index 6aa2823..0000000
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsAppData.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Boeing.
- * All rightsimport com.vaadin.Application;
-import com.vaadin.service.ApplicationContext.TransactionListener;
-he 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.ats.view.web;
-
-import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
-import org.eclipse.osee.display.api.search.SearchNavigator;
-import org.eclipse.osee.display.api.search.SearchPresenter;
-import org.eclipse.osee.display.view.web.OseeAppData;
-import com.vaadin.Application;
-
-/**
- * @author Shawn F. Cook AppData contains thread-safe session-global data based on Vaadin demonstation:
- * https://vaadin.com/book/-/page/advanced.global.html
- */
-public class AtsAppData extends OseeAppData {
-
- public AtsAppData(Application app) {
- super(app);
- }
-
- public static AtsNavigator getAtsNavigator() {
- return (AtsNavigator) OseeAppData.getNavigator();
- }
-
- public static AtsSearchPresenter getAtsWebSearchPresenter() {
- return (AtsSearchPresenter) OseeAppData.getSearchPresenter();
- }
-
- @Override
- protected SearchNavigator createNavigator() {
- return new AtsNavigator();
- }
-
- @Override
- protected SearchPresenter createSearchPresenter() {
- return AtsWebSearchPresenter_TestBackend.getInstance();
- }
-}
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 279f993..3a55417 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,62 +11,57 @@
package org.eclipse.osee.ats.view.web;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
+import org.eclipse.osee.display.api.search.SearchNavigator;
+import org.eclipse.osee.display.api.search.SearchPresenter;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
import org.eclipse.osee.vaadin.widgets.HasViews;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.FrameworkUtil;
-import com.vaadin.Application;
import com.vaadin.ui.Window;
/**
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class AtsUiApplication extends Application {
-
- private final AtsSearchPresenter atsBackend = AtsWebSearchPresenter_TestBackend.getInstance();
+public class AtsUiApplication extends OseeUiApplication {
@Override
public void init() {
- setTheme("osee");
- @SuppressWarnings("unused")
- AtsAppData sessionData = new AtsAppData(this);
+ super.init();
+
AtsWindowFactory factory = new AtsWindowFactory();
HasViews viewProvider = new AtsUiViews();
- Window mainWindow = factory.createNavigatableWindow(viewProvider);
+ Window mainWindow = factory.createNavigatableWindow(viewProvider, getAtsNavigator());
setMainWindow(mainWindow);
mainWindow.setApplication(this);
}
- @Override
- public String getVersion() {
- Bundle bundle = FrameworkUtil.getBundle(this.getClass());
- return bundle.getVersion().toString();
+ public AtsNavigator getAtsNavigator() {
+ AtsNavigator nav = null;
+ try {
+ nav = (AtsNavigator) this.navigator;
+ } catch (Exception e) {
+ System.out.println("AtsUiApplication.getAtsNavigator() - CRITICAL ERROR: (AtsNavigator) this.navigator threw an exception.");
+ }
+ return nav;
}
public AtsSearchPresenter getAtsWebSearchPresenter() {
- return atsBackend;
+ AtsSearchPresenter pres = null;
+ try {
+ pres = (AtsSearchPresenter) this.searchPresenter;
+ } catch (Exception e) {
+ System.out.println("AtsUiApplication.getAtsWebSearchPresenter() - CRITICAL ERROR: (AtsWebSearchPresenter) this.searchPresenter threw an exception.");
+ }
+ return pres;
+ }
+
+ @Override
+ protected SearchNavigator createNavigator() {
+ return new AtsNavigator();
+ }
+
+ @Override
+ protected SearchPresenter createSearchPresenter() {
+ return AtsWebSearchPresenter_TestBackend.getInstance();
}
- // @Override
- // public Window getWindow(String name) {
- // // If the window is identified by name, we are good to go
- // Window w = super.getWindow(name);
- //
- // // If not, we must create a new window for this new browser window/tab
- // if (w == null) {
- //
- // // Use the random name given by the framework to identify this
- // // window in future
- // AtsWindowFactory factory = new AtsWindowFactory();
- // HasViews viewProvider = new AtsUiViews();
- // Window mainWindow = factory.createNavigatableWindow(viewProvider);
- // mainWindow.setName(name);
- // addWindow(mainWindow);
- //
- // // Move to the url to remember the name in the future
- // mainWindow.open(new ExternalResource(mainWindow.getURL()));
- // }
- //
- // return w;
- // }
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
index b05c917..2b01cd1 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWebSearchPresenter_TestBackend.java
@@ -37,8 +37,14 @@ import org.eclipse.osee.display.view.web.UrlParamNameConstants;
public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
private static final AtsSearchPresenter atsBackend = new AtsWebSearchPresenter_TestBackend();
+ private String url = "";
- //*** TEST DATA ***
+ 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");
WebId build1 = new WebId("bld_1_guid", "Bld_1");
WebId build2 = new WebId("ftb0_guid", "FTP0");
@@ -69,31 +75,11 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
public AtsWebSearchPresenter_TestBackend() {
super();
- //populate test data
+ // populate test data
programsAndBuilds.put(program0, Arrays.asList(build0, build1, build2));
programsAndBuilds.put(program1, Arrays.asList(build3, build4, build5));
programsAndBuilds.put(program2, Arrays.asList(build6, build7));
- // Map<RelationType, Collection<Artifact>> swreqsRelations = new HashMap<RelationType, Collection<Artifact>>();
- // swreqsRelations.put(RelationType.PARENT, Arrays.asList(defaultroot));
- // Artifact swreqs = new Artifact("SWReq_GUID", "Software Requirements", "Folder", swreqsRelations);
- //
- // Map<RelationType, Collection<Artifact>> crewIntRelations = new HashMap<RelationType, Collection<Artifact>>();
- // crewIntRelations.put(RelationType.PARENT, Arrays.asList(swreqs));
- // Artifact crewIntreqs = new Artifact("CrewInt_GUID", "Crew Interface", "Folder", crewIntRelations);
- //
- // Map<RelationType, Collection<Artifact>> commSubSysCrewIntRelations =
- // new HashMap<RelationType, Collection<Artifact>>();
- // commSubSysCrewIntRelations.put(RelationType.PARENT, Arrays.asList(crewIntreqs));
- // Artifact commSubSysCrewIntreqs =
- // new Artifact("commSubSysCrewInt_GUID", "Communication Subsystem Crew Interface", "Heading",
- // commSubSysCrewIntRelations);
- //
- // Map<RelationType, Collection<Artifact>> comm_page_Relations = new HashMap<RelationType, Collection<Artifact>>();
- // comm_page_Relations.put(RelationType.PARENT, Arrays.asList(commSubSysCrewIntreqs));
- // Artifact comm_page_Intreqs =
- // new Artifact("com_page_GUID", "{COM_PAGE}", "Software Requirement", comm_page_Relations);
-
artifacts.put(defaultroot.getGuid(), defaultroot);
artifacts.put(swreqs.getGuid(), swreqs);
artifacts.put(crewIntreqs.getGuid(), crewIntreqs);
@@ -111,6 +97,17 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
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
@@ -144,7 +141,8 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
headerComponent.addProgram(entry.getKey());
}
}
- // headerComponent.setProgram(program0);
+ setSearchHeaderCriteria(headerComponent);
+ // headerComponent.setProgram(program0);
}
}
@@ -161,8 +159,13 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
@Override
public void initArtifactPage(String url, SearchHeaderComponent searchHeaderComp, ArtifactHeaderComponent artHeaderComp, RelationComponent relComp, AttributeComponent attrComp) {
- initSearchHome(searchHeaderComp);
- setSearchHeaderCriteria(url, (AtsSearchHeaderComponentInterface) searchHeaderComp);
+ this.url = url;
+ updateSearchHeaderCriteria(url);
+ try {
+ initSearchHome((AtsSearchHeaderComponentInterface) 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) {
@@ -181,7 +184,7 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
relComp.addRelationType(swReqRelationType);
attrComp.clearAll();
- attrComp.addAttribute("type1", "value1");
+ attrComp.addAttribute("type", "value");
}
}
}
@@ -210,22 +213,18 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
for (WebId build : builds) {
headerComponent.addBuild(build);
}
- // headerComponent.setBuild(builds.iterator().next());
+ // headerComponent.setBuild(builds.iterator().next());
}
}
}
@Override
public void initSearchResults(String url, SearchHeaderComponent searchHeaderComp, SearchResultsListComponent searchResultsComp) {
- //Do nothing
+ // Do nothing
}
- private void setSearchHeaderCriteria(String url, AtsSearchHeaderComponentInterface searchHeaderComponent) {
+ private void updateSearchHeaderCriteria(String url) {
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);
@@ -241,12 +240,14 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
nameOnly = nameOnlyStr.equalsIgnoreCase("true");
}
- searchPhrase = params.get(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE);
- if (searchPhrase == null) {
- searchPhrase = "";
+ 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);
@@ -255,9 +256,9 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
@Override
public void initSearchResults(String url, AtsSearchHeaderComponentInterface searchHeaderComponent, SearchResultsListComponent resultsComponent) {
-
+ this.url = url;
+ updateSearchHeaderCriteria(url);
initSearchHome(searchHeaderComponent);
- setSearchHeaderCriteria(url, searchHeaderComponent);
if (resultsComponent != null) {
resultsComponent.clearAll();
@@ -277,7 +278,8 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
private static Map<String, String> requestStringToParameterMap(String requestedDataId) {
Map<String, String> parameters = new HashMap<String, String>();
- //TODO: Need better error detection for malformed parameter strings here.
+ // TODO: Need better error detection for malformed parameter strings
+ // here.
if (requestedDataId != null) {
String[] tokens = requestedDataId.split("/");
@@ -297,7 +299,7 @@ public class AtsWebSearchPresenter_TestBackend implements AtsSearchPresenter {
private static String parameterMapToRequestString(Map<String, String> parameters) {
String requestedDataId = "/";
- //TODO: Need to properly encode the URI parameters here.
+ // TODO: Need to properly encode the URI parameters here.
Set<Entry<String, String>> keyValuePairs = parameters.entrySet();
for (Iterator<Entry<String, String>> iter = keyValuePairs.iterator(); iter.hasNext();) {
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
index b298714..3eda921 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
@@ -29,8 +29,7 @@ import com.vaadin.ui.Window;
@SuppressWarnings("serial")
public class AtsWindowFactory {
- public Window createNavigatableWindow(HasViews provider) {
- AtsNavigator navigator = AtsAppData.getAtsNavigator();
+ public Window createNavigatableWindow(HasViews provider, AtsNavigator navigator) {
VerticalLayout layout = new VerticalLayout();
final Window w = new Window("OSEE", layout);
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 cc0a277..b32afa3 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
@@ -12,8 +12,8 @@ package org.eclipse.osee.ats.view.web.components;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponentInterface;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
-import org.eclipse.osee.ats.view.web.AtsAppData;
import org.eclipse.osee.ats.view.web.AtsNavigator;
+import org.eclipse.osee.ats.view.web.AtsUiApplication;
import org.eclipse.osee.ats.view.web.search.AtsSearchHomeView;
import org.eclipse.osee.display.api.data.WebId;
import org.eclipse.osee.display.view.web.CssConstants;
@@ -40,31 +40,34 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implements AtsSearchHeaderComponentInterface, Handler {
- private boolean populated;
+ private boolean populated = false;
private final ComboBox programCombo;
private final ComboBox buildCombo;
private final CheckBox nameOnlyCheckBox;
private final TextField searchTextField;
private final boolean showOseeTitleAbove;
- private final AtsSearchPresenter atsBackend;
- private final AtsNavigator atsNavigator;
+ private AtsSearchPresenter searchPresenter;
+ private AtsNavigator navigator;
private boolean lockProgramCombo = false;
@Override
public void attach() {
- if (populated) {
- // Only populate the layout once
- return;
+ if (!populated) {
+ try {
+ 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;
}
private void selectSearch() {
WebId program = (WebId) programCombo.getValue();
- atsBackend.selectProgram(program, this);
+ searchPresenter.selectProgram(program, this);
}
public AtsSearchHeaderComponent(boolean showOseeTitleAbove) {
@@ -74,8 +77,6 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
buildCombo = new ComboBox("Build:");
nameOnlyCheckBox = new CheckBox("Name Only", false);
searchTextField = new TextField();
- atsBackend = AtsAppData.getAtsWebSearchPresenter();
- atsNavigator = AtsAppData.getAtsNavigator();
if (programCombo != null) {
programCombo.setNullSelectionAllowed(false);
@@ -136,7 +137,9 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
WebId build = (WebId) buildCombo.getValue();
boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
String searchPhrase = (String) searchTextField.getValue();
- atsBackend.selectSearch(program, build, nameOnly, searchPhrase, atsNavigator);
+ if (searchPresenter != null) {
+ searchPresenter.selectSearch(program, build, nameOnly, searchPhrase, navigator);
+ }
}
});
hLayoutRow2.addComponent(searchTextField);
@@ -147,7 +150,7 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
if (showOseeTitleAbove) {
OseeLogoLink oseeTitleLabel =
- new OseeLogoLink(atsNavigator, CssConstants.OSEE_TITLE_LARGE_TEXT, AtsSearchHomeView.class);
+ new OseeLogoLink(navigator, CssConstants.OSEE_TITLE_LARGE_TEXT, AtsSearchHomeView.class);
hLayoutRow0.addComponent(oseeTitleLabel);
hLayoutRow0.setComponentAlignment(oseeTitleLabel, Alignment.MIDDLE_CENTER);
oseeTitleLabel.setStyleName(CssConstants.OSEE_TITLE_LARGE_TEXT);
@@ -164,7 +167,7 @@ public class AtsSearchHeaderComponent extends OseeSearchHeaderComponent implemen
setComponentAlignment(hLayoutRow2, Alignment.MIDDLE_CENTER);
} else {
OseeLogoLink oseeTitleLabel =
- new OseeLogoLink(atsNavigator, CssConstants.OSEE_TITLE_MEDIUM_TEXT, AtsSearchHomeView.class);
+ new OseeLogoLink(navigator, CssConstants.OSEE_TITLE_MEDIUM_TEXT, AtsSearchHomeView.class);
Label spacer4 = new Label("");
spacer4.setWidth(15, UNITS_PIXELS);
oseeTitleLabel.setHeight(70, UNITS_PIXELS);
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 3e2e670..e79c44a 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * 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
@@ -11,7 +11,7 @@
package org.eclipse.osee.ats.view.web.search;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
-import org.eclipse.osee.ats.view.web.AtsAppData;
+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;
@@ -22,11 +22,22 @@ import org.eclipse.osee.display.view.web.search.OseeSearchHomeView;
@SuppressWarnings("serial")
public class AtsSearchHomeView extends OseeSearchHomeView {
- private final AtsSearchPresenter atsBackend;
+ private boolean populated = false;
+ private AtsSearchPresenter searchPresenter = null;
- public AtsSearchHomeView() {
- super();
- atsBackend = AtsAppData.getAtsWebSearchPresenter();
+ @Override
+ public void attach() {
+ if (!populated) {
+ try {
+ AtsUiApplication app = (AtsUiApplication) getApplication();
+ searchPresenter = app.getAtsWebSearchPresenter();
+ callInitSearchHome();
+ createLayout();
+ } catch (Exception e) {
+ System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: casting threw an exception.");
+ }
+ }
+ populated = true;
}
@Override
@@ -34,10 +45,19 @@ public class AtsSearchHomeView extends OseeSearchHomeView {
return new AtsSearchHeaderComponent(true);
}
- @Override
- protected void initComponents() {
- if (atsBackend != null) {
- atsBackend.initSearchHome((AtsSearchHeaderComponent) oseeSearchHeader);
+ private void callInitSearchHome() {
+ if (searchPresenter != null) {
+ try {
+ AtsSearchHeaderComponent atsSearchHeaderComp = (AtsSearchHeaderComponent) oseeSearchHeader;
+ searchPresenter.initSearchHome(atsSearchHeaderComp);
+ } catch (Exception e) {
+ System.out.println("OseeArtifactNameLinkComponent.navigateTo - CRITICAL ERROR: casting threw an exception.");
+ }
}
}
+
+ @Override
+ public void navigateTo(String 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 339463d..27d6c4e 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * 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
@@ -12,10 +12,12 @@ package org.eclipse.osee.ats.view.web.search;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponentInterface;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
-import org.eclipse.osee.ats.view.web.AtsAppData;
+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.OseeSearchResultsView;
+import org.eclipse.osee.vaadin.widgets.Navigator;
+import com.vaadin.Application;
/**
* @author Shawn F. Cook
@@ -23,11 +25,22 @@ import org.eclipse.osee.display.view.web.search.OseeSearchResultsView;
@SuppressWarnings("serial")
public class AtsSearchResultsView extends OseeSearchResultsView {
- private final AtsSearchPresenter atsBackend;
+ private boolean populated = false;
+ private AtsSearchPresenter searchPresenter;
- public AtsSearchResultsView() {
- super();
- atsBackend = AtsAppData.getAtsWebSearchPresenter();
+ @Override
+ public void attach() {
+ if (!populated) {
+ try {
+ AtsUiApplication app = (AtsUiApplication) this.getApplication();
+ searchPresenter = app.getAtsWebSearchPresenter();
+ callInitSearchHome();
+ createLayout();
+ } catch (Exception e) {
+ System.out.println("OseeArtifactNameLinkComponent.attach - CRITICAL ERROR: (AtsUiApplication) this.getApplication() threw an exception.");
+ }
+ }
+ populated = true;
}
@Override
@@ -35,16 +48,26 @@ public class AtsSearchResultsView extends OseeSearchResultsView {
return new AtsSearchHeaderComponent(false);
}
- @Override
- protected void initComponents() {
- // searchResultsListComponent.setSearchPresenter(atsBackend);
+ private void callInitSearchHome() {
+ if (searchPresenter != null) {
+ try {
+ searchPresenter.initSearchResults(requestedDataId, (AtsSearchHeaderComponentInterface) oseeSearchHeader,
+ searchResultsListComponent);
+ } catch (Exception e) {
+ System.out.println("AtsSearchResultsView.callInitSearchHome - CRITICAL ERROR: casting threw an exception.");
+ }
+ }
}
+ private String requestedDataId = "";
@Override
public void navigateTo(String requestedDataId) {
- if (atsBackend != null) {
- atsBackend.initSearchResults(requestedDataId, (AtsSearchHeaderComponentInterface) oseeSearchHeader,
- searchResultsListComponent);
- }
+ this.requestedDataId = requestedDataId;
+ callInitSearchHome();
+ }
+
+ @Override
+ public void init(Navigator navigator, Application application) {
+ super.init(navigator, application);
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java
deleted file mode 100644
index 8f942c6..0000000
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeAppData.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Boeing.
- * All rightsimport com.vaadin.Application;
-import com.vaadin.service.ApplicationContext.TransactionListener;
-he 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 javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.eclipse.osee.display.api.search.SearchNavigator;
-import org.eclipse.osee.display.api.search.SearchPresenter;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.gwt.server.HttpServletRequestListener;
-
-/**
- * @author Shawn F. Cook AppData contains thread-safe session-global data based
- * on Vaadin demonstation:
- * https://vaadin.com/book/-/page/advanced.global.html
- */
-@SuppressWarnings("serial")
-public class OseeAppData implements HttpServletRequestListener {
-
- protected final Application app; // For distinguishing between apps
- protected static ThreadLocal<OseeAppData> instance = new ThreadLocal<OseeAppData>();
-
- private final SearchNavigator navigator = createNavigator();
- private final SearchPresenter searchPresenter = createSearchPresenter();
-
- public OseeAppData(Application app) {
- this.app = app;
-
- // It's usable from now on in the current request
- instance.set(this);
- }
-
- protected SearchNavigator createNavigator() {
- return new OseeNavigator();
- }
-
- protected SearchPresenter createSearchPresenter() {
- return null;
- }
-
- public static SearchNavigator getNavigator() {
- return instance.get().navigator;
- }
-
- public static SearchPresenter getSearchPresenter() {
- return instance.get().searchPresenter;
- }
-
- // @return the current application instance
- public static OseeAppData getInstance() {
- return instance.get();
- }
-
- // Set the current application instance
- public static void setInstance(OseeAppData appdata) {
- instance.set(appdata);
- }
-
- @Override
- public void onRequestStart(HttpServletRequest request,
- HttpServletResponse response) {
- OseeAppData.setInstance(this);
- }
-
- @Override
- public void onRequestEnd(HttpServletRequest request,
- HttpServletResponse response) {
- instance.remove();
-
- }
-}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeFooter.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeFooter.java
index a4ac05a..c60277f 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeFooter.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeFooter.java
@@ -1,7 +1,5 @@
package org.eclipse.osee.display.view.web;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
@@ -19,13 +17,13 @@ public class OseeFooter extends VerticalLayout {
return;
}
- Label ll = new Label("Add Navigation Links Here");
- ll.setWidth(null);
- addComponent(ll);
- setComponentAlignment(ll, Alignment.MIDDLE_CENTER);
-
- Label summary = new Label(getApplicationInfo());
- addComponent(summary);
+ // Label ll = new Label("Add Navigation Links Here");
+ // ll.setWidth(null);
+ // addComponent(ll);
+ // setComponentAlignment(ll, Alignment.MIDDLE_CENTER);
+ //
+ // Label summary = new Label(getApplicationInfo());
+ // addComponent(summary);
populated = true;
}
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
new file mode 100644
index 0000000..d54b3c3
--- /dev/null
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/OseeUiApplication.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.search.SearchNavigator;
+import org.eclipse.osee.display.api.search.SearchPresenter;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
+import com.vaadin.Application;
+
+/**
+ * @author Shawn F. Cook
+ */
+public class OseeUiApplication extends Application {
+
+ protected final SearchNavigator navigator = createNavigator();
+ protected final SearchPresenter searchPresenter = createSearchPresenter();
+
+ @Override
+ public void init() {
+ setTheme("osee");
+ }
+
+ @Override
+ public String getVersion() {
+ Bundle bundle = FrameworkUtil.getBundle(this.getClass());
+ return bundle.getVersion().toString();
+ }
+
+ protected SearchNavigator createNavigator() {
+ return new OseeNavigator();
+ }
+
+ protected SearchPresenter createSearchPresenter() {
+ return null;
+ }
+
+ public SearchNavigator getNavigator() {
+ return navigator;
+ }
+
+ public SearchPresenter getSearchPresenter() {
+ return searchPresenter;
+ }
+}
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 b3136bf..c6ab3f7 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
@@ -14,7 +14,7 @@ import org.eclipse.osee.display.api.data.WebArtifact;
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.OseeAppData;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.ui.HorizontalLayout;
@@ -26,13 +26,29 @@ import com.vaadin.ui.Link;
@SuppressWarnings("serial")
public class OseeArtifactNameLinkComponent extends HorizontalLayout {
- private final SearchPresenter searchPresenter = OseeAppData.getSearchPresenter();
- private final SearchNavigator navigator = OseeAppData.getNavigator();
+ private boolean populated = false;
+ private SearchPresenter searchPresenter = null;
+ private SearchNavigator navigator = null;
public OseeArtifactNameLinkComponent(WebArtifact artifact) {
this(artifact, CssConstants.OSEE_SEARCHRESULT_ARTNAME);
}
+ @Override
+ public void attach() {
+ if (!populated) {
+ super.attach();
+ try {
+ 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.");
+ }
+ }
+ populated = true;
+ }
+
public OseeArtifactNameLinkComponent(final WebArtifact artifact, String styleName) {
super();
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 9205362..018a790 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
@@ -15,7 +15,7 @@ import org.eclipse.osee.display.api.data.WebArtifact;
import org.eclipse.osee.display.api.data.WebId;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.display.api.search.SearchPresenter;
-import org.eclipse.osee.display.view.web.OseeAppData;
+import org.eclipse.osee.display.view.web.OseeUiApplication;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.HorizontalLayout;
@@ -29,13 +29,30 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeRelationsComponent extends VerticalLayout implements RelationComponent {
+ private boolean populated = false;
private final ListSelect relationTypesListSelect = new ListSelect("Relation Types:");
private final ListSelect relationsListSelect = new ListSelect("Relations:");
- SearchPresenter searchPresenter = OseeAppData.getSearchPresenter();
- SearchNavigator navigator = OseeAppData.getNavigator();
+ private SearchPresenter searchPresenter = null;
+ private SearchNavigator navigator = null;
private boolean lockRelTypesListener = false;
private boolean lockRelsListener = false;
+ @Override
+ public void attach() {
+ if (!populated) {
+ try {
+ OseeUiApplication app = (OseeUiApplication) this.getApplication();
+ searchPresenter = app.getSearchPresenter();
+ navigator = app.getNavigator();
+ } catch (Exception e) {
+ System.out.println("OseeRelationsComponent.attach - CRITICAL ERROR: (OseeUiApplication) this.getApplication() threw an exception.");
+ }
+ }
+ populated = true;
+
+ createLayout();
+ }
+
private void createLayout() {
removeAllComponents();
@@ -64,8 +81,14 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
@Override
public void valueChange(ValueChangeEvent event) {
if (!lockRelTypesListener) {
- WebId relationType = (WebId) relationTypesListSelect.getValue();
- searchPresenter.selectRelationType(relationType, OseeRelationsComponent.this);
+ try {
+ WebId relationType = (WebId) relationTypesListSelect.getValue();
+ if (relationType != null) {
+ searchPresenter.selectRelationType(relationType, OseeRelationsComponent.this);
+ }
+ } catch (Exception e) {
+ System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
+ }
}
}
});
@@ -74,8 +97,14 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
@Override
public void valueChange(ValueChangeEvent event) {
if (!lockRelsListener) {
- WebArtifact artifact = (WebArtifact) relationsListSelect.getValue();
- searchPresenter.selectArtifact(artifact, navigator);
+ try {
+ WebArtifact artifact = (WebArtifact) relationsListSelect.getValue();
+ if (artifact != null) {
+ searchPresenter.selectArtifact(artifact, navigator);
+ }
+ } catch (Exception e) {
+ System.out.println("OseeRelationsComponent.createLayout - CRITICAL ERROR: (WebArtifact) relationsListSelect.getValue() threw an exception.");
+ }
}
}
});
@@ -140,5 +169,6 @@ public class OseeRelationsComponent extends VerticalLayout implements RelationCo
@Override
public void setErrorMessage(String message) {
+ //TODO:
}
}
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 8a1d3e1..6f8a78b 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
@@ -17,6 +17,7 @@ import java.util.Iterator;
import org.eclipse.osee.display.api.components.SearchResultComponent;
import org.eclipse.osee.display.api.components.SearchResultsListComponent;
import org.eclipse.osee.display.view.web.CssConstants;
+import com.vaadin.Application;
import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
@@ -31,6 +32,12 @@ public class OseeSearchResultsListComponent extends VerticalLayout implements Se
VerticalLayout bottomSpacer = new VerticalLayout();
HorizontalLayout manySearchResultsHorizLayout = new HorizontalLayout();
+ @Override
+ public void attach() {
+ super.attach();
+ Application app = this.getApplication();
+ }
+
public OseeSearchResultsListComponent() {
addComponent(manySearchResultsHorizLayout);
Label spacer2 = new Label("");
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 4bf072f..d096e8a 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,7 @@ 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.OseeAppData;
+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,14 +32,20 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeArtifactView extends CustomComponent implements Navigator.View, ArtifactHeaderComponent {
- protected SearchPresenter searchPresenter = OseeAppData.getSearchPresenter();
+ private boolean populated = false;
+ protected SearchPresenter searchPresenter = null;
protected OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
protected OseeRelationsComponent relationsComp = new OseeRelationsComponent();
protected OseeAttributeComponent attributeComp = new OseeAttributeComponent();
private final OseeBreadcrumbComponent breadcrumbComp = new OseeBreadcrumbComponent(null);
private WebArtifact artifact;
- private void initLayout() {
+ @Override
+ public void attach() {
+ //TODO: remove?
+ }
+
+ private void createLayout() {
setSizeFull();
HorizontalLayout leftMarginAndBody = new HorizontalLayout();
@@ -85,12 +91,25 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
@Override
public void init(Navigator navigator, Application application) {
- initLayout();
+ //Do nothing.
}
@Override
public void navigateTo(String requestedDataId) {
- searchPresenter.initArtifactPage(requestedDataId, oseeSearchHeader, this, relationsComp, attributeComp);
+ 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
@@ -105,13 +124,13 @@ public class OseeArtifactView extends CustomComponent implements Navigator.View,
@Override
public void clearAll() {
this.artifact = null;
- initLayout();
+ createLayout();
}
@Override
public void setArtifact(WebArtifact artifact) {
this.artifact = artifact;
- initLayout();
+ createLayout();
}
@Override
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 145eba8..64a3240 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * 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
@@ -22,16 +22,9 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeSearchHomeView extends CustomComponent implements Navigator.View {
- protected OseeSearchHeaderComponent oseeSearchHeader;
-
- public OseeSearchHomeView() {
- oseeSearchHeader = getOseeSearchHeader();
- }
-
- @Override
- public void init(Navigator navigator, Application application) {
- initComponents();
+ protected final OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
+ protected void createLayout() {
this.setSizeFull();
final VerticalLayout vertLayout = new VerticalLayout();
@@ -43,10 +36,6 @@ public class OseeSearchHomeView extends CustomComponent implements Navigator.Vie
setCompositionRoot(vertLayout);
}
- protected void initComponents() {
- //Do nothing
- }
-
protected OseeSearchHeaderComponent getOseeSearchHeader() {
return new OseeSearchHeaderComponent();
}
@@ -60,4 +49,9 @@ public class OseeSearchHomeView extends CustomComponent implements Navigator.Vie
public String getWarningForNavigatingFrom() {
return null;
}
+
+ @Override
+ public void init(Navigator navigator, Application application) {
+ //Do nothing.
+ }
}
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 06d5947..807604b 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,15 +25,10 @@ import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
public class OseeSearchResultsView extends CustomComponent implements Navigator.View {
- protected OseeSearchHeaderComponent oseeSearchHeader;
- protected OseeSearchResultsListComponent searchResultsListComponent;
+ protected final OseeSearchHeaderComponent oseeSearchHeader = getOseeSearchHeader();
+ protected final OseeSearchResultsListComponent searchResultsListComponent = new OseeSearchResultsListComponent();
- public OseeSearchResultsView() {
- oseeSearchHeader = getOseeSearchHeader();
- searchResultsListComponent = new OseeSearchResultsListComponent();
- }
-
- private void initLayout() {
+ protected void createLayout() {
setSizeFull();
HorizontalLayout leftMarginAndBody = new HorizontalLayout();
@@ -65,8 +60,7 @@ public class OseeSearchResultsView extends CustomComponent implements Navigator.
@Override
public void init(Navigator navigator, Application application) {
- initComponents();
- initLayout();
+ //Do nothing.
}
protected OseeSearchHeaderComponent getOseeSearchHeader() {
@@ -83,8 +77,4 @@ public class OseeSearchResultsView extends CustomComponent implements Navigator.
return null;
}
- protected void initComponents() {
- //Do nothing
- }
-
}