From e18177bac62e8367829dfc5ec3083a09973e621e Mon Sep 17 00:00:00 2001
From: Artur Signell
+ * By default a state object of the defined return type of + * {@link #getState()} is created. Subclasses can override this method and + * return a new instance of the correct state class but this should rarely + * be necessary. + *
+ *
+ * No configuration of the values of the state should be performed in
+ * {@link #createState()}.
+ *
+ * @since 7.0
+ *
+ * @return new shared state object
+ */
+ protected SharedState createState() {
+ try {
+ return getStateType().newInstance();
+ } catch (Exception e) {
+ throw new RuntimeException(
+ "Error creating state of type " + getStateType().getName()
+ + " for " + getClass().getName(), e);
+ }
+ }
+
+ @Override
+ public Class extends SharedState> getStateType() {
+ // Lazy load because finding type can be expensive because of the
+ // exceptions flying around
+ if (stateType == null) {
+ stateType = findStateType();
+ }
+
+ return stateType;
+ }
+
+ private Class extends SharedState> findStateType() {
+ try {
+ Class> class1 = getClass();
+ while (class1 != null) {
+ try {
+ Method m = class1.getDeclaredMethod("getState",
+ (Class[]) null);
+ Class> type = m.getReturnType();
+ return type.asSubclass(SharedState.class);
+ } catch (NoSuchMethodException nsme) {
+ // Try in superclass instead
+ class1 = class1.getSuperclass();
+ }
+ }
+ throw new NoSuchMethodException(getClass().getCanonicalName()
+ + ".getState()");
+ } catch (Exception e) {
+ throw new RuntimeException("Error finding state type for "
+ + getClass().getName(), e);
+ }
+ }
+
+ /**
+ * Returns an RPC proxy for a given server to client RPC interface for this
+ * component.
+ *
+ * TODO more javadoc, subclasses, ...
+ *
+ * @param rpcInterface
+ * RPC interface type
+ *
+ * @since 7.0
+ */
+ public
+ * The {@link #getApplication()} and {@link #getUI()} methods might return
+ *
+ * Extensions can use shared state and RPC in the same way as components.
+ *
+ * AbstractExtension adds a mechanism for adding the extension to any Connector
+ * (extend). To let the Extension determine what kind target it can be added to,
+ * the extend method is declared as protected.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public abstract class AbstractExtension extends AbstractClientConnector
+ implements Extension {
+ private boolean previouslyAttached = false;
+
+ /**
+ * Gets a type that the parent must be an instance of. Override this if the
+ * extension only support certain targets, e.g. if only TextFields can be
+ * extended.
+ *
+ * @return a type that the parent must be an instance of
+ */
+ protected Class extends ClientConnector> getSupportedParentType() {
+ return ClientConnector.class;
+ }
+
+ /**
+ * Add this extension to the target connector. This method is protected to
+ * allow subclasses to require a more specific type of target.
+ *
+ * @param target
+ * the connector to attach this extension to
+ */
+ protected void extend(AbstractClientConnector target) {
+ target.addExtension(this);
+ }
+
+ /**
+ * Remove this extension from its target. After an extension has been
+ * removed, it can not be attached again.
+ */
+ public void removeFromTarget() {
+ getParent().removeExtension(this);
+ }
+
+ @Override
+ public void setParent(ClientConnector parent) {
+ if (previouslyAttached && parent != null) {
+ throw new IllegalStateException(
+ "An extension can not be set to extend a new target after getting detached from the previous.");
+ }
+
+ Class extends ClientConnector> supportedParentType = getSupportedParentType();
+ if (parent == null || supportedParentType.isInstance(parent)) {
+ super.setParent(parent);
+ previouslyAttached = true;
+ } else {
+ throw new IllegalArgumentException(getClass().getName()
+ + " can only be attached to targets of type "
+ + supportedParentType.getName() + " but attach to "
+ + parent.getClass().getName() + " was attempted.");
+ }
+ }
+
+}
diff --git a/server/src/com/vaadin/server/AbstractJavaScriptExtension.java b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java
new file mode 100644
index 0000000000..20e2752801
--- /dev/null
+++ b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import com.vaadin.shared.JavaScriptExtensionState;
+import com.vaadin.ui.JavaScriptFunction;
+
+/**
+ * Base class for Extensions with all client-side logic implemented using
+ * JavaScript.
+ *
+ * When a new JavaScript extension is initialized in the browser, the framework
+ * will look for a globally defined JavaScript function that will initialize the
+ * extension. The name of the initialization function is formed by replacing .
+ * with _ in the name of the server-side class. If no such function is defined,
+ * each super class is used in turn until a match is found. The framework will
+ * thus first attempt with
+ *
+ * The initialization function will be called with
+ *
+ * Values in the Shared State and in RPC calls are converted between Java and
+ * JavaScript using the following conventions:
+ *
+ *
+ * This gives the adapter the possibility cache streams sent to the client.
+ * The caching may be made in adapter or at the client if the client
+ * supports caching. Default is
+ * If the buffer size is 0, the buffer size is decided by the terminal
+ * adapter. The default value is 0.
+ *
+ * This gives the adapter the possibility cache streams sent to the client.
+ * The caching may be made in adapter or at the client if the client
+ * supports caching. Zero or negavive value disbales the caching of this
+ * stream.
+ *
+ * An extension can only be attached once. It is not supported to move an
+ * extension from one target to another.
+ *
+ * Extensions can use shared state and RPC in the same way as components.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public interface Extension extends ClientConnector {
+ /*
+ * Currently just an empty marker interface to distinguish between
+ * extensions and other connectors, e.g. components
+ */
+}
diff --git a/server/src/com/vaadin/server/ExternalResource.java b/server/src/com/vaadin/server/ExternalResource.java
new file mode 100644
index 0000000000..925b0589f3
--- /dev/null
+++ b/server/src/com/vaadin/server/ExternalResource.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.net.URL;
+
+import com.vaadin.service.FileTypeResolver;
+
+/**
+ *
+ * You should most likely no use this class directly.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public class JavaScriptCallbackHelper implements Serializable {
+
+ private static final Method CALL_METHOD = ReflectTools.findMethod(
+ JavaScriptCallbackRpc.class, "call", String.class, JSONArray.class);
+ private AbstractClientConnector connector;
+
+ private Map
+ * Paints the Paintable into a UIDL stream. This method creates the UIDL
+ * sequence describing it and outputs it to the given UIDL stream.
+ *
+ * It is called when the contents of the component should be painted in
+ * response to the component first being shown or having been altered so
+ * that its visual representation is changed.
+ *
+ * Do not override this to paint your component. Override
+ * {@link #paintContent(PaintTarget)} instead.
+ *
+ * This is only a helper until paint is moved away from this class.
+ *
+ * @return
+ */
+ protected static boolean isVisibleInContext(Component c) {
+ HasComponents p = c.getParent();
+ while (p != null) {
+ if (!p.isVisible()) {
+ return false;
+ }
+ p = p.getParent();
+ }
+ if (c.getParent() != null && !c.getParent().isComponentVisible(c)) {
+ return false;
+ }
+
+ // All parents visible, return this state
+ return c.isVisible();
+ }
+
+}
diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java
new file mode 100644
index 0000000000..4cb9a1291e
--- /dev/null
+++ b/server/src/com/vaadin/server/Page.java
@@ -0,0 +1,653 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.EventObject;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.vaadin.event.EventRouter;
+import com.vaadin.server.WrappedRequest.BrowserDetails;
+import com.vaadin.shared.ui.BorderStyle;
+import com.vaadin.shared.ui.ui.PageClientRpc;
+import com.vaadin.shared.ui.ui.UIConstants;
+import com.vaadin.terminal.gwt.server.WebApplicationContext;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.tools.ReflectTools;
+import com.vaadin.ui.JavaScript;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI;
+
+public class Page implements Serializable {
+
+ /**
+ * Listener that gets notified when the size of the browser window
+ * containing the uI has changed.
+ *
+ * @see UI#addListener(BrowserWindowResizeListener)
+ */
+ public interface BrowserWindowResizeListener extends Serializable {
+ /**
+ * Invoked when the browser window containing a UI has been resized.
+ *
+ * @param event
+ * a browser window resize event
+ */
+ public void browserWindowResized(BrowserWindowResizeEvent event);
+ }
+
+ /**
+ * Event that is fired when a browser window containing a uI is resized.
+ */
+ public class BrowserWindowResizeEvent extends EventObject {
+
+ private final int width;
+ private final int height;
+
+ /**
+ * Creates a new event
+ *
+ * @param source
+ * the uI for which the browser window has been resized
+ * @param width
+ * the new width of the browser window
+ * @param height
+ * the new height of the browser window
+ */
+ public BrowserWindowResizeEvent(Page source, int width, int height) {
+ super(source);
+ this.width = width;
+ this.height = height;
+ }
+
+ @Override
+ public Page getSource() {
+ return (Page) super.getSource();
+ }
+
+ /**
+ * Gets the new browser window height
+ *
+ * @return an integer with the new pixel height of the browser window
+ */
+ public int getHeight() {
+ return height;
+ }
+
+ /**
+ * Gets the new browser window width
+ *
+ * @return an integer with the new pixel width of the browser window
+ */
+ public int getWidth() {
+ return width;
+ }
+ }
+
+ /**
+ * Private class for storing properties related to opening resources.
+ */
+ private class OpenResource implements Serializable {
+
+ /**
+ * The resource to open
+ */
+ private final Resource resource;
+
+ /**
+ * The name of the target window
+ */
+ private final String name;
+
+ /**
+ * The width of the target window
+ */
+ private final int width;
+
+ /**
+ * The height of the target window
+ */
+ private final int height;
+
+ /**
+ * The border style of the target window
+ */
+ private final BorderStyle border;
+
+ /**
+ * Creates a new open resource.
+ *
+ * @param resource
+ * The resource to open
+ * @param name
+ * The name of the target window
+ * @param width
+ * The width of the target window
+ * @param height
+ * The height of the target window
+ * @param border
+ * The border style of the target window
+ */
+ private OpenResource(Resource resource, String name, int width,
+ int height, BorderStyle border) {
+ this.resource = resource;
+ this.name = name;
+ this.width = width;
+ this.height = height;
+ this.border = border;
+ }
+
+ /**
+ * Paints the open request. Should be painted inside the window.
+ *
+ * @param target
+ * the paint target
+ * @throws PaintException
+ * if the paint operation fails
+ */
+ private void paintContent(PaintTarget target) throws PaintException {
+ target.startTag("open");
+ target.addAttribute("src", resource);
+ if (name != null && name.length() > 0) {
+ target.addAttribute("name", name);
+ }
+ if (width >= 0) {
+ target.addAttribute("width", width);
+ }
+ if (height >= 0) {
+ target.addAttribute("height", height);
+ }
+ switch (border) {
+ case MINIMAL:
+ target.addAttribute("border", "minimal");
+ break;
+ case NONE:
+ target.addAttribute("border", "none");
+ break;
+ }
+
+ target.endTag("open");
+ }
+ }
+
+ private static final Method BROWSWER_RESIZE_METHOD = ReflectTools
+ .findMethod(BrowserWindowResizeListener.class,
+ "browserWindowResized", BrowserWindowResizeEvent.class);
+
+ /**
+ * A border style used for opening resources in a window without a border.
+ */
+ @Deprecated
+ public static final BorderStyle BORDER_NONE = BorderStyle.NONE;
+
+ /**
+ * A border style used for opening resources in a window with a minimal
+ * border.
+ */
+ public static final BorderStyle BORDER_MINIMAL = BorderStyle.MINIMAL;
+
+ /**
+ * A border style that indicates that the default border style should be
+ * used when opening resources.
+ */
+ public static final BorderStyle BORDER_DEFAULT = BorderStyle.DEFAULT;
+
+ /**
+ * Listener that listens changes in URI fragment.
+ */
+ public interface FragmentChangedListener extends Serializable {
+ public void fragmentChanged(FragmentChangedEvent event);
+ }
+
+ private static final Method FRAGMENT_CHANGED_METHOD = ReflectTools
+ .findMethod(Page.FragmentChangedListener.class, "fragmentChanged",
+ FragmentChangedEvent.class);
+
+ /**
+ * Resources to be opened automatically on next repaint. The list is
+ * automatically cleared when it has been sent to the client.
+ */
+ private final LinkedList
+ * To listen changes in fragment, hook a
+ * {@link Page.FragmentChangedListener}.
+ *
+ * @return the current fragment in browser uri or null if not known
+ */
+ public String getFragment() {
+ return fragment;
+ }
+
+ public void init(WrappedRequest request) {
+ BrowserDetails browserDetails = request.getBrowserDetails();
+ if (browserDetails != null) {
+ fragment = browserDetails.getUriFragment();
+ }
+ }
+
+ public WebBrowser getWebBrowser() {
+ return ((WebApplicationContext) uI.getApplication().getContext())
+ .getBrowser();
+ }
+
+ public void setBrowserWindowSize(int width, int height) {
+ boolean fireEvent = false;
+
+ if (width != browserWindowWidth) {
+ browserWindowWidth = width;
+ fireEvent = true;
+ }
+
+ if (height != browserWindowHeight) {
+ browserWindowHeight = height;
+ fireEvent = true;
+ }
+
+ if (fireEvent) {
+ fireEvent(new BrowserWindowResizeEvent(this, browserWindowWidth,
+ browserWindowHeight));
+ }
+
+ }
+
+ /**
+ * Adds a new {@link BrowserWindowResizeListener} to this uI. The listener
+ * will be notified whenever the browser window within which this uI
+ * resides is resized.
+ *
+ * @param resizeListener
+ * the listener to add
+ *
+ * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent)
+ * @see #setResizeLazy(boolean)
+ */
+ public void addListener(BrowserWindowResizeListener resizeListener) {
+ addListener(BrowserWindowResizeEvent.class, resizeListener,
+ BROWSWER_RESIZE_METHOD);
+ }
+
+ /**
+ * Removes a {@link BrowserWindowResizeListener} from this uI. The
+ * listener will no longer be notified when the browser window is resized.
+ *
+ * @param resizeListener
+ * the listener to remove
+ */
+ public void removeListener(BrowserWindowResizeListener resizeListener) {
+ removeListener(BrowserWindowResizeEvent.class, resizeListener,
+ BROWSWER_RESIZE_METHOD);
+ }
+
+ /**
+ * Gets the last known height of the browser window in which this uI
+ * resides.
+ *
+ * @return the browser window height in pixels
+ */
+ public int getBrowserWindowHeight() {
+ return browserWindowHeight;
+ }
+
+ /**
+ * Gets the last known width of the browser window in which this uI
+ * resides.
+ *
+ * @return the browser window width in pixels
+ */
+ public int getBrowserWindowWidth() {
+ return browserWindowWidth;
+ }
+
+ public JavaScript getJavaScript() {
+ if (javaScript == null) {
+ // Create and attach on first use
+ javaScript = new JavaScript();
+ javaScript.extend(uI);
+ }
+
+ return javaScript;
+ }
+
+ public void paintContent(PaintTarget target) throws PaintException {
+ if (!openList.isEmpty()) {
+ for (final Iterator
+ * The supplied {@code windowName} is used as the target name in a
+ * window.open call in the client. This means that special values such as
+ * "_blank", "_self", "_top", "_parent" have special meaning. An empty or
+ *
+ * "", null and "_self" as {@code windowName} all causes the resource to be
+ * opened in the current window, replacing any old contents. For
+ * downloadable content you should avoid "_self" as "_self" causes the
+ * client to skip rendering of any other changes as it considers them
+ * irrelevant (the page will be replaced by the resource). This can speed up
+ * the opening of a resource, but it might also put the client side into an
+ * inconsistent state if the window content is not completely replaced e.g.,
+ * if the resource is downloaded instead of displayed in the browser.
+ *
+ * "_blank" as {@code windowName} causes the resource to always be opened in
+ * a new window or tab (depends on the browser and browser settings).
+ *
+ * "_top" and "_parent" as {@code windowName} works as specified by the HTML
+ * standard.
+ *
+ * Any other {@code windowName} will open the resource in a window with that
+ * name, either by opening a new window/tab in the browser or by replacing
+ * the contents of an existing window with that name.
+ *
+ * If the {@link Component} is found in cache and this function returns true
+ * it may omit the content and close the tag, in which case cached content
+ * should be used.
+ *
+ * This method may also add only a reference to the paintable and queue the
+ * paintable to be painted separately.
+ *
+ * Each paintable being painted should be closed by a matching
+ * {@link #endPaintable(Component)} regardless of the {@link PaintStatus}
+ * returned.
+ *
+ * The urls in UIDL message may use Vaadin specific protocol. Before
+ * actually using the urls on the client side, they should be passed via
+ * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}.
+ *
+ * Note that in current terminal implementation StreamVariables are cleaned
+ * from the terminal only when:
+ *
+ * Prints full XML section. The section data must be XML and it is
+ * surrounded by XML start and end-tags.
+ *
+ * This interface is implemented by all visual objects that can be scrolled
+ * programmatically from the server-side. The unit of scrolling is pixel.
+ *
+ * Scrolling offset is the number of pixels this scrollable has been
+ * scrolled right.
+ *
+ * Scrolling offset is the number of pixels this scrollable has been
+ * scrolled right.
+ *
+ * Scrolling offset is the number of pixels this scrollable has been
+ * scrolled down.
+ *
+ * Scrolling offset is the number of pixels this scrollable has been
+ * scrolled down.
+ *
+ * The scrolling position is limited by the current height of the content
+ * area. If the position is below the height, it is scrolled to the bottom.
+ * However, if the same response also adds height to the content area,
+ * scrolling to bottom only scrolls to the bottom of the previous content
+ * area.
+ *
+ * This gives the adapter the possibility cache streams sent to the client.
+ * The caching may be made in adapter or at the client if the client
+ * supports caching. Zero or negavive value disbales the caching of this
+ * stream.
+ *
+ * Note, writing to the {@link OutputStream} is not synchronized by the terminal
+ * (to avoid stalls in other operations when eg. streaming to a slow network
+ * service or file system). If UI is changed as a side effect of writing to the
+ * output stream, developer must handle synchronization manually.
+ *
+ *
+ * @author Vaadin Ltd.
+ * @since 6.5
+ * @see PaintTarget#addVariable(VariableOwner, String, StreamVariable)
+ */
+public interface StreamVariable extends Serializable {
+
+ /**
+ * Invoked by the terminal when a new upload arrives, after
+ * {@link #streamingStarted(StreamingStartEvent)} method has been called.
+ * The terminal implementation will write the streamed variable to the
+ * returned output stream.
+ *
+ * @return Stream to which the uploaded file should be written.
+ */
+ public OutputStream getOutputStream();
+
+ /**
+ * Whether the {@link #onProgress(long, long)} method should be called
+ * during the upload.
+ *
+ * {@link #onProgress(long, long)} is called in a synchronized block when
+ * the content is being received. This is potentially bit slow, so we are
+ * calling that method only if requested. The value is requested after the
+ * {@link #uploadStarted(StreamingStartEvent)} event, but not after reading
+ * each buffer.
+ *
+ * @return true if this {@link StreamVariable} wants to by notified during
+ * the upload of the progress of streaming.
+ * @see #onProgress(StreamingProgressEvent)
+ */
+ public boolean listenProgress();
+
+ /**
+ * This method is called by the terminal if {@link #listenProgress()}
+ * returns true when the streaming starts.
+ */
+ public void onProgress(StreamingProgressEvent event);
+
+ public void streamingStarted(StreamingStartEvent event);
+
+ public void streamingFinished(StreamingEndEvent event);
+
+ public void streamingFailed(StreamingErrorEvent event);
+
+ /*
+ * Not synchronized to avoid stalls (caused by UIDL requests) while
+ * streaming the content. Implementations also most commonly atomic even
+ * without the restriction.
+ */
+ /**
+ * If this method returns true while the content is being streamed the
+ * Terminal to stop receiving current upload.
+ *
+ * Note, the usage of this method is not synchronized over the Application
+ * instance by the terminal like other methods. The implementation should
+ * only return a boolean field and especially not modify UI or implement a
+ * synchronization by itself.
+ *
+ * @return true if the streaming should be interrupted as soon as possible.
+ */
+ public boolean isInterrupted();
+
+ public interface StreamingEvent extends Serializable {
+
+ /**
+ * @return the file name of the streamed file if known
+ */
+ public String getFileName();
+
+ /**
+ * @return the mime type of the streamed file if known
+ */
+ public String getMimeType();
+
+ /**
+ * @return the length of the stream (in bytes) if known, else -1
+ */
+ public long getContentLength();
+
+ /**
+ * @return then number of bytes streamed to StreamVariable
+ */
+ public long getBytesReceived();
+ }
+
+ /**
+ * Event passed to {@link #uploadStarted(StreamingStartEvent)} method before
+ * the streaming of the content to {@link StreamVariable} starts.
+ */
+ public interface StreamingStartEvent extends StreamingEvent {
+ /**
+ * The owner of the StreamVariable can call this method to inform the
+ * terminal implementation that this StreamVariable will not be used to
+ * accept more post.
+ */
+ public void disposeStreamVariable();
+ }
+
+ /**
+ * Event passed to {@link #onProgress(StreamingProgressEvent)} method during
+ * the streaming progresses.
+ */
+ public interface StreamingProgressEvent extends StreamingEvent {
+ }
+
+ /**
+ * Event passed to {@link #uploadFinished(StreamingEndEvent)} method the
+ * contents have been streamed to StreamVariable successfully.
+ */
+ public interface StreamingEndEvent extends StreamingEvent {
+ }
+
+ /**
+ * Event passed to {@link #uploadFailed(StreamingErrorEvent)} method when
+ * the streaming ended before the end of the input. The streaming may fail
+ * due an interruption by {@link } or due an other unknown exception in
+ * communication. In the latter case the exception is also passed to
+ * {@link Application#terminalError(com.vaadin.server.Terminal.ErrorEvent)}
+ * .
+ */
+ public interface StreamingErrorEvent extends StreamingEvent {
+
+ /**
+ * @return the exception that caused the receiving not to finish cleanly
+ */
+ public Exception getException();
+
+ }
+
+}
diff --git a/server/src/com/vaadin/server/SystemError.java b/server/src/com/vaadin/server/SystemError.java
new file mode 100644
index 0000000000..453be4f632
--- /dev/null
+++ b/server/src/com/vaadin/server/SystemError.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
+
+/**
+ *
+ * Paints the Paintable into a UIDL stream. This method creates the UIDL
+ * sequence describing it and outputs it to the given UIDL stream.
+ *
+ * It is called when the contents of the component should be painted in
+ * response to the component first being shown or having been altered so
+ * that its visual representation is changed.
+ *
+ * For a Vaadin6Component, markAsDirty will also cause
+ * {@link #paintContent(PaintTarget)} to be called before sending changes to
+ * the client.
+ *
+ * @see com.vaadin.terminal.gwt.server.ClientConnector#markAsDirty()
+ */
+ @Override
+ public void markAsDirty();
+}
diff --git a/server/src/com/vaadin/server/VariableOwner.java b/server/src/com/vaadin/server/VariableOwner.java
new file mode 100644
index 0000000000..4c6c86669c
--- /dev/null
+++ b/server/src/com/vaadin/server/VariableOwner.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ *
+ * Listener interface for UI variable changes. The user communicates with the
+ * application using the so-called variables. When the user makes a
+ * change using the UI the terminal trasmits the changed variables to the
+ * application, and the components owning those variables may then process those
+ * changes.
+ *
+ * Tests if the variable owner is enabled or not. The terminal should not
+ * send any variable changes to disabled variable owners.
+ *
+ * Tests if the variable owner is in immediate mode or not. Being in
+ * immediate mode means that all variable changes are required to be sent
+ * back from the terminal immediately when they occur.
+ *
+ * Note:
+ * Either this method or getWriter() may be called to write the response,
+ * not both.
+ *
+ * @return a
+ * Either this method or getOutputStream() may be called to write the
+ * response, not both.
+ *
+ * @return a Provides classes and interfaces that wrap the terminal-side functionalities
+for the server-side application. (FIXME: This could be a little more descriptive and wordy.)
- * By default a state object of the defined return type of
- * {@link #getState()} is created. Subclasses can override this method and
- * return a new instance of the correct state class but this should rarely
- * be necessary.
- *
- * No configuration of the values of the state should be performed in
- * {@link #createState()}.
- *
- * @since 7.0
- *
- * @return new shared state object
- */
- protected SharedState createState() {
- try {
- return getStateType().newInstance();
- } catch (Exception e) {
- throw new RuntimeException(
- "Error creating state of type " + getStateType().getName()
- + " for " + getClass().getName(), e);
- }
- }
-
- @Override
- public Class extends SharedState> getStateType() {
- // Lazy load because finding type can be expensive because of the
- // exceptions flying around
- if (stateType == null) {
- stateType = findStateType();
- }
-
- return stateType;
- }
-
- private Class extends SharedState> findStateType() {
- try {
- Class> class1 = getClass();
- while (class1 != null) {
- try {
- Method m = class1.getDeclaredMethod("getState",
- (Class[]) null);
- Class> type = m.getReturnType();
- return type.asSubclass(SharedState.class);
- } catch (NoSuchMethodException nsme) {
- // Try in superclass instead
- class1 = class1.getSuperclass();
- }
- }
- throw new NoSuchMethodException(getClass().getCanonicalName()
- + ".getState()");
- } catch (Exception e) {
- throw new RuntimeException("Error finding state type for "
- + getClass().getName(), e);
- }
- }
-
- /**
- * Returns an RPC proxy for a given server to client RPC interface for this
- * component.
- *
- * TODO more javadoc, subclasses, ...
- *
- * @param rpcInterface
- * RPC interface type
- *
- * @since 7.0
- */
- public
- * The {@link #getApplication()} and {@link #getUI()} methods might return
- *
- * Extensions can use shared state and RPC in the same way as components.
- *
- * AbstractExtension adds a mechanism for adding the extension to any Connector
- * (extend). To let the Extension determine what kind target it can be added to,
- * the extend method is declared as protected.
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public abstract class AbstractExtension extends AbstractClientConnector
- implements Extension {
- private boolean previouslyAttached = false;
-
- /**
- * Gets a type that the parent must be an instance of. Override this if the
- * extension only support certain targets, e.g. if only TextFields can be
- * extended.
- *
- * @return a type that the parent must be an instance of
- */
- protected Class extends ClientConnector> getSupportedParentType() {
- return ClientConnector.class;
- }
-
- /**
- * Add this extension to the target connector. This method is protected to
- * allow subclasses to require a more specific type of target.
- *
- * @param target
- * the connector to attach this extension to
- */
- protected void extend(AbstractClientConnector target) {
- target.addExtension(this);
- }
-
- /**
- * Remove this extension from its target. After an extension has been
- * removed, it can not be attached again.
- */
- public void removeFromTarget() {
- getParent().removeExtension(this);
- }
-
- @Override
- public void setParent(ClientConnector parent) {
- if (previouslyAttached && parent != null) {
- throw new IllegalStateException(
- "An extension can not be set to extend a new target after getting detached from the previous.");
- }
-
- Class extends ClientConnector> supportedParentType = getSupportedParentType();
- if (parent == null || supportedParentType.isInstance(parent)) {
- super.setParent(parent);
- previouslyAttached = true;
- } else {
- throw new IllegalArgumentException(getClass().getName()
- + " can only be attached to targets of type "
- + supportedParentType.getName() + " but attach to "
- + parent.getClass().getName() + " was attempted.");
- }
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java b/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java
deleted file mode 100644
index c8700d12ab..0000000000
--- a/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import com.vaadin.shared.JavaScriptExtensionState;
-import com.vaadin.ui.JavaScriptFunction;
-
-/**
- * Base class for Extensions with all client-side logic implemented using
- * JavaScript.
- *
- * When a new JavaScript extension is initialized in the browser, the framework
- * will look for a globally defined JavaScript function that will initialize the
- * extension. The name of the initialization function is formed by replacing .
- * with _ in the name of the server-side class. If no such function is defined,
- * each super class is used in turn until a match is found. The framework will
- * thus first attempt with
- *
- * The initialization function will be called with
- *
- * Values in the Shared State and in RPC calls are converted between Java and
- * JavaScript using the following conventions:
- *
- *
- * This gives the adapter the possibility cache streams sent to the client.
- * The caching may be made in adapter or at the client if the client
- * supports caching. Default is
- * If the buffer size is 0, the buffer size is decided by the terminal
- * adapter. The default value is 0.
- *
- * This gives the adapter the possibility cache streams sent to the client.
- * The caching may be made in adapter or at the client if the client
- * supports caching. Zero or negavive value disbales the caching of this
- * stream.
- *
- * An extension can only be attached once. It is not supported to move an
- * extension from one target to another.
- *
- * Extensions can use shared state and RPC in the same way as components.
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public interface Extension extends ClientConnector {
- /*
- * Currently just an empty marker interface to distinguish between
- * extensions and other connectors, e.g. components
- */
-}
diff --git a/server/src/com/vaadin/terminal/ExternalResource.java b/server/src/com/vaadin/terminal/ExternalResource.java
deleted file mode 100644
index d970c0934b..0000000000
--- a/server/src/com/vaadin/terminal/ExternalResource.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.net.URL;
-
-import com.vaadin.service.FileTypeResolver;
-
-/**
- *
- * You should most likely no use this class directly.
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public class JavaScriptCallbackHelper implements Serializable {
-
- private static final Method CALL_METHOD = ReflectTools.findMethod(
- JavaScriptCallbackRpc.class, "call", String.class, JSONArray.class);
- private AbstractClientConnector connector;
-
- private Map
- * Paints the Paintable into a UIDL stream. This method creates the UIDL
- * sequence describing it and outputs it to the given UIDL stream.
- *
- * It is called when the contents of the component should be painted in
- * response to the component first being shown or having been altered so
- * that its visual representation is changed.
- *
- * Do not override this to paint your component. Override
- * {@link #paintContent(PaintTarget)} instead.
- *
- * This is only a helper until paint is moved away from this class.
- *
- * @return
- */
- protected static boolean isVisibleInContext(Component c) {
- HasComponents p = c.getParent();
- while (p != null) {
- if (!p.isVisible()) {
- return false;
- }
- p = p.getParent();
- }
- if (c.getParent() != null && !c.getParent().isComponentVisible(c)) {
- return false;
- }
-
- // All parents visible, return this state
- return c.isVisible();
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java
deleted file mode 100644
index 66ef7da296..0000000000
--- a/server/src/com/vaadin/terminal/Page.java
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.EventObject;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import com.vaadin.event.EventRouter;
-import com.vaadin.shared.ui.BorderStyle;
-import com.vaadin.shared.ui.ui.PageClientRpc;
-import com.vaadin.shared.ui.ui.UIConstants;
-import com.vaadin.terminal.WrappedRequest.BrowserDetails;
-import com.vaadin.terminal.gwt.server.WebApplicationContext;
-import com.vaadin.terminal.gwt.server.WebBrowser;
-import com.vaadin.tools.ReflectTools;
-import com.vaadin.ui.JavaScript;
-import com.vaadin.ui.Notification;
-import com.vaadin.ui.UI;
-
-public class Page implements Serializable {
-
- /**
- * Listener that gets notified when the size of the browser window
- * containing the uI has changed.
- *
- * @see UI#addListener(BrowserWindowResizeListener)
- */
- public interface BrowserWindowResizeListener extends Serializable {
- /**
- * Invoked when the browser window containing a UI has been resized.
- *
- * @param event
- * a browser window resize event
- */
- public void browserWindowResized(BrowserWindowResizeEvent event);
- }
-
- /**
- * Event that is fired when a browser window containing a uI is resized.
- */
- public class BrowserWindowResizeEvent extends EventObject {
-
- private final int width;
- private final int height;
-
- /**
- * Creates a new event
- *
- * @param source
- * the uI for which the browser window has been resized
- * @param width
- * the new width of the browser window
- * @param height
- * the new height of the browser window
- */
- public BrowserWindowResizeEvent(Page source, int width, int height) {
- super(source);
- this.width = width;
- this.height = height;
- }
-
- @Override
- public Page getSource() {
- return (Page) super.getSource();
- }
-
- /**
- * Gets the new browser window height
- *
- * @return an integer with the new pixel height of the browser window
- */
- public int getHeight() {
- return height;
- }
-
- /**
- * Gets the new browser window width
- *
- * @return an integer with the new pixel width of the browser window
- */
- public int getWidth() {
- return width;
- }
- }
-
- /**
- * Private class for storing properties related to opening resources.
- */
- private class OpenResource implements Serializable {
-
- /**
- * The resource to open
- */
- private final Resource resource;
-
- /**
- * The name of the target window
- */
- private final String name;
-
- /**
- * The width of the target window
- */
- private final int width;
-
- /**
- * The height of the target window
- */
- private final int height;
-
- /**
- * The border style of the target window
- */
- private final BorderStyle border;
-
- /**
- * Creates a new open resource.
- *
- * @param resource
- * The resource to open
- * @param name
- * The name of the target window
- * @param width
- * The width of the target window
- * @param height
- * The height of the target window
- * @param border
- * The border style of the target window
- */
- private OpenResource(Resource resource, String name, int width,
- int height, BorderStyle border) {
- this.resource = resource;
- this.name = name;
- this.width = width;
- this.height = height;
- this.border = border;
- }
-
- /**
- * Paints the open request. Should be painted inside the window.
- *
- * @param target
- * the paint target
- * @throws PaintException
- * if the paint operation fails
- */
- private void paintContent(PaintTarget target) throws PaintException {
- target.startTag("open");
- target.addAttribute("src", resource);
- if (name != null && name.length() > 0) {
- target.addAttribute("name", name);
- }
- if (width >= 0) {
- target.addAttribute("width", width);
- }
- if (height >= 0) {
- target.addAttribute("height", height);
- }
- switch (border) {
- case MINIMAL:
- target.addAttribute("border", "minimal");
- break;
- case NONE:
- target.addAttribute("border", "none");
- break;
- }
-
- target.endTag("open");
- }
- }
-
- private static final Method BROWSWER_RESIZE_METHOD = ReflectTools
- .findMethod(BrowserWindowResizeListener.class,
- "browserWindowResized", BrowserWindowResizeEvent.class);
-
- /**
- * A border style used for opening resources in a window without a border.
- */
- @Deprecated
- public static final BorderStyle BORDER_NONE = BorderStyle.NONE;
-
- /**
- * A border style used for opening resources in a window with a minimal
- * border.
- */
- public static final BorderStyle BORDER_MINIMAL = BorderStyle.MINIMAL;
-
- /**
- * A border style that indicates that the default border style should be
- * used when opening resources.
- */
- public static final BorderStyle BORDER_DEFAULT = BorderStyle.DEFAULT;
-
- /**
- * Listener that listens changes in URI fragment.
- */
- public interface FragmentChangedListener extends Serializable {
- public void fragmentChanged(FragmentChangedEvent event);
- }
-
- private static final Method FRAGMENT_CHANGED_METHOD = ReflectTools
- .findMethod(Page.FragmentChangedListener.class, "fragmentChanged",
- FragmentChangedEvent.class);
-
- /**
- * Resources to be opened automatically on next repaint. The list is
- * automatically cleared when it has been sent to the client.
- */
- private final LinkedList
- * To listen changes in fragment, hook a
- * {@link Page.FragmentChangedListener}.
- *
- * @return the current fragment in browser uri or null if not known
- */
- public String getFragment() {
- return fragment;
- }
-
- public void init(WrappedRequest request) {
- BrowserDetails browserDetails = request.getBrowserDetails();
- if (browserDetails != null) {
- fragment = browserDetails.getUriFragment();
- }
- }
-
- public WebBrowser getWebBrowser() {
- return ((WebApplicationContext) uI.getApplication().getContext())
- .getBrowser();
- }
-
- public void setBrowserWindowSize(int width, int height) {
- boolean fireEvent = false;
-
- if (width != browserWindowWidth) {
- browserWindowWidth = width;
- fireEvent = true;
- }
-
- if (height != browserWindowHeight) {
- browserWindowHeight = height;
- fireEvent = true;
- }
-
- if (fireEvent) {
- fireEvent(new BrowserWindowResizeEvent(this, browserWindowWidth,
- browserWindowHeight));
- }
-
- }
-
- /**
- * Adds a new {@link BrowserWindowResizeListener} to this uI. The listener
- * will be notified whenever the browser window within which this uI
- * resides is resized.
- *
- * @param resizeListener
- * the listener to add
- *
- * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent)
- * @see #setResizeLazy(boolean)
- */
- public void addListener(BrowserWindowResizeListener resizeListener) {
- addListener(BrowserWindowResizeEvent.class, resizeListener,
- BROWSWER_RESIZE_METHOD);
- }
-
- /**
- * Removes a {@link BrowserWindowResizeListener} from this uI. The
- * listener will no longer be notified when the browser window is resized.
- *
- * @param resizeListener
- * the listener to remove
- */
- public void removeListener(BrowserWindowResizeListener resizeListener) {
- removeListener(BrowserWindowResizeEvent.class, resizeListener,
- BROWSWER_RESIZE_METHOD);
- }
-
- /**
- * Gets the last known height of the browser window in which this uI
- * resides.
- *
- * @return the browser window height in pixels
- */
- public int getBrowserWindowHeight() {
- return browserWindowHeight;
- }
-
- /**
- * Gets the last known width of the browser window in which this uI
- * resides.
- *
- * @return the browser window width in pixels
- */
- public int getBrowserWindowWidth() {
- return browserWindowWidth;
- }
-
- public JavaScript getJavaScript() {
- if (javaScript == null) {
- // Create and attach on first use
- javaScript = new JavaScript();
- javaScript.extend(uI);
- }
-
- return javaScript;
- }
-
- public void paintContent(PaintTarget target) throws PaintException {
- if (!openList.isEmpty()) {
- for (final Iterator
- * The supplied {@code windowName} is used as the target name in a
- * window.open call in the client. This means that special values such as
- * "_blank", "_self", "_top", "_parent" have special meaning. An empty or
- *
- * "", null and "_self" as {@code windowName} all causes the resource to be
- * opened in the current window, replacing any old contents. For
- * downloadable content you should avoid "_self" as "_self" causes the
- * client to skip rendering of any other changes as it considers them
- * irrelevant (the page will be replaced by the resource). This can speed up
- * the opening of a resource, but it might also put the client side into an
- * inconsistent state if the window content is not completely replaced e.g.,
- * if the resource is downloaded instead of displayed in the browser.
- *
- * "_blank" as {@code windowName} causes the resource to always be opened in
- * a new window or tab (depends on the browser and browser settings).
- *
- * "_top" and "_parent" as {@code windowName} works as specified by the HTML
- * standard.
- *
- * Any other {@code windowName} will open the resource in a window with that
- * name, either by opening a new window/tab in the browser or by replacing
- * the contents of an existing window with that name.
- *
- * If the {@link Component} is found in cache and this function returns true
- * it may omit the content and close the tag, in which case cached content
- * should be used.
- *
- * This method may also add only a reference to the paintable and queue the
- * paintable to be painted separately.
- *
- * Each paintable being painted should be closed by a matching
- * {@link #endPaintable(Component)} regardless of the {@link PaintStatus}
- * returned.
- *
- * The urls in UIDL message may use Vaadin specific protocol. Before
- * actually using the urls on the client side, they should be passed via
- * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}.
- *
- * Note that in current terminal implementation StreamVariables are cleaned
- * from the terminal only when:
- *
- * Prints full XML section. The section data must be XML and it is
- * surrounded by XML start and end-tags.
- *
- * This interface is implemented by all visual objects that can be scrolled
- * programmatically from the server-side. The unit of scrolling is pixel.
- *
- * Scrolling offset is the number of pixels this scrollable has been
- * scrolled right.
- *
- * Scrolling offset is the number of pixels this scrollable has been
- * scrolled right.
- *
- * Scrolling offset is the number of pixels this scrollable has been
- * scrolled down.
- *
- * Scrolling offset is the number of pixels this scrollable has been
- * scrolled down.
- *
- * The scrolling position is limited by the current height of the content
- * area. If the position is below the height, it is scrolled to the bottom.
- * However, if the same response also adds height to the content area,
- * scrolling to bottom only scrolls to the bottom of the previous content
- * area.
- *
- * This gives the adapter the possibility cache streams sent to the client.
- * The caching may be made in adapter or at the client if the client
- * supports caching. Zero or negavive value disbales the caching of this
- * stream.
- *
- * Note, writing to the {@link OutputStream} is not synchronized by the terminal
- * (to avoid stalls in other operations when eg. streaming to a slow network
- * service or file system). If UI is changed as a side effect of writing to the
- * output stream, developer must handle synchronization manually.
- *
- *
- * @author Vaadin Ltd.
- * @since 6.5
- * @see PaintTarget#addVariable(VariableOwner, String, StreamVariable)
- */
-public interface StreamVariable extends Serializable {
-
- /**
- * Invoked by the terminal when a new upload arrives, after
- * {@link #streamingStarted(StreamingStartEvent)} method has been called.
- * The terminal implementation will write the streamed variable to the
- * returned output stream.
- *
- * @return Stream to which the uploaded file should be written.
- */
- public OutputStream getOutputStream();
-
- /**
- * Whether the {@link #onProgress(long, long)} method should be called
- * during the upload.
- *
- * {@link #onProgress(long, long)} is called in a synchronized block when
- * the content is being received. This is potentially bit slow, so we are
- * calling that method only if requested. The value is requested after the
- * {@link #uploadStarted(StreamingStartEvent)} event, but not after reading
- * each buffer.
- *
- * @return true if this {@link StreamVariable} wants to by notified during
- * the upload of the progress of streaming.
- * @see #onProgress(StreamingProgressEvent)
- */
- public boolean listenProgress();
-
- /**
- * This method is called by the terminal if {@link #listenProgress()}
- * returns true when the streaming starts.
- */
- public void onProgress(StreamingProgressEvent event);
-
- public void streamingStarted(StreamingStartEvent event);
-
- public void streamingFinished(StreamingEndEvent event);
-
- public void streamingFailed(StreamingErrorEvent event);
-
- /*
- * Not synchronized to avoid stalls (caused by UIDL requests) while
- * streaming the content. Implementations also most commonly atomic even
- * without the restriction.
- */
- /**
- * If this method returns true while the content is being streamed the
- * Terminal to stop receiving current upload.
- *
- * Note, the usage of this method is not synchronized over the Application
- * instance by the terminal like other methods. The implementation should
- * only return a boolean field and especially not modify UI or implement a
- * synchronization by itself.
- *
- * @return true if the streaming should be interrupted as soon as possible.
- */
- public boolean isInterrupted();
-
- public interface StreamingEvent extends Serializable {
-
- /**
- * @return the file name of the streamed file if known
- */
- public String getFileName();
-
- /**
- * @return the mime type of the streamed file if known
- */
- public String getMimeType();
-
- /**
- * @return the length of the stream (in bytes) if known, else -1
- */
- public long getContentLength();
-
- /**
- * @return then number of bytes streamed to StreamVariable
- */
- public long getBytesReceived();
- }
-
- /**
- * Event passed to {@link #uploadStarted(StreamingStartEvent)} method before
- * the streaming of the content to {@link StreamVariable} starts.
- */
- public interface StreamingStartEvent extends StreamingEvent {
- /**
- * The owner of the StreamVariable can call this method to inform the
- * terminal implementation that this StreamVariable will not be used to
- * accept more post.
- */
- public void disposeStreamVariable();
- }
-
- /**
- * Event passed to {@link #onProgress(StreamingProgressEvent)} method during
- * the streaming progresses.
- */
- public interface StreamingProgressEvent extends StreamingEvent {
- }
-
- /**
- * Event passed to {@link #uploadFinished(StreamingEndEvent)} method the
- * contents have been streamed to StreamVariable successfully.
- */
- public interface StreamingEndEvent extends StreamingEvent {
- }
-
- /**
- * Event passed to {@link #uploadFailed(StreamingErrorEvent)} method when
- * the streaming ended before the end of the input. The streaming may fail
- * due an interruption by {@link } or due an other unknown exception in
- * communication. In the latter case the exception is also passed to
- * {@link Application#terminalError(com.vaadin.terminal.Terminal.ErrorEvent)}
- * .
- */
- public interface StreamingErrorEvent extends StreamingEvent {
-
- /**
- * @return the exception that caused the receiving not to finish cleanly
- */
- public Exception getException();
-
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/SystemError.java b/server/src/com/vaadin/terminal/SystemError.java
deleted file mode 100644
index c4cb7eef0c..0000000000
--- a/server/src/com/vaadin/terminal/SystemError.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
-
-/**
- *
- * Paints the Paintable into a UIDL stream. This method creates the UIDL
- * sequence describing it and outputs it to the given UIDL stream.
- *
- * It is called when the contents of the component should be painted in
- * response to the component first being shown or having been altered so
- * that its visual representation is changed.
- *
- * For a Vaadin6Component, markAsDirty will also cause
- * {@link #paintContent(PaintTarget)} to be called before sending changes to
- * the client.
- *
- * @see com.vaadin.terminal.gwt.server.ClientConnector#markAsDirty()
- */
- @Override
- public void markAsDirty();
-}
diff --git a/server/src/com/vaadin/terminal/VariableOwner.java b/server/src/com/vaadin/terminal/VariableOwner.java
deleted file mode 100644
index faa0298311..0000000000
--- a/server/src/com/vaadin/terminal/VariableOwner.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
- *
- * Listener interface for UI variable changes. The user communicates with the
- * application using the so-called variables. When the user makes a
- * change using the UI the terminal trasmits the changed variables to the
- * application, and the components owning those variables may then process those
- * changes.
- *
- * Tests if the variable owner is enabled or not. The terminal should not
- * send any variable changes to disabled variable owners.
- *
- * Tests if the variable owner is in immediate mode or not. Being in
- * immediate mode means that all variable changes are required to be sent
- * back from the terminal immediately when they occur.
- *
- * Note:
- * Either this method or getWriter() may be called to write the response,
- * not both.
- *
- * @return a
- * Either this method or getOutputStream() may be called to write the
- * response, not both.
- *
- * @return a Provides classes and interfaces that wrap the terminal-side functionalities
-for the server-side application. (FIXME: This could be a little more descriptive and wordy.)
diff --git a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java
index bd5735144e..3b80ac1f68 100644
--- a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java
+++ b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java
@@ -15,8 +15,8 @@
*/
package com.vaadin.ui;
+import com.vaadin.server.JavaScriptCallbackHelper;
import com.vaadin.shared.ui.JavaScriptComponentState;
-import com.vaadin.terminal.JavaScriptCallbackHelper;
/**
* Base class for Components with all client-side logic implemented using
diff --git a/server/src/com/vaadin/ui/AbstractMedia.java b/server/src/com/vaadin/ui/AbstractMedia.java
index 77c12ac045..f26fe714b9 100644
--- a/server/src/com/vaadin/ui/AbstractMedia.java
+++ b/server/src/com/vaadin/ui/AbstractMedia.java
@@ -19,10 +19,10 @@ package com.vaadin.ui;
import java.util.ArrayList;
import java.util.List;
+import com.vaadin.server.Resource;
import com.vaadin.shared.communication.URLReference;
import com.vaadin.shared.ui.AbstractMediaState;
import com.vaadin.shared.ui.MediaControl;
-import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.server.ResourceReference;
/**
diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
index 596bbb7ee2..53572097e0 100644
--- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
@@ -22,6 +22,7 @@ import java.util.LinkedList;
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
+import com.vaadin.server.Sizeable;
import com.vaadin.shared.Connector;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
@@ -29,7 +30,6 @@ import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutServerRpc;
import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState;
import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState.ChildComponentData;
-import com.vaadin.terminal.Sizeable;
@SuppressWarnings("serial")
public abstract class AbstractOrderedLayout extends AbstractLayout implements
diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java
index 21ff7ba948..05169552d7 100644
--- a/server/src/com/vaadin/ui/AbstractSelect.java
+++ b/server/src/com/vaadin/ui/AbstractSelect.java
@@ -39,12 +39,12 @@ import com.vaadin.event.dd.TargetDetailsImpl;
import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion;
import com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor;
import com.vaadin.event.dd.acceptcriteria.TargetDetailIs;
+import com.vaadin.server.KeyMapper;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
-import com.vaadin.terminal.KeyMapper;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
/**
diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java
index 8b7499115c..f9fea66276 100644
--- a/server/src/com/vaadin/ui/AbstractSplitPanel.java
+++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java
@@ -22,12 +22,12 @@ import java.util.Iterator;
import com.vaadin.event.ComponentEventListener;
import com.vaadin.event.MouseEvents.ClickEvent;
+import com.vaadin.server.Sizeable;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelRpc;
import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState;
import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState.SplitterState;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.tools.ReflectTools;
/**
diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java
index 1bd61023a4..94a32dac96 100644
--- a/server/src/com/vaadin/ui/AbstractTextField.java
+++ b/server/src/com/vaadin/ui/AbstractTextField.java
@@ -27,11 +27,11 @@ import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.event.FieldEvents.TextChangeEvent;
import com.vaadin.event.FieldEvents.TextChangeListener;
import com.vaadin.event.FieldEvents.TextChangeNotifier;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.textfield.AbstractTextFieldState;
import com.vaadin.shared.ui.textfield.TextFieldConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
public abstract class AbstractTextField extends AbstractField
* The image is loaded by the browser from a resource, typically a
- * {@link com.vaadin.terminal.ThemeResource}.
+ * {@link com.vaadin.server.ThemeResource}.
*
diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java
index ec805ecf46..fcd0b95015 100644
--- a/server/src/com/vaadin/ui/DragAndDropWrapper.java
+++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java
@@ -29,14 +29,14 @@ import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.TargetDetails;
import com.vaadin.event.dd.TargetDetailsImpl;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.StreamVariable;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.dd.HorizontalDropLocation;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.StreamVariable;
-import com.vaadin.terminal.Vaadin6Component;
@SuppressWarnings("serial")
public class DragAndDropWrapper extends CustomComponent implements DropTarget,
diff --git a/server/src/com/vaadin/ui/Embedded.java b/server/src/com/vaadin/ui/Embedded.java
index 41b93d0b27..a8663abd32 100644
--- a/server/src/com/vaadin/ui/Embedded.java
+++ b/server/src/com/vaadin/ui/Embedded.java
@@ -22,14 +22,14 @@ import java.util.Map;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.embedded.EmbeddedConstants;
import com.vaadin.shared.ui.embedded.EmbeddedServerRpc;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
/**
* Component for embedding external objects.
diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java
index 55404b2e6b..8bf46ed198 100644
--- a/server/src/com/vaadin/ui/Form.java
+++ b/server/src/com/vaadin/ui/Form.java
@@ -36,14 +36,14 @@ import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.Action.ShortcutNotifier;
import com.vaadin.event.ActionManager;
+import com.vaadin.server.AbstractErrorMessage;
+import com.vaadin.server.CompositeErrorMessage;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.UserError;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.form.FormState;
-import com.vaadin.terminal.AbstractErrorMessage;
-import com.vaadin.terminal.CompositeErrorMessage;
-import com.vaadin.terminal.ErrorMessage;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.UserError;
-import com.vaadin.terminal.Vaadin6Component;
/**
* Form component provides easy way of creating and managing sets fields.
diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java
index 3870b71611..27a25699ba 100644
--- a/server/src/com/vaadin/ui/GridLayout.java
+++ b/server/src/com/vaadin/ui/GridLayout.java
@@ -27,16 +27,16 @@ import java.util.Map.Entry;
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
+import com.vaadin.server.LegacyPaint;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.Connector;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.gridlayout.GridLayoutServerRpc;
import com.vaadin.shared.ui.gridlayout.GridLayoutState;
-import com.vaadin.terminal.LegacyPaint;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
/**
* A layout where the components are laid out on a grid using cell coordinates.
diff --git a/server/src/com/vaadin/ui/Html5File.java b/server/src/com/vaadin/ui/Html5File.java
index 596f83a1d8..47af708160 100644
--- a/server/src/com/vaadin/ui/Html5File.java
+++ b/server/src/com/vaadin/ui/Html5File.java
@@ -18,7 +18,7 @@ package com.vaadin.ui;
import java.io.Serializable;
import com.vaadin.event.dd.DropHandler;
-import com.vaadin.terminal.StreamVariable;
+import com.vaadin.server.StreamVariable;
/**
* {@link DragAndDropWrapper} can receive also files from client computer if
diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java
index b0dbc9e629..8e43d88b37 100644
--- a/server/src/com/vaadin/ui/Image.java
+++ b/server/src/com/vaadin/ui/Image.java
@@ -6,11 +6,11 @@ package com.vaadin.ui;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
+import com.vaadin.server.Resource;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.image.ImageServerRpc;
import com.vaadin.shared.ui.image.ImageState;
-import com.vaadin.terminal.Resource;
/**
* Component for embedding images.
diff --git a/server/src/com/vaadin/ui/JavaScript.java b/server/src/com/vaadin/ui/JavaScript.java
index e34ccae82a..f3e8564fab 100644
--- a/server/src/com/vaadin/ui/JavaScript.java
+++ b/server/src/com/vaadin/ui/JavaScript.java
@@ -21,11 +21,11 @@ import java.util.Map;
import com.vaadin.external.json.JSONArray;
import com.vaadin.external.json.JSONException;
+import com.vaadin.server.AbstractExtension;
+import com.vaadin.server.Page;
import com.vaadin.shared.communication.ServerRpc;
import com.vaadin.shared.extension.javascriptmanager.ExecuteJavaScriptRpc;
import com.vaadin.shared.extension.javascriptmanager.JavaScriptManagerState;
-import com.vaadin.terminal.AbstractExtension;
-import com.vaadin.terminal.Page;
/**
* Provides access to JavaScript functionality in the web browser. To get an
diff --git a/server/src/com/vaadin/ui/JavaScriptFunction.java b/server/src/com/vaadin/ui/JavaScriptFunction.java
index 3a17fef995..ebb5e2c073 100644
--- a/server/src/com/vaadin/ui/JavaScriptFunction.java
+++ b/server/src/com/vaadin/ui/JavaScriptFunction.java
@@ -20,7 +20,7 @@ import java.io.Serializable;
import com.vaadin.external.json.JSONArray;
import com.vaadin.external.json.JSONException;
-import com.vaadin.terminal.AbstractJavaScriptExtension;
+import com.vaadin.server.AbstractJavaScriptExtension;
/**
* Defines a method that is called by a client-side JavaScript function. When
diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java
index f98a2b0d2d..cb6b643c33 100644
--- a/server/src/com/vaadin/ui/Link.java
+++ b/server/src/com/vaadin/ui/Link.java
@@ -18,11 +18,11 @@ package com.vaadin.ui;
import java.util.Map;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.BorderStyle;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
/**
* Link is used to create external or internal URL links.
diff --git a/server/src/com/vaadin/ui/ListSelect.java b/server/src/com/vaadin/ui/ListSelect.java
index da78e24fa8..90e1c16a4d 100644
--- a/server/src/com/vaadin/ui/ListSelect.java
+++ b/server/src/com/vaadin/ui/ListSelect.java
@@ -19,8 +19,8 @@ package com.vaadin.ui;
import java.util.Collection;
import com.vaadin.data.Container;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
/**
* This is a simple list select without, for instance, support for new items,
diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java
index 1c154699d8..7715f08a6e 100644
--- a/server/src/com/vaadin/ui/LoginForm.java
+++ b/server/src/com/vaadin/ui/LoginForm.java
@@ -25,12 +25,12 @@ import java.util.Iterator;
import java.util.Map;
import com.vaadin.Application;
+import com.vaadin.server.ApplicationResource;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
/**
* LoginForm is a Vaadin component to handle common problem among Ajax
diff --git a/server/src/com/vaadin/ui/MenuBar.java b/server/src/com/vaadin/ui/MenuBar.java
index 51c06cf934..4414bef9aa 100644
--- a/server/src/com/vaadin/ui/MenuBar.java
+++ b/server/src/com/vaadin/ui/MenuBar.java
@@ -22,11 +22,11 @@ import java.util.List;
import java.util.Map;
import java.util.Stack;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.menubar.MenuBarConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
/**
*
diff --git a/server/src/com/vaadin/ui/NativeSelect.java b/server/src/com/vaadin/ui/NativeSelect.java
index c2969874b0..8006813276 100644
--- a/server/src/com/vaadin/ui/NativeSelect.java
+++ b/server/src/com/vaadin/ui/NativeSelect.java
@@ -19,8 +19,8 @@ package com.vaadin.ui;
import java.util.Collection;
import com.vaadin.data.Container;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
/**
* This is a simple drop-down select without, for instance, support for
diff --git a/server/src/com/vaadin/ui/Notification.java b/server/src/com/vaadin/ui/Notification.java
index 22ad31dffe..758d2c86a3 100644
--- a/server/src/com/vaadin/ui/Notification.java
+++ b/server/src/com/vaadin/ui/Notification.java
@@ -18,9 +18,9 @@ package com.vaadin.ui;
import java.io.Serializable;
+import com.vaadin.server.Page;
+import com.vaadin.server.Resource;
import com.vaadin.shared.Position;
-import com.vaadin.terminal.Page;
-import com.vaadin.terminal.Resource;
/**
* A notification message, used to display temporary messages to the user - for
diff --git a/server/src/com/vaadin/ui/OptionGroup.java b/server/src/com/vaadin/ui/OptionGroup.java
index 12507442c9..8846ec36e3 100644
--- a/server/src/com/vaadin/ui/OptionGroup.java
+++ b/server/src/com/vaadin/ui/OptionGroup.java
@@ -27,9 +27,9 @@ import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
import com.vaadin.shared.ui.optiongroup.OptionGroupConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
/**
* Configures select to be used as an option group.
diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java
index 00810b83db..d076e4d612 100644
--- a/server/src/com/vaadin/ui/Panel.java
+++ b/server/src/com/vaadin/ui/Panel.java
@@ -25,14 +25,14 @@ import com.vaadin.event.Action.Handler;
import com.vaadin.event.ActionManager;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Scrollable;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.panel.PanelServerRpc;
import com.vaadin.shared.ui.panel.PanelState;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Scrollable;
-import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.ui.Component.Focusable;
/**
@@ -195,8 +195,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
/*
* (non-Javadoc)
*
- * @see
- * com.vaadin.terminal.Vaadin6Component#paintContent(com.vaadin.terminal
+ * @see com.vaadin.server.Vaadin6Component#paintContent(com.vaadin.server
* .PaintTarget)
*/
@Override
@@ -250,7 +249,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
* Called when one or more variables handled by the implementing class are
* changed.
*
- * @see com.vaadin.terminal.VariableOwner#changeVariables(Object, Map)
+ * @see com.vaadin.server.VariableOwner#changeVariables(Object, Map)
*/
@Override
@SuppressWarnings("unchecked")
@@ -289,7 +288,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
+ * @see com.vaadin.server.Scrollable#setScrollable(boolean)
*/
@Override
public int getScrollLeft() {
@@ -299,7 +298,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Scrollable#setScrollable(boolean)
+ * @see com.vaadin.server.Scrollable#setScrollable(boolean)
*/
@Override
public int getScrollTop() {
@@ -309,7 +308,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Scrollable#setScrollLeft(int)
+ * @see com.vaadin.server.Scrollable#setScrollLeft(int)
*/
@Override
public void setScrollLeft(int scrollLeft) {
@@ -323,7 +322,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Scrollable#setScrollTop(int)
+ * @see com.vaadin.server.Scrollable#setScrollTop(int)
*/
@Override
public void setScrollTop(int scrollTop) {
diff --git a/server/src/com/vaadin/ui/PopupDateField.java b/server/src/com/vaadin/ui/PopupDateField.java
index acff49a142..39e0578301 100644
--- a/server/src/com/vaadin/ui/PopupDateField.java
+++ b/server/src/com/vaadin/ui/PopupDateField.java
@@ -19,8 +19,8 @@ package com.vaadin.ui;
import java.util.Date;
import com.vaadin.data.Property;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
/**
*
diff --git a/server/src/com/vaadin/ui/PopupView.java b/server/src/com/vaadin/ui/PopupView.java
index 786257c240..a4832a013f 100644
--- a/server/src/com/vaadin/ui/PopupView.java
+++ b/server/src/com/vaadin/ui/PopupView.java
@@ -20,10 +20,10 @@ import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.Map;
-import com.vaadin.terminal.LegacyPaint;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
+import com.vaadin.server.LegacyPaint;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
/**
*
@@ -309,7 +309,7 @@ public class PopupView extends AbstractComponentContainer implements
/**
* Paint (serialize) the component for the client.
*
- * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.terminal.PaintTarget)
+ * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.server.PaintTarget)
*/
@Override
public void paintContent(PaintTarget target) throws PaintException {
diff --git a/server/src/com/vaadin/ui/ProgressIndicator.java b/server/src/com/vaadin/ui/ProgressIndicator.java
index 528c404ab9..4ad441a949 100644
--- a/server/src/com/vaadin/ui/ProgressIndicator.java
+++ b/server/src/com/vaadin/ui/ProgressIndicator.java
@@ -20,9 +20,9 @@ import java.util.Map;
import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
/**
*
diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java
index 82faedcc41..f84e6f52ad 100644
--- a/server/src/com/vaadin/ui/TabSheet.java
+++ b/server/src/com/vaadin/ui/TabSheet.java
@@ -30,15 +30,15 @@ import com.vaadin.event.FieldEvents.BlurNotifier;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.KeyMapper;
+import com.vaadin.server.LegacyPaint;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.tabsheet.TabsheetBaseConstants;
import com.vaadin.shared.ui.tabsheet.TabsheetConstants;
-import com.vaadin.terminal.ErrorMessage;
-import com.vaadin.terminal.KeyMapper;
-import com.vaadin.terminal.LegacyPaint;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.ui.themes.Reindeer;
import com.vaadin.ui.themes.Runo;
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index 8fc3fc2572..118e3b3fcf 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -52,13 +52,13 @@ import com.vaadin.event.dd.DragSource;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.DropTarget;
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
+import com.vaadin.server.KeyMapper;
+import com.vaadin.server.LegacyPaint;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.table.TableConstants;
-import com.vaadin.terminal.KeyMapper;
-import com.vaadin.terminal.LegacyPaint;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
/**
*
@@ -4759,7 +4759,7 @@ public class Table extends AbstractSelect implements Action.Container,
*
* @see
* com.vaadin.event.dd.acceptcriteria.AcceptCriterion#paintResponse(
- * com.vaadin.terminal.PaintTarget)
+ * com.vaadin.server.PaintTarget)
*/
@Override
diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java
index 2d6673a67d..529847d54c 100644
--- a/server/src/com/vaadin/ui/Tree.java
+++ b/server/src/com/vaadin/ui/Tree.java
@@ -49,13 +49,13 @@ import com.vaadin.event.dd.TargetDetails;
import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion;
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
import com.vaadin.event.dd.acceptcriteria.TargetDetailIs;
+import com.vaadin.server.KeyMapper;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.shared.ui.tree.TreeConstants;
-import com.vaadin.terminal.KeyMapper;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
import com.vaadin.tools.ReflectTools;
/**
@@ -1449,7 +1449,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
*
* @see
* com.vaadin.event.dd.acceptCriteria.AcceptCriterion#paintResponse(
- * com.vaadin.terminal.PaintTarget)
+ * com.vaadin.server.PaintTarget)
*/
@Override
public void paintResponse(PaintTarget target) throws PaintException {
diff --git a/server/src/com/vaadin/ui/TreeTable.java b/server/src/com/vaadin/ui/TreeTable.java
index 05757a6d09..dd79461f37 100644
--- a/server/src/com/vaadin/ui/TreeTable.java
+++ b/server/src/com/vaadin/ui/TreeTable.java
@@ -32,10 +32,10 @@ import com.vaadin.data.Container.ItemSetChangeEvent;
import com.vaadin.data.util.ContainerHierarchicalWrapper;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.data.util.HierarchicalContainerOrderedWrapper;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
import com.vaadin.shared.ui.treetable.TreeTableConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
import com.vaadin.ui.Tree.CollapseEvent;
import com.vaadin.ui.Tree.CollapseListener;
import com.vaadin.ui.Tree.ExpandEvent;
diff --git a/server/src/com/vaadin/ui/TwinColSelect.java b/server/src/com/vaadin/ui/TwinColSelect.java
index 891e695a5f..76f1e1e8c7 100644
--- a/server/src/com/vaadin/ui/TwinColSelect.java
+++ b/server/src/com/vaadin/ui/TwinColSelect.java
@@ -19,9 +19,9 @@ package com.vaadin.ui;
import java.util.Collection;
import com.vaadin.data.Container;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
/**
* Multiselect component with two lists: left side for available items and right
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 17a028bcdf..4731ebffe6 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -34,21 +34,21 @@ import com.vaadin.event.Action.Handler;
import com.vaadin.event.ActionManager;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
+import com.vaadin.server.Page;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Vaadin6Component;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.Page.BrowserWindowResizeEvent;
+import com.vaadin.server.Page.BrowserWindowResizeListener;
+import com.vaadin.server.WrappedRequest.BrowserDetails;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.BorderStyle;
import com.vaadin.shared.ui.ui.UIConstants;
import com.vaadin.shared.ui.ui.UIServerRpc;
import com.vaadin.shared.ui.ui.UIState;
-import com.vaadin.terminal.Page;
-import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
-import com.vaadin.terminal.Page.BrowserWindowResizeListener;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Vaadin6Component;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedRequest.BrowserDetails;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.tools.ReflectTools;
diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java
index 619db07eea..683b9ce478 100644
--- a/server/src/com/vaadin/ui/Upload.java
+++ b/server/src/com/vaadin/ui/Upload.java
@@ -24,10 +24,10 @@ import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.StreamVariable.StreamingProgressEvent;
-import com.vaadin.terminal.Vaadin6Component;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
+import com.vaadin.server.StreamVariable.StreamingProgressEvent;
import com.vaadin.terminal.gwt.server.NoInputStreamException;
import com.vaadin.terminal.gwt.server.NoOutputStreamException;
@@ -936,11 +936,11 @@ public class Upload extends AbstractComponent implements Component.Focusable,
* Handle to terminal via Upload monitors and controls the upload during it
* is being streamed.
*/
- private com.vaadin.terminal.StreamVariable streamVariable;
+ private com.vaadin.server.StreamVariable streamVariable;
- protected com.vaadin.terminal.StreamVariable getStreamVariable() {
+ protected com.vaadin.server.StreamVariable getStreamVariable() {
if (streamVariable == null) {
- streamVariable = new com.vaadin.terminal.StreamVariable() {
+ streamVariable = new com.vaadin.server.StreamVariable() {
private StreamingStartEvent lastStartedEvent;
@Override
diff --git a/server/src/com/vaadin/ui/Video.java b/server/src/com/vaadin/ui/Video.java
index b54d404da6..939614c7a1 100644
--- a/server/src/com/vaadin/ui/Video.java
+++ b/server/src/com/vaadin/ui/Video.java
@@ -16,8 +16,8 @@
package com.vaadin.ui;
+import com.vaadin.server.Resource;
import com.vaadin.shared.ui.video.VideoState;
-import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.server.ResourceReference;
/**
diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java
index 6102350566..af85439e23 100644
--- a/server/src/com/vaadin/ui/Window.java
+++ b/server/src/com/vaadin/ui/Window.java
@@ -31,12 +31,12 @@ import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.event.ShortcutListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.window.WindowServerRpc;
import com.vaadin.shared.ui.window.WindowState;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
/**
* A component that represents a floating popup window that can be added to a
@@ -127,7 +127,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier,
/*
* (non-Javadoc)
*
- * @see com.vaadin.ui.Panel#paintContent(com.vaadin.terminal.PaintTarget)
+ * @see com.vaadin.ui.Panel#paintContent(com.vaadin.server.PaintTarget)
*/
@Override
diff --git a/shared/src/com/vaadin/shared/ComponentState.java b/shared/src/com/vaadin/shared/ComponentState.java
index ac6f1185bf..1b08f9b2d2 100644
--- a/shared/src/com/vaadin/shared/ComponentState.java
+++ b/shared/src/com/vaadin/shared/ComponentState.java
@@ -155,7 +155,7 @@ public class ComponentState extends SharedState {
/**
* Returns true if the component is in immediate mode.
*
- * @see com.vaadin.terminal.VariableOwner#isImmediate()
+ * @see com.vaadin.server.VariableOwner#isImmediate()
*
* @return true if the component is in immediate mode
*/
@@ -166,7 +166,7 @@ public class ComponentState extends SharedState {
/**
* Sets or resets the immediate mode for a component.
*
- * @see com.vaadin.terminal.VariableOwner#setImmediate()
+ * @see com.vaadin.server.VariableOwner#setImmediate()
*
* @param immediate
* new mode for the component
diff --git a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java
index 9c7e526dad..7a240a1f1d 100644
--- a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java
+++ b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java
@@ -318,8 +318,7 @@ public abstract class AbstractContainerTest extends TestCase {
FULLY_QUALIFIED_NAME, "ab", false, false));
validateContainer(container, "com.vaadin.data.BufferedValidatable",
- "com.vaadin.ui.TabSheet",
- "com.vaadin.client.Focusable",
+ "com.vaadin.ui.TabSheet", "com.vaadin.client.Focusable",
"com.vaadin.data.Buffered", isFilteredOutItemNull(), 20);
// Filter by "contains da" (reversed as ad here)
@@ -382,7 +381,7 @@ public abstract class AbstractContainerTest extends TestCase {
validateContainer(container, "com.vaadin.Application",
"org.vaadin.test.LastClass",
- "com.vaadin.terminal.ApplicationResource", "blah", true,
+ "com.vaadin.server.ApplicationResource", "blah", true,
sampleData.length);
sortable.sort(new Object[] { REVERSE_FULLY_QUALIFIED_NAME },
@@ -476,60 +475,52 @@ public abstract class AbstractContainerTest extends TestCase {
"com.vaadin.launcher.util.BrowserLauncher",
"com.vaadin.service.ApplicationContext",
"com.vaadin.service.FileTypeResolver",
- "com.vaadin.terminal.ApplicationResource",
- "com.vaadin.terminal.ClassResource",
- "com.vaadin.terminal.CompositeErrorMessage",
- "com.vaadin.terminal.DownloadStream",
- "com.vaadin.terminal.ErrorMessage",
- "com.vaadin.terminal.ExternalResource",
- "com.vaadin.terminal.FileResource",
+ "com.vaadin.server.ApplicationResource",
+ "com.vaadin.server.ClassResource",
+ "com.vaadin.server.CompositeErrorMessage",
+ "com.vaadin.server.DownloadStream",
+ "com.vaadin.server.ErrorMessage",
+ "com.vaadin.server.ExternalResource",
+ "com.vaadin.server.FileResource",
"com.vaadin.client.ApplicationConfiguration",
"com.vaadin.client.ApplicationConnection",
"com.vaadin.client.BrowserInfo",
"com.vaadin.client.ClientExceptionHandler",
"com.vaadin.client.ComponentDetail",
"com.vaadin.client.ComponentDetailMap",
- "com.vaadin.client.ComponentLocator",
- "com.vaadin.client.Console",
+ "com.vaadin.client.ComponentLocator", "com.vaadin.client.Console",
"com.vaadin.client.Container",
"com.vaadin.client.ContainerResizedListener",
- "com.vaadin.client.CSSRule",
- "com.vaadin.client.DateTimeService",
+ "com.vaadin.client.CSSRule", "com.vaadin.client.DateTimeService",
"com.vaadin.client.DefaultWidgetSet",
"com.vaadin.client.Focusable",
"com.vaadin.client.HistoryImplIEVaadin",
"com.vaadin.client.LocaleNotLoadedException",
"com.vaadin.client.LocaleService",
"com.vaadin.client.MouseEventDetails",
- "com.vaadin.client.NullConsole",
- "com.vaadin.client.Paintable",
+ "com.vaadin.client.NullConsole", "com.vaadin.client.Paintable",
"com.vaadin.client.RenderInformation",
"com.vaadin.client.RenderSpace",
"com.vaadin.client.StyleConstants",
- "com.vaadin.client.TooltipInfo",
- "com.vaadin.client.ui.Action",
+ "com.vaadin.client.TooltipInfo", "com.vaadin.client.ui.Action",
"com.vaadin.client.ui.ActionOwner",
"com.vaadin.client.ui.AlignmentInfo",
"com.vaadin.client.ui.CalendarEntry",
"com.vaadin.client.ui.ClickEventHandler",
- "com.vaadin.client.ui.Field",
- "com.vaadin.client.ui.Icon",
+ "com.vaadin.client.ui.Field", "com.vaadin.client.ui.Icon",
"com.vaadin.client.ui.layout.CellBasedLayout",
"com.vaadin.client.ui.layout.ChildComponentContainer",
"com.vaadin.client.ui.layout.Margins",
"com.vaadin.client.ui.LayoutClickEventHandler",
- "com.vaadin.client.ui.MenuBar",
- "com.vaadin.client.ui.MenuItem",
+ "com.vaadin.client.ui.MenuBar", "com.vaadin.client.ui.MenuItem",
"com.vaadin.client.ui.richtextarea.VRichTextArea",
"com.vaadin.client.ui.richtextarea.VRichTextToolbar",
"com.vaadin.client.ui.ShortcutActionHandler",
- "com.vaadin.client.ui.SubPartAware",
- "com.vaadin.client.ui.Table",
+ "com.vaadin.client.ui.SubPartAware", "com.vaadin.client.ui.Table",
"com.vaadin.client.ui.TreeAction",
"com.vaadin.client.ui.TreeImages",
"com.vaadin.client.ui.VAbsoluteLayout",
- "com.vaadin.client.ui.VAccordion",
- "com.vaadin.client.ui.VButton",
+ "com.vaadin.client.ui.VAccordion", "com.vaadin.client.ui.VButton",
"com.vaadin.client.ui.VCalendarPanel",
"com.vaadin.client.ui.VCheckBox",
"com.vaadin.client.ui.VContextMenu",
@@ -539,13 +530,11 @@ public abstract class AbstractContainerTest extends TestCase {
"com.vaadin.client.ui.VDateField",
"com.vaadin.client.ui.VDateFieldCalendar",
"com.vaadin.client.ui.VEmbedded",
- "com.vaadin.client.ui.VFilterSelect",
- "com.vaadin.client.ui.VForm",
+ "com.vaadin.client.ui.VFilterSelect", "com.vaadin.client.ui.VForm",
"com.vaadin.client.ui.VFormLayout",
"com.vaadin.client.ui.VGridLayout",
"com.vaadin.client.ui.VHorizontalLayout",
- "com.vaadin.client.ui.VLabel",
- "com.vaadin.client.ui.VLink",
+ "com.vaadin.client.ui.VLabel", "com.vaadin.client.ui.VLink",
"com.vaadin.client.ui.VListSelect",
"com.vaadin.client.ui.VMarginInfo",
"com.vaadin.client.ui.VMenuBar",
@@ -555,15 +544,13 @@ public abstract class AbstractContainerTest extends TestCase {
"com.vaadin.client.ui.VOptionGroup",
"com.vaadin.client.ui.VOptionGroupBase",
"com.vaadin.client.ui.VOrderedLayout",
- "com.vaadin.client.ui.VOverlay",
- "com.vaadin.client.ui.VPanel",
+ "com.vaadin.client.ui.VOverlay", "com.vaadin.client.ui.VPanel",
"com.vaadin.client.ui.VPasswordField",
"com.vaadin.client.ui.VPopupCalendar",
"com.vaadin.client.ui.VPopupView",
"com.vaadin.client.ui.VProgressIndicator",
"com.vaadin.client.ui.VScrollTable",
- "com.vaadin.client.ui.VSlider",
- "com.vaadin.client.ui.VSplitPanel",
+ "com.vaadin.client.ui.VSlider", "com.vaadin.client.ui.VSplitPanel",
"com.vaadin.client.ui.VSplitPanelHorizontal",
"com.vaadin.client.ui.VSplitPanelVertical",
"com.vaadin.client.ui.VTablePaging",
@@ -572,26 +559,20 @@ public abstract class AbstractContainerTest extends TestCase {
"com.vaadin.client.ui.VTabsheetPanel",
"com.vaadin.client.ui.VTextArea",
"com.vaadin.client.ui.VTextField",
- "com.vaadin.client.ui.VTextualDate",
- "com.vaadin.client.ui.VTime",
+ "com.vaadin.client.ui.VTextualDate", "com.vaadin.client.ui.VTime",
"com.vaadin.client.ui.VTree",
"com.vaadin.client.ui.VTwinColSelect",
"com.vaadin.client.ui.VUnknownComponent",
"com.vaadin.client.ui.VUpload",
"com.vaadin.client.ui.VUriFragmentUtility",
"com.vaadin.client.ui.VVerticalLayout",
- "com.vaadin.client.ui.VView",
- "com.vaadin.client.ui.VWindow",
- "com.vaadin.client.UIDL",
- "com.vaadin.client.Util",
- "com.vaadin.client.ValueMap",
- "com.vaadin.client.VCaption",
+ "com.vaadin.client.ui.VView", "com.vaadin.client.ui.VWindow",
+ "com.vaadin.client.UIDL", "com.vaadin.client.Util",
+ "com.vaadin.client.ValueMap", "com.vaadin.client.VCaption",
"com.vaadin.client.VCaptionWrapper",
"com.vaadin.client.VDebugConsole",
- "com.vaadin.client.VErrorMessage",
- "com.vaadin.client.VTooltip",
- "com.vaadin.client.VUIDLBrowser",
- "com.vaadin.client.WidgetMap",
+ "com.vaadin.client.VErrorMessage", "com.vaadin.client.VTooltip",
+ "com.vaadin.client.VUIDLBrowser", "com.vaadin.client.WidgetMap",
"com.vaadin.client.WidgetSet",
"com.vaadin.terminal.gwt.server.AbstractApplicationPortlet",
"com.vaadin.terminal.gwt.server.AbstractApplicationServlet",
@@ -621,18 +602,16 @@ public abstract class AbstractContainerTest extends TestCase {
"com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer",
"com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator",
"com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder",
- "com.vaadin.terminal.KeyMapper", "com.vaadin.terminal.Paintable",
- "com.vaadin.terminal.PaintException",
- "com.vaadin.terminal.PaintTarget",
- "com.vaadin.terminal.ParameterHandler",
- "com.vaadin.terminal.Resource", "com.vaadin.terminal.Scrollable",
- "com.vaadin.terminal.Sizeable",
- "com.vaadin.terminal.StreamResource",
- "com.vaadin.terminal.SystemError", "com.vaadin.terminal.Terminal",
- "com.vaadin.terminal.ThemeResource",
- "com.vaadin.terminal.UploadStream",
- "com.vaadin.terminal.URIHandler", "com.vaadin.terminal.UserError",
- "com.vaadin.terminal.VariableOwner",
+ "com.vaadin.server.KeyMapper", "com.vaadin.server.Paintable",
+ "com.vaadin.server.PaintException",
+ "com.vaadin.server.PaintTarget",
+ "com.vaadin.server.ParameterHandler", "com.vaadin.server.Resource",
+ "com.vaadin.server.Scrollable", "com.vaadin.server.Sizeable",
+ "com.vaadin.server.StreamResource",
+ "com.vaadin.server.SystemError", "com.vaadin.server.Terminal",
+ "com.vaadin.server.ThemeResource",
+ "com.vaadin.server.UploadStream", "com.vaadin.server.URIHandler",
+ "com.vaadin.server.UserError", "com.vaadin.server.VariableOwner",
"com.vaadin.tools.ReflectTools",
"com.vaadin.tools.WidgetsetCompiler",
"com.vaadin.ui.AbsoluteLayout", "com.vaadin.ui.AbstractComponent",
diff --git a/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java
index 6bfff90c7b..918c9dfb7b 100644
--- a/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java
+++ b/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java
@@ -149,7 +149,7 @@ public abstract class AbstractHierarchicalContainerTest extends
int expectedSize = sampleData.length + packages;
validateHierarchicalContainer(container, "com",
"org.vaadin.test.LastClass",
- "com.vaadin.terminal.ApplicationResource", "blah", true,
+ "com.vaadin.server.ApplicationResource", "blah", true,
expectedSize, 2, true);
}
@@ -172,7 +172,7 @@ public abstract class AbstractHierarchicalContainerTest extends
int expectedSize = sampleData.length + packages;
validateHierarchicalContainer(container, "com",
"org.vaadin.test.LastClass",
- "com.vaadin.terminal.ApplicationResource", "blah", true,
+ "com.vaadin.server.ApplicationResource", "blah", true,
expectedSize, 2, true);
sortable.sort(new Object[] { REVERSE_FULLY_QUALIFIED_NAME },
@@ -181,7 +181,7 @@ public abstract class AbstractHierarchicalContainerTest extends
validateHierarchicalContainer(container,
"com.vaadin.terminal.gwt.server.ApplicationPortlet2",
"com.vaadin.data.util.ObjectProperty",
- "com.vaadin.terminal.ApplicationResource", "blah", true,
+ "com.vaadin.server.ApplicationResource", "blah", true,
expectedSize, 2, true);
}
diff --git a/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java b/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java
index ebe604ff3a..ff6de50651 100644
--- a/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java
+++ b/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java
@@ -2,9 +2,6 @@ package com.vaadin.data.util;
import java.util.Collection;
-import com.vaadin.data.util.ContainerHierarchicalWrapper;
-import com.vaadin.data.util.IndexedContainer;
-
public class TestContainerHierarchicalWrapper extends
AbstractHierarchicalContainerTest {
@@ -34,7 +31,7 @@ public class TestContainerHierarchicalWrapper extends
int expectedSize = sampleData.length + packages - 1;
validateContainer(container, "com", "com.vaadin.util.SerializerHelper",
- "com.vaadin.terminal.ApplicationResource", "blah", true,
+ "com.vaadin.server.ApplicationResource", "blah", true,
expectedSize);
// rootItemIds
diff --git a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java
index f0cbfe7a87..d3d7d37690 100644
--- a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java
+++ b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java
@@ -2,7 +2,6 @@ package com.vaadin.data.util;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
-import com.vaadin.data.util.HierarchicalContainer;
public class TestHierarchicalContainer extends
AbstractHierarchicalContainerTest {
@@ -58,12 +57,10 @@ public class TestHierarchicalContainer extends
container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false);
Object p1 = container.getParent("com.vaadin.ui.TabSheet");
assertEquals("com.vaadin.ui", p1);
- p1 = container
- .getParent("com.vaadin.client.ui.VPopupCalendar");
+ p1 = container.getParent("com.vaadin.client.ui.VPopupCalendar");
assertNull(p1);
container.removeAllContainerFilters();
- p1 = container
- .getParent("com.vaadin.client.ui.VPopupCalendar");
+ p1 = container.getParent("com.vaadin.client.ui.VPopupCalendar");
assertEquals("com.vaadin.client.ui", p1);
}
@@ -110,9 +107,8 @@ public class TestHierarchicalContainer extends
int expectedRoots = 1;
validateHierarchicalContainer(container, "com",
- "com.vaadin.ui.TabSheet",
- "com.vaadin.client.Focusable", "blah", true,
- expectedSize, expectedRoots, true);
+ "com.vaadin.ui.TabSheet", "com.vaadin.client.Focusable",
+ "blah", true, expectedSize, expectedRoots, true);
// only include .gwt.client classes
container.removeAllContainerFilters();
@@ -127,8 +123,8 @@ public class TestHierarchicalContainer extends
validateHierarchicalContainer(container, "com",
"com.vaadin.client.WidgetSet",
- "com.vaadin.client.ui.VSplitPanelVertical",
- "blah", true, expectedSize, expectedRoots, true);
+ "com.vaadin.client.ui.VSplitPanelVertical", "blah", true,
+ expectedSize, expectedRoots, true);
// Additionally remove all without 'm' in the simple name.
container.addContainerFilter(SIMPLE_NAME, "m", false, false);
@@ -136,12 +132,10 @@ public class TestHierarchicalContainer extends
expectedSize = 7 + 18;
expectedRoots = 1;
- validateHierarchicalContainer(
- container,
- "com",
+ validateHierarchicalContainer(container, "com",
"com.vaadin.client.ui.VUriFragmentUtility",
- "com.vaadin.client.ui.layout.ChildComponentContainer",
- "blah", true, expectedSize, expectedRoots, true);
+ "com.vaadin.client.ui.layout.ChildComponentContainer", "blah",
+ true, expectedSize, expectedRoots, true);
}
@@ -218,10 +212,10 @@ public class TestHierarchicalContainer extends
// com.vaadin.client.ui.VTabsheetBase
// com.vaadin.client.ui.VTabsheetPanel
// com.vaadin.terminal.gwt.server.ChangeVariablesErrorEvent
- // com.vaadin.terminal.Paintable
- // com.vaadin.terminal.Scrollable
- // com.vaadin.terminal.Sizeable
- // com.vaadin.terminal.VariableOwner
+ // com.vaadin.server.Paintable
+ // com.vaadin.server.Scrollable
+ // com.vaadin.server.Sizeable
+ // com.vaadin.server.VariableOwner
// com.vaadin.ui.Label
// com.vaadin.ui.Table
// com.vaadin.ui.TableFieldFactory
@@ -232,9 +226,8 @@ public class TestHierarchicalContainer extends
validateHierarchicalContainer(container,
"com.vaadin.data.BufferedValidatable",
- "com.vaadin.ui.TabSheet",
- "com.vaadin.client.ui.VTabsheetBase", "blah",
- true, expectedSize, expectedRoots, false);
+ "com.vaadin.ui.TabSheet", "com.vaadin.client.ui.VTabsheetBase",
+ "blah", true, expectedSize, expectedRoots, false);
// only include .gwt.client classes
container.removeAllContainerFilters();
@@ -261,11 +254,10 @@ public class TestHierarchicalContainer extends
expectedSize = 13;
expectedRoots = expectedSize;
- validateHierarchicalContainer(container,
- "com.vaadin.client.Paintable",
+ validateHierarchicalContainer(container, "com.vaadin.client.Paintable",
"com.vaadin.client.ui.VTabsheetPanel",
- "com.vaadin.client.ui.VPopupCalendar", "blah",
- true, expectedSize, expectedRoots, false);
+ "com.vaadin.client.ui.VPopupCalendar", "blah", true,
+ expectedSize, expectedRoots, false);
}
}
diff --git a/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java b/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java
index 4f5f0b1431..1c1f9624c8 100644
--- a/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java
+++ b/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java
@@ -5,7 +5,7 @@ import java.util.HashMap;
import junit.framework.TestCase;
-import com.vaadin.terminal.KeyMapper;
+import com.vaadin.server.KeyMapper;
public class TestKeyMapper extends TestCase {
diff --git a/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java b/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java
index 8231030666..7bb1fd0050 100644
--- a/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java
+++ b/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.server;
import junit.framework.TestCase;
import com.vaadin.Application;
-import com.vaadin.terminal.ClassResource;
+import com.vaadin.server.ClassResource;
import com.vaadin.ui.Embedded;
public class TestMimeTypes extends TestCase {
diff --git a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
index 5ea4bc52c4..8b35b322cb 100644
--- a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
+++ b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java
@@ -5,8 +5,8 @@ import junit.framework.TestCase;
import org.easymock.EasyMock;
import com.vaadin.Application;
-import com.vaadin.terminal.StreamVariable;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.StreamVariable;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.terminal.gwt.server.CommunicationManager;
import com.vaadin.ui.UI;
import com.vaadin.ui.Upload;
diff --git a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
index f7ac55b6da..efebc097bf 100644
--- a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
+++ b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java
@@ -19,8 +19,8 @@ import junit.framework.TestCase;
import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
+import com.vaadin.server.DeploymentConfiguration;
import com.vaadin.service.ApplicationContext.TransactionListener;
-import com.vaadin.terminal.DeploymentConfiguration;
import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
import com.vaadin.terminal.gwt.server.WebApplicationContext;
diff --git a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
index 4458872c79..d76dcffa2f 100644
--- a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
+++ b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.server.component.absolutelayout;
import junit.framework.TestCase;
-import com.vaadin.terminal.Sizeable;
-import com.vaadin.terminal.Sizeable.Unit;
+import com.vaadin.server.Sizeable;
+import com.vaadin.server.Sizeable.Unit;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.Button;
diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java
index 3a251ecbb9..5dbab8467e 100644
--- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java
+++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java
@@ -8,7 +8,7 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.util.AbstractProperty;
import com.vaadin.data.util.converter.Converter.ConversionException;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.UI;
diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java
index 9b4d9492a2..906d6ccebd 100644
--- a/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java
+++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java
@@ -11,9 +11,9 @@ import org.easymock.EasyMock;
import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.DefaultUIProvider;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.DefaultUIProvider;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.UI;
public class CustomUIClassLoader extends TestCase {
diff --git a/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java b/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java
index c9ce0ac0a2..265e5382d4 100644
--- a/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java
+++ b/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java
@@ -1,6 +1,6 @@
package com.vaadin.tests.server.component.upload;
-import com.vaadin.terminal.StreamVariable.StreamingProgressEvent;
+import com.vaadin.server.StreamVariable.StreamingProgressEvent;
import com.vaadin.tests.server.component.AbstractListenerMethodsTest;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.FailedEvent;
diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
index 2a0a733140..0fb0765c9f 100644
--- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
+++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java
@@ -6,7 +6,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.vaadin.Application;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
diff --git a/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java b/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
index e342ee9005..18ed52cc2a 100644
--- a/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
+++ b/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java
@@ -23,8 +23,8 @@ import org.easymock.IMocksControl;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.Navigator.UriFragmentManager;
-import com.vaadin.terminal.Page;
-import com.vaadin.terminal.Page.FragmentChangedEvent;
+import com.vaadin.server.Page;
+import com.vaadin.server.Page.FragmentChangedEvent;
public class UriFragmentManagerTest extends TestCase {
diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
index 8183ed2d0b..b4a339c97f 100644
--- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -31,8 +31,8 @@ import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.AbstractUIProvider;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.AbstractUIProvider;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest;
import com.vaadin.tests.components.TestBase;
diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java
index 66e693a1de..5882c5cdb1 100644
--- a/tests/testbench/com/vaadin/tests/Components.java
+++ b/tests/testbench/com/vaadin/tests/Components.java
@@ -15,9 +15,9 @@ import com.vaadin.data.util.DefaultItemSorter;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.Sizeable;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Component;
diff --git a/tests/testbench/com/vaadin/tests/LayoutDemo.java b/tests/testbench/com/vaadin/tests/LayoutDemo.java
index 23997ac084..3348eda7a4 100644
--- a/tests/testbench/com/vaadin/tests/LayoutDemo.java
+++ b/tests/testbench/com/vaadin/tests/LayoutDemo.java
@@ -16,8 +16,8 @@
package com.vaadin.tests;
+import com.vaadin.server.ClassResource;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.ClassResource;
import com.vaadin.ui.Component;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java
index 4bce92b668..2418c74db8 100644
--- a/tests/testbench/com/vaadin/tests/NativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java
@@ -96,7 +96,7 @@ public class NativeWindowing extends Application.LegacyApplication {
public void buttonClick(ClickEvent event) {
try {
main.open(
- new com.vaadin.terminal.ExternalResource(
+ new com.vaadin.server.ExternalResource(
new URL(
getURL(),
"mainwin-"
diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java
index d6bc9007ed..b16d4ef65b 100644
--- a/tests/testbench/com/vaadin/tests/Parameters.java
+++ b/tests/testbench/com/vaadin/tests/Parameters.java
@@ -22,10 +22,10 @@ import java.util.Iterator;
import java.util.Map;
import com.vaadin.Application;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout.MarginHandler;
import com.vaadin.ui.Link;
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
index 5f92484c6c..0e76617cc5 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
@@ -19,8 +19,8 @@ package com.vaadin.tests;
import java.util.Date;
import java.util.Map;
+import com.vaadin.server.UserError;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent;
diff --git a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
index 0161a2a20e..0b6b0cf8ba 100644
--- a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
+++ b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
@@ -18,7 +18,7 @@ package com.vaadin.tests;
import java.util.Random;
-import com.vaadin.terminal.ExternalResource;
+import com.vaadin.server.ExternalResource;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java
index 32fff09455..67e1180d75 100644
--- a/tests/testbench/com/vaadin/tests/TestBench.java
+++ b/tests/testbench/com/vaadin/tests/TestBench.java
@@ -27,9 +27,9 @@ import java.util.List;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.Page;
-import com.vaadin.terminal.Page.FragmentChangedEvent;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.Page;
+import com.vaadin.server.Page.FragmentChangedEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalSplitPanel;
diff --git a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
index d5669e5689..57a98f787f 100644
--- a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
+++ b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
@@ -16,11 +16,11 @@
package com.vaadin.tests;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.UserError;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.ClassResource;
-import com.vaadin.terminal.ErrorMessage;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.UserError;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
diff --git a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
index e13b907f77..1a93de387a 100644
--- a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
+++ b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
@@ -3,7 +3,7 @@
*/
package com.vaadin.tests;
-import com.vaadin.terminal.Page;
+import com.vaadin.server.Page;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
diff --git a/tests/testbench/com/vaadin/tests/TestDateField.java b/tests/testbench/com/vaadin/tests/TestDateField.java
index 6cdeb3ffbd..67b2f2cc69 100644
--- a/tests/testbench/com/vaadin/tests/TestDateField.java
+++ b/tests/testbench/com/vaadin/tests/TestDateField.java
@@ -18,9 +18,9 @@ package com.vaadin.tests;
import java.util.Locale;
-import com.vaadin.terminal.ClassResource;
-import com.vaadin.terminal.ErrorMessage;
-import com.vaadin.terminal.UserError;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.UserError;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.DateField;
import com.vaadin.ui.Label;
diff --git a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
index 1692c2fe7b..1d28a0a1b4 100644
--- a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
+++ b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
@@ -18,7 +18,7 @@ package com.vaadin.tests;
import java.util.Locale;
-import com.vaadin.terminal.Sizeable;
+import com.vaadin.server.Sizeable;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
diff --git a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
index 81b21c46c3..da6b7ddf3e 100644
--- a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
@@ -19,7 +19,7 @@ package com.vaadin.tests;
import java.util.ArrayList;
import java.util.Iterator;
-import com.vaadin.terminal.ExternalResource;
+import com.vaadin.server.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
diff --git a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
index eb807504fa..a94198b1c8 100644
--- a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
@@ -19,7 +19,7 @@ package com.vaadin.tests;
import java.util.ArrayList;
import java.util.Iterator;
-import com.vaadin.terminal.ExternalResource;
+import com.vaadin.server.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
index 41b3309c57..cef9269b53 100644
--- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
@@ -96,7 +96,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication {
public void buttonClick(ClickEvent event) {
try {
main.open(
- new com.vaadin.terminal.ExternalResource(
+ new com.vaadin.server.ExternalResource(
new URL(
getURL(),
"mainwin-"
diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
index af41ccc37b..a6fdaf5643 100644
--- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
@@ -27,8 +27,8 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import com.vaadin.Application;
+import com.vaadin.server.StreamResource;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.StreamResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
diff --git a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
index 61cf9c1c16..ac69cbd096 100644
--- a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
@@ -19,7 +19,7 @@ package com.vaadin.tests;
import java.util.Iterator;
import java.util.Vector;
-import com.vaadin.terminal.UserError;
+import com.vaadin.server.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java
index d42870b5b1..eb59ed9f1f 100644
--- a/tests/testbench/com/vaadin/tests/TestForUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForUpload.java
@@ -29,8 +29,8 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.server.StreamResource;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.terminal.StreamResource;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
index 3b5c7404e7..253fd3aeea 100644
--- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
+++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
@@ -16,7 +16,7 @@
package com.vaadin.tests;
-import com.vaadin.terminal.ExternalResource;
+import com.vaadin.server.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
index a0ff6f0fc7..6121647bc1 100644
--- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
+++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
@@ -25,7 +25,7 @@ import com.vaadin.Application;
import com.vaadin.data.Container;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.terminal.ThemeResource;
+import com.vaadin.server.ThemeResource;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Button;
diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
index 9fa716a23e..26bf90948b 100644
--- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
+++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
@@ -4,8 +4,8 @@ import com.google.apphosting.api.DeadlineExceededException;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.terminal.ClassResource;
-import com.vaadin.terminal.DownloadStream;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.DownloadStream;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Embedded;
@@ -29,7 +29,7 @@ public class GAESyncTest extends Application.LegacyApplication {
}
@Override
- public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) {
+ public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) {
Throwable t = event.getThrowable();
// Was this caused by a GAE timeout?
while (t != null) {
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
index 1e6509ab85..3013659ed7 100644
--- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.application;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.AbstractUIProvider;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.AbstractUIProvider;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
diff --git a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
index 992a3afbca..0dcf0a6fa8 100644
--- a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
+++ b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
@@ -38,7 +38,7 @@ public class TerminalErrorNotification extends TestBase {
}
@Override
- public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) {
+ public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) {
event.getThrowable().printStackTrace();
UI mainWindow = getMainWindow();
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
index fa5ab7d100..f31ea76728 100644
--- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.application;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.ApplicationResource;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.tests.components.AbstractTestApplication;
import com.vaadin.tests.integration.FlagSeResource;
import com.vaadin.tests.util.Log;
@@ -28,7 +28,7 @@ public class ThreadLocalInstances extends AbstractTestApplication {
}
@Override
- public void paintContent(com.vaadin.terminal.PaintTarget target)
+ public void paintContent(com.vaadin.server.PaintTarget target)
throws PaintException {
if (!paintReported) {
reportCurrentStatus("root paint");
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
index cece73a14d..ece40f5b00 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
@@ -14,8 +14,8 @@ import com.vaadin.event.FieldEvents.BlurNotifier;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.ThemeResource;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
import com.vaadin.tests.util.Log;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.AbstractComponent;
@@ -715,7 +715,7 @@ public abstract class AbstractComponentTestnull
is returned.
+ *
+ * @return The connector's application, or null
if not attached
+ */
+ protected Application getApplication() {
+ UI uI = getUI();
+ if (uI == null) {
+ return null;
+ } else {
+ return uI.getApplication();
+ }
+ }
+
+ /**
+ * Finds a UI ancestor of this connector. null
is returned if
+ * no UI ancestor is found (typically because the connector is not
+ * attached to a proper hierarchy).
+ *
+ * @return the UI ancestor of this connector, or null
if none
+ * is found.
+ */
+ @Override
+ public UI getUI() {
+ ClientConnector connector = this;
+ while (connector != null) {
+ if (connector instanceof UI) {
+ return (UI) connector;
+ }
+ connector = connector.getParent();
+ }
+ return null;
+ }
+
+ private static Logger getLogger() {
+ return Logger.getLogger(AbstractClientConnector.class.getName());
+ }
+
+ @Override
+ @Deprecated
+ public void requestRepaintAll() {
+ markAsDirtyRecursive();
+ }
+
+ @Override
+ public void markAsDirtyRecursive() {
+ markAsDirty();
+
+ for (ClientConnector connector : getAllChildrenIterable(this)) {
+ connector.markAsDirtyRecursive();
+ }
+ }
+
+ private static final class CombinedIteratornull
after this method is called.
+ * "
+ + AbstractApplicationServlet
+ .safeEscapeForHtml(getMessage()) + "
";
+ break;
+ case XHTML:
+ result = getMessage();
+ break;
+ }
+ // if no message, combine the messages of all children
+ if (null == result && null != getCauses() && getCauses().size() > 0) {
+ StringBuilder sb = new StringBuilder();
+ for (ErrorMessage cause : getCauses()) {
+ String childMessage = cause.getFormattedHtmlMessage();
+ if (null != childMessage) {
+ sb.append("com_example_MyExtension
for the
+ * server-side
+ * com.example.MyExtension extends AbstractJavaScriptExtension
+ * class. If MyExtension instead extends com.example.SuperExtension
+ * , then com_example_SuperExtension
will also be attempted if
+ * com_example_MyExtension
has not been defined.
+ * this
pointing to
+ * a connector wrapper object providing integration to Vaadin with the following
+ * functions:
+ *
+ *
+ * The connector wrapper also supports these special functions:
+ * getConnectorId()
- returns a string with the id of the
+ * connector.getParentId([connectorId])
- returns a string with the id of
+ * the connector's parent. If connectorId
is provided, the id of
+ * the parent of the corresponding connector with the passed id is returned
+ * instead.getElement([connectorId])
- returns the DOM Element that is
+ * the root of a connector's widget. null
is returned if the
+ * connector can not be found or if the connector doesn't have a widget. If
+ * connectorId
is not provided, the connector id of the current
+ * connector will be used.getState()
- returns an object corresponding to the shared
+ * state defined on the server. The scheme for conversion between Java and
+ * JavaScript types is described bellow.registerRpc([name, ] rpcObject)
- registers the
+ * rpcObject
as a RPC handler. rpcObject
should be an
+ * object with field containing functions for all eligible RPC functions. If
+ * name
is provided, the RPC handler will only used for RPC calls
+ * for the RPC interface with the same fully qualified Java name. If no
+ * name
is provided, the RPC handler will be used for all incoming
+ * RPC invocations where the RPC method name is defined as a function field in
+ * the handler. The scheme for conversion between Java types in the RPC
+ * interface definition and the JavaScript values passed as arguments to the
+ * handler functions is described bellow.getRpcProxy([name])
- returns an RPC proxy object. If
+ * name
is provided, the proxy object will contain functions for
+ * all methods in the RPC interface with the same fully qualified name, provided
+ * a RPC handler has been registered by the server-side code. If no
+ * name
is provided, the returned RPC proxy object will contain
+ * functions for all methods in all RPC interfaces registered for the connector
+ * on the server. If the same method name is present in multiple registered RPC
+ * interfaces, the corresponding function in the RPC proxy object will throw an
+ * exception when called. The scheme for conversion between Java types in the
+ * RPC interface and the JavaScript values that should be passed to the
+ * functions is described bellow.translateVaadinUri(uri)
- Translates a Vaadin URI to a URL
+ * that can be used in the browser. This is just way of accessing
+ * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}
+ *
+ *
+ * onStateChange
- If the JavaScript code assigns a function to
+ * the field, that function is called whenever the contents of the shared state
+ * is changed.
+ *
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public abstract class AbstractJavaScriptExtension extends AbstractExtension {
+ private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
+ this);
+
+ @Override
+ protected this
). Calling that JavaScript function will
+ * cause the call method in the registered {@link JavaScriptFunction} to be
+ * invoked with the same arguments.
+ *
+ * @param functionName
+ * the name that should be used for client-side callback
+ * @param function
+ * the {@link JavaScriptFunction} object that will be invoked
+ * when the JavaScript function is called
+ */
+ protected void addFunction(String functionName, JavaScriptFunction function) {
+ callbackHelper.registerCallback(functionName, function);
+ }
+
+ /**
+ * Invoke a named function that the connector JavaScript has added to the
+ * JavaScript connector wrapper object. The arguments should only contain
+ * data types that can be represented in JavaScript including primitives,
+ * their boxed types, arrays, String, List, Set, Map, Connector and
+ * JavaBeans.
+ *
+ * @param name
+ * the name of the function
+ * @param arguments
+ * function arguments
+ */
+ protected void callFunction(String name, Object... arguments) {
+ callbackHelper.invokeCallback(name, arguments);
+ }
+
+ @Override
+ protected JavaScriptExtensionState getState() {
+ return (JavaScriptExtensionState) super.getState();
+ }
+}
diff --git a/server/src/com/vaadin/server/AbstractUIProvider.java b/server/src/com/vaadin/server/AbstractUIProvider.java
new file mode 100644
index 0000000000..ba8e266eb2
--- /dev/null
+++ b/server/src/com/vaadin/server/AbstractUIProvider.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import com.vaadin.Application;
+import com.vaadin.ui.UI;
+
+public abstract class AbstractUIProvider implements UIProvider {
+
+ @Override
+ public UI instantiateUI(Application application,
+ Class extends UI> type, WrappedRequest request) {
+ try {
+ return type.newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException("Could not instantiate root class", e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("Could not access root class", e);
+ }
+ }
+}
diff --git a/server/src/com/vaadin/server/ApplicationResource.java b/server/src/com/vaadin/server/ApplicationResource.java
new file mode 100644
index 0000000000..b18886ed55
--- /dev/null
+++ b/server/src/com/vaadin/server/ApplicationResource.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+
+import com.vaadin.Application;
+
+/**
+ * This interface must be implemented by classes wishing to provide Application
+ * resources.
+ * ApplicationResource
are a set of named resources (pictures,
+ * sounds, etc) associated with some specific application. Having named
+ * application resources provides a convenient method for having inter-theme
+ * common resources for an application.
+ * DEFAULT_CACHETIME
.
+ * ClassResource
is a named resource accessed with the class
+ * loader.
+ *
+ * This can be used to access resources such as icons, files, etc.
+ *
+ * @see java.lang.Class#getResource(java.lang.String)
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class ClassResource implements ApplicationResource, Serializable {
+
+ /**
+ * Default buffer size for this stream resource.
+ */
+ private int bufferSize = 0;
+
+ /**
+ * Default cache time for this stream resource.
+ */
+ private long cacheTime = DEFAULT_CACHETIME;
+
+ /**
+ * Associated class used for indetifying the source of the resource.
+ */
+ private final Class> associatedClass;
+
+ /**
+ * Name of the resource is relative to the associated class.
+ */
+ private final String resourceName;
+
+ /**
+ * Application used for serving the class.
+ */
+ private final Application application;
+
+ /**
+ * Creates a new application resource instance. The resource id is relative
+ * to the location of the application class.
+ *
+ * @param resourceName
+ * the Unique identifier of the resource within the application.
+ * @param application
+ * the application this resource will be added to.
+ */
+ public ClassResource(String resourceName, Application application) {
+ this(application.getClass(), resourceName, application);
+ }
+
+ /**
+ * Creates a new application resource instance.
+ *
+ * @param associatedClass
+ * the class of the which the resource is associated.
+ * @param resourceName
+ * the Unique identifier of the resource within the application.
+ * @param application
+ * the application this resource will be added to.
+ */
+ public ClassResource(Class> associatedClass, String resourceName,
+ Application application) {
+ this.associatedClass = associatedClass;
+ this.resourceName = resourceName;
+ this.application = application;
+ if (resourceName == null || associatedClass == null) {
+ throw new NullPointerException();
+ }
+ application.addResource(this);
+ }
+
+ /**
+ * Gets the MIME type of this resource.
+ *
+ * @see com.vaadin.server.Resource#getMIMEType()
+ */
+ @Override
+ public String getMIMEType() {
+ return FileTypeResolver.getMIMEType(resourceName);
+ }
+
+ /**
+ * Gets the application of this resource.
+ *
+ * @see com.vaadin.server.ApplicationResource#getApplication()
+ */
+ @Override
+ public Application getApplication() {
+ return application;
+ }
+
+ /**
+ * Gets the virtual filename for this resource.
+ *
+ * @return the file name associated to this resource.
+ * @see com.vaadin.server.ApplicationResource#getFilename()
+ */
+ @Override
+ public String getFilename() {
+ int index = 0;
+ int next = 0;
+ while ((next = resourceName.indexOf('/', index)) > 0
+ && next + 1 < resourceName.length()) {
+ index = next + 1;
+ }
+ return resourceName.substring(index);
+ }
+
+ /**
+ * Gets resource as stream.
+ *
+ * @see com.vaadin.server.ApplicationResource#getStream()
+ */
+ @Override
+ public DownloadStream getStream() {
+ final DownloadStream ds = new DownloadStream(
+ associatedClass.getResourceAsStream(resourceName),
+ getMIMEType(), getFilename());
+ ds.setBufferSize(getBufferSize());
+ ds.setCacheTime(cacheTime);
+ return ds;
+ }
+
+ /* documented in superclass */
+ @Override
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets the size of the download buffer used for this resource.
+ *
+ * @param bufferSize
+ * the size of the buffer in bytes.
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+ /* documented in superclass */
+ @Override
+ public long getCacheTime() {
+ return cacheTime;
+ }
+
+ /**
+ * Sets the length of cache expiration time.
+ *
+ * null
indicates that the default class
+ * loader should be used.
+ *
+ * @return the class loader to use, or null
+ */
+ public ClassLoader getClassLoader();
+
+ /**
+ * Returns the MIME type of the specified file, or null if the MIME type is
+ * not known. The MIME type is determined by the configuration of the
+ * container, and may be specified in a deployment descriptor. Common MIME
+ * types are "text/html" and "image/gif".
+ *
+ * @param resourceName
+ * a String specifying the name of a file
+ * @return a String specifying the file's MIME type
+ *
+ * @see ServletContext#getMimeType(String)
+ * @see PortletContext#getMimeType(String)
+ */
+ public String getMimeType(String resourceName);
+
+ /**
+ * Gets the properties configured for the deployment, e.g. as init
+ * parameters to the servlet or portlet.
+ *
+ * @return properties for the application.
+ */
+ public Properties getInitParameters();
+
+ public IteratorDEFAULT_CACHETIME
.
+ *
+ * @return Cache time in milliseconds
+ */
+ public long getCacheTime() {
+ return cacheTime;
+ }
+
+ /**
+ * Sets length of cache expiration time. This gives the adapter the
+ * possibility cache streams sent to the client. The caching may be made in
+ * adapter or at the client if the client supports caching. Zero or negavive
+ * value disbales the caching of this stream.
+ *
+ * @param cacheTime
+ * the cache time in milliseconds.
+ */
+ public void setCacheTime(long cacheTime) {
+ this.cacheTime = cacheTime;
+ }
+
+ /**
+ * Gets the size of the download buffer.
+ *
+ * @return int The size of the buffer in bytes.
+ */
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets the size of the download buffer.
+ *
+ * @param bufferSize
+ * the size of the buffer in bytes.
+ *
+ * @since 7.0
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+ /**
+ * Writes this download stream to a wrapped response. This takes care of
+ * setting response headers according to what is defined in this download
+ * stream ({@link #getContentType()}, {@link #getCacheTime()},
+ * {@link #getFileName()}) and transferring the data from the stream (
+ * {@link #getStream()}) to the response. Defined parameters (
+ * {@link #getParameterNames()}) are also included as headers in the
+ * response. If there's is a parameter named Location
, a
+ * redirect (302 Moved temporarily) is sent instead of the contents of this
+ * stream.
+ *
+ * @param response
+ * the wrapped response to write this download stream to
+ * @throws IOException
+ * passed through from the wrapped response
+ *
+ * @since 7.0
+ */
+ public void writeTo(WrappedResponse response) throws IOException {
+ if (getParameter("Location") != null) {
+ response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
+ response.setHeader("Location", getParameter("Location"));
+ return;
+ }
+
+ // Download from given stream
+ final InputStream data = getStream();
+ if (data != null) {
+
+ OutputStream out = null;
+ try {
+ // Sets content type
+ response.setContentType(getContentType());
+
+ // Sets cache headers
+ response.setCacheTime(getCacheTime());
+
+ // Copy download stream parameters directly
+ // to HTTP headers.
+ final Iteratornull
is also
+ * supported
+ */
+ static void tryToCloseStream(OutputStream out) {
+ try {
+ // try to close output stream (e.g. file handle)
+ if (out != null) {
+ out.close();
+ }
+ } catch (IOException e1) {
+ // NOP
+ }
+ }
+
+ /**
+ * Helper method that tries to close an input stream and ignores any
+ * exceptions.
+ *
+ * @param in
+ * the input stream to close, null
is also supported
+ */
+ static void tryToCloseStream(InputStream in) {
+ try {
+ // try to close output stream (e.g. file handle)
+ if (in != null) {
+ in.close();
+ }
+ } catch (IOException e1) {
+ // NOP
+ }
+ }
+
+}
diff --git a/server/src/com/vaadin/server/ErrorMessage.java b/server/src/com/vaadin/server/ErrorMessage.java
new file mode 100644
index 0000000000..fcc481e826
--- /dev/null
+++ b/server/src/com/vaadin/server/ErrorMessage.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+
+/**
+ * Interface for rendering error messages to terminal. All the visible errors
+ * shown to user must implement this interface.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+public interface ErrorMessage extends Serializable {
+
+ public enum ErrorLevel {
+ /**
+ * Error code for informational messages.
+ */
+ INFORMATION("info", 0),
+ /**
+ * Error code for warning messages.
+ */
+ WARNING("warning", 1),
+ /**
+ * Error code for regular error messages.
+ */
+ ERROR("error", 2),
+ /**
+ * Error code for critical error messages.
+ */
+ CRITICAL("critical", 3),
+ /**
+ * Error code for system errors and bugs.
+ */
+ SYSTEMERROR("system", 4);
+
+ String text;
+ int errorLevel;
+
+ private ErrorLevel(String text, int errorLevel) {
+ this.text = text;
+ this.errorLevel = errorLevel;
+ }
+
+ /**
+ * Textual representation for server-client communication of level
+ *
+ * @return String for error severity
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * Integer representation of error severity for comparison
+ *
+ * @return integer for error severity
+ */
+ public int intValue() {
+ return errorLevel;
+ }
+
+ @Override
+ public String toString() {
+ return text;
+ }
+
+ }
+
+ /**
+ * @deprecated from 7.0, use {@link ErrorLevel#SYSTEMERROR} instead  Â
+ */
+ @Deprecated
+ public static final ErrorLevel SYSTEMERROR = ErrorLevel.SYSTEMERROR;
+
+ /**
+ * @deprecated from 7.0, use {@link ErrorLevel#CRITICAL} instead  Â
+ */
+ @Deprecated
+ public static final ErrorLevel CRITICAL = ErrorLevel.CRITICAL;
+
+ /**
+ * @deprecated from 7.0, use {@link ErrorLevel#ERROR} instead  Â
+ */
+
+ @Deprecated
+ public static final ErrorLevel ERROR = ErrorLevel.ERROR;
+
+ /**
+ * @deprecated from 7.0, use {@link ErrorLevel#WARNING} instead  Â
+ */
+ @Deprecated
+ public static final ErrorLevel WARNING = ErrorLevel.WARNING;
+
+ /**
+ * @deprecated from 7.0, use {@link ErrorLevel#INFORMATION} instead  Â
+ */
+ @Deprecated
+ public static final ErrorLevel INFORMATION = ErrorLevel.INFORMATION;
+
+ /**
+ * Gets the errors level.
+ *
+ * @return the level of error as an integer.
+ */
+ public ErrorLevel getErrorLevel();
+
+ /**
+ * Returns the HTML formatted message to show in as the error message on the
+ * client.
+ *
+ * This method should perform any necessary escaping to avoid XSS attacks.
+ *
+ * TODO this API may still change to use a separate data transfer object
+ *
+ * @return HTML formatted string for the error message
+ * @since 7.0
+ */
+ public String getFormattedHtmlMessage();
+
+}
diff --git a/server/src/com/vaadin/server/Extension.java b/server/src/com/vaadin/server/Extension.java
new file mode 100644
index 0000000000..cf0dad5d1a
--- /dev/null
+++ b/server/src/com/vaadin/server/Extension.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import com.vaadin.terminal.gwt.server.ClientConnector;
+
+/**
+ * An extension is an entity that is attached to a Component or another
+ * Extension and independently communicates between client and server.
+ * ExternalResource
implements source for resources fetched from
+ * location specified by URL:s. The resources are fetched directly by the client
+ * terminal and are not fetched trough the terminal adapter.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class ExternalResource implements Resource, Serializable {
+
+ /**
+ * Url of the download.
+ */
+ private String sourceURL = null;
+
+ /**
+ * MIME Type for the resource
+ */
+ private String mimeType = null;
+
+ /**
+ * Creates a new download component for downloading directly from given URL.
+ *
+ * @param sourceURL
+ * the source URL.
+ */
+ public ExternalResource(URL sourceURL) {
+ if (sourceURL == null) {
+ throw new RuntimeException("Source must be non-null");
+ }
+
+ this.sourceURL = sourceURL.toString();
+ }
+
+ /**
+ * Creates a new download component for downloading directly from given URL.
+ *
+ * @param sourceURL
+ * the source URL.
+ * @param mimeType
+ * the MIME Type
+ */
+ public ExternalResource(URL sourceURL, String mimeType) {
+ this(sourceURL);
+ this.mimeType = mimeType;
+ }
+
+ /**
+ * Creates a new download component for downloading directly from given URL.
+ *
+ * @param sourceURL
+ * the source URL.
+ */
+ public ExternalResource(String sourceURL) {
+ if (sourceURL == null) {
+ throw new RuntimeException("Source must be non-null");
+ }
+
+ this.sourceURL = sourceURL.toString();
+ }
+
+ /**
+ * Creates a new download component for downloading directly from given URL.
+ *
+ * @param sourceURL
+ * the source URL.
+ * @param mimeType
+ * the MIME Type
+ */
+ public ExternalResource(String sourceURL, String mimeType) {
+ this(sourceURL);
+ this.mimeType = mimeType;
+ }
+
+ /**
+ * Gets the URL of the external resource.
+ *
+ * @return the URL of the external resource.
+ */
+ public String getURL() {
+ return sourceURL;
+ }
+
+ /**
+ * Gets the MIME type of the resource.
+ *
+ * @see com.vaadin.server.Resource#getMIMEType()
+ */
+ @Override
+ public String getMIMEType() {
+ if (mimeType == null) {
+ mimeType = FileTypeResolver.getMIMEType(getURL().toString());
+ }
+ return mimeType;
+ }
+
+ /**
+ * Sets the MIME type of the resource.
+ */
+ public void setMIMEType(String mimeType) {
+ this.mimeType = mimeType;
+ }
+
+}
diff --git a/server/src/com/vaadin/server/FileResource.java b/server/src/com/vaadin/server/FileResource.java
new file mode 100644
index 0000000000..7b3f338b4f
--- /dev/null
+++ b/server/src/com/vaadin/server/FileResource.java
@@ -0,0 +1,184 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+import com.vaadin.Application;
+import com.vaadin.server.Terminal.ErrorEvent;
+import com.vaadin.service.FileTypeResolver;
+
+/**
+ * FileResources
are files or directories on local filesystem. The
+ * files and directories are served through URI:s to the client terminal and
+ * thus must be registered to an URI context before they can be used. The
+ * resource is automatically registered to the application when it is created.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class FileResource implements ApplicationResource {
+
+ /**
+ * Default buffer size for this stream resource.
+ */
+ private int bufferSize = 0;
+
+ /**
+ * File where the downloaded content is fetched from.
+ */
+ private File sourceFile;
+
+ /**
+ * Application.
+ */
+ private final Application application;
+
+ /**
+ * Default cache time for this stream resource.
+ */
+ private long cacheTime = DownloadStream.DEFAULT_CACHETIME;
+
+ /**
+ * Creates a new file resource for providing given file for client
+ * terminals.
+ */
+ public FileResource(File sourceFile, Application application) {
+ this.application = application;
+ setSourceFile(sourceFile);
+ application.addResource(this);
+ }
+
+ /**
+ * Gets the resource as stream.
+ *
+ * @see com.vaadin.server.ApplicationResource#getStream()
+ */
+ @Override
+ public DownloadStream getStream() {
+ try {
+ final DownloadStream ds = new DownloadStream(new FileInputStream(
+ sourceFile), getMIMEType(), getFilename());
+ ds.setParameter("Content-Length",
+ String.valueOf(sourceFile.length()));
+
+ ds.setCacheTime(cacheTime);
+ return ds;
+ } catch (final FileNotFoundException e) {
+ // Log the exception using the application error handler
+ getApplication().getErrorHandler().terminalError(new ErrorEvent() {
+
+ @Override
+ public Throwable getThrowable() {
+ return e;
+ }
+
+ });
+
+ return null;
+ }
+ }
+
+ /**
+ * Gets the source file.
+ *
+ * @return the source File.
+ */
+ public File getSourceFile() {
+ return sourceFile;
+ }
+
+ /**
+ * Sets the source file.
+ *
+ * @param sourceFile
+ * the source file to set.
+ */
+ public void setSourceFile(File sourceFile) {
+ this.sourceFile = sourceFile;
+ }
+
+ /**
+ * @see com.vaadin.server.ApplicationResource#getApplication()
+ */
+ @Override
+ public Application getApplication() {
+ return application;
+ }
+
+ /**
+ * @see com.vaadin.server.ApplicationResource#getFilename()
+ */
+ @Override
+ public String getFilename() {
+ return sourceFile.getName();
+ }
+
+ /**
+ * @see com.vaadin.server.Resource#getMIMEType()
+ */
+ @Override
+ public String getMIMEType() {
+ return FileTypeResolver.getMIMEType(sourceFile);
+ }
+
+ /**
+ * Gets the length of cache expiration time. This gives the adapter the
+ * possibility cache streams sent to the client. The caching may be made in
+ * adapter or at the client if the client supports caching. Default is
+ * DownloadStream.DEFAULT_CACHETIME
.
+ *
+ * @return Cache time in milliseconds.
+ */
+ @Override
+ public long getCacheTime() {
+ return cacheTime;
+ }
+
+ /**
+ * Sets the length of cache expiration time. This gives the adapter the
+ * possibility cache streams sent to the client. The caching may be made in
+ * adapter or at the client if the client supports caching. Zero or negavive
+ * value disbales the caching of this stream.
+ *
+ * @param cacheTime
+ * the cache time in milliseconds.
+ */
+ public void setCacheTime(long cacheTime) {
+ this.cacheTime = cacheTime;
+ }
+
+ /* documented in superclass */
+ @Override
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets the size of the download buffer used for this resource.
+ *
+ * @param bufferSize
+ * the size of the buffer in bytes.
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+}
diff --git a/server/src/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java
new file mode 100644
index 0000000000..19b19ce824
--- /dev/null
+++ b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import com.vaadin.external.json.JSONArray;
+import com.vaadin.external.json.JSONException;
+import com.vaadin.shared.JavaScriptConnectorState;
+import com.vaadin.tools.ReflectTools;
+import com.vaadin.ui.AbstractJavaScriptComponent;
+import com.vaadin.ui.JavaScript.JavaScriptCallbackRpc;
+import com.vaadin.ui.JavaScriptFunction;
+
+/**
+ * Internal helper class used to implement functionality common to
+ * {@link AbstractJavaScriptComponent} and {@link AbstractJavaScriptExtension}.
+ * Corresponding support in client-side code is in
+ * {@link com.vaadin.client.JavaScriptConnectorHelper}.
+ * KeyMapper
is the simple two-way map for generating textual keys
+ * for objects and retrieving the objects later with the key.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+public class KeyMappernull
window name is also a special case.
+ * null
+ */
+ public static Page getCurrent() {
+ UI currentUI = UI.getCurrent();
+ if (currentUI == null) {
+ return null;
+ }
+ return currentUI.getPage();
+ }
+
+ /**
+ * Sets the page title. The page title is displayed by the browser e.g. as
+ * the title of the browser window or as the title of the tab.
+ *
+ * @param title
+ * the new page title to set
+ */
+ public void setTitle(String title) {
+ uI.getRpcProxy(PageClientRpc.class).setTitle(title);
+ }
+
+}
diff --git a/server/src/com/vaadin/server/PaintException.java b/server/src/com/vaadin/server/PaintException.java
new file mode 100644
index 0000000000..5d6f7b1d58
--- /dev/null
+++ b/server/src/com/vaadin/server/PaintException.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+/**
+ * PaintExcepection
is thrown if painting of a component fails.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class PaintException extends IOException implements Serializable {
+
+ /**
+ * Constructs an instance of PaintExeception
with the specified
+ * detail message.
+ *
+ * @param msg
+ * the detail message.
+ */
+ public PaintException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructs an instance of PaintExeception
with the specified
+ * detail message and cause.
+ *
+ * @param msg
+ * the detail message.
+ * @param cause
+ * the cause
+ */
+ public PaintException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ /**
+ * Constructs an instance of PaintExeception
from IOException.
+ *
+ * @param exception
+ * the original exception.
+ */
+ public PaintException(IOException exception) {
+ super(exception.getMessage());
+ }
+}
diff --git a/server/src/com/vaadin/server/PaintTarget.java b/server/src/com/vaadin/server/PaintTarget.java
new file mode 100644
index 0000000000..e50fac1cb4
--- /dev/null
+++ b/server/src/com/vaadin/server/PaintTarget.java
@@ -0,0 +1,517 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.vaadin.server.StreamVariable.StreamingStartEvent;
+import com.vaadin.terminal.gwt.server.ClientConnector;
+import com.vaadin.ui.Component;
+
+/**
+ * This interface defines the methods for painting XML to the UIDL stream.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+public interface PaintTarget extends Serializable {
+
+ /**
+ * Prints single XMLsection.
+ *
+ * Prints full XML section. The section data is escaped from XML tags and
+ * surrounded by XML start and end-tags.
+ *
+ * @param sectionTagName
+ * the name of the tag.
+ * @param sectionData
+ * the scetion data.
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addSection(String sectionTagName, String sectionData)
+ throws PaintException;
+
+ /**
+ * Result of starting to paint a Component (
+ * {@link PaintTarget#startPaintable(Component, String)}).
+ *
+ * @since 7.0
+ */
+ public enum PaintStatus {
+ /**
+ * Painting started, addVariable() and addAttribute() etc. methods may
+ * be called.
+ */
+ PAINTING,
+ /**
+ * A previously unpainted or painted {@link Component} has been queued
+ * be created/update later in a separate change in the same set of
+ * changes.
+ */
+ CACHED
+ }
+
+ /**
+ * Prints element start tag of a paintable section. Starts a paintable
+ * section using the given tag. The PaintTarget may implement a caching
+ * scheme, that checks the paintable has actually changed or can a cached
+ * version be used instead. This method should call the startTag method.
+ *
+ * Todo:
+ * Checking of input values
+ *
+ *
+ * @param tagName
+ * the name of the start tag.
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void startTag(String tagName) throws PaintException;
+
+ /**
+ * Prints element end tag.
+ *
+ * If the parent tag is closed before every child tag is closed an
+ * PaintException is raised.
+ *
+ * @param tagName
+ * the name of the end tag.
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void endTag(String tagName) throws PaintException;
+
+ /**
+ * Adds a boolean attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Attribute name.
+ * @param value
+ * the Attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, boolean value) throws PaintException;
+
+ /**
+ * Adds a integer attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Attribute name.
+ * @param value
+ * the Attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, int value) throws PaintException;
+
+ /**
+ * Adds a resource attribute to component. Atributes must be added before
+ * any content is written.
+ *
+ * @param name
+ * the Attribute name
+ * @param value
+ * the Attribute value
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, Resource value) throws PaintException;
+
+ /**
+ * Adds details about {@link StreamVariable} to the UIDL stream. Eg. in web
+ * terminals Receivers are typically rendered for the client side as URLs,
+ * where the client side implementation can do an http post request.
+ *
+ *
+ * Most commonly a component developer can just ignore this issue, but with
+ * strict memory requirements and lots of StreamVariables implementations
+ * that reserve a lot of memory this may be a critical issue.
+ *
+ * @param owner
+ * the ReceiverOwner that can track the progress of streaming to
+ * the given StreamVariable
+ * @param name
+ * an identifying name for the StreamVariable
+ * @param value
+ * the StreamVariable to paint
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name,
+ StreamVariable value) throws PaintException;
+
+ /**
+ * Adds a long attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Attribute name.
+ * @param value
+ * the Attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, long value) throws PaintException;
+
+ /**
+ * Adds a float attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Attribute name.
+ * @param value
+ * the Attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, float value) throws PaintException;
+
+ /**
+ * Adds a double attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Attribute name.
+ * @param value
+ * the Attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, double value) throws PaintException;
+
+ /**
+ * Adds a string attribute to component. Atributes must be added before any
+ * content is written.
+ *
+ * @param name
+ * the Boolean attribute name.
+ * @param value
+ * the Boolean attribute value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addAttribute(String name, String value) throws PaintException;
+
+ /**
+ * TODO
+ *
+ * @param name
+ * @param value
+ * @throws PaintException
+ */
+ public void addAttribute(String name, Map, ?> value)
+ throws PaintException;
+
+ /**
+ * Adds a Component type attribute. On client side the value will be a
+ * terminal specific reference to corresponding component on client side
+ * implementation.
+ *
+ * @param name
+ * the name of the attribute
+ * @param value
+ * the Component to be referenced on client side
+ * @throws PaintException
+ */
+ public void addAttribute(String name, Component value)
+ throws PaintException;
+
+ /**
+ * Adds a string type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, String value)
+ throws PaintException;
+
+ /**
+ * Adds a int type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, int value)
+ throws PaintException;
+
+ /**
+ * Adds a long type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, long value)
+ throws PaintException;
+
+ /**
+ * Adds a float type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, float value)
+ throws PaintException;
+
+ /**
+ * Adds a double type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, double value)
+ throws PaintException;
+
+ /**
+ * Adds a boolean type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, boolean value)
+ throws PaintException;
+
+ /**
+ * Adds a string array type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ * @param value
+ * the Variable initial value.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addVariable(VariableOwner owner, String name, String[] value)
+ throws PaintException;
+
+ /**
+ * Adds a Component type variable. On client side the variable value will be
+ * a terminal specific reference to corresponding component on client side
+ * implementation. When updated from client side, terminal will map the
+ * client side component reference back to a corresponding server side
+ * reference.
+ *
+ * @param owner
+ * the Listener for variable changes
+ * @param name
+ * the name of the variable
+ * @param value
+ * the initial value of the variable
+ *
+ * @throws PaintException
+ * if the paint oparation fails
+ */
+ public void addVariable(VariableOwner owner, String name, Component value)
+ throws PaintException;
+
+ /**
+ * Adds a upload stream type variable.
+ *
+ * @param owner
+ * the Listener for variable changes.
+ * @param name
+ * the Variable name.
+ *
+ * @throws PaintException
+ * if the paint operation failed.
+ */
+ public void addUploadStreamVariable(VariableOwner owner, String name)
+ throws PaintException;
+
+ /**
+ * Prints single XML section.
+ * false
to indicate that no more request handlers
+ * should be invoked for the request.
+ *
+ * @param application
+ * The application to which the request belongs
+ * @param request
+ * The request to handle
+ * @param response
+ * The response object to which a response can be written.
+ * @return true if a response has been written and no further request
+ * handlers should be called, otherwise false
+ * @throws IOException
+ */
+ boolean handleRequest(Application application, WrappedRequest request,
+ WrappedResponse response) throws IOException;
+
+}
diff --git a/server/src/com/vaadin/server/Resource.java b/server/src/com/vaadin/server/Resource.java
new file mode 100644
index 0000000000..fa1e040929
--- /dev/null
+++ b/server/src/com/vaadin/server/Resource.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+
+/**
+ * Resource
provided to the client terminal. Support for actually
+ * displaying the resource type is left to the terminal.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+public interface Resource extends Serializable {
+
+ /**
+ * Gets the MIME type of the resource.
+ *
+ * @return the MIME type of the resource.
+ */
+ public String getMIMEType();
+}
diff --git a/server/src/com/vaadin/server/Scrollable.java b/server/src/com/vaadin/server/Scrollable.java
new file mode 100644
index 0000000000..ca89d598c5
--- /dev/null
+++ b/server/src/com/vaadin/server/Scrollable.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+
+/**
+ * StreamResource
is a resource provided to the client directly by
+ * the application. The strean resource is fetched from URI that is most often
+ * in the context of the application or window. The resource is automatically
+ * registered to window in creation.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class StreamResource implements ApplicationResource {
+
+ /**
+ * Source stream the downloaded content is fetched from.
+ */
+ private StreamSource streamSource = null;
+
+ /**
+ * Explicit mime-type.
+ */
+ private String MIMEType = null;
+
+ /**
+ * Filename.
+ */
+ private String filename;
+
+ /**
+ * Application.
+ */
+ private final Application application;
+
+ /**
+ * Default buffer size for this stream resource.
+ */
+ private int bufferSize = 0;
+
+ /**
+ * Default cache time for this stream resource.
+ */
+ private long cacheTime = DEFAULT_CACHETIME;
+
+ /**
+ * Creates a new stream resource for downloading from stream.
+ *
+ * @param streamSource
+ * the source Stream.
+ * @param filename
+ * the name of the file.
+ * @param application
+ * the Application object.
+ */
+ public StreamResource(StreamSource streamSource, String filename,
+ Application application) {
+
+ this.application = application;
+ setFilename(filename);
+ setStreamSource(streamSource);
+
+ // Register to application
+ application.addResource(this);
+
+ }
+
+ /**
+ * @see com.vaadin.server.Resource#getMIMEType()
+ */
+ @Override
+ public String getMIMEType() {
+ if (MIMEType != null) {
+ return MIMEType;
+ }
+ return FileTypeResolver.getMIMEType(filename);
+ }
+
+ /**
+ * Sets the mime type of the resource.
+ *
+ * @param MIMEType
+ * the MIME type to be set.
+ */
+ public void setMIMEType(String MIMEType) {
+ this.MIMEType = MIMEType;
+ }
+
+ /**
+ * Returns the source for this StreamResource
. StreamSource is
+ * queried when the resource is about to be streamed to the client.
+ *
+ * @return Source of the StreamResource.
+ */
+ public StreamSource getStreamSource() {
+ return streamSource;
+ }
+
+ /**
+ * Sets the source for this StreamResource
.
+ * StreamSource
is queried when the resource is about to be
+ * streamed to the client.
+ *
+ * @param streamSource
+ * the source to set.
+ */
+ public void setStreamSource(StreamSource streamSource) {
+ this.streamSource = streamSource;
+ }
+
+ /**
+ * Gets the filename.
+ *
+ * @return the filename.
+ */
+ @Override
+ public String getFilename() {
+ return filename;
+ }
+
+ /**
+ * Sets the filename.
+ *
+ * @param filename
+ * the filename to set.
+ */
+ public void setFilename(String filename) {
+ this.filename = filename;
+ }
+
+ /**
+ * @see com.vaadin.server.ApplicationResource#getApplication()
+ */
+ @Override
+ public Application getApplication() {
+ return application;
+ }
+
+ /**
+ * @see com.vaadin.server.ApplicationResource#getStream()
+ */
+ @Override
+ public DownloadStream getStream() {
+ final StreamSource ss = getStreamSource();
+ if (ss == null) {
+ return null;
+ }
+ final DownloadStream ds = new DownloadStream(ss.getStream(),
+ getMIMEType(), getFilename());
+ ds.setBufferSize(getBufferSize());
+ ds.setCacheTime(cacheTime);
+ return ds;
+ }
+
+ /**
+ * Interface implemented by the source of a StreamResource.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+ public interface StreamSource extends Serializable {
+
+ /**
+ * Returns new input stream that is used for reading the resource.
+ */
+ public InputStream getStream();
+ }
+
+ /* documented in superclass */
+ @Override
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets the size of the download buffer used for this resource.
+ *
+ * @param bufferSize
+ * the size of the buffer in bytes.
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+ /* documented in superclass */
+ @Override
+ public long getCacheTime() {
+ return cacheTime;
+ }
+
+ /**
+ * Sets the length of cache expiration time.
+ *
+ * SystemError
is an error message for a problem caused by error in
+ * system, not the user application code. The system error can contain technical
+ * information such as stack trace and exception.
+ *
+ * SystemError does not support HTML in error messages or stack traces. If HTML
+ * messages are required, use {@link UserError} or a custom implementation of
+ * {@link ErrorMessage}.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class SystemError extends AbstractErrorMessage {
+
+ /**
+ * Constructor for SystemError with error message specified.
+ *
+ * @param message
+ * the Textual error description.
+ */
+ public SystemError(String message) {
+ super(message);
+ setErrorLevel(ErrorLevel.SYSTEMERROR);
+ setMode(ContentMode.XHTML);
+ setMessage(getHtmlMessage());
+ }
+
+ /**
+ * Constructor for SystemError with causing exception and error message.
+ *
+ * @param message
+ * the Textual error description.
+ * @param cause
+ * the throwable causing the system error.
+ */
+ public SystemError(String message, Throwable cause) {
+ this(message);
+ addCause(AbstractErrorMessage.getErrorMessageForException(cause));
+ }
+
+ /**
+ * Constructor for SystemError with cause.
+ *
+ * @param cause
+ * the throwable causing the system error.
+ */
+ public SystemError(Throwable cause) {
+ this(null, cause);
+ }
+
+ /**
+ * Returns the message of the error in HTML.
+ *
+ * Note that this API may change in future versions.
+ */
+ protected String getHtmlMessage() {
+ // TODO wrapping div with namespace? See the old code:
+ // target.addXMLSection("div", message,
+ // "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
+
+ StringBuilder sb = new StringBuilder();
+ if (getMessage() != null) {
+ sb.append("");
+ sb.append(AbstractApplicationServlet
+ .safeEscapeForHtml(getMessage()));
+ sb.append("
");
+ }
+ return sb.toString();
+ }
+
+}
diff --git a/server/src/com/vaadin/server/Terminal.java b/server/src/com/vaadin/server/Terminal.java
new file mode 100644
index 0000000000..265668aa42
--- /dev/null
+++ b/server/src/com/vaadin/server/Terminal.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+
+/**
+ * An interface that provides information about the user's terminal.
+ * Implementors typically provide additional information using methods not in
+ * this interface. ThemeResource
is a named theme dependant resource provided and
+ * managed by a theme. The actual resource contents are dynamically resolved to
+ * comply with the used theme by the terminal adapter. This is commonly used to
+ * provide static images, flash, java-applets, etc for the terminals.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class ThemeResource implements Resource {
+
+ /**
+ * Id of the terminal managed resource.
+ */
+ private String resourceID = null;
+
+ /**
+ * Creates a resource.
+ *
+ * @param resourceId
+ * the Id of the resource.
+ */
+ public ThemeResource(String resourceId) {
+ if (resourceId == null) {
+ throw new NullPointerException("Resource ID must not be null");
+ }
+ if (resourceId.length() == 0) {
+ throw new IllegalArgumentException("Resource ID can not be empty");
+ }
+ if (resourceId.charAt(0) == '/') {
+ throw new IllegalArgumentException(
+ "Resource ID must be relative (can not begin with /)");
+ }
+
+ resourceID = resourceId;
+ }
+
+ /**
+ * Tests if the given object equals this Resource.
+ *
+ * @param obj
+ * the object to be tested for equality.
+ * @return true
if the given object equals this Icon,
+ * false
if not.
+ * @see java.lang.Object#equals(Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof ThemeResource
+ && resourceID.equals(((ThemeResource) obj).resourceID);
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return resourceID.hashCode();
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return resourceID.toString();
+ }
+
+ /**
+ * Gets the resource id.
+ *
+ * @return the resource id.
+ */
+ public String getResourceId() {
+ return resourceID;
+ }
+
+ /**
+ * @see com.vaadin.server.Resource#getMIMEType()
+ */
+ @Override
+ public String getMIMEType() {
+ return FileTypeResolver.getMIMEType(getResourceId());
+ }
+}
diff --git a/server/src/com/vaadin/server/UIProvider.java b/server/src/com/vaadin/server/UIProvider.java
new file mode 100644
index 0000000000..e06b80c62f
--- /dev/null
+++ b/server/src/com/vaadin/server/UIProvider.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import com.vaadin.Application;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.ui.UI;
+
+public interface UIProvider {
+ public Class extends UI> getUIClass(Application application,
+ WrappedRequest request) throws UIRequiresMoreInformationException;
+
+ public UI instantiateUI(Application application,
+ Class extends UI> type, WrappedRequest request);
+}
diff --git a/server/src/com/vaadin/server/UserError.java b/server/src/com/vaadin/server/UserError.java
new file mode 100644
index 0000000000..756f2e70e0
--- /dev/null
+++ b/server/src/com/vaadin/server/UserError.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+/**
+ * UserError
is a controlled error occurred in application. User
+ * errors are occur in normal usage of the application and guide the user.
+ *
+ * @author Vaadin Ltd.
+ * @since 3.0
+ */
+@SuppressWarnings("serial")
+public class UserError extends AbstractErrorMessage {
+
+ /**
+ * @deprecated from 7.0, use {@link ContentMode#TEXT} instead  Â
+ */
+ @Deprecated
+ public static final ContentMode CONTENT_TEXT = ContentMode.TEXT;
+
+ /**
+ * @deprecated from 7.0, use {@link ContentMode#PREFORMATTED} instead  Â
+ */
+ @Deprecated
+ public static final ContentMode CONTENT_PREFORMATTED = ContentMode.PREFORMATTED;
+
+ /**
+ * @deprecated from 7.0, use {@link ContentMode#XHTML} instead  Â
+ */
+ @Deprecated
+ public static final ContentMode CONTENT_XHTML = ContentMode.XHTML;
+
+ /**
+ * Creates a textual error message of level ERROR.
+ *
+ * @param textErrorMessage
+ * the text of the error message.
+ */
+ public UserError(String textErrorMessage) {
+ super(textErrorMessage);
+ }
+
+ /**
+ * Creates an error message with level and content mode.
+ *
+ * @param message
+ * the error message.
+ * @param contentMode
+ * the content Mode.
+ * @param errorLevel
+ * the level of error.
+ */
+ public UserError(String message, ContentMode contentMode,
+ ErrorLevel errorLevel) {
+ super(message);
+ if (contentMode == null) {
+ contentMode = ContentMode.TEXT;
+ }
+ if (errorLevel == null) {
+ errorLevel = ErrorLevel.ERROR;
+ }
+ setMode(contentMode);
+ setErrorLevel(errorLevel);
+ }
+
+}
diff --git a/server/src/com/vaadin/server/Vaadin6Component.java b/server/src/com/vaadin/server/Vaadin6Component.java
new file mode 100644
index 0000000000..00889df14a
--- /dev/null
+++ b/server/src/com/vaadin/server/Vaadin6Component.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.server;
+
+import java.util.EventListener;
+
+import com.vaadin.ui.Component;
+
+/**
+ * Interface provided to ease porting of Vaadin 6 components to Vaadin 7. By
+ * implementing this interface your Component will be able to use
+ * {@link #paintContent(PaintTarget)} and
+ * {@link #changeVariables(Object, java.util.Map)} just like in Vaadin 6.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ *
+ */
+public interface Vaadin6Component extends VariableOwner, Component,
+ EventListener {
+
+ /**
+ * true
if the variable owner is enabled,
+ * false
if not
+ */
+ public boolean isEnabled();
+
+ /**
+ * VariableOwner
does not include a set-
+ * method for the immediateness property. This is because not all
+ * VariableOwners wish to offer the functionality. Such VariableOwners are
+ * never in the immediate mode, thus they always return false
+ * in {@link #isImmediate()}.
+ * true
if the component is in immediate mode,
+ * false
if not.
+ */
+ public boolean isImmediate();
+
+ /**
+ * VariableOwner error event.
+ */
+ public interface ErrorEvent extends Terminal.ErrorEvent {
+
+ /**
+ * Gets the source VariableOwner.
+ *
+ * @return the variable owner.
+ */
+ public VariableOwner getVariableOwner();
+
+ }
+}
diff --git a/server/src/com/vaadin/server/WrappedRequest.java b/server/src/com/vaadin/server/WrappedRequest.java
new file mode 100644
index 0000000000..d012d572ea
--- /dev/null
+++ b/server/src/com/vaadin/server/WrappedRequest.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
+import com.vaadin.Application;
+import com.vaadin.UIRequiresMoreInformationException;
+import com.vaadin.annotations.EagerInit;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.ui.UI;
+
+/**
+ * A generic request to the server, wrapping a more specific request type, e.g.
+ * HttpServletReqest or PortletRequest.
+ *
+ * @since 7.0
+ */
+public interface WrappedRequest extends Serializable {
+
+ /**
+ * Detailed information extracted from the browser.
+ *
+ * @see WrappedRequest#getBrowserDetails()
+ */
+ public interface BrowserDetails extends Serializable {
+ /**
+ * Gets the URI hash fragment for the request. This is typically used to
+ * encode navigation within an application.
+ *
+ * @return the URI hash fragment
+ */
+ public String getUriFragment();
+
+ /**
+ * Gets the value of window.name from the browser. This can be used to
+ * keep track of the specific window between browser reloads.
+ *
+ * @return the string value of window.name in the browser
+ */
+ public String getWindowName();
+
+ /**
+ * Gets a reference to the {@link WebBrowser} object containing
+ * additional information, e.g. screen size and the time zone offset.
+ *
+ * @return the web browser object
+ */
+ public WebBrowser getWebBrowser();
+ }
+
+ /**
+ * Gets the named request parameter This is typically a HTTP GET or POST
+ * parameter, though other request types might have other ways of
+ * representing parameters.
+ *
+ * @see javax.servlet.ServletRequest#getParameter(String)
+ * @see javax.portlet.PortletRequest#getParameter(String)
+ *
+ * @param parameter
+ * the name of the parameter
+ * @return The paramter value, or null
if no parameter with the
+ * given name is present
+ */
+ public String getParameter(String parameter);
+
+ /**
+ * Gets all the parameters of the request.
+ *
+ * @see #getParameter(String)
+ *
+ * @see javax.servlet.ServletRequest#getParameterMap()
+ * @see javax.portlet.PortletRequest#getParameter(String)
+ *
+ * @return A mapping of parameter names to arrays of parameter values
+ */
+ public Mapnull
if there is no
+ * attribute with the given name
+ *
+ * @see javax.servlet.ServletRequest#getAttribute(String)
+ * @see javax.portlet.PortletRequest#getAttribute(String)
+ */
+ public Object getAttribute(String name);
+
+ /**
+ * Defines a request attribute.
+ *
+ * @param name
+ * the name of the attribute
+ * @param value
+ * the attribute value
+ *
+ * @see javax.servlet.ServletRequest#setAttribute(String, Object)
+ * @see javax.portlet.PortletRequest#setAttribute(String, Object)
+ */
+ public void setAttribute(String name, Object value);
+
+ /**
+ * Gets the path of the requested resource relative to the application. The
+ * path be null
if no path information is available. Does
+ * always start with / if the path isn't null
.
+ *
+ * @return a string with the path relative to the application.
+ *
+ * @see javax.servlet.http.HttpServletRequest#getPathInfo()
+ */
+ public String getRequestPathInfo();
+
+ /**
+ * Returns the maximum time interval, in seconds, that the session
+ * associated with this request will be kept open between client accesses.
+ *
+ * @return an integer specifying the number of seconds the session
+ * associated with this request remains open between client requests
+ *
+ * @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
+ * @see javax.portlet.PortletSession#getMaxInactiveInterval()
+ */
+ public int getSessionMaxInactiveInterval();
+
+ /**
+ * Gets an attribute from the session associated with this request.
+ *
+ * @param name
+ * the name of the attribute
+ * @return the attribute value, or null
if the attribute is not
+ * defined in the session
+ *
+ * @see javax.servlet.http.HttpSession#getAttribute(String)
+ * @see javax.portlet.PortletSession#getAttribute(String)
+ */
+ public Object getSessionAttribute(String name);
+
+ /**
+ * Saves an attribute value in the session associated with this request.
+ *
+ * @param name
+ * the name of the attribute
+ * @param attribute
+ * the attribute value
+ *
+ * @see javax.servlet.http.HttpSession#setAttribute(String, Object)
+ * @see javax.portlet.PortletSession#setAttribute(String, Object)
+ */
+ public void setSessionAttribute(String name, Object attribute);
+
+ /**
+ * Returns the MIME type of the body of the request, or null if the type is
+ * not known.
+ *
+ * @return a string containing the name of the MIME type of the request, or
+ * null if the type is not known
+ *
+ * @see javax.servlet.ServletRequest#getContentType()
+ * @see javax.portlet.ResourceRequest#getContentType()
+ *
+ */
+ public String getContentType();
+
+ /**
+ * Gets detailed information about the browser from which the request
+ * originated. This consists of information that is not available from
+ * normal HTTP requests, but requires additional information to be extracted
+ * for instance using javascript in the browser.
+ *
+ * This information is only guaranteed to be available in some special
+ * cases, for instance when
+ * {@link Application#getUIForRequest(WrappedRequest)} is called again after
+ * throwing {@link UIRequiresMoreInformationException} or in
+ * {@link UI#init(WrappedRequest)} for a UI class not annotated with
+ * {@link EagerInit}
+ *
+ * @return the browser details, or null
if details are not
+ * available
+ *
+ * @see BrowserDetails
+ */
+ public BrowserDetails getBrowserDetails();
+
+ /**
+ * Gets locale information from the query, e.g. using the Accept-Language
+ * header.
+ *
+ * @return the preferred Locale
+ *
+ * @see ServletRequest#getLocale()
+ * @see PortletRequest#getLocale()
+ */
+ public Locale getLocale();
+
+ /**
+ * Returns the IP address from which the request came. This might also be
+ * the address of a proxy between the server and the original requester.
+ *
+ * @return a string containing the IP address, or null
if the
+ * address is not available
+ *
+ * @see ServletRequest#getRemoteAddr()
+ */
+ public String getRemoteAddr();
+
+ /**
+ * Checks whether the request was made using a secure channel, e.g. using
+ * https.
+ *
+ * @return a boolean indicating if the request is secure
+ *
+ * @see ServletRequest#isSecure()
+ * @see PortletRequest#isSecure()
+ */
+ public boolean isSecure();
+
+ /**
+ * Gets the value of a request header, e.g. a http header for a
+ * {@link HttpServletRequest}.
+ *
+ * @param headerName
+ * the name of the header
+ * @return the header value, or null
if the header is not
+ * present in the request
+ *
+ * @see HttpServletRequest#getHeader(String)
+ */
+ public String getHeader(String headerName);
+
+ /**
+ * Gets the deployment configuration for the context of this request.
+ *
+ * @return the deployment configuration
+ *
+ * @see DeploymentConfiguration
+ */
+ public DeploymentConfiguration getDeploymentConfiguration();
+
+}
diff --git a/server/src/com/vaadin/server/WrappedResponse.java b/server/src/com/vaadin/server/WrappedResponse.java
new file mode 100644
index 0000000000..c8d9342418
--- /dev/null
+++ b/server/src/com/vaadin/server/WrappedResponse.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Serializable;
+
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletResponse;
+import javax.portlet.ResourceResponse;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * A generic response from the server, wrapping a more specific response type,
+ * e.g. HttpServletResponse or PortletResponse.
+ *
+ * @since 7.0
+ */
+public interface WrappedResponse extends Serializable {
+
+ /**
+ * Sets the (http) status code for the response. If you want to include an
+ * error message along the status code, use {@link #sendError(int, String)}
+ * instead.
+ *
+ * @param statusCode
+ * the status code to set
+ * @see HttpServletResponse#setStatus(int)
+ *
+ * @see ResourceResponse#HTTP_STATUS_CODE
+ */
+ public void setStatus(int statusCode);
+
+ /**
+ * Sets the content type of this response. If the content type including a
+ * charset is set before {@link #getWriter()} is invoked, the returned
+ * PrintWriter will automatically use the defined charset.
+ *
+ * @param contentType
+ * a string specifying the MIME type of the content
+ *
+ * @see ServletResponse#setContentType(String)
+ * @see MimeResponse#setContentType(String)
+ */
+ public void setContentType(String contentType);
+
+ /**
+ * Sets the value of a generic response header. If the header had already
+ * been set, the new value overwrites the previous one.
+ *
+ * @param name
+ * the name of the header
+ * @param value
+ * the header value.
+ *
+ * @see HttpServletResponse#setHeader(String, String)
+ * @see PortletResponse#setProperty(String, String)
+ */
+ public void setHeader(String name, String value);
+
+ /**
+ * Properly formats a timestamp as a date header. If the header had already
+ * been set, the new value overwrites the previous one.
+ *
+ * @param name
+ * the name of the header
+ * @param timestamp
+ * the number of milliseconds since epoch
+ *
+ * @see HttpServletResponse#setDateHeader(String, long)
+ */
+ public void setDateHeader(String name, long timestamp);
+
+ /**
+ * Returns a OutputStream
for writing binary data in the
+ * response.
+ * OutputStream
for writing binary data
+ * @throws IOException
+ * if an input or output exception occurred
+ *
+ * @see #getWriter()
+ * @see ServletResponse#getOutputStream()
+ * @see MimeResponse#getPortletOutputStream()
+ */
+ public OutputStream getOutputStream() throws IOException;
+
+ /**
+ * Returns a PrintWriter
object that can send character text to
+ * the client. The PrintWriter uses the character encoding defined using
+ * setContentType.
+ * PrintWriter
for writing character text
+ * @throws IOException
+ * if an input or output exception occurred
+ *
+ * @see #getOutputStream()
+ * @see ServletResponse#getWriter()
+ * @see MimeResponse#getWriter()
+ */
+ public PrintWriter getWriter() throws IOException;
+
+ /**
+ * Sets cache time in milliseconds, -1 means no cache at all. All required
+ * headers related to caching in the response are set based on the time.
+ *
+ * @param milliseconds
+ * Cache time in milliseconds
+ */
+ public void setCacheTime(long milliseconds);
+
+ /**
+ * Sends an error response to the client using the specified status code and
+ * clears the buffer. In some configurations, this can cause a predefined
+ * error page to be displayed.
+ *
+ * @param errorCode
+ * the HTTP status code
+ * @param message
+ * a message to accompany the error
+ * @throws IOException
+ * if an input or output exception occurs
+ *
+ * @see HttpServletResponse#sendError(int, String)
+ */
+ public void sendError(int errorCode, String message) throws IOException;
+
+ /**
+ * Gets the deployment configuration for the context of this response.
+ *
+ * @return the deployment configuration
+ *
+ * @see DeploymentConfiguration
+ */
+ public DeploymentConfiguration getDeploymentConfiguration();
+}
diff --git a/server/src/com/vaadin/server/package.html b/server/src/com/vaadin/server/package.html
new file mode 100644
index 0000000000..83514a0de5
--- /dev/null
+++ b/server/src/com/vaadin/server/package.html
@@ -0,0 +1,21 @@
+
+
+Package Specification
+
+
+
+
+
+
+
diff --git a/server/src/com/vaadin/service/ApplicationContext.java b/server/src/com/vaadin/service/ApplicationContext.java
index 55495dcd5c..aaf5d1b386 100644
--- a/server/src/com/vaadin/service/ApplicationContext.java
+++ b/server/src/com/vaadin/service/ApplicationContext.java
@@ -22,7 +22,7 @@ import java.net.URL;
import java.util.Collection;
import com.vaadin.Application;
-import com.vaadin.terminal.ApplicationResource;
+import com.vaadin.server.ApplicationResource;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
/**
diff --git a/server/src/com/vaadin/service/FileTypeResolver.java b/server/src/com/vaadin/service/FileTypeResolver.java
index 2b289d6752..4b1c8697eb 100644
--- a/server/src/com/vaadin/service/FileTypeResolver.java
+++ b/server/src/com/vaadin/service/FileTypeResolver.java
@@ -23,8 +23,8 @@ import java.util.Hashtable;
import java.util.Map;
import java.util.StringTokenizer;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.ThemeResource;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
/**
* Utility class that can figure out mime-types and icons related to files.
diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java
deleted file mode 100644
index 157bd17e41..0000000000
--- a/server/src/com/vaadin/terminal/AbstractClientConnector.java
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.logging.Logger;
-
-import com.vaadin.Application;
-import com.vaadin.external.json.JSONException;
-import com.vaadin.external.json.JSONObject;
-import com.vaadin.shared.communication.ClientRpc;
-import com.vaadin.shared.communication.ServerRpc;
-import com.vaadin.shared.communication.SharedState;
-import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
-import com.vaadin.terminal.gwt.server.ClientConnector;
-import com.vaadin.terminal.gwt.server.ClientMethodInvocation;
-import com.vaadin.terminal.gwt.server.RpcManager;
-import com.vaadin.terminal.gwt.server.RpcTarget;
-import com.vaadin.terminal.gwt.server.ServerRpcManager;
-import com.vaadin.ui.HasComponents;
-import com.vaadin.ui.UI;
-
-/**
- * An abstract base class for ClientConnector implementations. This class
- * provides all the basic functionality required for connectors.
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public abstract class AbstractClientConnector implements ClientConnector {
- /**
- * A map from client to server RPC interface class to the RPC call manager
- * that handles incoming RPC calls for that interface.
- */
- private Mapnull
is returned.
- *
- * @return The connector's application, or null
if not attached
- */
- protected Application getApplication() {
- UI uI = getUI();
- if (uI == null) {
- return null;
- } else {
- return uI.getApplication();
- }
- }
-
- /**
- * Finds a UI ancestor of this connector. null
is returned if
- * no UI ancestor is found (typically because the connector is not
- * attached to a proper hierarchy).
- *
- * @return the UI ancestor of this connector, or null
if none
- * is found.
- */
- @Override
- public UI getUI() {
- ClientConnector connector = this;
- while (connector != null) {
- if (connector instanceof UI) {
- return (UI) connector;
- }
- connector = connector.getParent();
- }
- return null;
- }
-
- private static Logger getLogger() {
- return Logger.getLogger(AbstractClientConnector.class.getName());
- }
-
- @Override
- @Deprecated
- public void requestRepaintAll() {
- markAsDirtyRecursive();
- }
-
- @Override
- public void markAsDirtyRecursive() {
- markAsDirty();
-
- for (ClientConnector connector : getAllChildrenIterable(this)) {
- connector.markAsDirtyRecursive();
- }
- }
-
- private static final class CombinedIteratornull
after this method is called.
- * "
- + AbstractApplicationServlet
- .safeEscapeForHtml(getMessage()) + "
";
- break;
- case XHTML:
- result = getMessage();
- break;
- }
- // if no message, combine the messages of all children
- if (null == result && null != getCauses() && getCauses().size() > 0) {
- StringBuilder sb = new StringBuilder();
- for (ErrorMessage cause : getCauses()) {
- String childMessage = cause.getFormattedHtmlMessage();
- if (null != childMessage) {
- sb.append("com_example_MyExtension
for the
- * server-side
- * com.example.MyExtension extends AbstractJavaScriptExtension
- * class. If MyExtension instead extends com.example.SuperExtension
- * , then com_example_SuperExtension
will also be attempted if
- * com_example_MyExtension
has not been defined.
- * this
pointing to
- * a connector wrapper object providing integration to Vaadin with the following
- * functions:
- *
- *
- * The connector wrapper also supports these special functions:
- * getConnectorId()
- returns a string with the id of the
- * connector.getParentId([connectorId])
- returns a string with the id of
- * the connector's parent. If connectorId
is provided, the id of
- * the parent of the corresponding connector with the passed id is returned
- * instead.getElement([connectorId])
- returns the DOM Element that is
- * the root of a connector's widget. null
is returned if the
- * connector can not be found or if the connector doesn't have a widget. If
- * connectorId
is not provided, the connector id of the current
- * connector will be used.getState()
- returns an object corresponding to the shared
- * state defined on the server. The scheme for conversion between Java and
- * JavaScript types is described bellow.registerRpc([name, ] rpcObject)
- registers the
- * rpcObject
as a RPC handler. rpcObject
should be an
- * object with field containing functions for all eligible RPC functions. If
- * name
is provided, the RPC handler will only used for RPC calls
- * for the RPC interface with the same fully qualified Java name. If no
- * name
is provided, the RPC handler will be used for all incoming
- * RPC invocations where the RPC method name is defined as a function field in
- * the handler. The scheme for conversion between Java types in the RPC
- * interface definition and the JavaScript values passed as arguments to the
- * handler functions is described bellow.getRpcProxy([name])
- returns an RPC proxy object. If
- * name
is provided, the proxy object will contain functions for
- * all methods in the RPC interface with the same fully qualified name, provided
- * a RPC handler has been registered by the server-side code. If no
- * name
is provided, the returned RPC proxy object will contain
- * functions for all methods in all RPC interfaces registered for the connector
- * on the server. If the same method name is present in multiple registered RPC
- * interfaces, the corresponding function in the RPC proxy object will throw an
- * exception when called. The scheme for conversion between Java types in the
- * RPC interface and the JavaScript values that should be passed to the
- * functions is described bellow.translateVaadinUri(uri)
- Translates a Vaadin URI to a URL
- * that can be used in the browser. This is just way of accessing
- * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}
- *
- *
- * onStateChange
- If the JavaScript code assigns a function to
- * the field, that function is called whenever the contents of the shared state
- * is changed.
- *
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- */
-public abstract class AbstractJavaScriptExtension extends AbstractExtension {
- private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
- this);
-
- @Override
- protected this
). Calling that JavaScript function will
- * cause the call method in the registered {@link JavaScriptFunction} to be
- * invoked with the same arguments.
- *
- * @param functionName
- * the name that should be used for client-side callback
- * @param function
- * the {@link JavaScriptFunction} object that will be invoked
- * when the JavaScript function is called
- */
- protected void addFunction(String functionName, JavaScriptFunction function) {
- callbackHelper.registerCallback(functionName, function);
- }
-
- /**
- * Invoke a named function that the connector JavaScript has added to the
- * JavaScript connector wrapper object. The arguments should only contain
- * data types that can be represented in JavaScript including primitives,
- * their boxed types, arrays, String, List, Set, Map, Connector and
- * JavaBeans.
- *
- * @param name
- * the name of the function
- * @param arguments
- * function arguments
- */
- protected void callFunction(String name, Object... arguments) {
- callbackHelper.invokeCallback(name, arguments);
- }
-
- @Override
- protected JavaScriptExtensionState getState() {
- return (JavaScriptExtensionState) super.getState();
- }
-}
diff --git a/server/src/com/vaadin/terminal/AbstractUIProvider.java b/server/src/com/vaadin/terminal/AbstractUIProvider.java
deleted file mode 100644
index 5bb4d35b30..0000000000
--- a/server/src/com/vaadin/terminal/AbstractUIProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import com.vaadin.Application;
-import com.vaadin.ui.UI;
-
-public abstract class AbstractUIProvider implements UIProvider {
-
- @Override
- public UI instantiateUI(Application application,
- Class extends UI> type, WrappedRequest request) {
- try {
- return type.newInstance();
- } catch (InstantiationException e) {
- throw new RuntimeException("Could not instantiate root class", e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException("Could not access root class", e);
- }
- }
-}
diff --git a/server/src/com/vaadin/terminal/ApplicationResource.java b/server/src/com/vaadin/terminal/ApplicationResource.java
deleted file mode 100644
index 1d1444b774..0000000000
--- a/server/src/com/vaadin/terminal/ApplicationResource.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-
-import com.vaadin.Application;
-
-/**
- * This interface must be implemented by classes wishing to provide Application
- * resources.
- * ApplicationResource
are a set of named resources (pictures,
- * sounds, etc) associated with some specific application. Having named
- * application resources provides a convenient method for having inter-theme
- * common resources for an application.
- * DEFAULT_CACHETIME
.
- * ClassResource
is a named resource accessed with the class
- * loader.
- *
- * This can be used to access resources such as icons, files, etc.
- *
- * @see java.lang.Class#getResource(java.lang.String)
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class ClassResource implements ApplicationResource, Serializable {
-
- /**
- * Default buffer size for this stream resource.
- */
- private int bufferSize = 0;
-
- /**
- * Default cache time for this stream resource.
- */
- private long cacheTime = DEFAULT_CACHETIME;
-
- /**
- * Associated class used for indetifying the source of the resource.
- */
- private final Class> associatedClass;
-
- /**
- * Name of the resource is relative to the associated class.
- */
- private final String resourceName;
-
- /**
- * Application used for serving the class.
- */
- private final Application application;
-
- /**
- * Creates a new application resource instance. The resource id is relative
- * to the location of the application class.
- *
- * @param resourceName
- * the Unique identifier of the resource within the application.
- * @param application
- * the application this resource will be added to.
- */
- public ClassResource(String resourceName, Application application) {
- this(application.getClass(), resourceName, application);
- }
-
- /**
- * Creates a new application resource instance.
- *
- * @param associatedClass
- * the class of the which the resource is associated.
- * @param resourceName
- * the Unique identifier of the resource within the application.
- * @param application
- * the application this resource will be added to.
- */
- public ClassResource(Class> associatedClass, String resourceName,
- Application application) {
- this.associatedClass = associatedClass;
- this.resourceName = resourceName;
- this.application = application;
- if (resourceName == null || associatedClass == null) {
- throw new NullPointerException();
- }
- application.addResource(this);
- }
-
- /**
- * Gets the MIME type of this resource.
- *
- * @see com.vaadin.terminal.Resource#getMIMEType()
- */
- @Override
- public String getMIMEType() {
- return FileTypeResolver.getMIMEType(resourceName);
- }
-
- /**
- * Gets the application of this resource.
- *
- * @see com.vaadin.terminal.ApplicationResource#getApplication()
- */
- @Override
- public Application getApplication() {
- return application;
- }
-
- /**
- * Gets the virtual filename for this resource.
- *
- * @return the file name associated to this resource.
- * @see com.vaadin.terminal.ApplicationResource#getFilename()
- */
- @Override
- public String getFilename() {
- int index = 0;
- int next = 0;
- while ((next = resourceName.indexOf('/', index)) > 0
- && next + 1 < resourceName.length()) {
- index = next + 1;
- }
- return resourceName.substring(index);
- }
-
- /**
- * Gets resource as stream.
- *
- * @see com.vaadin.terminal.ApplicationResource#getStream()
- */
- @Override
- public DownloadStream getStream() {
- final DownloadStream ds = new DownloadStream(
- associatedClass.getResourceAsStream(resourceName),
- getMIMEType(), getFilename());
- ds.setBufferSize(getBufferSize());
- ds.setCacheTime(cacheTime);
- return ds;
- }
-
- /* documented in superclass */
- @Override
- public int getBufferSize() {
- return bufferSize;
- }
-
- /**
- * Sets the size of the download buffer used for this resource.
- *
- * @param bufferSize
- * the size of the buffer in bytes.
- */
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
- /* documented in superclass */
- @Override
- public long getCacheTime() {
- return cacheTime;
- }
-
- /**
- * Sets the length of cache expiration time.
- *
- * null
indicates that the default class
- * loader should be used.
- *
- * @return the class loader to use, or null
- */
- public ClassLoader getClassLoader();
-
- /**
- * Returns the MIME type of the specified file, or null if the MIME type is
- * not known. The MIME type is determined by the configuration of the
- * container, and may be specified in a deployment descriptor. Common MIME
- * types are "text/html" and "image/gif".
- *
- * @param resourceName
- * a String specifying the name of a file
- * @return a String specifying the file's MIME type
- *
- * @see ServletContext#getMimeType(String)
- * @see PortletContext#getMimeType(String)
- */
- public String getMimeType(String resourceName);
-
- /**
- * Gets the properties configured for the deployment, e.g. as init
- * parameters to the servlet or portlet.
- *
- * @return properties for the application.
- */
- public Properties getInitParameters();
-
- public IteratorDEFAULT_CACHETIME
.
- *
- * @return Cache time in milliseconds
- */
- public long getCacheTime() {
- return cacheTime;
- }
-
- /**
- * Sets length of cache expiration time. This gives the adapter the
- * possibility cache streams sent to the client. The caching may be made in
- * adapter or at the client if the client supports caching. Zero or negavive
- * value disbales the caching of this stream.
- *
- * @param cacheTime
- * the cache time in milliseconds.
- */
- public void setCacheTime(long cacheTime) {
- this.cacheTime = cacheTime;
- }
-
- /**
- * Gets the size of the download buffer.
- *
- * @return int The size of the buffer in bytes.
- */
- public int getBufferSize() {
- return bufferSize;
- }
-
- /**
- * Sets the size of the download buffer.
- *
- * @param bufferSize
- * the size of the buffer in bytes.
- *
- * @since 7.0
- */
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
- /**
- * Writes this download stream to a wrapped response. This takes care of
- * setting response headers according to what is defined in this download
- * stream ({@link #getContentType()}, {@link #getCacheTime()},
- * {@link #getFileName()}) and transferring the data from the stream (
- * {@link #getStream()}) to the response. Defined parameters (
- * {@link #getParameterNames()}) are also included as headers in the
- * response. If there's is a parameter named Location
, a
- * redirect (302 Moved temporarily) is sent instead of the contents of this
- * stream.
- *
- * @param response
- * the wrapped response to write this download stream to
- * @throws IOException
- * passed through from the wrapped response
- *
- * @since 7.0
- */
- public void writeTo(WrappedResponse response) throws IOException {
- if (getParameter("Location") != null) {
- response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
- response.setHeader("Location", getParameter("Location"));
- return;
- }
-
- // Download from given stream
- final InputStream data = getStream();
- if (data != null) {
-
- OutputStream out = null;
- try {
- // Sets content type
- response.setContentType(getContentType());
-
- // Sets cache headers
- response.setCacheTime(getCacheTime());
-
- // Copy download stream parameters directly
- // to HTTP headers.
- final Iteratornull
is also
- * supported
- */
- static void tryToCloseStream(OutputStream out) {
- try {
- // try to close output stream (e.g. file handle)
- if (out != null) {
- out.close();
- }
- } catch (IOException e1) {
- // NOP
- }
- }
-
- /**
- * Helper method that tries to close an input stream and ignores any
- * exceptions.
- *
- * @param in
- * the input stream to close, null
is also supported
- */
- static void tryToCloseStream(InputStream in) {
- try {
- // try to close output stream (e.g. file handle)
- if (in != null) {
- in.close();
- }
- } catch (IOException e1) {
- // NOP
- }
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/ErrorMessage.java b/server/src/com/vaadin/terminal/ErrorMessage.java
deleted file mode 100644
index 15273efb6f..0000000000
--- a/server/src/com/vaadin/terminal/ErrorMessage.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-
-/**
- * Interface for rendering error messages to terminal. All the visible errors
- * shown to user must implement this interface.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-public interface ErrorMessage extends Serializable {
-
- public enum ErrorLevel {
- /**
- * Error code for informational messages.
- */
- INFORMATION("info", 0),
- /**
- * Error code for warning messages.
- */
- WARNING("warning", 1),
- /**
- * Error code for regular error messages.
- */
- ERROR("error", 2),
- /**
- * Error code for critical error messages.
- */
- CRITICAL("critical", 3),
- /**
- * Error code for system errors and bugs.
- */
- SYSTEMERROR("system", 4);
-
- String text;
- int errorLevel;
-
- private ErrorLevel(String text, int errorLevel) {
- this.text = text;
- this.errorLevel = errorLevel;
- }
-
- /**
- * Textual representation for server-client communication of level
- *
- * @return String for error severity
- */
- public String getText() {
- return text;
- }
-
- /**
- * Integer representation of error severity for comparison
- *
- * @return integer for error severity
- */
- public int intValue() {
- return errorLevel;
- }
-
- @Override
- public String toString() {
- return text;
- }
-
- }
-
- /**
- * @deprecated from 7.0, use {@link ErrorLevel#SYSTEMERROR} instead  Â
- */
- @Deprecated
- public static final ErrorLevel SYSTEMERROR = ErrorLevel.SYSTEMERROR;
-
- /**
- * @deprecated from 7.0, use {@link ErrorLevel#CRITICAL} instead  Â
- */
- @Deprecated
- public static final ErrorLevel CRITICAL = ErrorLevel.CRITICAL;
-
- /**
- * @deprecated from 7.0, use {@link ErrorLevel#ERROR} instead  Â
- */
-
- @Deprecated
- public static final ErrorLevel ERROR = ErrorLevel.ERROR;
-
- /**
- * @deprecated from 7.0, use {@link ErrorLevel#WARNING} instead  Â
- */
- @Deprecated
- public static final ErrorLevel WARNING = ErrorLevel.WARNING;
-
- /**
- * @deprecated from 7.0, use {@link ErrorLevel#INFORMATION} instead  Â
- */
- @Deprecated
- public static final ErrorLevel INFORMATION = ErrorLevel.INFORMATION;
-
- /**
- * Gets the errors level.
- *
- * @return the level of error as an integer.
- */
- public ErrorLevel getErrorLevel();
-
- /**
- * Returns the HTML formatted message to show in as the error message on the
- * client.
- *
- * This method should perform any necessary escaping to avoid XSS attacks.
- *
- * TODO this API may still change to use a separate data transfer object
- *
- * @return HTML formatted string for the error message
- * @since 7.0
- */
- public String getFormattedHtmlMessage();
-
-}
diff --git a/server/src/com/vaadin/terminal/Extension.java b/server/src/com/vaadin/terminal/Extension.java
deleted file mode 100644
index 87901c3c13..0000000000
--- a/server/src/com/vaadin/terminal/Extension.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import com.vaadin.terminal.gwt.server.ClientConnector;
-
-/**
- * An extension is an entity that is attached to a Component or another
- * Extension and independently communicates between client and server.
- * ExternalResource
implements source for resources fetched from
- * location specified by URL:s. The resources are fetched directly by the client
- * terminal and are not fetched trough the terminal adapter.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class ExternalResource implements Resource, Serializable {
-
- /**
- * Url of the download.
- */
- private String sourceURL = null;
-
- /**
- * MIME Type for the resource
- */
- private String mimeType = null;
-
- /**
- * Creates a new download component for downloading directly from given URL.
- *
- * @param sourceURL
- * the source URL.
- */
- public ExternalResource(URL sourceURL) {
- if (sourceURL == null) {
- throw new RuntimeException("Source must be non-null");
- }
-
- this.sourceURL = sourceURL.toString();
- }
-
- /**
- * Creates a new download component for downloading directly from given URL.
- *
- * @param sourceURL
- * the source URL.
- * @param mimeType
- * the MIME Type
- */
- public ExternalResource(URL sourceURL, String mimeType) {
- this(sourceURL);
- this.mimeType = mimeType;
- }
-
- /**
- * Creates a new download component for downloading directly from given URL.
- *
- * @param sourceURL
- * the source URL.
- */
- public ExternalResource(String sourceURL) {
- if (sourceURL == null) {
- throw new RuntimeException("Source must be non-null");
- }
-
- this.sourceURL = sourceURL.toString();
- }
-
- /**
- * Creates a new download component for downloading directly from given URL.
- *
- * @param sourceURL
- * the source URL.
- * @param mimeType
- * the MIME Type
- */
- public ExternalResource(String sourceURL, String mimeType) {
- this(sourceURL);
- this.mimeType = mimeType;
- }
-
- /**
- * Gets the URL of the external resource.
- *
- * @return the URL of the external resource.
- */
- public String getURL() {
- return sourceURL;
- }
-
- /**
- * Gets the MIME type of the resource.
- *
- * @see com.vaadin.terminal.Resource#getMIMEType()
- */
- @Override
- public String getMIMEType() {
- if (mimeType == null) {
- mimeType = FileTypeResolver.getMIMEType(getURL().toString());
- }
- return mimeType;
- }
-
- /**
- * Sets the MIME type of the resource.
- */
- public void setMIMEType(String mimeType) {
- this.mimeType = mimeType;
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/FileResource.java b/server/src/com/vaadin/terminal/FileResource.java
deleted file mode 100644
index ab8bc95ce3..0000000000
--- a/server/src/com/vaadin/terminal/FileResource.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import com.vaadin.Application;
-import com.vaadin.service.FileTypeResolver;
-import com.vaadin.terminal.Terminal.ErrorEvent;
-
-/**
- * FileResources
are files or directories on local filesystem. The
- * files and directories are served through URI:s to the client terminal and
- * thus must be registered to an URI context before they can be used. The
- * resource is automatically registered to the application when it is created.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class FileResource implements ApplicationResource {
-
- /**
- * Default buffer size for this stream resource.
- */
- private int bufferSize = 0;
-
- /**
- * File where the downloaded content is fetched from.
- */
- private File sourceFile;
-
- /**
- * Application.
- */
- private final Application application;
-
- /**
- * Default cache time for this stream resource.
- */
- private long cacheTime = DownloadStream.DEFAULT_CACHETIME;
-
- /**
- * Creates a new file resource for providing given file for client
- * terminals.
- */
- public FileResource(File sourceFile, Application application) {
- this.application = application;
- setSourceFile(sourceFile);
- application.addResource(this);
- }
-
- /**
- * Gets the resource as stream.
- *
- * @see com.vaadin.terminal.ApplicationResource#getStream()
- */
- @Override
- public DownloadStream getStream() {
- try {
- final DownloadStream ds = new DownloadStream(new FileInputStream(
- sourceFile), getMIMEType(), getFilename());
- ds.setParameter("Content-Length",
- String.valueOf(sourceFile.length()));
-
- ds.setCacheTime(cacheTime);
- return ds;
- } catch (final FileNotFoundException e) {
- // Log the exception using the application error handler
- getApplication().getErrorHandler().terminalError(new ErrorEvent() {
-
- @Override
- public Throwable getThrowable() {
- return e;
- }
-
- });
-
- return null;
- }
- }
-
- /**
- * Gets the source file.
- *
- * @return the source File.
- */
- public File getSourceFile() {
- return sourceFile;
- }
-
- /**
- * Sets the source file.
- *
- * @param sourceFile
- * the source file to set.
- */
- public void setSourceFile(File sourceFile) {
- this.sourceFile = sourceFile;
- }
-
- /**
- * @see com.vaadin.terminal.ApplicationResource#getApplication()
- */
- @Override
- public Application getApplication() {
- return application;
- }
-
- /**
- * @see com.vaadin.terminal.ApplicationResource#getFilename()
- */
- @Override
- public String getFilename() {
- return sourceFile.getName();
- }
-
- /**
- * @see com.vaadin.terminal.Resource#getMIMEType()
- */
- @Override
- public String getMIMEType() {
- return FileTypeResolver.getMIMEType(sourceFile);
- }
-
- /**
- * Gets the length of cache expiration time. This gives the adapter the
- * possibility cache streams sent to the client. The caching may be made in
- * adapter or at the client if the client supports caching. Default is
- * DownloadStream.DEFAULT_CACHETIME
.
- *
- * @return Cache time in milliseconds.
- */
- @Override
- public long getCacheTime() {
- return cacheTime;
- }
-
- /**
- * Sets the length of cache expiration time. This gives the adapter the
- * possibility cache streams sent to the client. The caching may be made in
- * adapter or at the client if the client supports caching. Zero or negavive
- * value disbales the caching of this stream.
- *
- * @param cacheTime
- * the cache time in milliseconds.
- */
- public void setCacheTime(long cacheTime) {
- this.cacheTime = cacheTime;
- }
-
- /* documented in superclass */
- @Override
- public int getBufferSize() {
- return bufferSize;
- }
-
- /**
- * Sets the size of the download buffer used for this resource.
- *
- * @param bufferSize
- * the size of the buffer in bytes.
- */
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java b/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java
deleted file mode 100644
index 17fa2cbd32..0000000000
--- a/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.vaadin.external.json.JSONArray;
-import com.vaadin.external.json.JSONException;
-import com.vaadin.shared.JavaScriptConnectorState;
-import com.vaadin.tools.ReflectTools;
-import com.vaadin.ui.AbstractJavaScriptComponent;
-import com.vaadin.ui.JavaScript.JavaScriptCallbackRpc;
-import com.vaadin.ui.JavaScriptFunction;
-
-/**
- * Internal helper class used to implement functionality common to
- * {@link AbstractJavaScriptComponent} and {@link AbstractJavaScriptExtension}.
- * Corresponding support in client-side code is in
- * {@link com.vaadin.client.JavaScriptConnectorHelper}.
- * KeyMapper
is the simple two-way map for generating textual keys
- * for objects and retrieving the objects later with the key.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-public class KeyMappernull
window name is also a special case.
- * null
- */
- public static Page getCurrent() {
- UI currentUI = UI.getCurrent();
- if (currentUI == null) {
- return null;
- }
- return currentUI.getPage();
- }
-
- /**
- * Sets the page title. The page title is displayed by the browser e.g. as
- * the title of the browser window or as the title of the tab.
- *
- * @param title
- * the new page title to set
- */
- public void setTitle(String title) {
- uI.getRpcProxy(PageClientRpc.class).setTitle(title);
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/PaintException.java b/server/src/com/vaadin/terminal/PaintException.java
deleted file mode 100644
index dd5752653a..0000000000
--- a/server/src/com/vaadin/terminal/PaintException.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-/**
- * PaintExcepection
is thrown if painting of a component fails.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class PaintException extends IOException implements Serializable {
-
- /**
- * Constructs an instance of PaintExeception
with the specified
- * detail message.
- *
- * @param msg
- * the detail message.
- */
- public PaintException(String msg) {
- super(msg);
- }
-
- /**
- * Constructs an instance of PaintExeception
with the specified
- * detail message and cause.
- *
- * @param msg
- * the detail message.
- * @param cause
- * the cause
- */
- public PaintException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- /**
- * Constructs an instance of PaintExeception
from IOException.
- *
- * @param exception
- * the original exception.
- */
- public PaintException(IOException exception) {
- super(exception.getMessage());
- }
-}
diff --git a/server/src/com/vaadin/terminal/PaintTarget.java b/server/src/com/vaadin/terminal/PaintTarget.java
deleted file mode 100644
index fd349310f6..0000000000
--- a/server/src/com/vaadin/terminal/PaintTarget.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import com.vaadin.terminal.StreamVariable.StreamingStartEvent;
-import com.vaadin.terminal.gwt.server.ClientConnector;
-import com.vaadin.ui.Component;
-
-/**
- * This interface defines the methods for painting XML to the UIDL stream.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-public interface PaintTarget extends Serializable {
-
- /**
- * Prints single XMLsection.
- *
- * Prints full XML section. The section data is escaped from XML tags and
- * surrounded by XML start and end-tags.
- *
- * @param sectionTagName
- * the name of the tag.
- * @param sectionData
- * the scetion data.
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addSection(String sectionTagName, String sectionData)
- throws PaintException;
-
- /**
- * Result of starting to paint a Component (
- * {@link PaintTarget#startPaintable(Component, String)}).
- *
- * @since 7.0
- */
- public enum PaintStatus {
- /**
- * Painting started, addVariable() and addAttribute() etc. methods may
- * be called.
- */
- PAINTING,
- /**
- * A previously unpainted or painted {@link Component} has been queued
- * be created/update later in a separate change in the same set of
- * changes.
- */
- CACHED
- }
-
- /**
- * Prints element start tag of a paintable section. Starts a paintable
- * section using the given tag. The PaintTarget may implement a caching
- * scheme, that checks the paintable has actually changed or can a cached
- * version be used instead. This method should call the startTag method.
- *
- * Todo:
- * Checking of input values
- *
- *
- * @param tagName
- * the name of the start tag.
- * @throws PaintException
- * if the paint operation failed.
- */
- public void startTag(String tagName) throws PaintException;
-
- /**
- * Prints element end tag.
- *
- * If the parent tag is closed before every child tag is closed an
- * PaintException is raised.
- *
- * @param tagName
- * the name of the end tag.
- * @throws PaintException
- * if the paint operation failed.
- */
- public void endTag(String tagName) throws PaintException;
-
- /**
- * Adds a boolean attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Attribute name.
- * @param value
- * the Attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, boolean value) throws PaintException;
-
- /**
- * Adds a integer attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Attribute name.
- * @param value
- * the Attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, int value) throws PaintException;
-
- /**
- * Adds a resource attribute to component. Atributes must be added before
- * any content is written.
- *
- * @param name
- * the Attribute name
- * @param value
- * the Attribute value
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, Resource value) throws PaintException;
-
- /**
- * Adds details about {@link StreamVariable} to the UIDL stream. Eg. in web
- * terminals Receivers are typically rendered for the client side as URLs,
- * where the client side implementation can do an http post request.
- *
- *
- * Most commonly a component developer can just ignore this issue, but with
- * strict memory requirements and lots of StreamVariables implementations
- * that reserve a lot of memory this may be a critical issue.
- *
- * @param owner
- * the ReceiverOwner that can track the progress of streaming to
- * the given StreamVariable
- * @param name
- * an identifying name for the StreamVariable
- * @param value
- * the StreamVariable to paint
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name,
- StreamVariable value) throws PaintException;
-
- /**
- * Adds a long attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Attribute name.
- * @param value
- * the Attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, long value) throws PaintException;
-
- /**
- * Adds a float attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Attribute name.
- * @param value
- * the Attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, float value) throws PaintException;
-
- /**
- * Adds a double attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Attribute name.
- * @param value
- * the Attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, double value) throws PaintException;
-
- /**
- * Adds a string attribute to component. Atributes must be added before any
- * content is written.
- *
- * @param name
- * the Boolean attribute name.
- * @param value
- * the Boolean attribute value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addAttribute(String name, String value) throws PaintException;
-
- /**
- * TODO
- *
- * @param name
- * @param value
- * @throws PaintException
- */
- public void addAttribute(String name, Map, ?> value)
- throws PaintException;
-
- /**
- * Adds a Component type attribute. On client side the value will be a
- * terminal specific reference to corresponding component on client side
- * implementation.
- *
- * @param name
- * the name of the attribute
- * @param value
- * the Component to be referenced on client side
- * @throws PaintException
- */
- public void addAttribute(String name, Component value)
- throws PaintException;
-
- /**
- * Adds a string type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, String value)
- throws PaintException;
-
- /**
- * Adds a int type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, int value)
- throws PaintException;
-
- /**
- * Adds a long type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, long value)
- throws PaintException;
-
- /**
- * Adds a float type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, float value)
- throws PaintException;
-
- /**
- * Adds a double type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, double value)
- throws PaintException;
-
- /**
- * Adds a boolean type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, boolean value)
- throws PaintException;
-
- /**
- * Adds a string array type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- * @param value
- * the Variable initial value.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addVariable(VariableOwner owner, String name, String[] value)
- throws PaintException;
-
- /**
- * Adds a Component type variable. On client side the variable value will be
- * a terminal specific reference to corresponding component on client side
- * implementation. When updated from client side, terminal will map the
- * client side component reference back to a corresponding server side
- * reference.
- *
- * @param owner
- * the Listener for variable changes
- * @param name
- * the name of the variable
- * @param value
- * the initial value of the variable
- *
- * @throws PaintException
- * if the paint oparation fails
- */
- public void addVariable(VariableOwner owner, String name, Component value)
- throws PaintException;
-
- /**
- * Adds a upload stream type variable.
- *
- * @param owner
- * the Listener for variable changes.
- * @param name
- * the Variable name.
- *
- * @throws PaintException
- * if the paint operation failed.
- */
- public void addUploadStreamVariable(VariableOwner owner, String name)
- throws PaintException;
-
- /**
- * Prints single XML section.
- * false
to indicate that no more request handlers
- * should be invoked for the request.
- *
- * @param application
- * The application to which the request belongs
- * @param request
- * The request to handle
- * @param response
- * The response object to which a response can be written.
- * @return true if a response has been written and no further request
- * handlers should be called, otherwise false
- * @throws IOException
- */
- boolean handleRequest(Application application, WrappedRequest request,
- WrappedResponse response) throws IOException;
-
-}
diff --git a/server/src/com/vaadin/terminal/Resource.java b/server/src/com/vaadin/terminal/Resource.java
deleted file mode 100644
index 27adb16869..0000000000
--- a/server/src/com/vaadin/terminal/Resource.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-
-/**
- * Resource
provided to the client terminal. Support for actually
- * displaying the resource type is left to the terminal.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-public interface Resource extends Serializable {
-
- /**
- * Gets the MIME type of the resource.
- *
- * @return the MIME type of the resource.
- */
- public String getMIMEType();
-}
diff --git a/server/src/com/vaadin/terminal/Scrollable.java b/server/src/com/vaadin/terminal/Scrollable.java
deleted file mode 100644
index 641b20ab34..0000000000
--- a/server/src/com/vaadin/terminal/Scrollable.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-
-/**
- * StreamResource
is a resource provided to the client directly by
- * the application. The strean resource is fetched from URI that is most often
- * in the context of the application or window. The resource is automatically
- * registered to window in creation.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class StreamResource implements ApplicationResource {
-
- /**
- * Source stream the downloaded content is fetched from.
- */
- private StreamSource streamSource = null;
-
- /**
- * Explicit mime-type.
- */
- private String MIMEType = null;
-
- /**
- * Filename.
- */
- private String filename;
-
- /**
- * Application.
- */
- private final Application application;
-
- /**
- * Default buffer size for this stream resource.
- */
- private int bufferSize = 0;
-
- /**
- * Default cache time for this stream resource.
- */
- private long cacheTime = DEFAULT_CACHETIME;
-
- /**
- * Creates a new stream resource for downloading from stream.
- *
- * @param streamSource
- * the source Stream.
- * @param filename
- * the name of the file.
- * @param application
- * the Application object.
- */
- public StreamResource(StreamSource streamSource, String filename,
- Application application) {
-
- this.application = application;
- setFilename(filename);
- setStreamSource(streamSource);
-
- // Register to application
- application.addResource(this);
-
- }
-
- /**
- * @see com.vaadin.terminal.Resource#getMIMEType()
- */
- @Override
- public String getMIMEType() {
- if (MIMEType != null) {
- return MIMEType;
- }
- return FileTypeResolver.getMIMEType(filename);
- }
-
- /**
- * Sets the mime type of the resource.
- *
- * @param MIMEType
- * the MIME type to be set.
- */
- public void setMIMEType(String MIMEType) {
- this.MIMEType = MIMEType;
- }
-
- /**
- * Returns the source for this StreamResource
. StreamSource is
- * queried when the resource is about to be streamed to the client.
- *
- * @return Source of the StreamResource.
- */
- public StreamSource getStreamSource() {
- return streamSource;
- }
-
- /**
- * Sets the source for this StreamResource
.
- * StreamSource
is queried when the resource is about to be
- * streamed to the client.
- *
- * @param streamSource
- * the source to set.
- */
- public void setStreamSource(StreamSource streamSource) {
- this.streamSource = streamSource;
- }
-
- /**
- * Gets the filename.
- *
- * @return the filename.
- */
- @Override
- public String getFilename() {
- return filename;
- }
-
- /**
- * Sets the filename.
- *
- * @param filename
- * the filename to set.
- */
- public void setFilename(String filename) {
- this.filename = filename;
- }
-
- /**
- * @see com.vaadin.terminal.ApplicationResource#getApplication()
- */
- @Override
- public Application getApplication() {
- return application;
- }
-
- /**
- * @see com.vaadin.terminal.ApplicationResource#getStream()
- */
- @Override
- public DownloadStream getStream() {
- final StreamSource ss = getStreamSource();
- if (ss == null) {
- return null;
- }
- final DownloadStream ds = new DownloadStream(ss.getStream(),
- getMIMEType(), getFilename());
- ds.setBufferSize(getBufferSize());
- ds.setCacheTime(cacheTime);
- return ds;
- }
-
- /**
- * Interface implemented by the source of a StreamResource.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
- public interface StreamSource extends Serializable {
-
- /**
- * Returns new input stream that is used for reading the resource.
- */
- public InputStream getStream();
- }
-
- /* documented in superclass */
- @Override
- public int getBufferSize() {
- return bufferSize;
- }
-
- /**
- * Sets the size of the download buffer used for this resource.
- *
- * @param bufferSize
- * the size of the buffer in bytes.
- */
- public void setBufferSize(int bufferSize) {
- this.bufferSize = bufferSize;
- }
-
- /* documented in superclass */
- @Override
- public long getCacheTime() {
- return cacheTime;
- }
-
- /**
- * Sets the length of cache expiration time.
- *
- * SystemError
is an error message for a problem caused by error in
- * system, not the user application code. The system error can contain technical
- * information such as stack trace and exception.
- *
- * SystemError does not support HTML in error messages or stack traces. If HTML
- * messages are required, use {@link UserError} or a custom implementation of
- * {@link ErrorMessage}.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class SystemError extends AbstractErrorMessage {
-
- /**
- * Constructor for SystemError with error message specified.
- *
- * @param message
- * the Textual error description.
- */
- public SystemError(String message) {
- super(message);
- setErrorLevel(ErrorLevel.SYSTEMERROR);
- setMode(ContentMode.XHTML);
- setMessage(getHtmlMessage());
- }
-
- /**
- * Constructor for SystemError with causing exception and error message.
- *
- * @param message
- * the Textual error description.
- * @param cause
- * the throwable causing the system error.
- */
- public SystemError(String message, Throwable cause) {
- this(message);
- addCause(AbstractErrorMessage.getErrorMessageForException(cause));
- }
-
- /**
- * Constructor for SystemError with cause.
- *
- * @param cause
- * the throwable causing the system error.
- */
- public SystemError(Throwable cause) {
- this(null, cause);
- }
-
- /**
- * Returns the message of the error in HTML.
- *
- * Note that this API may change in future versions.
- */
- protected String getHtmlMessage() {
- // TODO wrapping div with namespace? See the old code:
- // target.addXMLSection("div", message,
- // "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
-
- StringBuilder sb = new StringBuilder();
- if (getMessage() != null) {
- sb.append("");
- sb.append(AbstractApplicationServlet
- .safeEscapeForHtml(getMessage()));
- sb.append("
");
- }
- return sb.toString();
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/Terminal.java b/server/src/com/vaadin/terminal/Terminal.java
deleted file mode 100644
index a02bcb50bb..0000000000
--- a/server/src/com/vaadin/terminal/Terminal.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.Serializable;
-
-/**
- * An interface that provides information about the user's terminal.
- * Implementors typically provide additional information using methods not in
- * this interface. ThemeResource
is a named theme dependant resource provided and
- * managed by a theme. The actual resource contents are dynamically resolved to
- * comply with the used theme by the terminal adapter. This is commonly used to
- * provide static images, flash, java-applets, etc for the terminals.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class ThemeResource implements Resource {
-
- /**
- * Id of the terminal managed resource.
- */
- private String resourceID = null;
-
- /**
- * Creates a resource.
- *
- * @param resourceId
- * the Id of the resource.
- */
- public ThemeResource(String resourceId) {
- if (resourceId == null) {
- throw new NullPointerException("Resource ID must not be null");
- }
- if (resourceId.length() == 0) {
- throw new IllegalArgumentException("Resource ID can not be empty");
- }
- if (resourceId.charAt(0) == '/') {
- throw new IllegalArgumentException(
- "Resource ID must be relative (can not begin with /)");
- }
-
- resourceID = resourceId;
- }
-
- /**
- * Tests if the given object equals this Resource.
- *
- * @param obj
- * the object to be tested for equality.
- * @return true
if the given object equals this Icon,
- * false
if not.
- * @see java.lang.Object#equals(Object)
- */
- @Override
- public boolean equals(Object obj) {
- return obj instanceof ThemeResource
- && resourceID.equals(((ThemeResource) obj).resourceID);
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return resourceID.hashCode();
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return resourceID.toString();
- }
-
- /**
- * Gets the resource id.
- *
- * @return the resource id.
- */
- public String getResourceId() {
- return resourceID;
- }
-
- /**
- * @see com.vaadin.terminal.Resource#getMIMEType()
- */
- @Override
- public String getMIMEType() {
- return FileTypeResolver.getMIMEType(getResourceId());
- }
-}
diff --git a/server/src/com/vaadin/terminal/UIProvider.java b/server/src/com/vaadin/terminal/UIProvider.java
deleted file mode 100644
index 27b63fbcac..0000000000
--- a/server/src/com/vaadin/terminal/UIProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import com.vaadin.Application;
-import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.ui.UI;
-
-public interface UIProvider {
- public Class extends UI> getUIClass(Application application,
- WrappedRequest request) throws UIRequiresMoreInformationException;
-
- public UI instantiateUI(Application application,
- Class extends UI> type, WrappedRequest request);
-}
diff --git a/server/src/com/vaadin/terminal/UserError.java b/server/src/com/vaadin/terminal/UserError.java
deleted file mode 100644
index 18680f912f..0000000000
--- a/server/src/com/vaadin/terminal/UserError.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-/**
- * UserError
is a controlled error occurred in application. User
- * errors are occur in normal usage of the application and guide the user.
- *
- * @author Vaadin Ltd.
- * @since 3.0
- */
-@SuppressWarnings("serial")
-public class UserError extends AbstractErrorMessage {
-
- /**
- * @deprecated from 7.0, use {@link ContentMode#TEXT} instead  Â
- */
- @Deprecated
- public static final ContentMode CONTENT_TEXT = ContentMode.TEXT;
-
- /**
- * @deprecated from 7.0, use {@link ContentMode#PREFORMATTED} instead  Â
- */
- @Deprecated
- public static final ContentMode CONTENT_PREFORMATTED = ContentMode.PREFORMATTED;
-
- /**
- * @deprecated from 7.0, use {@link ContentMode#XHTML} instead  Â
- */
- @Deprecated
- public static final ContentMode CONTENT_XHTML = ContentMode.XHTML;
-
- /**
- * Creates a textual error message of level ERROR.
- *
- * @param textErrorMessage
- * the text of the error message.
- */
- public UserError(String textErrorMessage) {
- super(textErrorMessage);
- }
-
- /**
- * Creates an error message with level and content mode.
- *
- * @param message
- * the error message.
- * @param contentMode
- * the content Mode.
- * @param errorLevel
- * the level of error.
- */
- public UserError(String message, ContentMode contentMode,
- ErrorLevel errorLevel) {
- super(message);
- if (contentMode == null) {
- contentMode = ContentMode.TEXT;
- }
- if (errorLevel == null) {
- errorLevel = ErrorLevel.ERROR;
- }
- setMode(contentMode);
- setErrorLevel(errorLevel);
- }
-
-}
diff --git a/server/src/com/vaadin/terminal/Vaadin6Component.java b/server/src/com/vaadin/terminal/Vaadin6Component.java
deleted file mode 100644
index eb169c90f9..0000000000
--- a/server/src/com/vaadin/terminal/Vaadin6Component.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.terminal;
-
-import java.util.EventListener;
-
-import com.vaadin.ui.Component;
-
-/**
- * Interface provided to ease porting of Vaadin 6 components to Vaadin 7. By
- * implementing this interface your Component will be able to use
- * {@link #paintContent(PaintTarget)} and
- * {@link #changeVariables(Object, java.util.Map)} just like in Vaadin 6.
- *
- * @author Vaadin Ltd
- * @since 7.0.0
- *
- */
-public interface Vaadin6Component extends VariableOwner, Component,
- EventListener {
-
- /**
- * true
if the variable owner is enabled,
- * false
if not
- */
- public boolean isEnabled();
-
- /**
- * VariableOwner
does not include a set-
- * method for the immediateness property. This is because not all
- * VariableOwners wish to offer the functionality. Such VariableOwners are
- * never in the immediate mode, thus they always return false
- * in {@link #isImmediate()}.
- * true
if the component is in immediate mode,
- * false
if not.
- */
- public boolean isImmediate();
-
- /**
- * VariableOwner error event.
- */
- public interface ErrorEvent extends Terminal.ErrorEvent {
-
- /**
- * Gets the source VariableOwner.
- *
- * @return the variable owner.
- */
- public VariableOwner getVariableOwner();
-
- }
-}
diff --git a/server/src/com/vaadin/terminal/WrappedRequest.java b/server/src/com/vaadin/terminal/WrappedRequest.java
deleted file mode 100644
index 343a60848e..0000000000
--- a/server/src/com/vaadin/terminal/WrappedRequest.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.portlet.PortletRequest;
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-
-import com.vaadin.Application;
-import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.annotations.EagerInit;
-import com.vaadin.terminal.gwt.server.WebBrowser;
-import com.vaadin.ui.UI;
-
-/**
- * A generic request to the server, wrapping a more specific request type, e.g.
- * HttpServletReqest or PortletRequest.
- *
- * @since 7.0
- */
-public interface WrappedRequest extends Serializable {
-
- /**
- * Detailed information extracted from the browser.
- *
- * @see WrappedRequest#getBrowserDetails()
- */
- public interface BrowserDetails extends Serializable {
- /**
- * Gets the URI hash fragment for the request. This is typically used to
- * encode navigation within an application.
- *
- * @return the URI hash fragment
- */
- public String getUriFragment();
-
- /**
- * Gets the value of window.name from the browser. This can be used to
- * keep track of the specific window between browser reloads.
- *
- * @return the string value of window.name in the browser
- */
- public String getWindowName();
-
- /**
- * Gets a reference to the {@link WebBrowser} object containing
- * additional information, e.g. screen size and the time zone offset.
- *
- * @return the web browser object
- */
- public WebBrowser getWebBrowser();
- }
-
- /**
- * Gets the named request parameter This is typically a HTTP GET or POST
- * parameter, though other request types might have other ways of
- * representing parameters.
- *
- * @see javax.servlet.ServletRequest#getParameter(String)
- * @see javax.portlet.PortletRequest#getParameter(String)
- *
- * @param parameter
- * the name of the parameter
- * @return The paramter value, or null
if no parameter with the
- * given name is present
- */
- public String getParameter(String parameter);
-
- /**
- * Gets all the parameters of the request.
- *
- * @see #getParameter(String)
- *
- * @see javax.servlet.ServletRequest#getParameterMap()
- * @see javax.portlet.PortletRequest#getParameter(String)
- *
- * @return A mapping of parameter names to arrays of parameter values
- */
- public Mapnull
if there is no
- * attribute with the given name
- *
- * @see javax.servlet.ServletRequest#getAttribute(String)
- * @see javax.portlet.PortletRequest#getAttribute(String)
- */
- public Object getAttribute(String name);
-
- /**
- * Defines a request attribute.
- *
- * @param name
- * the name of the attribute
- * @param value
- * the attribute value
- *
- * @see javax.servlet.ServletRequest#setAttribute(String, Object)
- * @see javax.portlet.PortletRequest#setAttribute(String, Object)
- */
- public void setAttribute(String name, Object value);
-
- /**
- * Gets the path of the requested resource relative to the application. The
- * path be null
if no path information is available. Does
- * always start with / if the path isn't null
.
- *
- * @return a string with the path relative to the application.
- *
- * @see javax.servlet.http.HttpServletRequest#getPathInfo()
- */
- public String getRequestPathInfo();
-
- /**
- * Returns the maximum time interval, in seconds, that the session
- * associated with this request will be kept open between client accesses.
- *
- * @return an integer specifying the number of seconds the session
- * associated with this request remains open between client requests
- *
- * @see javax.servlet.http.HttpSession#getMaxInactiveInterval()
- * @see javax.portlet.PortletSession#getMaxInactiveInterval()
- */
- public int getSessionMaxInactiveInterval();
-
- /**
- * Gets an attribute from the session associated with this request.
- *
- * @param name
- * the name of the attribute
- * @return the attribute value, or null
if the attribute is not
- * defined in the session
- *
- * @see javax.servlet.http.HttpSession#getAttribute(String)
- * @see javax.portlet.PortletSession#getAttribute(String)
- */
- public Object getSessionAttribute(String name);
-
- /**
- * Saves an attribute value in the session associated with this request.
- *
- * @param name
- * the name of the attribute
- * @param attribute
- * the attribute value
- *
- * @see javax.servlet.http.HttpSession#setAttribute(String, Object)
- * @see javax.portlet.PortletSession#setAttribute(String, Object)
- */
- public void setSessionAttribute(String name, Object attribute);
-
- /**
- * Returns the MIME type of the body of the request, or null if the type is
- * not known.
- *
- * @return a string containing the name of the MIME type of the request, or
- * null if the type is not known
- *
- * @see javax.servlet.ServletRequest#getContentType()
- * @see javax.portlet.ResourceRequest#getContentType()
- *
- */
- public String getContentType();
-
- /**
- * Gets detailed information about the browser from which the request
- * originated. This consists of information that is not available from
- * normal HTTP requests, but requires additional information to be extracted
- * for instance using javascript in the browser.
- *
- * This information is only guaranteed to be available in some special
- * cases, for instance when
- * {@link Application#getUIForRequest(WrappedRequest)} is called again after
- * throwing {@link UIRequiresMoreInformationException} or in
- * {@link UI#init(WrappedRequest)} for a UI class not annotated with
- * {@link EagerInit}
- *
- * @return the browser details, or null
if details are not
- * available
- *
- * @see BrowserDetails
- */
- public BrowserDetails getBrowserDetails();
-
- /**
- * Gets locale information from the query, e.g. using the Accept-Language
- * header.
- *
- * @return the preferred Locale
- *
- * @see ServletRequest#getLocale()
- * @see PortletRequest#getLocale()
- */
- public Locale getLocale();
-
- /**
- * Returns the IP address from which the request came. This might also be
- * the address of a proxy between the server and the original requester.
- *
- * @return a string containing the IP address, or null
if the
- * address is not available
- *
- * @see ServletRequest#getRemoteAddr()
- */
- public String getRemoteAddr();
-
- /**
- * Checks whether the request was made using a secure channel, e.g. using
- * https.
- *
- * @return a boolean indicating if the request is secure
- *
- * @see ServletRequest#isSecure()
- * @see PortletRequest#isSecure()
- */
- public boolean isSecure();
-
- /**
- * Gets the value of a request header, e.g. a http header for a
- * {@link HttpServletRequest}.
- *
- * @param headerName
- * the name of the header
- * @return the header value, or null
if the header is not
- * present in the request
- *
- * @see HttpServletRequest#getHeader(String)
- */
- public String getHeader(String headerName);
-
- /**
- * Gets the deployment configuration for the context of this request.
- *
- * @return the deployment configuration
- *
- * @see DeploymentConfiguration
- */
- public DeploymentConfiguration getDeploymentConfiguration();
-
-}
diff --git a/server/src/com/vaadin/terminal/WrappedResponse.java b/server/src/com/vaadin/terminal/WrappedResponse.java
deleted file mode 100644
index 02daaa1bdd..0000000000
--- a/server/src/com/vaadin/terminal/WrappedResponse.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.terminal;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Serializable;
-
-import javax.portlet.MimeResponse;
-import javax.portlet.PortletResponse;
-import javax.portlet.ResourceResponse;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * A generic response from the server, wrapping a more specific response type,
- * e.g. HttpServletResponse or PortletResponse.
- *
- * @since 7.0
- */
-public interface WrappedResponse extends Serializable {
-
- /**
- * Sets the (http) status code for the response. If you want to include an
- * error message along the status code, use {@link #sendError(int, String)}
- * instead.
- *
- * @param statusCode
- * the status code to set
- * @see HttpServletResponse#setStatus(int)
- *
- * @see ResourceResponse#HTTP_STATUS_CODE
- */
- public void setStatus(int statusCode);
-
- /**
- * Sets the content type of this response. If the content type including a
- * charset is set before {@link #getWriter()} is invoked, the returned
- * PrintWriter will automatically use the defined charset.
- *
- * @param contentType
- * a string specifying the MIME type of the content
- *
- * @see ServletResponse#setContentType(String)
- * @see MimeResponse#setContentType(String)
- */
- public void setContentType(String contentType);
-
- /**
- * Sets the value of a generic response header. If the header had already
- * been set, the new value overwrites the previous one.
- *
- * @param name
- * the name of the header
- * @param value
- * the header value.
- *
- * @see HttpServletResponse#setHeader(String, String)
- * @see PortletResponse#setProperty(String, String)
- */
- public void setHeader(String name, String value);
-
- /**
- * Properly formats a timestamp as a date header. If the header had already
- * been set, the new value overwrites the previous one.
- *
- * @param name
- * the name of the header
- * @param timestamp
- * the number of milliseconds since epoch
- *
- * @see HttpServletResponse#setDateHeader(String, long)
- */
- public void setDateHeader(String name, long timestamp);
-
- /**
- * Returns a OutputStream
for writing binary data in the
- * response.
- * OutputStream
for writing binary data
- * @throws IOException
- * if an input or output exception occurred
- *
- * @see #getWriter()
- * @see ServletResponse#getOutputStream()
- * @see MimeResponse#getPortletOutputStream()
- */
- public OutputStream getOutputStream() throws IOException;
-
- /**
- * Returns a PrintWriter
object that can send character text to
- * the client. The PrintWriter uses the character encoding defined using
- * setContentType.
- * PrintWriter
for writing character text
- * @throws IOException
- * if an input or output exception occurred
- *
- * @see #getOutputStream()
- * @see ServletResponse#getWriter()
- * @see MimeResponse#getWriter()
- */
- public PrintWriter getWriter() throws IOException;
-
- /**
- * Sets cache time in milliseconds, -1 means no cache at all. All required
- * headers related to caching in the response are set based on the time.
- *
- * @param milliseconds
- * Cache time in milliseconds
- */
- public void setCacheTime(long milliseconds);
-
- /**
- * Sends an error response to the client using the specified status code and
- * clears the buffer. In some configurations, this can cause a predefined
- * error page to be displayed.
- *
- * @param errorCode
- * the HTTP status code
- * @param message
- * a message to accompany the error
- * @throws IOException
- * if an input or output exception occurs
- *
- * @see HttpServletResponse#sendError(int, String)
- */
- public void sendError(int errorCode, String message) throws IOException;
-
- /**
- * Gets the deployment configuration for the context of this response.
- *
- * @return the deployment configuration
- *
- * @see DeploymentConfiguration
- */
- public DeploymentConfiguration getDeploymentConfiguration();
-}
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
index 345f462239..47b9e97648 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -57,10 +57,10 @@ import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
import com.vaadin.Application.SystemMessages;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.Terminal;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.Terminal;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback;
import com.vaadin.ui.UI;
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
index 13fd869166..c92dfddd3b 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java
@@ -49,12 +49,12 @@ import javax.servlet.http.HttpSession;
import com.vaadin.Application;
import com.vaadin.Application.ApplicationStartEvent;
import com.vaadin.Application.SystemMessages;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.Terminal;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.Terminal;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback;
import com.vaadin.ui.UI;
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 47923a1374..d4c1cfb157 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -66,6 +66,21 @@ import com.vaadin.annotations.StyleSheet;
import com.vaadin.external.json.JSONArray;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
+import com.vaadin.server.AbstractClientConnector;
+import com.vaadin.server.CombinedRequest;
+import com.vaadin.server.LegacyPaint;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.StreamVariable;
+import com.vaadin.server.Vaadin6Component;
+import com.vaadin.server.VariableOwner;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
+import com.vaadin.server.StreamVariable.StreamingEndEvent;
+import com.vaadin.server.StreamVariable.StreamingErrorEvent;
+import com.vaadin.server.Terminal.ErrorEvent;
+import com.vaadin.server.Terminal.ErrorListener;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.Connector;
import com.vaadin.shared.JavaScriptConnectorState;
@@ -75,21 +90,6 @@ import com.vaadin.shared.communication.MethodInvocation;
import com.vaadin.shared.communication.SharedState;
import com.vaadin.shared.communication.UidlValue;
import com.vaadin.shared.ui.ui.UIConstants;
-import com.vaadin.terminal.AbstractClientConnector;
-import com.vaadin.terminal.CombinedRequest;
-import com.vaadin.terminal.LegacyPaint;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.StreamVariable;
-import com.vaadin.terminal.StreamVariable.StreamingEndEvent;
-import com.vaadin.terminal.StreamVariable.StreamingErrorEvent;
-import com.vaadin.terminal.Terminal.ErrorEvent;
-import com.vaadin.terminal.Terminal.ErrorListener;
-import com.vaadin.terminal.Vaadin6Component;
-import com.vaadin.terminal.VariableOwner;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
import com.vaadin.terminal.gwt.server.BootstrapHandler.BootstrapContext;
import com.vaadin.terminal.gwt.server.ComponentSizeValidator.InvalidLayout;
import com.vaadin.terminal.gwt.server.RpcManager.RpcInvocationException;
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java
index 4052f5a400..ab85214d25 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java
@@ -22,7 +22,7 @@ import java.util.Properties;
import java.util.ServiceLoader;
import java.util.logging.Logger;
-import com.vaadin.terminal.DeploymentConfiguration;
+import com.vaadin.server.DeploymentConfiguration;
public abstract class AbstractDeploymentConfiguration implements
DeploymentConfiguration {
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java b/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java
index ec2aa84947..4ee309576b 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.terminal.gwt.server;
-import com.vaadin.terminal.StreamVariable.StreamingEvent;
+import com.vaadin.server.StreamVariable.StreamingEvent;
/**
* Abstract base class for StreamingEvent implementations.
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java b/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java
index d857eeef4a..29a2bcf72f 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java
@@ -34,9 +34,9 @@ import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
import com.vaadin.Application;
+import com.vaadin.server.ApplicationResource;
import com.vaadin.service.ApplicationContext;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.ApplicationResource;
/**
* Base class for web application contexts (including portlet contexts) that
diff --git a/server/src/com/vaadin/terminal/gwt/server/AddonContext.java b/server/src/com/vaadin/terminal/gwt/server/AddonContext.java
index 2af22c560b..03f1d95a56 100644
--- a/server/src/com/vaadin/terminal/gwt/server/AddonContext.java
+++ b/server/src/com/vaadin/terminal/gwt/server/AddonContext.java
@@ -24,7 +24,7 @@ import java.util.ServiceLoader;
import com.vaadin.Application;
import com.vaadin.event.EventRouter;
-import com.vaadin.terminal.DeploymentConfiguration;
+import com.vaadin.server.DeploymentConfiguration;
import com.vaadin.tools.ReflectTools;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java b/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java
index d5c0d604c3..397c8e7369 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java
@@ -23,11 +23,11 @@ import java.util.regex.Pattern;
import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.ApplicationResource;
+import com.vaadin.server.DownloadStream;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
public class ApplicationResourceHandler implements RequestHandler {
private static final Pattern APP_RESOURCE_PATTERN = Pattern
diff --git a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java
index 857c7c738c..6765958369 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java
@@ -20,7 +20,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import com.vaadin.Application;
-import com.vaadin.terminal.DefaultUIProvider;
+import com.vaadin.server.DefaultUIProvider;
import com.vaadin.terminal.gwt.server.ServletPortletHelper.ApplicationClassException;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java
index 6f69086523..ff26a1270a 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.jsoup.nodes.Node;
import com.vaadin.Application;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.WrappedRequest;
/**
* A representation of a bootstrap fragment being generated. The bootstrap
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
index 02005e8d22..94328b47bf 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java
@@ -40,14 +40,14 @@ import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.Version;
import com.vaadin.shared.ui.ui.UIConstants;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.UI;
public abstract class BootstrapHandler implements RequestHandler {
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java
index 847578ef97..1d244a69be 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java
@@ -21,8 +21,8 @@ import java.util.Map;
import org.jsoup.nodes.Document;
import com.vaadin.Application;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
/**
* A representation of a bootstrap page being generated. The bootstrap page
diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
index a422cba345..bc2fdb0dd2 100644
--- a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java
@@ -20,7 +20,7 @@ import java.util.EventObject;
import com.vaadin.Application;
import com.vaadin.UIRequiresMoreInformationException;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.UI;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
index c2fbbe37d4..152acf9d2b 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java
@@ -20,10 +20,10 @@ import java.util.List;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
+import com.vaadin.server.AbstractClientConnector;
+import com.vaadin.server.Extension;
import com.vaadin.shared.Connector;
import com.vaadin.shared.communication.SharedState;
-import com.vaadin.terminal.AbstractClientConnector;
-import com.vaadin.terminal.Extension;
import com.vaadin.ui.Component;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.UI;
diff --git a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
index 7551e849a1..93a2ede4ce 100644
--- a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
+++ b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java
@@ -23,8 +23,8 @@ import javax.servlet.ServletContext;
import com.vaadin.Application;
import com.vaadin.external.json.JSONException;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.ui.UI;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java b/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java
index 2349be1974..b8a116b1ad 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java
@@ -28,7 +28,7 @@ import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
-import com.vaadin.terminal.Sizeable.Unit;
+import com.vaadin.server.Sizeable.Unit;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.AbstractSplitPanel;
import com.vaadin.ui.Component;
diff --git a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java
index 0106f466fc..ff5cedd656 100644
--- a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java
+++ b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java
@@ -33,12 +33,12 @@ import com.vaadin.event.dd.TargetDetailsImpl;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
+import com.vaadin.server.Extension;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.VariableOwner;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.communication.SharedState;
import com.vaadin.shared.ui.dd.DragEventType;
-import com.vaadin.terminal.Extension;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.VariableOwner;
import com.vaadin.ui.Component;
import com.vaadin.ui.UI;
diff --git a/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java b/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java
index 22467a0c1a..3b5eb9b42f 100644
--- a/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java
+++ b/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java
@@ -23,8 +23,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.vaadin.Application;
+import com.vaadin.server.Terminal;
import com.vaadin.service.ApplicationContext.TransactionListener;
-import com.vaadin.terminal.Terminal;
/**
* {@link Application} that implements this interface gets notified of request
diff --git a/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
index cfc3cc7e7e..e7efd28a9c 100644
--- a/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
+++ b/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
@@ -27,11 +27,11 @@ import java.util.Stack;
import java.util.Vector;
import java.util.logging.Logger;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.StreamVariable;
-import com.vaadin.terminal.VariableOwner;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
+import com.vaadin.server.StreamVariable;
+import com.vaadin.server.VariableOwner;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomLayout;
@@ -589,7 +589,7 @@ public class JsonPaintTarget implements PaintTarget {
* @throws PaintException
* if the paint operation failed.
*
- * @see com.vaadin.terminal.PaintTarget#addXMLSection(String, String,
+ * @see com.vaadin.server.PaintTarget#addXMLSection(String, String,
* String)
*/
diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
index 3e0f8d6b99..b10e661fb3 100644
--- a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
+++ b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java
@@ -45,7 +45,7 @@ import javax.servlet.http.HttpSessionBindingListener;
import javax.xml.namespace.QName;
import com.vaadin.Application;
-import com.vaadin.terminal.ExternalResource;
+import com.vaadin.server.ExternalResource;
import com.vaadin.ui.UI;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
index e127425786..a2aa446ac7 100644
--- a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
+++ b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
@@ -29,11 +29,11 @@ import javax.portlet.ResourceURL;
import com.vaadin.Application;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.UI;
/**
diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java b/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java
index f7b6421e11..5647606a75 100644
--- a/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java
+++ b/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java
@@ -22,8 +22,8 @@ import javax.portlet.PortletResponse;
import javax.servlet.Filter;
import com.vaadin.Application;
+import com.vaadin.server.Terminal;
import com.vaadin.service.ApplicationContext.TransactionListener;
-import com.vaadin.terminal.Terminal;
/**
* An {@link Application} that implements this interface gets notified of
diff --git a/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java b/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java
index a1d5731f7d..98aa61a885 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java
@@ -16,11 +16,11 @@
package com.vaadin.terminal.gwt.server;
import com.vaadin.Application;
+import com.vaadin.server.ApplicationResource;
+import com.vaadin.server.ExternalResource;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
import com.vaadin.shared.communication.URLReference;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.ThemeResource;
public class ResourceReference extends URLReference {
diff --git a/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java b/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java
index 1a3cf28fcc..0bdb141b6f 100644
--- a/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java
+++ b/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java
@@ -18,7 +18,7 @@ package com.vaadin.terminal.gwt.server;
import java.io.Serializable;
-import com.vaadin.terminal.VariableOwner;
+import com.vaadin.server.VariableOwner;
/**
* Marker interface for server side classes that can receive RPC calls.
diff --git a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
index 1d35785a57..cb95eada22 100644
--- a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
+++ b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java
@@ -3,9 +3,9 @@ package com.vaadin.terminal.gwt.server;
import java.io.Serializable;
import com.vaadin.Application;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.UI;
/*
diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java
index 6bc9f8fbd9..a484705ca5 100644
--- a/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java
+++ b/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.terminal.gwt.server;
-import com.vaadin.terminal.StreamVariable.StreamingEndEvent;
+import com.vaadin.server.StreamVariable.StreamingEndEvent;
@SuppressWarnings("serial")
final class StreamingEndEventImpl extends AbstractStreamingEvent implements
diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java
index cf9339d676..8e794b5fbf 100644
--- a/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java
+++ b/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.terminal.gwt.server;
-import com.vaadin.terminal.StreamVariable.StreamingErrorEvent;
+import com.vaadin.server.StreamVariable.StreamingErrorEvent;
@SuppressWarnings("serial")
final class StreamingErrorEventImpl extends AbstractStreamingEvent implements
diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java
index bcb114db60..14d0ed4f3a 100644
--- a/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java
+++ b/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.terminal.gwt.server;
-import com.vaadin.terminal.StreamVariable.StreamingProgressEvent;
+import com.vaadin.server.StreamVariable.StreamingProgressEvent;
@SuppressWarnings("serial")
final class StreamingProgressEventImpl extends AbstractStreamingEvent implements
diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java
index 07ff6cf7b1..51c286549d 100644
--- a/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java
+++ b/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java
@@ -15,7 +15,7 @@
*/
package com.vaadin.terminal.gwt.server;
-import com.vaadin.terminal.StreamVariable.StreamingStartEvent;
+import com.vaadin.server.StreamVariable.StreamingStartEvent;
@SuppressWarnings("serial")
final class StreamingStartEventImpl extends AbstractStreamingEvent implements
diff --git a/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java b/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java
index 22e46cb722..b30133191d 100644
--- a/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java
+++ b/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java
@@ -19,9 +19,9 @@ import java.io.IOException;
import java.io.Writer;
import com.vaadin.Application;
-import com.vaadin.terminal.RequestHandler;
-import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.RequestHandler;
+import com.vaadin.server.WrappedRequest;
+import com.vaadin.server.WrappedResponse;
/**
* A {@link RequestHandler} that presents an informative page if the browser in
diff --git a/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java b/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java
index 37bc81cfcf..25193b5cbe 100644
--- a/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java
+++ b/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java
@@ -19,8 +19,8 @@ package com.vaadin.terminal.gwt.server;
import java.util.Date;
import java.util.Locale;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.shared.VBrowserDetails;
-import com.vaadin.terminal.WrappedRequest;
/**
* Class that provides information about the web browser the user is using.
diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java
index a64be4c163..6b69a125a2 100644
--- a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java
+++ b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java
@@ -20,9 +20,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import com.vaadin.Application;
-import com.vaadin.terminal.CombinedRequest;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.server.CombinedRequest;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedRequest;
/**
* Wrapper for {@link HttpServletRequest}.
diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java
index 237bb643ee..c2e8ed1416 100644
--- a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java
@@ -19,8 +19,8 @@ package com.vaadin.terminal.gwt.server;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedResponse;
/**
* Wrapper for {@link HttpServletResponse}.
diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java
index 9ac2e5a608..80d6f9571e 100644
--- a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java
+++ b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java
@@ -26,10 +26,10 @@ import javax.portlet.PortletRequest;
import javax.portlet.ResourceRequest;
import com.vaadin.Application;
+import com.vaadin.server.CombinedRequest;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedRequest;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.terminal.CombinedRequest;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedRequest;
/**
* Wrapper for {@link PortletRequest} and its subclasses.
diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java
index 39ccacd331..584c304eaa 100644
--- a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java
+++ b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java
@@ -29,8 +29,8 @@ import javax.portlet.MimeResponse;
import javax.portlet.PortletResponse;
import javax.portlet.ResourceResponse;
-import com.vaadin.terminal.DeploymentConfiguration;
-import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.WrappedResponse;
/**
* Wrapper for {@link PortletResponse} and its subclasses.
diff --git a/server/src/com/vaadin/terminal/package.html b/server/src/com/vaadin/terminal/package.html
deleted file mode 100644
index 83514a0de5..0000000000
--- a/server/src/com/vaadin/terminal/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-Package Specification
-
-
-
-
-
-
-
diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java
index 56bbd19852..412a3390e4 100644
--- a/server/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/server/src/com/vaadin/ui/AbsoluteLayout.java
@@ -24,12 +24,12 @@ import java.util.Map;
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
+import com.vaadin.server.Sizeable;
import com.vaadin.shared.Connector;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutServerRpc;
import com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutState;
-import com.vaadin.terminal.Sizeable;
/**
* AbsoluteLayout is a layout implementation that mimics html absolute
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java
index 33ba80656d..d651755a2a 100644
--- a/server/src/com/vaadin/ui/AbstractComponent.java
+++ b/server/src/com/vaadin/ui/AbstractComponent.java
@@ -32,11 +32,11 @@ import com.vaadin.event.ActionManager;
import com.vaadin.event.EventRouter;
import com.vaadin.event.MethodEventSource;
import com.vaadin.event.ShortcutListener;
+import com.vaadin.server.AbstractClientConnector;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.Resource;
+import com.vaadin.server.Terminal;
import com.vaadin.shared.ComponentState;
-import com.vaadin.terminal.AbstractClientConnector;
-import com.vaadin.terminal.ErrorMessage;
-import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.Terminal;
import com.vaadin.terminal.gwt.server.ClientConnector;
import com.vaadin.terminal.gwt.server.ComponentSizeValidator;
import com.vaadin.terminal.gwt.server.ResourceReference;
@@ -1072,7 +1072,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#getHeight()
+ * @see com.vaadin.Sizeable#getHeight()
*/
@Override
public float getHeight() {
@@ -1082,7 +1082,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#getHeightUnits()
+ * @see com.vaadin.server.Sizeable#getHeightUnits()
*/
@Override
public Unit getHeightUnits() {
@@ -1092,7 +1092,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#getWidth()
+ * @see com.vaadin.server.Sizeable#getWidth()
*/
@Override
public float getWidth() {
@@ -1102,7 +1102,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#getWidthUnits()
+ * @see com.vaadin.server.Sizeable#getWidthUnits()
*/
@Override
public Unit getWidthUnits() {
@@ -1112,7 +1112,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setHeight(float, Unit)
+ * @see com.vaadin.server.Sizeable#setHeight(float, Unit)
*/
@Override
public void setHeight(float height, Unit unit) {
@@ -1128,7 +1128,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setSizeFull()
+ * @see com.vaadin.server.Sizeable#setSizeFull()
*/
@Override
public void setSizeFull() {
@@ -1139,7 +1139,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setSizeUndefined()
+ * @see com.vaadin.server.Sizeable#setSizeUndefined()
*/
@Override
public void setSizeUndefined() {
@@ -1150,7 +1150,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setWidth(float, Unit)
+ * @see com.vaadin.server.Sizeable#setWidth(float, Unit)
*/
@Override
public void setWidth(float width, Unit unit) {
@@ -1166,7 +1166,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setWidth(java.lang.String)
+ * @see com.vaadin.server.Sizeable#setWidth(java.lang.String)
*/
@Override
public void setWidth(String width) {
@@ -1181,7 +1181,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
/*
* (non-Javadoc)
*
- * @see com.vaadin.terminal.Sizeable#setHeight(java.lang.String)
+ * @see com.vaadin.server.Sizeable#setHeight(java.lang.String)
*/
@Override
public void setHeight(String height) {
diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java
index 9396af5c44..de44c89656 100644
--- a/server/src/com/vaadin/ui/AbstractEmbedded.java
+++ b/server/src/com/vaadin/ui/AbstractEmbedded.java
@@ -4,8 +4,8 @@
package com.vaadin.ui;
+import com.vaadin.server.Resource;
import com.vaadin.shared.ui.AbstractEmbeddedState;
-import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.server.ResourceReference;
/**
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java
index 5123d08da9..eaedfa5809 100644
--- a/server/src/com/vaadin/ui/AbstractField.java
+++ b/server/src/com/vaadin/ui/AbstractField.java
@@ -37,10 +37,10 @@ import com.vaadin.data.util.converter.ConverterUtil;
import com.vaadin.event.Action;
import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutListener;
+import com.vaadin.server.AbstractErrorMessage;
+import com.vaadin.server.CompositeErrorMessage;
+import com.vaadin.server.ErrorMessage;
import com.vaadin.shared.AbstractFieldState;
-import com.vaadin.terminal.AbstractErrorMessage;
-import com.vaadin.terminal.CompositeErrorMessage;
-import com.vaadin.terminal.ErrorMessage;
/**
*
diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java
index ad62b90211..e8f7b5e8c7 100644
--- a/server/src/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/com/vaadin/ui/ConnectorTracker.java
@@ -25,7 +25,7 @@ import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
-import com.vaadin.terminal.AbstractClientConnector;
+import com.vaadin.server.AbstractClientConnector;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
import com.vaadin.terminal.gwt.server.ClientConnector;
diff --git a/server/src/com/vaadin/ui/CustomLayout.java b/server/src/com/vaadin/ui/CustomLayout.java
index 54308b99c3..cf64af85ca 100644
--- a/server/src/com/vaadin/ui/CustomLayout.java
+++ b/server/src/com/vaadin/ui/CustomLayout.java
@@ -24,10 +24,10 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.customlayout.CustomLayoutState;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
import com.vaadin.terminal.gwt.server.JsonPaintTarget;
/**
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java
index 828fa3b21d..b4bf93b5b0 100644
--- a/server/src/com/vaadin/ui/DateField.java
+++ b/server/src/com/vaadin/ui/DateField.java
@@ -36,10 +36,10 @@ import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
import com.vaadin.shared.ui.datefield.DateFieldConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
/**
*
ProgressIndicator
is component that shows user state of a
diff --git a/server/src/com/vaadin/ui/RichTextArea.java b/server/src/com/vaadin/ui/RichTextArea.java
index 51caa82136..e2beace1be 100644
--- a/server/src/com/vaadin/ui/RichTextArea.java
+++ b/server/src/com/vaadin/ui/RichTextArea.java
@@ -19,9 +19,9 @@ package com.vaadin.ui;
import java.util.Map;
import com.vaadin.data.Property;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
/**
* A simple RichTextArea to edit HTML format text.
diff --git a/server/src/com/vaadin/ui/Select.java b/server/src/com/vaadin/ui/Select.java
index 6ff7c9c9bc..c7688df7e8 100644
--- a/server/src/com/vaadin/ui/Select.java
+++ b/server/src/com/vaadin/ui/Select.java
@@ -32,9 +32,9 @@ import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Resource;
/**
*