Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-01-06 20:25:40 -0500
committerRoberto E. Escobar2012-01-06 20:25:40 -0500
commitd69f34f497b0132d80f8de75c891d113976dff7f (patch)
treebd8a50a589e0cac327de16b07003b62613fae0d2
parent7164447695ad244f2fd5e7a68f3af335a7566a72 (diff)
downloadorg.eclipse.osee-d69f34f497b0132d80f8de75c891d113976dff7f.tar.gz
org.eclipse.osee-d69f34f497b0132d80f8de75c891d113976dff7f.tar.xz
org.eclipse.osee-d69f34f497b0132d80f8de75c891d113976dff7f.zip
feature[ats_Y5ZXT]: Add multi-tab, multi-window support0.9.9.v201111091249_XS_REL
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplication.java30
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsUiApplicationFactory.java22
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindow.java (renamed from plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java)45
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java10
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java64
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLogoLink.java3
-rw-r--r--plugins/org.eclipse.osee.vaadin/build.properties3
-rw-r--r--plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/AbstractApplication.java134
-rw-r--r--plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/ApplicationFactory.java6
-rw-r--r--plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/HasMultiplePages.java23
-rw-r--r--plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationServlet.java6
-rw-r--r--plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationState.java70
12 files changed, 343 insertions, 73 deletions
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 82ec2c0613f..d8e7149ad6a 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,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web;
+import java.util.Locale;
import org.eclipse.osee.ats.api.components.AtsSearchHeaderComponent;
import org.eclipse.osee.ats.api.data.AtsSearchParameters;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
@@ -18,45 +19,45 @@ import org.eclipse.osee.display.view.web.HasNavigator;
import org.eclipse.osee.display.view.web.HasPresenter;
import org.eclipse.osee.display.view.web.HasUrl;
import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.vaadin.AbstractApplication;
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<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> extends Application implements HasUrl, HasNavigator, HasPresenter, HasLogger {
+public class AtsUiApplication<T extends AtsSearchHeaderComponent, K extends AtsSearchParameters> extends AbstractApplication implements HasUrl, HasNavigator, HasPresenter, HasLogger {
private final AtsSearchPresenter<T, K> atsSearchPresenter;
- private AtsNavigator navigator;
private String url = "";
private final Log logger;
public AtsUiApplication(AtsSearchPresenter<T, K> searchPresenter, Log logger) {
+ super();
this.atsSearchPresenter = searchPresenter;
this.logger = logger;
+ setTheme("osee");
}
@Override
- public void init() {
- setTheme("osee");
-
- AtsWindowFactory factory = new AtsWindowFactory();
+ protected Window createApplicationWindow(Locale locale) {
HasViews viewProvider = new AtsUiViews();
- Window mainWindow = factory.createNavigatableWindow(viewProvider, getNavigator());
- setMainWindow(mainWindow);
- mainWindow.setApplication(this);
+ AtsWindow window = new AtsWindow(viewProvider, new AtsNavigator());
+ return window;
+ }
+
+ @Override
+ protected String getApplicationWindowName() {
+ return "AtsUiApplication";
}
@Override
public AtsNavigator getNavigator() {
- if (navigator == null) {
- navigator = new AtsNavigator();
- }
- return navigator;
+ AtsWindow atsWindow = (AtsWindow) getCurrentWindow();
+ return atsWindow.getNavigator();
}
@Override
@@ -99,4 +100,5 @@ public class AtsUiApplication<T extends AtsSearchHeaderComponent, K extends AtsS
public void logDebug(String format, Object... args) {
logger.debug(format, args);
}
+
}
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 1d86968b385..83ffc4ee1b0 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
@@ -16,8 +16,8 @@ import org.eclipse.osee.ats.api.search.AtsPresenterFactory;
import org.eclipse.osee.ats.api.search.AtsSearchPresenter;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.ApplicationContext;
+import org.eclipse.osee.vaadin.AbstractApplication;
import org.eclipse.osee.vaadin.ApplicationFactory;
-import com.vaadin.Application;
/**
* @author Shawn F. Cook
@@ -27,8 +27,16 @@ public class AtsUiApplicationFactory implements ApplicationFactory {
private AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> presenterFactory;
private Log logger;
+ public void setPresenterFactory(AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> presenterFactory) {
+ this.presenterFactory = presenterFactory;
+ }
+
+ public void setLogger(Log logger) {
+ this.logger = logger;
+ }
+
@Override
- public Application createInstance() {
+ public AbstractApplication createInstance() {
AtsApplicationContext context = new AtsApplicationContext();
AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> searchPresenter =
@@ -43,18 +51,10 @@ public class AtsUiApplicationFactory implements ApplicationFactory {
}
@Override
- public Class<? extends Application> getApplicationClass() {
+ public Class<? extends AbstractApplication> getApplicationClass() {
return AtsUiApplication.class;
}
- public void setPresenterFactory(AtsPresenterFactory<AtsSearchHeaderComponent, AtsSearchParameters> presenterFactory) {
- this.presenterFactory = presenterFactory;
- }
-
- public void setLogger(Log logger) {
- this.logger = logger;
- }
-
private final class AtsApplicationContext implements ApplicationContext {
private Object user;
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/AtsWindow.java
index 8931925a465..c2bfd799287 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/AtsWindow.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.view.web;
+import org.eclipse.osee.vaadin.HasMultiplePages;
import org.eclipse.osee.vaadin.widgets.AccountMenuBar;
import org.eclipse.osee.vaadin.widgets.HasViewTitle;
import org.eclipse.osee.vaadin.widgets.HasViews;
@@ -26,18 +27,36 @@ import com.vaadin.ui.Window;
/**
* @author Shawn F. Cook
*/
-public class AtsWindowFactory {
+public class AtsWindow extends Window implements HasMultiplePages {
- public Window createNavigatableWindow(HasViews provider, final AtsNavigator navigator) {
+ private static final long serialVersionUID = 307122520779262094L;
- VerticalLayout layout = new VerticalLayout();
- final Window w = new Window("OSEE", layout);
+ private final HasViews provider;
+ private final AtsNavigator navigator;
+ private VerticalLayout layout;
+ private View currentView;
+
+ public AtsWindow(HasViews provider, AtsNavigator navigator) {
+ super("OSEE");
+ this.provider = provider;
+ this.navigator = navigator;
+ }
+
+ public AtsNavigator getNavigator() {
+ return navigator;
+ }
+
+ @Override
+ public void attach() {
+ super.attach();
+ layout = new VerticalLayout();
+ setContent(layout);
for (final Class<?> viewClass : provider.getViews()) {
navigator.addView(viewClass.getSimpleName(), viewClass);
}
- w.addComponent(createNavigationBar(navigator, provider));
- w.addComponent(navigator);
+ addComponent(createNavigationBar(navigator, provider));
+ addComponent(navigator);
layout.setMargin(false);
layout.setSpacing(true);
@@ -47,7 +66,8 @@ public class AtsWindowFactory {
navigator.addListener(new ViewChangeListener() {
@Override
public void navigatorViewChange(View previous, View current) {
- Window mainWindow = w.getApplication().getMainWindow();
+ currentView = current;
+ Window mainWindow = getApplication().getMainWindow();
String title = "OSEE";
if (current instanceof HasViewTitle) {
String currentTitle = ((HasViewTitle) current).getViewTitle();
@@ -58,7 +78,6 @@ public class AtsWindowFactory {
mainWindow.setCaption(title);
}
});
- return w;
}
private Component createNavigationBar(final Navigator navigator, HasViews provider) {
@@ -78,4 +97,14 @@ public class AtsWindowFactory {
layout.setExpandRatio(menu, 1.0f);
return layout;
}
+
+ @Override
+ public void setToDefault() {
+ navigator.navigateTo(provider.getViews().get(0));
+ }
+
+ @Override
+ public Component getCurrentPage() {
+ return currentView;
+ }
}
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 300d5b454f5..3707c250b61 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
@@ -13,7 +13,6 @@ package org.eclipse.osee.ats.view.web.components;
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.AtsNavigator;
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;
@@ -134,7 +133,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
String searchPhrase = (String) searchTextField.getValue();
AtsSearchParameters params = new AtsSearchParameters(searchPhrase, nameOnly, build, program);
- getPresenter().selectSearch(getRequestedDataId(), params, getNavigator());
+ getPresenter().selectSearch(getRequestedDataId(), params, ComponentUtility.getNavigator(this));
} else {
ComponentUtility.logWarn("AtsSearchHeaderComponent.selectSearch - WARNING: null value detected.", this);
}
@@ -180,8 +179,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
}
});
- OseeLogoLink oseeLogoImg =
- new OseeLogoLink(getNavigator(), CssConstants.OSEE_TITLE_MEDIUM_TEXT, AtsSearchResultsView.class);
+ OseeLogoLink oseeLogoImg = new OseeLogoLink(CssConstants.OSEE_TITLE_MEDIUM_TEXT, AtsSearchResultsView.class);
Label hSpacer_LogoRight = new Label("");
oseeLogoImg.setSizeUndefined();
@@ -323,10 +321,6 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
return (AtsUiApplication<AtsSearchHeaderComponent, AtsSearchParameters>) super.getApplication();
}
- private AtsNavigator getNavigator() {
- return getApplication().getNavigator();
- }
-
private AtsSearchPresenter<AtsSearchHeaderComponent, AtsSearchParameters> getPresenter() {
return getApplication().getPresenter();
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
index ccc550bf0b4..ba921315c0e 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
@@ -42,63 +42,79 @@ public final class ComponentUtility {
public static SearchNavigator getNavigator(Component component) {
SearchNavigator navigator = null;
- Application app = component.getApplication();
- if (app instanceof HasNavigator) {
- navigator = ((HasNavigator) app).getNavigator();
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasNavigator) {
+ navigator = ((HasNavigator) app).getNavigator();
+ }
}
return navigator;
}
public static String getUrl(Component component) {
String url = null;
- Application app = component.getApplication();
- if (app instanceof HasUrl) {
- url = ((HasUrl) app).getUrl();
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasUrl) {
+ url = ((HasUrl) app).getUrl();
+ }
}
return url;
}
public static void setUrl(Component component, String url) {
- Application app = component.getApplication();
- if (app instanceof HasUrl) {
- ((HasUrl) app).setUrl(url);
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasUrl) {
+ ((HasUrl) app).setUrl(url);
+ }
}
}
public static SearchPresenter<?, ?> getPresenter(Component component) {
SearchPresenter presenter = null;
- Application app = component.getApplication();
- if (app instanceof HasPresenter) {
- presenter = ((HasPresenter) app).getPresenter();
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasPresenter) {
+ presenter = ((HasPresenter) app).getPresenter();
+ }
}
return presenter;
}
public static void logError(String format, Component component, Object... args) {
- Application app = component.getApplication();
- if (app instanceof HasLogger) {
- ((HasLogger) app).logError(format, args);
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasLogger) {
+ ((HasLogger) app).logError(format, args);
+ }
}
}
public static void logWarn(String format, Component component, Object... args) {
- Application app = component.getApplication();
- if (app instanceof HasLogger) {
- ((HasLogger) app).logWarn(format, args);
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasLogger) {
+ ((HasLogger) app).logWarn(format, args);
+ }
}
}
public static void logInfo(String format, Component component, Object... args) {
- Application app = component.getApplication();
- if (app instanceof HasLogger) {
- ((HasLogger) app).logInfo(format, args);
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasLogger) {
+ ((HasLogger) app).logInfo(format, args);
+ }
}
}
public static void logDebug(String format, Component component, Object... args) {
- Application app = component.getApplication();
- if (app instanceof HasLogger) {
- ((HasLogger) app).logDebug(format, args);
+ if (isAccessible(component)) {
+ Application app = component.getApplication();
+ if (app instanceof HasLogger) {
+ ((HasLogger) app).logDebug(format, args);
+ }
}
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLogoLink.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLogoLink.java
index e33ee83ea0a..f2a3ccef5b6 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLogoLink.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLogoLink.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.display.view.web.components;
-import org.eclipse.osee.vaadin.widgets.Navigator;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
@@ -19,7 +18,7 @@ import com.vaadin.ui.Link;
@SuppressWarnings("serial")
public class OseeLogoLink extends Link {
- public OseeLogoLink(Navigator navigator, String styleName, Class<?> viewClass) {
+ public OseeLogoLink(String styleName, Class<?> viewClass) {
//super("", new ExternalResource(String.format("ats#%s", navigator.getUri(viewClass))));
super("", new ExternalResource("ats"));
Resource logoIconRes = new ThemeResource("../osee/osee_large.png");
diff --git a/plugins/org.eclipse.osee.vaadin/build.properties b/plugins/org.eclipse.osee.vaadin/build.properties
index bd38ae27181..e7fa11f1930 100644
--- a/plugins/org.eclipse.osee.vaadin/build.properties
+++ b/plugins/org.eclipse.osee.vaadin/build.properties
@@ -8,4 +8,5 @@ additional.bundles = org.eclipse.osee.event,\
org.eclipse.osee.logger,\
org.eclipse.osgi,\
javax.servlet,\
- com.vaadin
+ com.vaadin,\
+ org.eclipse.osee.framework.jdk.core
diff --git a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/AbstractApplication.java b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/AbstractApplication.java
new file mode 100644
index 00000000000..d51f4dc3809
--- /dev/null
+++ b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/AbstractApplication.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.vaadin;
+
+import java.util.Locale;
+import javax.servlet.http.HttpServletRequest;
+import org.eclipse.osee.vaadin.internal.ApplicationState;
+import com.vaadin.Application;
+import com.vaadin.service.ApplicationContext.TransactionListener;
+import com.vaadin.ui.Window;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public abstract class AbstractApplication extends Application implements TransactionListener {
+
+ private static final long serialVersionUID = -3069770596395717931L;
+
+ private static final ApplicationState applicationState = new ApplicationState();
+
+ protected AbstractApplication() {
+ super();
+ }
+
+ protected Window getCurrentWindow() {
+ return applicationState.getWindow();
+ }
+
+ @Override
+ public final void init() {
+ getContext().addTransactionListener(this);
+
+ boolean isApplicationValid = applicationState.isApplicationValid();
+ if (!isApplicationValid) {
+ applicationState.setApplication(this);
+ }
+
+ Window currentWindow = createWindow();
+ currentWindow.setName(getWindowName());
+ setMainWindow(currentWindow);
+
+ if (!isApplicationValid) {
+ applicationState.removeApplication();
+ }
+ }
+
+ @Override
+ public final void transactionStart(Application application, Object transactionData) {
+ if (this == application) {
+
+ if (!applicationState.isApplicationValid()) {
+ applicationState.setApplication(this);
+ }
+
+ HttpServletRequest request = (HttpServletRequest) transactionData;
+ String paramValue = request.getParameter("fr");
+ applicationState.setUriFragment(paramValue);
+ }
+ }
+
+ @Override
+ public final void transactionEnd(Application application, Object transactionData) {
+ if (this == application) {
+ applicationState.clearAll();
+ }
+ }
+
+ //https://vaadin.com/web/joonas/wiki/-/wiki/Main/Supporting%20Multible%20Tabs
+ @Override
+ public final Window getWindow(String name) {
+ Window toReturn = null;
+ if (isRunning()) {
+ toReturn = super.getWindow(name);
+
+ Window mainWindow = getMainWindow();
+ if (mainWindow != null && matchesWindowName(mainWindow.getName(), name)) {
+ if (toReturn == null) {
+ toReturn = createWindow();
+ toReturn.setName(name);
+ addWindow(toReturn);
+ }
+ applicationState.setWindow(toReturn);
+
+ // SEE: http://vaadin.com/forum/-/message_boards/message/57240
+ // Empty string is a call for home page.
+ if ("".equals(applicationState.getUriFragment())) {
+ if (mainWindow instanceof HasMultiplePages) {
+ HasMultiplePages multiPaged = (HasMultiplePages) mainWindow;
+ if (multiPaged.getCurrentPage() == null) {
+ multiPaged.setToDefault();
+ }
+ }
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ private Window createWindow() {
+ try {
+ Application application = applicationState.getApplication();
+ return createApplicationWindow(application.getLocale());
+ } catch (Exception ex) {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ private String getWindowName() {
+ return getApplicationWindowName();
+ }
+
+ protected boolean matchesWindowName(String windowName, String name) {
+ boolean result = name.equals(windowName);
+ if (!result) {
+ String[] nameParts = name.split("_");
+ if (nameParts.length == 2) {
+ result = windowName.equals(nameParts[0]);
+ }
+ }
+ return result;
+ }
+
+ protected abstract Window createApplicationWindow(Locale locale) throws Exception;
+
+ protected abstract String getApplicationWindowName();
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/ApplicationFactory.java b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/ApplicationFactory.java
index 6313cf42ba7..650a3769359 100644
--- a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/ApplicationFactory.java
+++ b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/ApplicationFactory.java
@@ -10,15 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.vaadin;
-import com.vaadin.Application;
-
/**
* @author Roberto E. Escobar
*/
public interface ApplicationFactory {
- Application createInstance() throws Exception;
+ AbstractApplication createInstance() throws Exception;
- Class<? extends Application> getApplicationClass();
+ Class<? extends AbstractApplication> getApplicationClass();
}
diff --git a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/HasMultiplePages.java b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/HasMultiplePages.java
new file mode 100644
index 00000000000..fab4feb6e09
--- /dev/null
+++ b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/HasMultiplePages.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.vaadin;
+
+import com.vaadin.ui.Component;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface HasMultiplePages {
+
+ void setToDefault();
+
+ Component getCurrentPage();
+}
diff --git a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationServlet.java b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationServlet.java
index fbbd52708c1..7128637c17f 100644
--- a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationServlet.java
+++ b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationServlet.java
@@ -23,6 +23,7 @@ import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.vaadin.AbstractApplication;
import org.eclipse.osee.vaadin.ApplicationFactory;
import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
@@ -63,8 +64,10 @@ public class ApplicationServlet extends AbstractApplicationServlet {
throw new ServletException(String.format("Error creating vaading application using [%s]",
factory.getClass().getName()));
}
+
setApplicationMetaData(request, application);
HttpSession httpSession = request.getSession();
+
final ApplicationSession session = new ApplicationSession(application, httpSession);
sessions.add(session);
httpSession.setAttribute(ApplicationSession.class.getName(), new HttpSessionListener() {
@@ -164,7 +167,7 @@ public class ApplicationServlet extends AbstractApplicationServlet {
@Override
protected Class<? extends Application> getApplicationClass() {
- return factory.getApplicationClass();
+ return AbstractApplication.class;
}
@Override
@@ -393,4 +396,5 @@ public class ApplicationServlet extends AbstractApplicationServlet {
return string;
}
+
}
diff --git a/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationState.java b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationState.java
new file mode 100644
index 00000000000..7f35650eb8c
--- /dev/null
+++ b/plugins/org.eclipse.osee.vaadin/src/org/eclipse/osee/vaadin/internal/ApplicationState.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.vaadin.internal;
+
+import com.vaadin.Application;
+import com.vaadin.ui.Window;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ApplicationState {
+
+ private final ThreadLocal<Application> application = new ThreadLocal<Application>();
+ private final ThreadLocal<Window> window = new ThreadLocal<Window>();
+ private final ThreadLocal<String> uriFragment = new ThreadLocal<String>();
+
+ public Application getApplication() {
+ return application.get();
+ }
+
+ public void setApplication(Application application) {
+ this.application.set(application);
+ }
+
+ public boolean isApplicationValid() {
+ return getApplication() != null;
+ }
+
+ public Window getWindow() {
+ return window.get();
+ }
+
+ public void setWindow(Window window) {
+ this.window.set(window);
+ }
+
+ public String getUriFragment() {
+ return uriFragment.get();
+ }
+
+ public void setUriFragment(String fragment) {
+ uriFragment.set(fragment);
+ }
+
+ public void removeApplication() {
+ application.remove();
+ }
+
+ public void removeWindow() {
+ window.remove();
+ }
+
+ public void removeUriFragment() {
+ uriFragment.remove();
+ }
+
+ public void clearAll() {
+ removeApplication();
+ removeWindow();
+ removeUriFragment();
+ }
+}

Back to the top