package com.itmill.toolkit;
+import java.io.Serializable;
import java.net.SocketException;
import java.net.URL;
import java.util.Collection;
* @VERSION@
* @since 3.0
*/
-public abstract class Application implements URIHandler, Terminal.ErrorListener {
+@SuppressWarnings("serial")
+public abstract class Application implements URIHandler,
+ Terminal.ErrorListener, Serializable {
/**
* Random window name generator.
*/
public class UserChangeEvent extends java.util.EventObject {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3544951069307188281L;
-
/**
* New user of the application.
*/
* @VERSION@
* @since 3.0
*/
- public interface UserChangeListener extends EventListener {
+ public interface UserChangeListener extends EventListener, Serializable {
/**
* The <code>applicationUserChanged</code> method Invoked when the
*/
public class WindowDetachEvent extends EventObject {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3544669568644691769L;
-
private final Window window;
/**
*/
public class WindowAttachEvent extends EventObject {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3977578104367822392L;
-
private final Window window;
/**
/**
* Window attach listener interface.
*/
- public interface WindowAttachListener {
+ public interface WindowAttachListener extends Serializable {
/**
* Window attached
/**
* Window detach listener interface.
*/
- public interface WindowDetachListener {
+ public interface WindowDetachListener extends Serializable {
/**
* Window detached.
* </p>
*
*/
- public static class SystemMessages {
+ public static class SystemMessages implements Serializable {
protected String sessionExpiredURL = null;
protected boolean sessionExpiredNotificationEnabled = true;
protected String sessionExpiredCaption = "Session Expired";
* </p>
*/
- public static class CustomizedSystemMessages extends SystemMessages {
+ public static class CustomizedSystemMessages extends SystemMessages
+ implements Serializable {
/**
* Sets the URL to go to when the session has expired.
}
public class ApplicationError implements Terminal.ErrorEvent {
-
private final Throwable throwable;
public ApplicationError(Throwable throwable) {
}
}
-
}
\ No newline at end of file
\r
public class ComponentsInTable extends CustomComponent {\r
\r
+ private static final long serialVersionUID = 7179313717613510935L;\r
+\r
public ComponentsInTable(int cols, int rows) {\r
final OrderedLayout main = new OrderedLayout();\r
setCompositionRoot(main);\r
import com.itmill.toolkit.ui.Window;
public class SimplestApplication extends com.itmill.toolkit.Application {
+ private static final long serialVersionUID = 1401107566407830534L;
@Override
public void init() {
* the tab contents between the vertical tabs.
*/
public class AccordionExample extends CustomComponent {
+ private static final long serialVersionUID = 7172404542359409349L;
+
public AccordionExample() {
// Create a new accordion
final Accordion accordion = new Accordion();
public class ButtonExample extends CustomComponent implements\r
Button.ClickListener {\r
\r
+ private static final long serialVersionUID = -3934416497726624080L;\r
+\r
public ButtonExample() {\r
\r
final VerticalLayout main = new VerticalLayout();\r
*/\r
public class ClientCachingExample extends CustomComponent {\r
\r
+ private static final long serialVersionUID = -1033520074262036031L;\r
private static final String msg = "This example is a (simple) demonstration of client-side caching."\r
+ " The content in one tab is intentionally made very slow to"\r
+ " 'produce' server-side. When you changes to this tab for the"\r
layout = new VerticalLayout();\r
layout.setMargin(true);\r
l = new Label("Slow label - until cached client side.") {\r
+ private static final long serialVersionUID = -2741194381200799815L;\r
+\r
@Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
try {\r
*/
public class ComboBoxExample extends CustomComponent {
+ private static final long serialVersionUID = 1580175413996261572L;
+
private static final String[] firstnames = new String[] { "John", "Mary",
"Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Robert", "Paula",
"Lenny", "Kenny", "Nathan", "Nicole", "Laura", "Jos", "Josie",
public class EmbeddedBrowserExample extends VerticalLayout implements
Select.ValueChangeListener {
+ private static final long serialVersionUID = -6209869808788169597L;
+
// Default URL to open.
private static final String DEFAULT_URL = "http://www.itmill.com/index_itmill_toolkit.htm";
public class FeatureBrowser extends com.itmill.toolkit.Application implements
Select.ValueChangeListener {
+ private static final long serialVersionUID = -4653905515159295197L;
// Property IDs
+
private static final Object PROPERTY_ID_CATEGORY = "Category";
private static final Object PROPERTY_ID_NAME = "Name";
private static final Object PROPERTY_ID_DESC = "Description";
tree.addListener(this);
tree.setImmediate(true);
tree.expandItemsRecursively(rootId);
- for (Iterator i = container.getItemIds().iterator(); i.hasNext();) {
+ for (Iterator<?> i = container.getItemIds().iterator(); i.hasNext();) {
Object id = i.next();
if (container.getChildren(id) == null) {
tree.setChildrenAllowed(id, false);
final HorizontalLayout wbLayout = new HorizontalLayout();
Button b = new Button("Open in sub-window", new Button.ClickListener() {
+ private static final long serialVersionUID = -9168589977880405848L;
+
public void buttonClick(ClickEvent event) {
Component component = (Component) ts.getComponentIterator()
.next();
b.setStyleName(Button.STYLE_LINK);
wbLayout.addComponent(b);
b = new Button("Open in native window", new Button.ClickListener() {
+
+ private static final long serialVersionUID = 3847765713639897223L;
+
public void buttonClick(ClickEvent event) {
Component component = (Component) ts.getComponentIterator()
.next();
tree.setValue(table.getValue());
table.addListener(this);
final Item item = table.getItem(table.getValue());
- final Class c = (Class) item.getItemProperty(PROPERTY_ID_CLASS)
- .getValue();
+ final Class<?> c = (Class<?>) item.getItemProperty(
+ PROPERTY_ID_CLASS).getValue();
final Component component = getComponent(c);
if (component != null) {
final String caption = (String) item.getItemProperty(
}
- private Component getComponent(Class componentClass) {
+ private Component getComponent(Class<?> componentClass) {
if (!exampleInstances.containsKey(componentClass)) {
try {
final Component c = (Component) componentClass.newInstance();
package com.itmill.toolkit.automatedtests.featurebrowser;
+import java.io.Serializable;
+
import com.itmill.toolkit.data.Item;
import com.itmill.toolkit.data.Validator;
import com.itmill.toolkit.data.util.BeanItem;
*/
public class FormExample extends CustomComponent {
+ private static final long serialVersionUID = -5382205369084031674L;
static final String cities[] = { "Amsterdam", "Berlin", "Helsinki",
"Hong Kong", "London", "Luxemburg", "New York", "Oslo", "Paris",
"Rome", "Stockholm", "Tokyo", "Turku" };
final Address dataModel = new Address();
Button peekDataModelState = new Button("Show the data model state",
new Button.ClickListener() {
+ private static final long serialVersionUID = -9128707564903086213L;
public void buttonClick(ClickEvent event) {
getWindow().showNotification(
}
public static class AddressForm extends Form {
+
+ private static final long serialVersionUID = -1356475197391501301L;
+
public AddressForm(String caption) {
setCaption(caption);
* This is example on how to customize field creation. Any kind of field
* components could be created on the fly.
*/
- static class MyFieldFactory extends BaseFieldFactory {
+ static class MyFieldFactory extends BaseFieldFactory implements
+ Serializable {
+
+ private static final long serialVersionUID = 4993348078809959988L;
@Override
public Field createField(Item item, Object propertyId,
*/
static class PostalCodeValidator implements Validator {
+ private static final long serialVersionUID = -7635596091609806427L;
+
public boolean isValid(Object value) {
if (value == null || !(value instanceof String)) {
return false;
* it would be a good idea to implement Item -interface for the datamodel to
* make it directly bindable to form (without BeanItem wrapper)
*/
- public static class Address {
+ public static class Address implements Serializable {
+
+ private static final long serialVersionUID = 6238878890199428556L;
String name = "";
String streetAddress = "";
String postalCode = "";
* @author magi
*/
public class GeneratedColumnExample extends CustomComponent {
+
/**
* The business model: fill-up at a gas station.
*/
* implementations, as they are not needed in this example.
*/
public class MySimpleIndexedContainer implements Container, Indexed {
- Vector items;
+
+ Vector<BeanItem> items;
Object itemtemplate;
public MySimpleIndexedContainer(Object itemtemplate) {
this.itemtemplate = itemtemplate;
- items = new Vector(); // Yeah this is just a test
+ items = new Vector<BeanItem>(); // Yeah this is just a test
}
public boolean addContainerProperty(Object propertyId, Class type,
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < items.size()) {
- Item item = (Item) items.get(pos);
+ Item item = items.get(pos);
// The BeanItem provides the property objects for the items.
return item.getItemProperty(propertyId);
if (itemId instanceof Integer) {
int pos = ((Integer) itemId).intValue();
if (pos >= 0 && pos < items.size()) {
- return (Item) items.get(pos);
+ return items.get(pos);
}
}
return null;
/** Table column generator for calculating consumption column. */
class ConsumptionColumnGenerator implements Table.ColumnGenerator {
+
+ private static final long serialVersionUID = -1077081052659001251L;
+
/**
* Generates a cell containing value calculated from the item.
*/
/** Table column generator for calculating daily cost column. */
class DailyCostColumnGenerator extends ConsumptionColumnGenerator {
+
@Override
public Component generateCell(FillUp fillup, FillUp prev) {
double dailycost = fillup.dailyCost(prev);
package com.itmill.toolkit.automatedtests.util;
+import java.io.Serializable;
import java.util.HashMap;
import com.itmill.toolkit.ui.Component;
-public class DebugId {
+public class DebugId implements Serializable {
private static HashMap debugIds = new HashMap();
package com.itmill.toolkit.automatedtests.util;
+import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
* figure out what went wrong.
*
*/
-public class Log {
+public class Log implements Serializable {
// 3 (errors only)
// 2 (+ warnings)
package com.itmill.toolkit.automatedtests.util;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.Random;
import com.itmill.toolkit.ui.TabSheet;
import com.itmill.toolkit.ui.TextField;
-public class RandomComponents {
+public class RandomComponents implements Serializable {
private Random rand = null;
package com.itmill.toolkit.data;
+import java.io.Serializable;
+
import com.itmill.toolkit.data.Validator.InvalidValueException;
import com.itmill.toolkit.terminal.ErrorMessage;
import com.itmill.toolkit.terminal.PaintException;
* @VERSION@
* @since 3.0
*/
-public interface Buffered {
+public interface Buffered extends Serializable {
/**
* Updates all changes since the previous commit to the data source. The
* @VERSION@
* @since 3.0
*/
+ @SuppressWarnings("serial")
public class SourceException extends RuntimeException implements
- ErrorMessage {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3256720671781630518L;
+ ErrorMessage, Serializable {
/** Source class implementing the buffered interface */
private final Buffered source;
package com.itmill.toolkit.data;
+import java.io.Serializable;
+
/**
* <p>
* This interface defines the combination of <code>Validatable</code> and
* @VERSION@
* @since 3.0
*/
-public interface BufferedValidatable extends Buffered, Validatable {
+public interface BufferedValidatable extends Buffered, Validatable,
+ Serializable {
/**
* Tests if the invalid data is committed to datasource. The default is
package com.itmill.toolkit.data;
+import java.io.Serializable;
import java.util.Collection;
/**
* @VERSION@
* @since 3.0
*/
-public interface Container {
+public interface Container extends Serializable {
/**
* Gets the Item with the given Item ID from the Container. If the Container
*
* @return unmodifiable collection of Property IDs
*/
- public Collection getContainerPropertyIds();
+ public Collection<?> getContainerPropertyIds();
/**
* Gets the ID's of all Items stored in the Container. The ID's are returned
*
* @return unmodifiable collection of Item IDs
*/
- public Collection getItemIds();
+ public Collection<?> getItemIds();
/**
* Gets the Property identified by the given itemId and propertyId from the
* ID identifying the Properties
* @return data type of the Properties
*/
- public Class getType(Object propertyId);
+ public Class<?> getType(Object propertyId);
/**
* Gets the number of Items in the Container.
* @return <code>true</code> if the operation succeeded, <code>false</code>
* if not
*/
- public boolean addContainerProperty(Object propertyId, Class type,
+ public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException;
/**
*
* @return The sortable field ids.
*/
- Collection getSortableContainerPropertyIds();
+ Collection<?> getSortableContainerPropertyIds();
}
* containing the IDs of all other Items that are children in
* the container hierarchy
*/
- public Collection getChildren(Object itemId);
+ public Collection<?> getChildren(Object itemId);
/**
* Gets the ID of the parent Item of the specified Item.
* @return An unmodifiable {@link java.util.Collection collection}
* containing IDs of all root elements of the container
*/
- public Collection rootItemIds();
+ public Collection<?> rootItemIds();
/**
* <p>
*
* @since 5.0
*/
- public interface Filterable extends Container {
+ public interface Filterable extends Container, Serializable {
/**
* Add a filter for given property.
* Interface implemented by viewer classes capable of using a Container as a
* data source.
*/
- public interface Viewer {
+ public interface Viewer extends Serializable {
/**
* Sets the Container that serves as the data source of the viewer.
* internally.
* </p>
*/
- public interface Editor extends Container.Viewer {
+ public interface Editor extends Container.Viewer, Serializable {
}
* An <code>Event</code> object specifying the Container whose Item set has
* changed.
*/
- public interface ItemSetChangeEvent {
+ public interface ItemSetChangeEvent extends Serializable {
/**
* Gets the Property where the event occurred.
}
/** Container Item set change listener interface. */
- public interface ItemSetChangeListener {
+ public interface ItemSetChangeListener extends Serializable {
/**
* Lets the listener know a Containers Item set has changed.
* be able to implement an interface.
* </p>
*/
- public interface ItemSetChangeNotifier {
+ public interface ItemSetChangeNotifier extends Serializable {
/**
* Adds an Item set change listener for the object.
* An <code>Event</code> object specifying the Container whose Property set
* has changed.
*/
- public interface PropertySetChangeEvent {
+ public interface PropertySetChangeEvent extends Serializable {
/**
* Retrieves the Container whose contents have been modified.
* The listener interface for receiving <code>PropertySetChangeEvent</code>
* objects.
*/
- public interface PropertySetChangeListener {
+ public interface PropertySetChangeListener extends Serializable {
/**
* Notifies this listener that the Containers contents has changed.
* be able to implement an interface.
* </p>
*/
- public interface PropertySetChangeNotifier {
+ public interface PropertySetChangeNotifier extends Serializable {
/**
* Registers a new Property set change listener for this Container.
package com.itmill.toolkit.data;
+import java.io.Serializable;
import java.util.Collection;
/**
* @VERSION@
* @since 3.0
*/
-public interface Item {
+public interface Item extends Serializable {
/**
* Gets the Property corresponding to the given Property ID stored in the
* @return unmodifiable collection containing IDs of the Properties stored
* the Item
*/
- public Collection getItemPropertyIds();
+ public Collection<?> getItemPropertyIds();
/**
* Tries to add a new Property into the Item.
* Interface implemented by viewer classes capable of using an Item as a
* data source.
*/
- public interface Viewer {
+ public interface Viewer extends Serializable {
/**
* Sets the Item that serves as the data source of the viewer.
* restrict the class from editing the contents of an internally.
* </p>
*/
- public interface Editor extends Item.Viewer {
+ public interface Editor extends Item.Viewer, Serializable {
}
* this event.
* </p>
*/
- public interface PropertySetChangeEvent {
+ public interface PropertySetChangeEvent extends Serializable {
/**
* Retrieves the Item whose contents has been modified.
* The listener interface for receiving <code>PropertySetChangeEvent</code>
* objects.
*/
- public interface PropertySetChangeListener {
+ public interface PropertySetChangeListener extends Serializable {
/**
* Notifies this listener that the Item's property set has changed.
* be able to implement an interface.
* </p>
*/
- public interface PropertySetChangeNotifier {
+ public interface PropertySetChangeNotifier extends Serializable {
/**
* Registers a new property set change listener for this Item.
package com.itmill.toolkit.data;
+import java.io.Serializable;
+
/**
* <p>
* The <code>Property</code> is a simple data object that contains one typed
* @VERSION@
* @since 3.0
*/
-public interface Property {
+public interface Property extends Serializable {
/**
* Gets the value stored in the Property. The returned object is compatible
*
* @return type of the Property
*/
- public Class getType();
+ public Class<?> getType();
/**
* Tests if the Property is in read-only mode. In read-only mode calls to
* @VERSION@
* @since 3.0
*/
+ @SuppressWarnings("serial")
public class ReadOnlyException extends RuntimeException {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257571702287119410L;
-
/**
* Constructs a new <code>ReadOnlyException</code> without a detail
* message.
* @VERSION@
* @since 3.0
*/
+ @SuppressWarnings("serial")
public class ConversionException extends RuntimeException {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257571706666366008L;
-
/**
* Constructs a new <code>ConversionException</code> without a detail
* message.
* @VERSION@
* @since 3.0
*/
- public interface Viewer {
+ public interface Viewer extends Serializable {
/**
* Sets the Property that serves as the data source of the viewer.
* @VERSION@
* @since 3.0
*/
- public interface Editor extends Property.Viewer {
+ public interface Editor extends Property.Viewer, Serializable {
}
* @VERSION@
* @since 3.0
*/
- public interface ValueChangeEvent {
+ public interface ValueChangeEvent extends Serializable {
/**
* Retrieves the Property that has been modified.
* @VERSION@
* @since 3.0
*/
- public interface ValueChangeListener {
+ public interface ValueChangeListener extends Serializable {
/**
* Notifies this listener that the Property's value has changed.
* @VERSION@
* @since 3.0
*/
- public interface ValueChangeNotifier {
+ public interface ValueChangeNotifier extends Serializable {
/**
* Registers a new value change listener for this Property.
* @VERSION@
* @since 3.0
*/
- public interface ReadOnlyStatusChangeEvent {
+ public interface ReadOnlyStatusChangeEvent extends Serializable {
/**
* Property whose read-only state has changed.
* @VERSION@
* @since 3.0
*/
- public interface ReadOnlyStatusChangeListener {
+ public interface ReadOnlyStatusChangeListener extends Serializable {
/**
* Notifies this listener that a Property's read-only status has
* @VERSION@
* @since 3.0
*/
- public interface ReadOnlyStatusChangeNotifier {
+ public interface ReadOnlyStatusChangeNotifier extends Serializable {
/**
* Registers a new read-only status change listener for this Property.
package com.itmill.toolkit.data;
+import java.io.Serializable;
import java.util.Collection;
/**
* @since 3.0
* @see com.itmill.toolkit.data.Validator
*/
-public interface Validatable {
+public interface Validatable extends Serializable {
/**
* <p>
*
* @return collection of validators or <code>null</code>
*/
- public Collection getValidators();
+ public Collection<?> getValidators();
/**
* <p>
package com.itmill.toolkit.data;
+import java.io.Serializable;
+
import com.itmill.toolkit.terminal.ErrorMessage;
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
* @VERSION@
* @since 3.0
*/
-public interface Validator {
+public interface Validator extends Serializable {
/**
* Checks the given value against this validator. If the value is valid this
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class BeanItem extends PropertysetItem {
/**
* @param propertyIds
* id of the property.
*/
- public BeanItem(Object bean, Collection propertyIds) {
+ public BeanItem(Object bean, Collection<?> propertyIds) {
this.bean = bean;
package com.itmill.toolkit.data.util;
import java.beans.PropertyDescriptor;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
*
* @since 5.4
*/
+@SuppressWarnings("serial")
public class BeanItemContainer<BT> implements Indexed, Sortable, Filterable,
ItemSetChangeNotifier, ValueChangeListener {
// filtered and unfiltered item IDs
// internal data model to obtain property IDs etc.
private final Class<BT> type;
- private final LinkedHashMap<String, PropertyDescriptor> model;
+ private transient LinkedHashMap<String, PropertyDescriptor> model;
private List<ItemSetChangeListener> itemSetChangeListeners;
private Set<Filter> filters = new HashSet<Filter>();
+ /* Special serialization to handle method references */
+ private void readObject(java.io.ObjectInputStream in) throws IOException,
+ ClassNotFoundException {
+ in.defaultReadObject();
+ model = BeanItem.getPropertyDescriptors(type);
+ }
+
public BeanItemContainer(Class<BT> type) throws InstantiationException,
IllegalAccessException {
this.type = type;
* @throws IllegalAccessException
* @throws InstantiationException
*/
- @SuppressWarnings("unchecked")
public BeanItemContainer(Collection<BT> list)
throws InstantiationException, IllegalAccessException {
type = (Class<BT>) list.iterator().next().getClass();
* Id of the new item to be added.
* @return Returns new item or null if the operation fails.
*/
- @SuppressWarnings("unchecked")
private Item addItemAtInternalIndex(int index, Object newItemId) {
// Make sure that the Item has not been created yet
if (allItems.contains(newItemId)) {
}
}
- @SuppressWarnings("unchecked")
public void addContainerFilter(Object propertyId, String filterString,
boolean ignoreCase, boolean onlyMatchPrefix) {
if (filters.isEmpty()) {
* items, and send a notification if the set of visible items changed in any
* way.
*/
- @SuppressWarnings("unchecked")
protected void filterAll() {
// avoid notification if the filtering had no effect
List<BT> originalItems = list;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class ContainerHierarchicalWrapper implements Container.Hierarchical,
Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier {
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class ContainerOrderedWrapper implements Container.Ordered,
Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier {
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
* @author mattitahvonen
*
*/
+@SuppressWarnings("serial")
public class FilesystemContainer implements Container.Hierarchical {
/**
*/
public static Collection FILE_PROPERTIES;
- private static Method FILEITEM_LASTMODIFIED;
+ private final static Method FILEITEM_LASTMODIFIED;
- private static Method FILEITEM_NAME;
+ private final static Method FILEITEM_NAME;
- private static Method FILEITEM_ICON;
+ private final static Method FILEITEM_ICON;
- private static Method FILEITEM_SIZE;
+ private final static Method FILEITEM_SIZE;
static {
* @VERSION@
* @since 3.0
*/
- public class FileExtensionFilter implements FilenameFilter {
+ public class FileExtensionFilter implements FilenameFilter, Serializable {
private final String filter;
package com.itmill.toolkit.data.util;\r
\r
+import java.io.Serializable;\r
+\r
import com.itmill.toolkit.data.Item;\r
import com.itmill.toolkit.data.Property;\r
\r
* \r
* @since 5.4\r
*/\r
-public class Filter {\r
+@SuppressWarnings("serial")\r
+public class Filter implements Serializable {\r
final Object propertyId;\r
final String filterString;\r
final boolean ignoreCase;\r
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class HierarchicalContainer extends IndexedContainer implements
Container.Hierarchical {
package com.itmill.toolkit.data.util;
+import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Collection;
* @since 3.0
*/
+@SuppressWarnings("serial")
public class IndexedContainer implements Container.Indexed,
Container.ItemSetChangeNotifier, Container.PropertySetChangeNotifier,
Property.ValueChangeNotifier, Container.Sortable, Comparator,
* @since 3.0
*/
private class PropertySetChangeEvent extends EventObject implements
- Container.PropertySetChangeEvent {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257002172528079926L;
+ Container.PropertySetChangeEvent, Serializable {
private PropertySetChangeEvent(IndexedContainer source) {
super(source);
* @since 3.0
*/
public class ItemSetChangeEvent extends EventObject implements
- Container.ItemSetChangeEvent {
+ Container.ItemSetChangeEvent, Serializable {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3832616279386372147L;
private final int addedItemIndex;
private ItemSetChangeEvent(IndexedContainer source, int addedItemIndex) {
* @since 3.0
*/
private class PropertyValueChangeEvent extends EventObject implements
- Property.ValueChangeEvent {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3833749884498359857L;
+ Property.ValueChangeEvent, Serializable {
private PropertyValueChangeEvent(Property source) {
super(source);
package com.itmill.toolkit.data.util;
+import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class MethodProperty implements Property, Property.ValueChangeNotifier,
Property.ReadOnlyStatusChangeNotifier {
/**
* The object that includes the property the MethodProperty is bound to.
*/
- private final Object instance;
+ private transient Object instance;
/**
* Argument arrays for the getter and setter methods.
*/
- private Object[] setArgs, getArgs;
+ private transient Object[] setArgs, getArgs;
/**
* Is the MethodProperty read-only?
/**
* The getter and setter methods.
*/
- private Method setMethod, getMethod;
+ private transient Method setMethod, getMethod;
/**
* Index of the new value in the argument list for the setter method. If the
*/
private LinkedList valueChangeListeners = null;
+ /* Special serialization to handle method references */
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ out.defaultWriteObject();
+ out.writeObject(instance);
+ out.writeObject(setArgs);
+ out.writeObject(getArgs);
+ out.writeObject(setMethod.getName());
+ out.writeObject(setMethod.getParameterTypes());
+ out.writeObject(getMethod.getName());
+ out.writeObject(getMethod.getParameterTypes());
+ };
+
+ /* Special serialization to handle method references */
+ private void readObject(java.io.ObjectInputStream in) throws IOException,
+ ClassNotFoundException {
+ in.defaultReadObject();
+ try {
+ instance = in.readObject();
+ setArgs = (Object[]) in.readObject();
+ getArgs = (Object[]) in.readObject();
+ String name = (String) in.readObject();
+ Class<?>[] paramTypes = (Class<?>[]) in.readObject();
+ setMethod = instance.getClass().getMethod(name, paramTypes);
+ name = (String) in.readObject();
+ paramTypes = (Class<?>[]) in.readObject();
+ getMethod = instance.getClass().getMethod(name, paramTypes);
+ } catch (SecurityException e) {
+ System.err.println("Internal deserialization error");
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ System.err.println("Internal deserialization error");
+ e.printStackTrace();
+ }
+ };
+
/**
* <p>
* Creates a new instance of <code>MethodProperty</code> from a named bean
*/
public class MethodException extends RuntimeException {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3690473623827855153L;
-
/**
* Cause of the method exception
*/
private class ReadOnlyStatusChangeEvent extends java.util.EventObject
implements Property.ReadOnlyStatusChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3258129163305955896L;
-
/**
* Constructs a new read-only status change event for this object.
*
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class ObjectProperty implements Property, Property.ValueChangeNotifier,
Property.ReadOnlyStatusChangeNotifier {
private class ValueChangeEvent extends java.util.EventObject implements
Property.ValueChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3256718468479725873L;
-
/**
* Constructs a new value change event for this object.
*
private class ReadOnlyStatusChangeEvent extends java.util.EventObject
implements Property.ReadOnlyStatusChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3907208273529616696L;
-
/**
* Constructs a new read-only status change event for this object.
*
* @author IT Mill Ltd.
* @since 5.3.0
*/
+@SuppressWarnings("serial")
public abstract class PropertyFormatter implements Property,
Property.ValueChangeNotifier, Property.ValueChangeListener,
Property.ReadOnlyStatusChangeListener,
private class ValueChangeEvent extends java.util.EventObject implements
Property.ValueChangeEvent {
- /**
- *
- */
- private static final long serialVersionUID = -489631310964258710L;
-
/**
* Constructs a new value change event for this object.
*
private class ReadOnlyStatusChangeEvent extends java.util.EventObject
implements Property.ReadOnlyStatusChangeEvent {
- /**
- *
- */
- private static final long serialVersionUID = 8329395774911454548L;
-
/**
* Constructs a new read-only status change event for this object.
*
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class PropertysetItem implements Item, Item.PropertySetChangeNotifier,
Cloneable {
private class PropertySetChangeEvent extends EventObject implements
Item.PropertySetChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257562910590055991L;
-
private PropertySetChangeEvent(Item source) {
super(source);
}
* @since 4.0
*/
+@SuppressWarnings("serial")
public class QueryContainer implements Container, Container.Ordered,
Container.Indexed {
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public abstract class AbstractStringValidator extends AbstractValidator {\r
\r
/**\r
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public abstract class AbstractValidator implements Validator {\r
\r
/**\r
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class CompositeValidator extends AbstractValidator {
/**
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public class DoubleValidator extends AbstractStringValidator {\r
\r
/**\r
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public class EmailValidator extends RegexpValidator {\r
\r
/**\r
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public class IntegerValidator extends AbstractStringValidator {\r
\r
/**\r
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class NullValidator implements Validator {
private boolean onlyNullAllowed;
* @VERSION@\r
* @since 5.4\r
*/\r
+@SuppressWarnings("serial")\r
public class RegexpValidator extends AbstractStringValidator {\r
\r
private Pattern pattern;\r
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class StringLengthValidator extends AbstractValidator {
private int minLength = -1;
public class HelloWorld extends com.itmill.toolkit.Application {
/**
- * Init is invoked on application load (when a user accesses the application
- * for the first time).
+ * Init is invoked on application load (when a user accesses the application
+ * for the first time).
*/
@Override
public void init() {
- // Main window is the primary browser window
+ // Main window is the primary browser window
final Window main = new Window("Hello window");
setMainWindow(main);
- // "Hello world" text is added to window as a Label component
+ // "Hello world" text is added to window as a Label component
main.addComponent(new Label("Hello World!"));
}
}
* @author IT Mill Ltd.
*
*/
+@SuppressWarnings("serial")
public class ToolkitTunesLayout extends Application {
@Override
package com.itmill.toolkit.demo.sampler;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Map;
/**
* ActiveLink click listener
*/
- public interface LinkActivatedListener {
+ public interface LinkActivatedListener extends Serializable {
/**
* ActiveLink has been activated.
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.Serializable;
import com.itmill.toolkit.ui.Component;
* </p>
*
*/
-abstract public class Feature {
+abstract public class Feature implements Serializable {
public static final Object PROPERTY_ICON = "Icon";
public static final Object PROPERTY_NAME = "Name";
* May return null, if the example has no related resources.
* </p>
* <p>
- * The name of the NamedExternalResource will be shown in the UI. <br/> Note
- * that Javadoc should be referenced via {@link #getRelatedAPI()}.
+ * The name of the NamedExternalResource will be shown in the UI. <br/>
+ * Note that Javadoc should be referenced via {@link #getRelatedAPI()}.
* </p>
*
* @see #getThemeBase()
import com.itmill.toolkit.terminal.Resource;
import com.itmill.toolkit.terminal.ThemeResource;
import com.itmill.toolkit.terminal.URIHandler;
-import com.itmill.toolkit.terminal.gwt.server.WebApplicationContext;
import com.itmill.toolkit.ui.Alignment;
import com.itmill.toolkit.ui.Button;
import com.itmill.toolkit.ui.ComboBox;
import com.itmill.toolkit.ui.UriFragmentUtility.FragmentChangedEvent;
import com.itmill.toolkit.ui.UriFragmentUtility.FragmentChangedListener;
+@SuppressWarnings("serial")
public class SamplerApplication extends Application {
// All features in one container
package com.itmill.toolkit.demo.tutorial.addressbook.data;
-public class Person {
- private String firstName = "";
- private String lastName = "";
- private String email = "";
- private String phoneNumber = "";
- private String streetAddress = "";
- private Integer postalCode = null;
- private String city = "";
-
- /**
- * @return the firstName
- */
- public String getFirstName() {
- return firstName;
- }
-
- /**
- * @param firstName
- * the firstName to set
- */
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- /**
- * @return the lastName
- */
- public String getLastName() {
- return lastName;
- }
-
- /**
- * @param lastName
- * the lastName to set
- */
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- /**
- * @return the email
- */
- public String getEmail() {
- return email;
- }
-
- /**
- * @param email
- * the email to set
- */
- public void setEmail(String email) {
- this.email = email;
- }
-
- /**
- * @return the phoneNumber
- */
- public String getPhoneNumber() {
- return phoneNumber;
- }
-
- /**
- * @param phoneNumber
- * the phoneNumber to set
- */
- public void setPhoneNumber(String phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
-
- /**
- * @return the streetAddress
- */
- public String getStreetAddress() {
- return streetAddress;
- }
-
- /**
- * @param streetAddress
- * the streetAddress to set
- */
- public void setStreetAddress(String streetAddress) {
- this.streetAddress = streetAddress;
- }
-
- /**
- * @return the postalCode
- */
- public Integer getPostalCode() {
- return postalCode;
- }
-
- /**
- * @param postalCode
- * the postalCode to set
- */
- public void setPostalCode(Integer postalCode) {
- this.postalCode = postalCode;
- }
-
- /**
- * @return the city
- */
- public String getCity() {
- return city;
- }
-
- /**
- * @param city
- * the city to set
- */
- public void setCity(String city) {
- this.city = city;
- }
+import java.io.Serializable;
+
+public class Person implements Serializable {
+ private String firstName = "";
+ private String lastName = "";
+ private String email = "";
+ private String phoneNumber = "";
+ private String streetAddress = "";
+ private Integer postalCode = null;
+ private String city = "";
+
+ /**
+ * @return the firstName
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * @param firstName
+ * the firstName to set
+ */
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ /**
+ * @return the lastName
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * @param lastName
+ * the lastName to set
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ /**
+ * @return the email
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * @param email
+ * the email to set
+ */
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ /**
+ * @return the phoneNumber
+ */
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ /**
+ * @param phoneNumber
+ * the phoneNumber to set
+ */
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ /**
+ * @return the streetAddress
+ */
+ public String getStreetAddress() {
+ return streetAddress;
+ }
+
+ /**
+ * @param streetAddress
+ * the streetAddress to set
+ */
+ public void setStreetAddress(String streetAddress) {
+ this.streetAddress = streetAddress;
+ }
+
+ /**
+ * @return the postalCode
+ */
+ public Integer getPostalCode() {
+ return postalCode;
+ }
+
+ /**
+ * @param postalCode
+ * the postalCode to set
+ */
+ public void setPostalCode(Integer postalCode) {
+ this.postalCode = postalCode;
+ }
+
+ /**
+ * @return the city
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * @param city
+ * the city to set
+ */
+ public void setCity(String city) {
+ this.city = city;
+ }
}
\ No newline at end of file
package com.itmill.toolkit.demo.tutorial.addressbook.data;
+import java.io.Serializable;
import java.util.Random;
import com.itmill.toolkit.data.util.BeanItemContainer;
-public class PersonContainer extends BeanItemContainer<Person> {
+public class PersonContainer extends BeanItemContainer<Person> implements
+ Serializable {
- /**
- * Natural property order for Person bean. Used in tables and forms.
- */
- public static final Object[] NATURAL_COL_ORDER = new Object[] {
- "firstName", "lastName", "email", "phoneNumber", "streetAddress",
- "postalCode", "city" };
+ /**
+ * Natural property order for Person bean. Used in tables and forms.
+ */
+ public static final Object[] NATURAL_COL_ORDER = new Object[] {
+ "firstName", "lastName", "email", "phoneNumber", "streetAddress",
+ "postalCode", "city" };
- /**
- * "Human readable" captions for properties in same order as in
- * NATURAL_COL_ORDER.
- */
- public static final String[] COL_HEADERS_ENGLISH = new String[] {
- "First name", "Last name", "Email", "Phone number",
- "Street Address", "Postal Code", "City" };
+ /**
+ * "Human readable" captions for properties in same order as in
+ * NATURAL_COL_ORDER.
+ */
+ public static final String[] COL_HEADERS_ENGLISH = new String[] {
+ "First name", "Last name", "Email", "Phone number",
+ "Street Address", "Postal Code", "City" };
- public PersonContainer() throws InstantiationException,
- IllegalAccessException {
- super(Person.class);
- }
+ public PersonContainer() throws InstantiationException,
+ IllegalAccessException {
+ super(Person.class);
+ }
- public static PersonContainer createWithTestData() {
- final String[] fnames = { "Peter", "Alice", "Joshua", "Mike", "Olivia",
- "Nina", "Alex", "Rita", "Dan", "Umberto", "Henrik", "Rene",
- "Lisa", "Marge" };
- final String[] lnames = { "Smith", "Gordon", "Simpson", "Brown",
- "Clavel", "Simons", "Verne", "Scott", "Allison", "Gates",
- "Rowling", "Barks", "Ross", "Schneider", "Tate" };
- final String cities[] = { "Amsterdam", "Berlin", "Helsinki",
- "Hong Kong", "London", "Luxemburg", "New York", "Oslo",
- "Paris", "Rome", "Stockholm", "Tokyo", "Turku" };
- final String streets[] = { "4215 Blandit Av.", "452-8121 Sem Ave",
- "279-4475 Tellus Road", "4062 Libero. Av.", "7081 Pede. Ave",
- "6800 Aliquet St.", "P.O. Box 298, 9401 Mauris St.",
- "161-7279 Augue Ave", "P.O. Box 496, 1390 Sagittis. Rd.",
- "448-8295 Mi Avenue", "6419 Non Av.",
- "659-2538 Elementum Street", "2205 Quis St.",
- "252-5213 Tincidunt St.", "P.O. Box 175, 4049 Adipiscing Rd.",
- "3217 Nam Ave", "P.O. Box 859, 7661 Auctor St.",
- "2873 Nonummy Av.", "7342 Mi, Avenue",
- "539-3914 Dignissim. Rd.", "539-3675 Magna Avenue",
- "Ap #357-5640 Pharetra Avenue", "416-2983 Posuere Rd.",
- "141-1287 Adipiscing Avenue", "Ap #781-3145 Gravida St.",
- "6897 Suscipit Rd.", "8336 Purus Avenue", "2603 Bibendum. Av.",
- "2870 Vestibulum St.", "Ap #722 Aenean Avenue",
- "446-968 Augue Ave", "1141 Ultricies Street",
- "Ap #992-5769 Nunc Street", "6690 Porttitor Avenue",
- "Ap #105-1700 Risus Street",
- "P.O. Box 532, 3225 Lacus. Avenue", "736 Metus Street",
- "414-1417 Fringilla Street", "Ap #183-928 Scelerisque Road",
- "561-9262 Iaculis Avenue" };
- PersonContainer c = null;
- Random r = new Random(0);
- try {
- c = new PersonContainer();
- for (int i = 0; i < 100; i++) {
- Person p = new Person();
- p.setFirstName(fnames[r.nextInt(fnames.length)]);
- p.setLastName(lnames[r.nextInt(lnames.length)]);
- p.setCity(cities[r.nextInt(cities.length)]);
- p.setEmail(p.getFirstName().toLowerCase() + "."
- + p.getLastName().toLowerCase() + "@itmill.com");
- p.setPhoneNumber("+358 02 555 " + r.nextInt(10) + r.nextInt(10)
- + r.nextInt(10) + r.nextInt(10));
- int n = r.nextInt(100000);
- if (n < 10000) {
- n += 10000;
- }
- p.setPostalCode(n);
- p.setStreetAddress(streets[r.nextInt(streets.length)]);
- c.addItem(p);
- }
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ public static PersonContainer createWithTestData() {
+ final String[] fnames = { "Peter", "Alice", "Joshua", "Mike", "Olivia",
+ "Nina", "Alex", "Rita", "Dan", "Umberto", "Henrik", "Rene",
+ "Lisa", "Marge" };
+ final String[] lnames = { "Smith", "Gordon", "Simpson", "Brown",
+ "Clavel", "Simons", "Verne", "Scott", "Allison", "Gates",
+ "Rowling", "Barks", "Ross", "Schneider", "Tate" };
+ final String cities[] = { "Amsterdam", "Berlin", "Helsinki",
+ "Hong Kong", "London", "Luxemburg", "New York", "Oslo",
+ "Paris", "Rome", "Stockholm", "Tokyo", "Turku" };
+ final String streets[] = { "4215 Blandit Av.", "452-8121 Sem Ave",
+ "279-4475 Tellus Road", "4062 Libero. Av.", "7081 Pede. Ave",
+ "6800 Aliquet St.", "P.O. Box 298, 9401 Mauris St.",
+ "161-7279 Augue Ave", "P.O. Box 496, 1390 Sagittis. Rd.",
+ "448-8295 Mi Avenue", "6419 Non Av.",
+ "659-2538 Elementum Street", "2205 Quis St.",
+ "252-5213 Tincidunt St.", "P.O. Box 175, 4049 Adipiscing Rd.",
+ "3217 Nam Ave", "P.O. Box 859, 7661 Auctor St.",
+ "2873 Nonummy Av.", "7342 Mi, Avenue",
+ "539-3914 Dignissim. Rd.", "539-3675 Magna Avenue",
+ "Ap #357-5640 Pharetra Avenue", "416-2983 Posuere Rd.",
+ "141-1287 Adipiscing Avenue", "Ap #781-3145 Gravida St.",
+ "6897 Suscipit Rd.", "8336 Purus Avenue", "2603 Bibendum. Av.",
+ "2870 Vestibulum St.", "Ap #722 Aenean Avenue",
+ "446-968 Augue Ave", "1141 Ultricies Street",
+ "Ap #992-5769 Nunc Street", "6690 Porttitor Avenue",
+ "Ap #105-1700 Risus Street",
+ "P.O. Box 532, 3225 Lacus. Avenue", "736 Metus Street",
+ "414-1417 Fringilla Street", "Ap #183-928 Scelerisque Road",
+ "561-9262 Iaculis Avenue" };
+ PersonContainer c = null;
+ Random r = new Random(0);
+ try {
+ c = new PersonContainer();
+ for (int i = 0; i < 100; i++) {
+ Person p = new Person();
+ p.setFirstName(fnames[r.nextInt(fnames.length)]);
+ p.setLastName(lnames[r.nextInt(lnames.length)]);
+ p.setCity(cities[r.nextInt(cities.length)]);
+ p.setEmail(p.getFirstName().toLowerCase() + "."
+ + p.getLastName().toLowerCase() + "@itmill.com");
+ p.setPhoneNumber("+358 02 555 " + r.nextInt(10) + r.nextInt(10)
+ + r.nextInt(10) + r.nextInt(10));
+ int n = r.nextInt(100000);
+ if (n < 10000) {
+ n += 10000;
+ }
+ p.setPostalCode(n);
+ p.setStreetAddress(streets[r.nextInt(streets.length)]);
+ c.addItem(p);
+ }
+ } catch (InstantiationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
- return c;
- }
+ return c;
+ }
}
package com.itmill.toolkit.demo.tutorial.addressbook.data;
-public class SearchFilter {
-
- private final String term;
- private final Object propertyId;
- private String searchName;
-
- public SearchFilter(Object propertyId, String searchTerm, String name) {
- this.propertyId = propertyId;
- this.term = searchTerm;
- this.searchName = name;
- }
-
- /**
- * @return the term
- */
- public String getTerm() {
- return term;
- }
-
- /**
- * @return the propertyId
- */
- public Object getPropertyId() {
- return propertyId;
- }
-
- /**
- * @return the name of the search
- */
- public String getSearchName() {
- return searchName;
- }
-
- @Override
- public String toString() {
- return getSearchName();
- }
+import java.io.Serializable;
+
+public class SearchFilter implements Serializable {
+
+ private final String term;
+ private final Object propertyId;
+ private String searchName;
+
+ public SearchFilter(Object propertyId, String searchTerm, String name) {
+ this.propertyId = propertyId;
+ term = searchTerm;
+ searchName = name;
+ }
+
+ /**
+ * @return the term
+ */
+ public String getTerm() {
+ return term;
+ }
+
+ /**
+ * @return the propertyId
+ */
+ public Object getPropertyId() {
+ return propertyId;
+ }
+
+ /**
+ * @return the name of the search
+ */
+ public String getSearchName() {
+ return searchName;
+ }
+
+ @Override
+ public String toString() {
+ return getSearchName();
+ }
}
package com.itmill.toolkit.event;
+import java.io.Serializable;
+
import com.itmill.toolkit.terminal.Resource;
/**
* @VERSION@
* @since 3.0
*/
-public class Action {
+@SuppressWarnings("serial")
+public class Action implements Serializable {
/**
* Action title.
* @VERSION@
* @since 3.0
*/
- public interface Handler {
+ public interface Handler extends Serializable {
/**
* Gets the list of actions applicable to this handler.
* @VERSION@
* @since 3.0
*/
- public interface Container {
+ public interface Container extends Serializable {
/**
* Registers a new action handler for this container
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class EventRouter implements MethodEventSource {
/**
package com.itmill.toolkit.event;
+import java.io.Serializable;
import java.lang.reflect.Method;
import com.itmill.toolkit.data.Container;
* TODO extract generic super class/interfaces if we implement some other
* click events.
*/
-public class ItemClickEvent extends Event {
+@SuppressWarnings("serial")
+public class ItemClickEvent extends Event implements Serializable {
public static final int BUTTON_LEFT = MouseEventDetails.BUTTON_LEFT;
public static final int BUTTON_MIDDLE = MouseEventDetails.BUTTON_MIDDLE;
public static final int BUTTON_RIGHT = MouseEventDetails.BUTTON_RIGHT;
return details.isShiftKey();
}
- /**
- * Serial generated by eclipse
- */
- private static final long serialVersionUID = 3576399524236787971L;
-
public static final Method ITEM_CLICK_METHOD;
static {
}
}
- public interface ItemClickListener {
+ public interface ItemClickListener extends Serializable {
public void itemClick(ItemClickEvent event);
}
* @link {@link Container} interface may support emitting
* {@link ItemClickEvent}s.
*/
- public interface ItemClickSource {
+ public interface ItemClickSource extends Serializable {
/**
* Register listener to handle ItemClickEvents.
*
package com.itmill.toolkit.event;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.EventListener;
* @VERSION@
* @since 3.0
*/
-public class ListenerMethod implements EventListener {
+@SuppressWarnings("serial")
+public class ListenerMethod implements EventListener, Serializable {
/**
* Type of the event that should trigger this listener. Also the subclasses
* of this class are accepted to trigger the listener.
*/
- private final Class eventType;
+ private final Class<?> eventType;
/**
* The object containing the trigger method.
*/
- private final Object object;
+ private Object object;
/**
* The trigger method to call when an event passing the given criteria
* fires.
*/
- private final Method method;
+ private transient Method method;
/**
* Optional argument set to pass to the trigger method.
*/
private int eventArgumentIndex;
+ /* Special serialization to handle method references */
+ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
+ try {
+ out.defaultWriteObject();
+ String name = method.getName();
+ Class<?>[] paramTypes = method.getParameterTypes();
+ out.writeObject(name);
+ out.writeObject(paramTypes);
+ } catch (NotSerializableException e) {
+ System.err
+ .println("Fatal error in serialization of the application: Class "
+ + object.getClass().getName()
+ + " must implement serialization.");
+ throw e;
+ }
+
+ };
+
+ /* Special serialization to handle method references */
+ private void readObject(java.io.ObjectInputStream in) throws IOException,
+ ClassNotFoundException {
+ in.defaultReadObject();
+ try {
+ String name = (String) in.readObject();
+ Class<?>[] paramTypes = (Class<?>[]) in.readObject();
+ // We can not use getMethod directly as we want to support anonymous
+ // inner classes
+ method = findHighestMethod(object.getClass(), name, paramTypes);
+ } catch (SecurityException e) {
+ System.err.println("Internal deserialization error");
+ e.printStackTrace();
+ }
+ };
+
+ private static Method findHighestMethod(Class<?> cls, String method,
+ Class<?>[] paramTypes) {
+ Class<?>[] ifaces = cls.getInterfaces();
+ for (int i = 0; i < ifaces.length; i++) {
+ Method ifaceMethod = findHighestMethod(ifaces[i], method,
+ paramTypes);
+ if (ifaceMethod != null) {
+ return ifaceMethod;
+ }
+ }
+ if (cls.getSuperclass() != null) {
+ Method parentMethod = findHighestMethod(cls.getSuperclass(),
+ method, paramTypes);
+ if (parentMethod != null) {
+ return parentMethod;
+ }
+ }
+ Method[] methods = cls.getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ // we ignore parameter types for now - you need to add this
+ if (methods[i].getName().equals(method)) {
+ return methods[i];
+ }
+ }
+ return null;
+ }
+
/**
* <p>
* Constructs a new event listener from a trigger method, it's arguments and
* if <code>method</code> is not a member of <code>object</code>
* .
*/
- public ListenerMethod(Class eventType, Object object, Method method,
+ public ListenerMethod(Class<?> eventType, Object object, Method method,
Object[] arguments, int eventArgumentIndex)
throws java.lang.IllegalArgumentException {
* unless exactly one match <code>methodName</code> is found in
* <code>object</code>.
*/
- public ListenerMethod(Class eventType, Object object, String methodName,
+ public ListenerMethod(Class<?> eventType, Object object, String methodName,
Object[] arguments, int eventArgumentIndex)
throws java.lang.IllegalArgumentException {
* if <code>method</code> is not a member of <code>object</code>
* .
*/
- public ListenerMethod(Class eventType, Object object, Method method,
+ public ListenerMethod(Class<?> eventType, Object object, Method method,
Object[] arguments) throws java.lang.IllegalArgumentException {
// Check that the object is of correct type
* unless exactly one match <code>methodName</code> is found in
* <code>object</code>.
*/
- public ListenerMethod(Class eventType, Object object, String methodName,
+ public ListenerMethod(Class<?> eventType, Object object, String methodName,
Object[] arguments) throws java.lang.IllegalArgumentException {
// Find the correct method
* if <code>method</code> is not a member of <code>object</code>
* .
*/
- public ListenerMethod(Class eventType, Object object, Method method)
+ public ListenerMethod(Class<?> eventType, Object object, Method method)
throws java.lang.IllegalArgumentException {
// Checks that the object is of correct type
this.method = method;
eventArgumentIndex = -1;
- final Class[] params = method.getParameterTypes();
+ final Class<?>[] params = method.getParameterTypes();
if (params.length == 0) {
arguments = new Object[0];
* unless exactly one match <code>methodName</code> is found in
* <code>object</code>.
*/
- public ListenerMethod(Class eventType, Object object, String methodName)
+ public ListenerMethod(Class<?> eventType, Object object, String methodName)
throws java.lang.IllegalArgumentException {
// Finds the correct method
this.method = method;
eventArgumentIndex = -1;
- final Class[] params = method.getParameterTypes();
+ final Class<?>[] params = method.getParameterTypes();
if (params.length == 0) {
arguments = new Object[0];
* the one stored in this object and <code>eventType</code> equals
* the event type stored in this object. *
*/
- public boolean matches(Class eventType, Object target) {
+ public boolean matches(Class<?> eventType, Object target) {
return (target == object) && (eventType.equals(this.eventType));
}
* the event type stored in this object and <code>method</code>
* equals with the method stored in this object
*/
- public boolean matches(Class eventType, Object target, Method method) {
+ public boolean matches(Class<?> eventType, Object target, Method method) {
return (target == object)
&& (eventType.equals(this.eventType) && method
.equals(this.method));
* @VERSION@
* @since 3.0
*/
- public class MethodException extends RuntimeException {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257005445242894135L;
+ public class MethodException extends RuntimeException implements
+ Serializable {
private final Throwable cause;
package com.itmill.toolkit.event;
+import java.io.Serializable;
import java.lang.reflect.Method;
/**
* @VERSION@
* @since 3.0
*/
-public interface MethodEventSource {
+public interface MethodEventSource extends Serializable {
/**
* <p>
package com.itmill.toolkit.event;
+import java.io.Serializable;
+
import com.itmill.toolkit.terminal.Resource;
/**
* @version
* @since 4.0.1
*/
+@SuppressWarnings("serial")
public class ShortcutAction extends Action {
private final int keyCode;
* Key codes that can be used for shortcuts
*
*/
- public interface KeyCode {
+ public interface KeyCode extends Serializable {
public static final int ENTER = 13;
public static final int ESCAPE = 27;
* Modifier key constants
*
*/
- public interface ModifierKey {
+ public interface ModifierKey extends Serializable {
public static final int SHIFT = 16;
public static final int CTRL = 17;
package com.itmill.toolkit.service;
import java.io.File;
+import java.io.Serializable;
import java.util.Collection;
import com.itmill.toolkit.Application;
* @VERSION@
* @since 3.1
*/
-public interface ApplicationContext {
+public interface ApplicationContext extends Serializable {
/**
* Returns application context base directory.
* between the client and the application.
*
*/
- public interface TransactionListener {
+ public interface TransactionListener extends Serializable {
/**
* Invoked at the beginning of every transaction.
package com.itmill.toolkit.service;
import java.io.File;
+import java.io.Serializable;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Map;
* @VERSION@
* @since 3.0
*/
-public class FileTypeResolver {
+@SuppressWarnings("serial")
+public class FileTypeResolver implements Serializable {
/**
* Default icon given if no icon is specified for a mime-type.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
import com.itmill.toolkit.Application;
/**
* @VERSION@
* @since 3.0
*/
-public interface ApplicationResource extends Resource {
+public interface ApplicationResource extends Resource, Serializable {
/**
* Default cache time.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
import com.itmill.toolkit.Application;
import com.itmill.toolkit.service.FileTypeResolver;
* @VERSION@
* @since 3.0
*/
-public class ClassResource implements ApplicationResource {
+@SuppressWarnings("serial")
+public class ClassResource implements ApplicationResource, Serializable {
/**
* Default buffer size for this stream resource.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
* @VERSION@
* @since 3.0
*/
-public class CompositeErrorMessage implements ErrorMessage {
+@SuppressWarnings("serial")
+public class CompositeErrorMessage implements ErrorMessage, Serializable {
/**
* Array of all the errors.
package com.itmill.toolkit.terminal;
import java.io.InputStream;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
* @VERSION@
* @since 3.0
*/
-public class DownloadStream {
+@SuppressWarnings("serial")
+public class DownloadStream implements Serializable {
/**
* Maximum cache time.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* Interface for rendering error messages to terminal. All the visible errors
* shown to user must implement this interface.
* @VERSION@
* @since 3.0
*/
-public interface ErrorMessage extends Paintable {
+public interface ErrorMessage extends Paintable, Serializable {
/**
* Error code for system errors and bugs.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.net.URL;
import com.itmill.toolkit.service.FileTypeResolver;
* @VERSION@
* @since 3.0
*/
-public class ExternalResource implements Resource {
+public class ExternalResource implements Resource, Serializable {
/**
* Url of the download.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class FileResource implements ApplicationResource {
/**
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.util.Hashtable;
/**
* @VERSION@
* @since 3.0
*/
-public class KeyMapper {
+@SuppressWarnings("serial")
+public class KeyMapper implements Serializable {
private int lastKey = 0;
package com.itmill.toolkit.terminal;
import java.io.IOException;
+import java.io.Serializable;
/**
* <code>PaintExcepection</code> is thrown if painting of a component fails.
* @VERSION@
* @since 3.0
*/
-public class PaintException extends IOException {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3762535607221891897L;
+@SuppressWarnings("serial")
+public class PaintException extends IOException implements Serializable {
/**
* Constructs an instance of <code>PaintExeception</code> with the specified
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* This interface defines the methods for painting XML to the UIDL stream.
*
* @VERSION@
* @since 3.0
*/
-public interface PaintTarget {
+public interface PaintTarget extends Serializable{
/**
* Prints single XMLsection.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.util.EventObject;
/**
* @VERSION@
* @since 3.0
*/
-public interface Paintable extends java.util.EventListener {
+public interface Paintable extends java.util.EventListener, Serializable {
/**
* <p>
* This is typically done when the <code>paint</code> method would return
* dissimilar UIDL from the previous call of the method.
*/
+ @SuppressWarnings("serial")
public class RepaintRequestEvent extends EventObject {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3256725095530442805L;
-
/**
* Constructs a new event.
*
* when the <code>paint</code> method would return dissimilar UIDL from the
* previous call of the method.
*/
- public interface RepaintRequestListener {
+ public interface RepaintRequestListener extends Serializable {
/**
* Receives repaint request events.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.util.Map;
/**
* @VERSION@
* @since 3.0
*/
-public interface ParameterHandler {
+public interface ParameterHandler extends Serializable{
/**
* <p>
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* <code>Resource</code> provided to the client terminal. Support for actually
* displaying the resource type is left to the terminal.
* @VERSION@
* @since 3.0
*/
-public interface Resource {
+public interface Resource extends Serializable{
/**
* Gets the MIME type of the resource.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* <p>
* This interface is implemented by all visual objects that can be scrolled. The
* @VERSION@
* @since 3.0
*/
-public interface Scrollable {
+public interface Scrollable extends Serializable {
/**
* Gets scroll left offset.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* Interface to be implemented by components wishing to display some object that
* may be dynamically resized during runtime.
* @VERSION@
* @since 3.0
*/
-public interface Sizeable {
+public interface Sizeable extends Serializable{
/**
* Unit code representing pixels.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class StreamResource implements ApplicationResource {
/**
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class SystemError extends RuntimeException implements ErrorMessage {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3256445789512675891L;
-
/**
* The cause of the system error. The cause is stored separately as JDK 1.3
* does not support causes natively.
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
+
/**
* Interface for different terminal types.
*
* @VERSION@
* @since 3.0
*/
-public interface Terminal {
+public interface Terminal extends Serializable {
/**
* Gets the name of the default theme.
/**
* Terminal error event.
*/
- public interface ErrorEvent {
+ public interface ErrorEvent extends Serializable{
/**
* Gets the contained throwable.
/**
* Terminal error listener interface.
*/
- public interface ErrorListener {
+ public interface ErrorListener extends Serializable{
/**
* Invoked when terminal error occurs.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class ThemeResource implements Resource {
/**
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.net.URL;
/**
* @VERSION@
* @since 3.0
*/
-public interface URIHandler {
+public interface URIHandler extends Serializable {
/**
* Handles a given relative URI. If the URI handling wants to emit a
package com.itmill.toolkit.terminal;
import java.io.InputStream;
+import java.io.Serializable;
/**
* Defines a variable type, that is used for passing uploaded files from
* @VERSION@
* @since 3.0
*/
-public interface UploadStream {
+public interface UploadStream extends Serializable {
/**
* Gets the name of the stream.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class UserError implements ErrorMessage {
/**
package com.itmill.toolkit.terminal;
+import java.io.Serializable;
import java.util.Map;
/**
* @VERSION@
* @since 3.0
*/
-public interface VariableOwner {
+public interface VariableOwner extends Serializable {
/**
* Called when one or more variables handled by the implementing class are
package com.itmill.toolkit.terminal.gwt.client.ui;
-public class IMarginInfo {
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class IMarginInfo implements Serializable {
private static final int TOP = 1;
private static final int RIGHT = 2;
\r
import java.io.IOException;\r
import java.io.PrintWriter;\r
+import java.io.Serializable;\r
\r
import javax.portlet.ActionRequest;\r
import javax.portlet.ActionResponse;\r
\r
import com.itmill.toolkit.Application;\r
\r
-public class ApplicationPortlet implements Portlet {\r
+@SuppressWarnings("serial")\r
+public class ApplicationPortlet implements Portlet, Serializable {\r
// The application to show\r
protected String app = null;\r
// some applications might require forced height (and, more seldom, width)\r
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
* @since 5.0
*/
+@SuppressWarnings("serial")
public class ApplicationServlet extends HttpServlet {
- private static final long serialVersionUID = -4937882979845826574L;
-
/**
* Version number of this release. For example "5.0.0".
*/
private static final int MAX_BUFFER_SIZE = 64 * 1024;
- // TODO This is session specific not servlet wide data. No need to store
- // this here, move it to Session from where it can be queried when required
- protected static HashMap<Application, CommunicationManager> applicationToAjaxAppMgrMap = new HashMap<Application, CommunicationManager>();
-
private static final String RESOURCE_URI = "/RES/";
private static final String AJAX_UIDL_URI = "/UIDL";
// If servlet is application runner, store request's classname
String applicationRunnerClassname = null;
- private ClassLoader classLoader;
-
/**
* Called by the servlet container to indicate to a servlet that the servlet
* is being placed into service.
System.err.println(NOT_PRODUCTION_MODE_INFO);
}
- // Gets custom class loader
- final String classLoaderName = getApplicationOrSystemProperty(
- "ClassLoader", null);
- ClassLoader classLoader;
- if (classLoaderName == null) {
- classLoader = getClass().getClassLoader();
- } else {
- try {
- final Class classLoaderClass = getClass().getClassLoader()
- .loadClass(classLoaderName);
- final Constructor c = classLoaderClass
- .getConstructor(new Class[] { ClassLoader.class });
- classLoader = (ClassLoader) c
- .newInstance(new Object[] { getClass().getClassLoader() });
- } catch (final Exception e) {
- throw new ServletException(
- "Could not find specified class loader: "
- + classLoaderName, e);
- }
- }
- this.classLoader = classLoader;
-
// Loads the application class using the same class loader
// as the servlet itself
if (!isApplicationRunnerServlet) {
"Application not specified in servlet parameters");
}
try {
- applicationClass = classLoader.loadClass(applicationClassName);
+ applicationClass = getClassLoader().loadClass(
+ applicationClassName);
} catch (final ClassNotFoundException e) {
throw new ServletException("Failed to load application class: "
+ applicationClassName);
}
+ private ClassLoader getClassLoader() throws ServletException {
+ // Gets custom class loader
+ final String classLoaderName = getApplicationOrSystemProperty(
+ "ClassLoader", null);
+ ClassLoader classLoader;
+ if (classLoaderName == null) {
+ classLoader = getClass().getClassLoader();
+ } else {
+ try {
+ final Class<?> classLoaderClass = getClass().getClassLoader()
+ .loadClass(classLoaderName);
+ final Constructor<?> c = classLoaderClass
+ .getConstructor(new Class[] { ClassLoader.class });
+ classLoader = (ClassLoader) c
+ .newInstance(new Object[] { getClass().getClassLoader() });
+ } catch (final Exception e) {
+ throw new ServletException(
+ "Could not find specified class loader: "
+ + classLoaderName, e);
+ }
+ }
+ return classLoader;
+ }
+
/**
* Gets an application or system property value.
*
// note: endTransaction is called on finalize below
((WebApplicationContext) application.getContext())
.startTransaction(application, request);
- getApplicationManager(application).handleFileUpload(request,
- response);
+ ((WebApplicationContext) application.getContext())
+ .getApplicationManager(application, this)
+ .handleFileUpload(request, response);
return;
}
.startTransaction(application, request);
// Handle UIDL request
- getApplicationManager(application).handleUidlRequest(
- request, response, this);
+ ((WebApplicationContext) application.getContext())
+ .getApplicationManager(application, this)
+ .handleUidlRequest(request, response, this);
return;
}
}
application.close();
final HttpSession session = request.getSession(false);
if (session != null) {
- ApplicationServlet.applicationToAjaxAppMgrMap
+ WebApplicationContext.getApplicationContext(session).applicationToAjaxAppMgrMap
.remove(application);
WebApplicationContext.getApplicationContext(session)
.removeApplication(application);
DownloadStream download = null;
// Handles the URI if the application is still running
- download = getApplicationManager(application).handleURI(window,
- request, response);
+ download = ((WebApplicationContext) application.getContext())
+ .getApplicationManager(application, this).handleURI(window,
+ request, response);
// If this is not a download request
if (download == null) {
* @param request
* @param response
* @throws IOException
+ * @throws ServletException
*/
private void serveStaticResourcesInITMILL(String filename,
- HttpServletResponse response) throws IOException {
+ HttpServletResponse response) throws IOException, ServletException {
final ServletContext sc = getServletContext();
InputStream is = sc.getResourceAsStream(filename);
// strip leading "/" otherwise stream from JAR wont work
filename = filename.substring(1);
- is = classLoader.getResourceAsStream(filename);
+ is = getClassLoader().getResourceAsStream(filename);
if (is == null) {
// cannot serve requested file
* @throws SAXException
* @throws IllegalAccessException
* @throws InstantiationException
+ * @throws ServletException
*/
private Application getNewApplication(HttpServletRequest request,
HttpServletResponse response) throws MalformedURLException,
- SAXException, IllegalAccessException, InstantiationException {
+ SAXException, IllegalAccessException, InstantiationException,
+ ServletException {
// Create application
final WebApplicationContext context = WebApplicationContext
applicationUrl = new URL(getApplicationUrl(request).toString()
+ applicationClassname + "/");
try {
- applicationClass = classLoader.loadClass(applicationClassname);
+ applicationClass = getClassLoader().loadClass(
+ applicationClassname);
} catch (final ClassNotFoundException e) {
throw new InstantiationException(
"Failed to load application class: "
* Implementation of ParameterHandler.ErrorEvent interface.
*/
public class ParameterHandlerErrorImpl implements
- ParameterHandler.ErrorEvent {
+ ParameterHandler.ErrorEvent, Serializable {
private ParameterHandler owner;
/**
* Implementation of URIHandler.ErrorEvent interface.
*/
- public class URIHandlerErrorImpl implements URIHandler.ErrorEvent {
+ public class URIHandlerErrorImpl implements URIHandler.ErrorEvent,
+ Serializable {
private final URIHandler owner;
}
}
- /**
- * Gets communication manager for an application.
- *
- * If this application has not been running before, new manager is created.
- *
- * @param application
- * @return CommunicationManager
- */
- private CommunicationManager getApplicationManager(Application application) {
- CommunicationManager mgr = applicationToAjaxAppMgrMap.get(application);
-
- if (mgr == null) {
- // Creates new manager
- mgr = new CommunicationManager(application, this);
- applicationToAjaxAppMgrMap.put(application, mgr);
- }
- return mgr;
- }
-
/**
* Gets resource path using different implementations. Required to
* supporting different servlet container implementations (application
return resultPath;
}
- public class RequestError implements Terminal.ErrorEvent {
+ public class RequestError implements Terminal.ErrorEvent, Serializable {
private final Throwable throwable;
import com.itmill.toolkit.ui.Component;\r
import com.itmill.toolkit.ui.AbstractComponent.ComponentErrorEvent;\r
\r
+@SuppressWarnings("serial")\r
public class ChangeVariablesErrorEvent implements ComponentErrorEvent {\r
\r
private Throwable throwable;\r
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
* @VERSION@
* @since 5.0
*/
-public class CommunicationManager implements Paintable.RepaintRequestListener {
+@SuppressWarnings("serial")
+public class CommunicationManager implements Paintable.RepaintRequestListener,
+ Serializable {
private static String GET_PARAM_REPAINT_ALL = "repaintAll";
return success;
}
- public class ErrorHandlerErrorEvent implements ErrorEvent {
-
+ public class ErrorHandlerErrorEvent implements ErrorEvent, Serializable {
private final Throwable throwable;
public ErrorHandlerErrorEvent(Throwable throwable) {
p.requestRepaintRequests();
}
- private final class SingleValueMap implements Map {
+ private final class SingleValueMap implements Map<Object, Object>,
+ Serializable {
+
private final String name;
private final Object value;
/**
* Implementation of URIHandler.ErrorEvent interface.
*/
- public class URIHandlerErrorImpl implements URIHandler.ErrorEvent {
+ public class URIHandlerErrorImpl implements URIHandler.ErrorEvent,
+ Serializable {
private final URIHandler owner;
* FileUpload can determine content length. Used to detect files total size,
* uploads progress can be tracked inside upload.
*/
- private class UploadProgressListener implements ProgressListener {
+ private class UploadProgressListener implements ProgressListener,
+ Serializable {
+
Upload uploadComponent;
boolean updated = false;
import java.io.PrintStream;
import java.io.PrintWriter;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import com.itmill.toolkit.ui.Window;
import com.itmill.toolkit.ui.GridLayout.Area;
-public class ComponentSizeValidator {
+@SuppressWarnings("serial")
+public class ComponentSizeValidator implements Serializable {
private final static int LAYERS_SHOWN = 4;
}
} else if (component instanceof Form) {
Form form = (Form) component;
- if (form.getLayout() != null)
+ if (form.getLayout() != null) {
errors = validateComponentRelativeSizes(form.getLayout(),
errors, parent);
- if (form.getFooter() != null)
+ }
+ if (form.getFooter() != null) {
errors = validateComponentRelativeSizes(form.getFooter(),
errors, parent);
+ }
}
return errors;
}
}
- public static class InvalidLayout {
+ public static class InvalidLayout implements Serializable {
private Component component;
}
}
- private static class ComponentInfo {
+ private static class ComponentInfo implements Serializable {
Component component;
String info;
|| parent instanceof TabSheet
|| parent instanceof CustomComponent) {
// FIXME Could we use com.itmill.toolkit package name here and
- // fail for all component containers?
- // FIXME Actually this should be moved to containers so it can be implemented for custom containers
+ // fail for all component containers?
+ // FIXME Actually this should be moved to containers so it can
+ // be implemented for custom containers
// TODO vertical splitpanel with another non relative component?
return false;
} else if (parent instanceof Window) {
private static Map<Object, FileLocation> widthLocations = new HashMap<Object, FileLocation>();
private static Map<Object, FileLocation> heightLocations = new HashMap<Object, FileLocation>();
- public static class FileLocation {
+ public static class FileLocation implements Serializable {
public String method;
public String file;
public String className;
* @VERSION@
* @since 5.0
*/
+@SuppressWarnings("serial")
public class HttpUploadStream implements
com.itmill.toolkit.terminal.UploadStream {
package com.itmill.toolkit.terminal.gwt.server;
import java.io.PrintWriter;
+import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
* @VERSION@
* @since 5.0
*/
+@SuppressWarnings("serial")
public class JsonPaintTarget implements PaintTarget {
/* Document type declarations */
* @author mattitahvonen
*
*/
- class JsonTag {
+ class JsonTag implements Serializable {
boolean firstField = false;
Vector variables = new Vector();
}
}
- abstract class Variable {
+ abstract class Variable implements Serializable {
String name;
public abstract String getJsonPresentation();
}
- class BooleanVariable extends Variable {
+ class BooleanVariable extends Variable implements Serializable {
boolean value;
public BooleanVariable(VariableOwner owner, String name, boolean v) {
}
- class StringVariable extends Variable {
+ class StringVariable extends Variable implements Serializable {
String value;
public StringVariable(VariableOwner owner, String name, String v) {
}
- class IntVariable extends Variable {
+ class IntVariable extends Variable implements Serializable {
int value;
public IntVariable(VariableOwner owner, String name, int v) {
}
}
- class LongVariable extends Variable {
+ class LongVariable extends Variable implements Serializable {
long value;
public LongVariable(VariableOwner owner, String name, long v) {
}
}
- class FloatVariable extends Variable {
+ class FloatVariable extends Variable implements Serializable {
float value;
public FloatVariable(VariableOwner owner, String name, float v) {
}
}
- class DoubleVariable extends Variable {
+ class DoubleVariable extends Variable implements Serializable {
double value;
public DoubleVariable(VariableOwner owner, String name, double v) {
}
}
- class ArrayVariable extends Variable {
+ class ArrayVariable extends Variable implements Serializable {
String[] value;
public ArrayVariable(VariableOwner owner, String name, String[] v) {
import java.io.IOException;\r
import java.io.OutputStream;\r
import java.io.PrintWriter;\r
+import java.io.Serializable;\r
import java.util.HashMap;\r
import java.util.Iterator;\r
import java.util.LinkedHashSet;\r
* @author marc\r
* \r
*/\r
-public class PortletApplicationContext extends WebApplicationContext {\r
+@SuppressWarnings("serial")\r
+public class PortletApplicationContext extends WebApplicationContext implements\r
+ Serializable {\r
\r
protected PortletSession portletSession;\r
\r
}\r
}\r
\r
- public interface PortletListener {\r
+ public interface PortletListener extends Serializable {\r
public void handleRenderRequest(RenderRequest request,\r
RenderResponse response);\r
\r
ActionResponse response);\r
}\r
\r
- private class RestrictedRenderResponse implements RenderResponse {\r
+ private class RestrictedRenderResponse implements RenderResponse,\r
+ Serializable {\r
\r
private RenderResponse response;\r
\r
package com.itmill.toolkit.terminal.gwt.server;
+@SuppressWarnings("serial")
public class SessionExpired extends Exception {
- private static final long serialVersionUID = -2211425033877155423L;
-
}
package com.itmill.toolkit.terminal.gwt.server;\r
\r
+@SuppressWarnings("serial")\r
public class SystemMessageException extends RuntimeException {\r
\r
- /**\r
- * Serial generated by eclipse.\r
- */\r
- private static final long serialVersionUID = -8249486543123286960L;\r
-\r
/**\r
* Cause of the method exception\r
*/\r
import java.io.File;
import java.io.PrintWriter;
+import java.io.Serializable;
import java.io.StringWriter;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
* @VERSION@
* @since 3.1
*/
+@SuppressWarnings("serial")
public class WebApplicationContext implements ApplicationContext,
- HttpSessionBindingListener {
+ HttpSessionBindingListener, Serializable {
protected List listeners;
- protected HttpSession session;
+ protected transient HttpSession session;
protected final HashSet applications = new HashSet();
protected WebBrowser browser = new WebBrowser();
+ protected HashMap<Application, CommunicationManager> applicationToAjaxAppMgrMap = new HashMap<Application, CommunicationManager>();
+
/**
* Creates a new Web Application Context.
*
final Application app = (Application) applications.iterator()
.next();
app.close();
- ApplicationServlet.applicationToAjaxAppMgrMap.remove(app);
+ applicationToAjaxAppMgrMap.remove(app);
removeApplication(app);
}
} catch (Exception e) {
public WebBrowser getBrowser() {
return browser;
}
+
+ /**
+ * Gets communication manager for an application.
+ *
+ * If this application has not been running before, new manager is created.
+ *
+ * @param application
+ * @return CommunicationManager
+ */
+ protected CommunicationManager getApplicationManager(
+ Application application, ApplicationServlet servlet) {
+ CommunicationManager mgr = applicationToAjaxAppMgrMap.get(application);
+
+ if (mgr == null) {
+ // Creates new manager
+ mgr = new CommunicationManager(application, servlet);
+ applicationToAjaxAppMgrMap.put(application, mgr);
+ }
+ return mgr;
+ }
+
}
import com.itmill.toolkit.terminal.Terminal;
+@SuppressWarnings("serial")
public class WebBrowser implements Terminal {
private int screenHeight = 0;
--- /dev/null
+package com.itmill.toolkit.tests.tickets;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import com.itmill.toolkit.Application;
+import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.Window;
+import com.itmill.toolkit.ui.Button.ClickEvent;
+
+public class Ticket695 extends Application {
+
+ private static final long serialVersionUID = 3803150085397590662L;
+
+ @Override
+ public void init() {
+ final Window w = new Window("Serialization test #695");
+ setMainWindow(w);
+ Button b = new Button("Serialize ApplicationContext");
+ w.addComponent(b);
+ b.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ try {
+ ObjectOutputStream oos = new ObjectOutputStream(buffer);
+ oos.writeObject(getContext());
+ w.showNotification("ApplicationContext serialized ("
+ + buffer.size() + "bytes)");
+ } catch (IOException e) {
+ e.printStackTrace();
+ w
+ .showNotification("ApplicationContext serialization failed - see console for stacktrace");
+ }
+
+ }
+ });
+ }
+
+}
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
* positioning.
*
*/
+@SuppressWarnings("serial")
public class AbsoluteLayout extends AbstractLayout {
private Collection<Component> components = new LinkedHashSet<Component>();
* in generic java tools
*
*/
- public class ComponentPosition {
+ public class ComponentPosition implements Serializable {
private int zIndex = -1;
private float top = -1;
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public abstract class AbstractComponent implements Component, MethodEventSource {
/* Private members */
public interface ComponentErrorEvent extends Terminal.ErrorEvent {
}
- public interface ComponentErrorHandler {
+ public interface ComponentErrorHandler extends Serializable {
/**
* Handle the component error
*
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public abstract class AbstractComponentContainer extends AbstractComponent
implements ComponentContainer {
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public abstract class AbstractField extends AbstractComponent implements Field,
Property.ReadOnlyStatusChangeNotifier {
* @since 3.0
*/
public class ReadOnlyStatusChangeEvent extends Component.Event implements
- Property.ReadOnlyStatusChangeEvent {
-
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3258688823264161846L;
+ Property.ReadOnlyStatusChangeEvent, Serializable {
/**
* New instance of text change event.
* @VERSION@
* @since 5.0
*/
+@SuppressWarnings("serial")
public abstract class AbstractLayout extends AbstractComponentContainer
implements Layout, MarginHandler {
import com.itmill.toolkit.terminal.PaintTarget;
import com.itmill.toolkit.terminal.Sizeable;
+@SuppressWarnings("serial")
public abstract class AbstractOrderedLayout extends AbstractLayout implements
Layout.AlignmentHandler, Layout.SpacingHandler {
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
* @VERSION@
* @since 5.0
*/
+@SuppressWarnings("serial")
public abstract class AbstractSelect extends AbstractField implements
Container, Container.Viewer, Container.PropertySetChangeListener,
Container.PropertySetChangeNotifier, Container.ItemSetChangeNotifier,
* caption. <code>FILTERINGMODE_CONTAINS</code> (1) matches anywhere in the
* caption.
*/
- public interface Filtering {
+ public interface Filtering extends Serializable {
public static final int FILTERINGMODE_OFF = 0;
public static final int FILTERINGMODE_STARTSWITH = 1;
public static final int FILTERINGMODE_CONTAINS = 2;
return newItemHandler;
}
- public interface NewItemHandler {
+ public interface NewItemHandler extends Serializable {
void addNewItem(String newItemCaption);
}
/**
* Implementation of item set change event.
*/
- private class ItemSetChangeEvent implements Container.ItemSetChangeEvent {
+ private class ItemSetChangeEvent implements Serializable,
+ Container.ItemSetChangeEvent {
/**
* Gets the Property where the event occurred.
* Implementation of property set change event.
*/
private class PropertySetChangeEvent implements
- Container.PropertySetChangeEvent {
+ Container.PropertySetChangeEvent, Serializable {
/**
* Retrieves the Container whose contents have been modified.
package com.itmill.toolkit.ui;
+@SuppressWarnings("serial")
public class Accordion extends TabSheet {
@Override
package com.itmill.toolkit.ui;
+import java.io.Serializable;
+
import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo.Bits;
/**
* Class containing information about alignment of a component. Use the
* pre-instantiated classes.
*/
-public final class Alignment {
+@SuppressWarnings("serial")
+public final class Alignment implements Serializable {
public static final Alignment TOP_RIGHT = new Alignment(Bits.ALIGNMENT_TOP
+ Bits.ALIGNMENT_RIGHT);
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
* r,right for right alignment
*
*/
-public class AlignmentUtils {
+@SuppressWarnings("serial")
+public class AlignmentUtils implements Serializable {
private static int horizontalMask = AlignmentHandler.ALIGNMENT_LEFT
| AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER
* @since 3.1
*/
+@SuppressWarnings("serial")
public class BaseFieldFactory implements FieldFactory {
/**
package com.itmill.toolkit.ui;
import java.io.IOException;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Map;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Button extends AbstractField {
/* Private members */
*/
public class ClickEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3546647602931118393L;
-
/**
* New instance of text change event.
*
* @VERSION@
* @since 3.0
*/
- public interface ClickListener {
+ public interface ClickListener extends Serializable {
/**
* Button has been pressed.
import com.itmill.toolkit.data.Property;
+@SuppressWarnings("serial")
public class CheckBox extends Button {
/**
* Creates a new switch button.
* can not turn on multi-select mode.\r
* \r
*/\r
+@SuppressWarnings("serial")\r
public class ComboBox extends Select {\r
\r
private String inputPrompt = null;\r
this.inputPrompt = inputPrompt;\r
}\r
\r
+ @Override\r
public void paintContent(PaintTarget target) throws PaintException {\r
if (inputPrompt != null) {\r
target.addAttribute("prompt", inputPrompt);\r
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Collection;
import java.util.EventListener;
import java.util.EventObject;
* @VERSION@
* @since 3.0
*/
-public interface Component extends Paintable, VariableOwner, Sizeable {
+public interface Component extends Paintable, VariableOwner, Sizeable,
+ Serializable {
/**
* Gets style for component. Multiple styles are joined with spaces.
*/
public class Event extends EventObject {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 4048791277653274933L;
-
/**
* Constructs a new event with a specified source component.
*
/**
* Listener interface for receiving <code>Component.Event</code>s.
*/
- public interface Listener extends EventListener {
+ public interface Listener extends EventListener, Serializable {
/**
* Notifies the listener of a component event.
/**
* Class of all component originated <code>ErrorEvent</code>s.
*/
+ @SuppressWarnings("serial")
public class ErrorEvent extends Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 4051323457293857333L;
-
private final ErrorMessage message;
/**
/**
* Listener interface for receiving <code>Component.Errors</code>s.
*/
- public interface ErrorListener extends EventListener {
+ public interface ErrorListener extends EventListener, Serializable {
/**
* Notifies the listener of a component error.
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Iterator;
/**
/**
* Component attach listener interface.
*/
- public interface ComponentAttachListener {
+ public interface ComponentAttachListener extends Serializable {
/**
* A new component is attached to container.
/**
* Component detach listener interface.
*/
- public interface ComponentDetachListener {
+ public interface ComponentDetachListener extends Serializable {
/**
* A component has been detached from container.
/**
* Component attach event sent when a component is attached to container.
*/
+ @SuppressWarnings("serial")
public class ComponentAttachEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257285812184692019L;
-
private final Component component;
/**
/**
* Component detach event sent when a component is detached from container.
*/
+ @SuppressWarnings("serial")
public class ComponentDetachEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3618140052337930290L;
-
private final Component component;
/**
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Iterator;
import com.itmill.toolkit.terminal.PaintException;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class CustomComponent extends AbstractComponentContainer {
/**
return "customcomponent";
}
- public Iterator getComponentIterator() {
- return new Iterator() {
- boolean first = getCompositionRoot() != null;
+ private class ComponentIterator implements Iterator, Serializable {
+ boolean first = getCompositionRoot() != null;
- public boolean hasNext() {
- return first;
- }
+ public boolean hasNext() {
+ return first;
+ }
- public Object next() {
- first = false;
- return root;
- }
+ public Object next() {
+ first = false;
+ return root;
+ }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Iterator getComponentIterator() {
+ return new ComponentIterator();
}
/**
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class CustomLayout extends AbstractLayout {
private static final int BUFFER_SIZE = 10000;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class DateField extends AbstractField {
/* Private members */
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Embedded extends AbstractComponent {
/**
*
* @deprecated Deprecated in favor of the new OrderedLayout
*/
+@SuppressWarnings("serial")
@Deprecated
public class ExpandLayout extends OrderedLayout {
* @VERSION@
* @since 3.0
*/
+ @SuppressWarnings("serial")
public class ValueChangeEvent extends Component.Event implements
Property.ValueChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3545803169444672816L;
-
/**
* Constructs a new event object with the specified source field object.
*
package com.itmill.toolkit.ui;
+import java.io.Serializable;
+
import com.itmill.toolkit.data.Container;
import com.itmill.toolkit.data.Item;
import com.itmill.toolkit.data.Property;
* @VERSION@
* @since 3.1
*/
-public interface FieldFactory {
+public interface FieldFactory extends Serializable {
/**
* Creates a field based on type of data.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Form extends AbstractField implements Item.Editor, Buffered, Item,
Validatable {
* bottom are by default on.
*
*/
+@SuppressWarnings( { "deprecation", "serial" })
public class FormLayout extends OrderedLayout {
public FormLayout() {
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class GridLayout extends AbstractLayout implements
Layout.AlignmentHandler, Layout.SpacingHandler {
* @VERSION@
* @since 3.0
*/
- public class Area {
+ public class Area implements Serializable {
/**
* The column of the upper left corner cell of the area.
*/
public class OverlapsException extends java.lang.RuntimeException {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3978144339870101561L;
-
private final Area existingArea;
/**
*/
public class OutOfBoundsException extends java.lang.RuntimeException {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3618985589664592694L;
-
private final Area areaOutOfBounds;
/**
* @VERSION@
* @since 5.3
*/
+@SuppressWarnings("serial")
public class HorizontalLayout extends AbstractOrderedLayout {
public HorizontalLayout() {
* @VERSION@\r
* @since 5.0\r
*/\r
+@SuppressWarnings("serial")\r
public class InlineDateField extends DateField {\r
\r
public InlineDateField() {\r
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Label extends AbstractComponent implements Property,
Property.Viewer, Property.ValueChangeListener,
Property.ValueChangeNotifier, Comparable {
public class ValueChangeEvent extends Component.Event implements
Property.ValueChangeEvent {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3906084563938586935L;
-
/**
* New instance of text change event
*
package com.itmill.toolkit.ui;
+import java.io.Serializable;
+
import com.itmill.toolkit.terminal.gwt.client.ui.IMarginInfo;
import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo.Bits;
* @VERSION@
* @since 3.0
*/
-public interface Layout extends ComponentContainer {
+public interface Layout extends ComponentContainer, Serializable {
/**
* Enable layout margins. Affects all four sides of the layout. This will
* AlignmentHandler is most commonly an advanced {@link Layout} that can
* align its components.
*/
- public interface AlignmentHandler {
+ public interface AlignmentHandler extends Serializable {
/**
* Contained component should be aligned horizontally to the left.
* components.
*
*/
- public interface SpacingHandler {
+ public interface SpacingHandler extends Serializable {
/**
* Enable spacing between child components within this layout.
*
* This type of layout supports automatic addition of margins (space around
* its components).
*/
- public interface MarginHandler {
+ public interface MarginHandler extends Serializable {
/**
* Enable margins for this layout.
*
public MarginInfo getMargin();
}
- public static class MarginInfo extends IMarginInfo {
+ @SuppressWarnings("serial")
+ public static class MarginInfo extends IMarginInfo implements Serializable {
public MarginInfo(boolean enabled) {
super(enabled, enabled, enabled, enabled);
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Link extends AbstractComponent {
/* Target window border type constant: No window border */
* This is a simple list select without, for instance, support for new items,
* lazyloading, and other advanced features.
*/
+@SuppressWarnings("serial")
public class ListSelect extends AbstractSelect {
private int columns = 0;
package com.itmill.toolkit.ui;
import java.io.ByteArrayInputStream;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.HashMap;
*
* @since 5.3
*/
+@SuppressWarnings("serial")
public class LoginForm extends CustomComponent {
private Embedded iframe = new Embedded();
*/
public class LoginEvent extends Event {
- private static final long serialVersionUID = 1966036438671224308L;
-
private Map params;
private LoginEvent(Map params) {
* Login listener is a class capable to listen LoginEvents sent from
* LoginBox
*/
- public interface LoginListener {
+ public interface LoginListener extends Serializable {
/**
* This method is fired on each login form post.
*
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
* are represented as vertical menu.
* </p>
*/
+@SuppressWarnings("serial")
public class MenuBar extends AbstractComponent {
// Items of the top-level menu
// This generates the tree from the contents of the menu
while (itr.hasNext()) {
- MenuItem item = (MenuItem) itr.next();
+ MenuItem item = itr.next();
target.startTag("item");
// Go through all the items in the menu
while (!found && !items.empty()) {
- tmpItem = (MenuItem) items.pop();
+ tmpItem = items.pop();
found = (clickedId.intValue() == tmpItem.getId());
if (tmpItem.hasChildren()) {
* {@link com.itmill.toolkit.ui.MenuBar.MenuItem}. The selected item is
* given as an argument.
*/
- public interface Command {
+ public interface Command extends Serializable {
public void menuSelected(MenuBar.MenuItem selectedItem);
}
* multiple MenuItems to a MenuItem and create a sub-menu.
*
*/
- public class MenuItem {
+ public class MenuItem implements Serializable {
/** Private members * */
private final int itsId;
* "native" select without all the bells-and-whistles of the ComboBox is a
* better choice.
*/
+@SuppressWarnings("serial")
public class NativeSelect extends AbstractSelect {
// width in characters, mimics TextField
/**
* Configures select to be used as an option group.
*/
+@SuppressWarnings("serial")
public class OptionGroup extends AbstractSelect {
public OptionGroup() {
* OrderedLayout but AbstractOrderedLayout (which also OrderedLayout
* extends).
*/
+@SuppressWarnings("serial")
@Deprecated
public class OrderedLayout extends AbstractOrderedLayout {
/* Predefined orientations */
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Panel extends AbstractComponentContainer implements Scrollable,
ComponentContainer.ComponentAttachListener,
ComponentContainer.ComponentDetachListener, Action.Container {
* @VERSION@\r
* @since 5.0\r
*/\r
+@SuppressWarnings("serial")\r
public class PopupDateField extends DateField {\r
\r
public PopupDateField() {\r
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.Map;
*
* @author IT Mill Ltd.
*/
+@SuppressWarnings("serial")
public class PopupView extends AbstractComponentContainer {
private Content content;
* dynamically loaded when they are redrawn. The user must take care that
* neither of these methods ever return null.
*/
- public interface Content {
+ public interface Content extends Serializable {
/**
* This should return a small view of the full data.
*
*/
public class PopupVisibilityEvent extends Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = -130167162207143457L;
public PopupVisibilityEvent(PopupView source) {
super(source);
* visibility of the popup changes.
*
*/
- public interface PopupVisibilityListener {
+ public interface PopupVisibilityListener extends Serializable {
/**
* Pass to {@link PopupView#PopupVisibilityEvent} to start listening for
* popup visibility changes.
* @VERSION@
* @since 4
*/
+@SuppressWarnings("serial")
public class ProgressIndicator extends AbstractField implements Property,
Property.Viewer, Property.ValueChangeListener {
* {@link RichTextArea} may produce unexpected results as formatting is counted
* into length of field.
*/
+@SuppressWarnings("serial")
public class RichTextArea extends TextField {
@Override
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Select extends AbstractSelect implements AbstractSelect.Filtering {
/**
import com.itmill.toolkit.terminal.PaintTarget;\r
\r
/**\r
- * A component for selecting a numerical value within a range. A Slider\r
- * can have the appearance of a scroll bar or e.g. look like an Adobe Photoshop\r
- * style of a slider.\r
+ * A component for selecting a numerical value within a range. A Slider can have\r
+ * the appearance of a scroll bar or e.g. look like an Adobe Photoshop style of\r
+ * a slider.\r
* \r
* Example code: <code>\r
* class MyPlayer extends CustomComponent implements ValueChangeListener {\r
* \r
* @author IT Mill Ltd.\r
*/\r
+@SuppressWarnings("serial")\r
public class Slider extends AbstractField {\r
\r
public static final int ORIENTATION_HORIZONTAL = 0;\r
*/\r
public class ValueOutOfBoundsException extends Exception {\r
\r
- /**\r
- * Serial generated by Eclipse.\r
- */\r
- private static final long serialVersionUID = -6451298598644446340L;\r
-\r
private final Double value;\r
\r
/**\r
* @VERSION@
* @since 5.0
*/
+@SuppressWarnings("serial")
public class SplitPanel extends AbstractLayout {
/* Predefined orientations */
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.LinkedList;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class TabSheet extends AbstractComponentContainer implements
RepaintRequestListener {
* not) we select this tab instead
*/
if (selected == null || !selected.isVisible()
- || (!selected.isEnabled() && this.isEnabled())) {
+ || (!selected.isEnabled() && isEnabled())) {
selected = c;
}
target.startTag("tab");
*/
public class SelectedTabChangeEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3258129141914940469L;
-
/**
* New instance of selected tab change event
*
* @VERSION@
* @since 3.0
*/
- public interface SelectedTabChangeListener {
+ public interface SelectedTabChangeListener extends Serializable {
/**
* Visible tab in tab sheet has has been changed.
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Table extends AbstractSelect implements Action.Container,
Container.Ordered, Container.Sortable, ItemClickSource {
* Table.addGeneratedColumn along with an id for the column to be generated.
*
*/
- public interface ColumnGenerator {
+ public interface ColumnGenerator extends Serializable {
/**
* Called by Table when a cell in a generated column needs to be
* to the cell content is <tt>i-table-cell-content-[style name]</tt>, and
* the row style will be <tt>i-table-row-[style name]</tt>.
*/
- public interface CellStyleGenerator {
+ public interface CellStyleGenerator extends Serializable {
/**
* Called by Table when a cell (and row) is painted.
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class TextField extends AbstractField {
/* Private members */
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Tree extends AbstractSelect implements Container.Hierarchical,
Action.Container, ItemClickSource {
- /* Static members */
-
private static final Method EXPAND_METHOD;
private static final Method COLLAPSE_METHOD;
*/
public class ExpandEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3832624001804481075L;
-
private final Object expandedItemId;
/**
* @VERSION@
* @since 3.0
*/
- public interface ExpandListener {
+ public interface ExpandListener extends Serializable {
/**
* A node has been expanded.
*/
public class CollapseEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = 3257009834783290160L;
-
private final Object collapsedItemId;
/**
* @VERSION@
* @since 3.0
*/
- public interface CollapseListener {
+ public interface CollapseListener extends Serializable {
/**
* A node has been collapsed.
* Multiselect component with two lists: left side for available items and right
* side for selected items.
*/
+@SuppressWarnings("serial")
public class TwinColSelect extends AbstractSelect {
private int columns = 0;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.LinkedHashSet;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Upload extends AbstractComponent implements Component.Focusable {
private boolean delayedFocus;
* @VERSION@
* @since 3.0
*/
- public interface Receiver {
+ public interface Receiver extends Serializable {
/**
* Invoked when a new upload arrives.
*/
public class FinishedEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = 3257288015385670969L;
/**
*/
public class FailedEvent extends FinishedEvent {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = 3833746590157386293L;
private Exception reason = null;
*/
public class NoOutputStreamEvent extends FailedEvent {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = 4745219890852396500L;
/**
*/
public class NoInputStreamEvent extends FailedEvent {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = -529960205445737170L;
/**
*/
public class SucceededEvent extends FinishedEvent {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = 3256445798169524023L;
/**
*/
public class StartedEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
private static final long serialVersionUID = -3984393770487403525L;
private final String filename;
private final String type;
* @VERSION@
* @since 5.0
*/
- public interface StartedListener {
+ public interface StartedListener extends Serializable {
/**
* Upload has started.
* @VERSION@
* @since 3.0
*/
- public interface FinishedListener {
+ public interface FinishedListener extends Serializable {
/**
* Upload has finished.
* @VERSION@
* @since 3.0
*/
- public interface FailedListener {
+ public interface FailedListener extends Serializable {
/**
* Upload has finished unsuccessfully.
* @VERSION@
* @since 3.0
*/
- public interface SucceededListener {
+ public interface SucceededListener extends Serializable {
/**
* Upload successfull..
/**
* ProgressListener receives events to track progress of upload.
*/
- public interface ProgressListener {
+ public interface ProgressListener extends Serializable {
/**
* Updates progress to listener
*
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Map;
* bookmarking a program state and back button.
*
*/
+@SuppressWarnings("serial")
public class UriFragmentUtility extends AbstractComponent {
/**
* Listener that listens changes in URI fragment.
*/
- public interface FragmentChangedListener {
+ public interface FragmentChangedListener extends Serializable {
public void fragmentChanged(FragmentChangedEvent source);
*/
public class FragmentChangedEvent extends Component.Event {
- /**
- * Serial generated by eclipse
- */
- private static final long serialVersionUID = -4142140007700263197L;
-
/**
* Creates a new instance of UriFragmentReader change event.
*
* @VERSION@
* @since 5.3
*/
+@SuppressWarnings("serial")
public class VerticalLayout extends AbstractOrderedLayout {
public VerticalLayout() {
package com.itmill.toolkit.ui;
+import java.io.Serializable;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
* @VERSION@
* @since 3.0
*/
+@SuppressWarnings("serial")
public class Window extends Panel implements URIHandler, ParameterHandler {
/**
/**
* Private data structure for storing opening window properties.
*/
- private class OpenResource {
+ private class OpenResource implements Serializable {
private final Resource resource;
public class CloseEvent extends Component.Event {
- /**
- * Serial generated by eclipse.
- */
- private static final long serialVersionUID = -7235770057344367327L;
-
/**
*
* @param source
}
}
- public interface CloseListener {
+ public interface CloseListener extends Serializable {
public void windowClose(CloseEvent e);
}
*/
public class ResizeEvent extends Component.Event {
- // Generated serial
- private static final long serialVersionUID = 8569831802323447687L;
-
/**
*
* @param source
*
* @see com.itmill.toolkit.ui.Window.ResizeEvent
*/
- public interface ResizeListener {
+ public interface ResizeListener extends Serializable {
public void windowResized(ResizeEvent e);
}
* </p>
*
*/
- public static class Notification {
+ public static class Notification implements Serializable {
public static final int TYPE_HUMANIZED_MESSAGE = 1;
public static final int TYPE_WARNING_MESSAGE = 2;
public static final int TYPE_ERROR_MESSAGE = 3;