aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Laakso <jani.laakso@itmill.com>2008-02-06 13:06:00 +0000
committerJani Laakso <jani.laakso@itmill.com>2008-02-06 13:06:00 +0000
commitd1cf6e4334f78b22923c2f935fa35e1062a73bdc (patch)
treed2811d035dc7bff365c54f30836cd797f384f0f9
parentc9ac55500aeb1a54b6153dff7c197da83ebac2e9 (diff)
downloadvaadin-framework-d1cf6e4334f78b22923c2f935fa35e1062a73bdc.tar.gz
vaadin-framework-d1cf6e4334f78b22923c2f935fa35e1062a73bdc.zip
1. Removed obsolete dependency framework methods and interface definitions.
2. "Undeprecated" reflection based listeners, we still wish to support these. But I noted on javadoc that using these methods is discouraged and suggested better methods. svn changeset:3718/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/VariableOwner.java48
-rw-r--r--src/com/itmill/toolkit/ui/AbstractComponent.java39
-rw-r--r--src/com/itmill/toolkit/ui/Button.java13
-rw-r--r--src/com/itmill/toolkit/ui/CheckBox.java12
-rw-r--r--src/com/itmill/toolkit/ui/CustomComponent.java13
-rw-r--r--src/com/itmill/toolkit/ui/Form.java5
-rw-r--r--src/com/itmill/toolkit/ui/Panel.java2
7 files changed, 22 insertions, 110 deletions
diff --git a/src/com/itmill/toolkit/terminal/VariableOwner.java b/src/com/itmill/toolkit/terminal/VariableOwner.java
index b14c83d1ef..cdb3321ba0 100644
--- a/src/com/itmill/toolkit/terminal/VariableOwner.java
+++ b/src/com/itmill/toolkit/terminal/VariableOwner.java
@@ -5,7 +5,6 @@
package com.itmill.toolkit.terminal;
import java.util.Map;
-import java.util.Set;
/**
* <p>
@@ -16,20 +15,6 @@ import java.util.Set;
* changes.
* </p>
*
- * <p>
- * The variable-owning components can be linked with <i>dependency relationships</i>.
- * A dependency between two components means that all variable change events to
- * the depended component will be handled before any such events to the
- * depending component.
- * </p>
- *
- * <p>
- * For example, the commit button for a text field will depend on that text
- * field. This is because we want to handle any pending changes the user makes
- * to the contents on the text field before we accept the click of the commit
- * button which starts processing the text field contents.
- * </p>
- *
* @author IT Mill Ltd.
* @version
* @VERSION@
@@ -38,17 +23,6 @@ import java.util.Set;
public interface VariableOwner {
/**
- * Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
- * 5. *
- *
- * @return Set of <code>VariableOwners</code> this component directly
- * depend on, <code>null</code> if this component does not depend
- * on anybody.
- * @deprecated
- */
- public Set getDirectDependencies();
-
- /**
* Called when one or more variables handled by the implementing class are
* changed.
*
@@ -61,28 +35,6 @@ public interface VariableOwner {
public void changeVariables(Object source, Map variables);
/**
- * Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
- * 5.
- *
- * @param depended
- * the <code>VariableOwner</code> component who this
- * component depends on.
- * @deprecated
- */
- public void dependsOn(VariableOwner depended);
-
- /**
- * Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit
- * 5.
- *
- * @param depended
- * the component to be removed from this component's
- * dependency list.
- * @deprecated
- */
- public void removeDirectDependency(VariableOwner depended);
-
- /**
* <p>
* Tests if the variable owner is enabled or not. The terminal should not
* send any variable changes to disabled variable owners.
diff --git a/src/com/itmill/toolkit/ui/AbstractComponent.java b/src/com/itmill/toolkit/ui/AbstractComponent.java
index 3508266d91..07292b8859 100644
--- a/src/com/itmill/toolkit/ui/AbstractComponent.java
+++ b/src/com/itmill/toolkit/ui/AbstractComponent.java
@@ -11,7 +11,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
-import java.util.Set;
import com.itmill.toolkit.Application;
import com.itmill.toolkit.event.EventRouter;
@@ -20,7 +19,6 @@ import com.itmill.toolkit.terminal.ErrorMessage;
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
import com.itmill.toolkit.terminal.Resource;
-import com.itmill.toolkit.terminal.VariableOwner;
/**
* An abstract class that defines default implementation for the
@@ -581,7 +579,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* here, we use the default documentation from implemented interface.
*/
public final void paint(PaintTarget target) throws PaintException {
-
if (!target.startTag(this, getTag()) || repaintRequestListenersNotified) {
// Paint the contents of the component
@@ -667,7 +664,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
/* Documentation copied from interface */
public void childRequestedRepaint(Collection alreadyNotified) {
-
// Invisible components do not need repaints
if (!isVisible()) {
return;
@@ -682,10 +678,8 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* @param alreadyNotified
*/
private void fireRequestRepaintEvent(Collection alreadyNotified) {
-
// Notify listeners only once
if (!repaintRequestListenersNotified) {
-
// Notify the listeners
if (repaintRequestListeners != null
&& !repaintRequestListeners.isEmpty()) {
@@ -740,18 +734,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* interface.
*/
public void changeVariables(Object source, Map variables) {
-
- }
-
- /* Dependency -framework is deprecated */
- public void dependsOn(VariableOwner depended) {
- }
-
- public void removeDirectDependency(VariableOwner depended) {
- }
-
- public Set getDirectDependencies() {
- return null;
}
/* General event framework *************************************** */
@@ -800,10 +782,10 @@ public abstract class AbstractComponent implements Component, MethodEventSource
/**
* <p>
- * Registers a new listener with the specified activation method to listen
- * events generated by this component. If the activation method does not
- * have any arguments the event object will not be passed to it when it's
- * called.
+ * Convenience method for registering a new listener with the specified
+ * activation method to listen events generated by this component. If the
+ * activation method does not have any arguments the event object will not
+ * be passed to it when it's called.
* </p>
*
* <p>
@@ -818,6 +800,12 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* {@link com.itmill.toolkit.event com.itmill.toolkit.event package documentation}.
* </p>
*
+ * <p>
+ * Note: Using this method is discouraged because it cannot be checked
+ * during compilation. Use {@link #addListener(Class, Object, Method)} or
+ * {@link #addListener(com.itmill.toolkit.ui.Component.Listener)} instead.
+ * </p>
+ *
* @param eventType
* the type of the listened event. Events of this type or its
* subclasses activate the listener.
@@ -825,10 +813,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* the object instance who owns the activation method.
* @param methodName
* the name of the activation method.
- * @deprecated Use {@link #addListener(Class, Object, Method)} or
- * {@link #addListener(com.itmill.toolkit.ui.Component.Listener)}
- * instead. Using this method is discouraged because it cannot
- * be checked during compilation.
*/
public void addListener(Class eventType, Object object, String methodName) {
if (eventRouter == null) {
@@ -929,7 +913,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* the Event to be sent to all listeners.
*/
protected void fireEvent(Component.Event event) {
-
if (eventRouter != null) {
eventRouter.fireEvent(event);
}
@@ -944,7 +927,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* implemented interface.
*/
public void addListener(Component.Listener listener) {
-
if (eventRouter == null) {
eventRouter = new EventRouter();
}
@@ -959,7 +941,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* interface.
*/
public void removeListener(Component.Listener listener) {
-
if (eventRouter != null) {
eventRouter.removeListener(Component.Event.class, listener,
COMPONENT_EVENT_METHOD);
diff --git a/src/com/itmill/toolkit/ui/Button.java b/src/com/itmill/toolkit/ui/Button.java
index 605cac85b7..538c8953d6 100644
--- a/src/com/itmill/toolkit/ui/Button.java
+++ b/src/com/itmill/toolkit/ui/Button.java
@@ -63,9 +63,12 @@ public class Button extends AbstractField {
}
/**
- * Creates a new push button with a method listening button clicks. The
- * method must have either no parameters, or only one parameter of
- * Button.ClickEvent type.
+ * Creates a new push button with a method listening button clicks. Using
+ * this method is discouraged because it cannot be checked during
+ * compilation. Use
+ * {@link #Button(String, com.itmill.toolkit.ui.Button.ClickListener)}
+ * instead. The method must have either no parameters, or only one parameter
+ * of Button.ClickEvent type.
*
* @param caption
* the Button caption.
@@ -74,10 +77,6 @@ public class Button extends AbstractField {
* @param methodName
* the name of the method in target object, that receives
* button click events.
- * @deprecated Use
- * {@link #Button(String, com.itmill.toolkit.ui.Button.ClickListener)}
- * instead. Using this method is discouraged because it cannot
- * be checked during compilation.
*/
public Button(String caption, Object target, String methodName) {
this(caption);
diff --git a/src/com/itmill/toolkit/ui/CheckBox.java b/src/com/itmill/toolkit/ui/CheckBox.java
index 12edb77bff..86ba0fee95 100644
--- a/src/com/itmill/toolkit/ui/CheckBox.java
+++ b/src/com/itmill/toolkit/ui/CheckBox.java
@@ -45,8 +45,12 @@ public class CheckBox extends Button {
}
/**
- * Creates a new switch button with a method listening button clicks. The
- * method must have either no parameters, or only one parameter of
+ * Convenience method for creating a new switch button with a method
+ * listening button clicks. Using this method is discouraged because it
+ * cannot be checked during compilation. Use
+ * {@link #addListener(Class, Object, Method)} or
+ * {@link #addListener(com.itmill.toolkit.ui.Component.Listener)} instead.
+ * The method must have either no parameters, or only one parameter of
* Button.ClickEvent type.
*
* @param caption
@@ -56,10 +60,6 @@ public class CheckBox extends Button {
* @param methodName
* the name of the method in target object, that receives
* button click events.
- * @deprecated Use {@link #addListener(Class, Object, Method)} or
- * {@link #addListener(com.itmill.toolkit.ui.Component.Listener)}
- * instead. Using this method is discouraged because it cannot
- * be checked during compilation.
*/
public CheckBox(String caption, Object target, String methodName) {
setCaption(caption);
diff --git a/src/com/itmill/toolkit/ui/CustomComponent.java b/src/com/itmill/toolkit/ui/CustomComponent.java
index ef531aa12f..7c165df687 100644
--- a/src/com/itmill/toolkit/ui/CustomComponent.java
+++ b/src/com/itmill/toolkit/ui/CustomComponent.java
@@ -8,13 +8,11 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
-import java.util.Set;
import com.itmill.toolkit.Application;
import com.itmill.toolkit.terminal.PaintException;
import com.itmill.toolkit.terminal.PaintTarget;
import com.itmill.toolkit.terminal.Resource;
-import com.itmill.toolkit.terminal.VariableOwner;
/**
* Custom component provides simple implementation of Component interface for
@@ -424,17 +422,6 @@ public class CustomComponent implements Component {
public void changeVariables(Object source, Map variables) {
}
- /* Dependency -framework is deprecated */
- public void dependsOn(VariableOwner depended) {
- }
-
- public void removeDirectDependency(VariableOwner depended) {
- }
-
- public Set getDirectDependencies() {
- return null;
- }
-
/* Event functions are not implemented by default -------------------- */
/**
diff --git a/src/com/itmill/toolkit/ui/Form.java b/src/com/itmill/toolkit/ui/Form.java
index 4ceebcb186..f818c99481 100644
--- a/src/com/itmill/toolkit/ui/Form.java
+++ b/src/com/itmill/toolkit/ui/Form.java
@@ -368,7 +368,6 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
public void addField(Object propertyId, Field field) {
if (propertyId != null && field != null) {
- dependsOn(field);
fields.put(propertyId, field);
propertyIds.addLast(propertyId);
field.setReadThrough(readThrough);
@@ -437,7 +436,6 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
if (field != null) {
propertyIds.remove(id);
fields.remove(id);
- removeDirectDependency(field);
layout.removeComponent(field);
return true;
}
@@ -672,9 +670,6 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item,
// Replaces the old field with new one
layout.replaceComponent(oldField, newField);
fields.put(propertyId, newField);
- removeDirectDependency(oldField);
- dependsOn(newField);
- newField.dependsOn(this);
return newField;
}
diff --git a/src/com/itmill/toolkit/ui/Panel.java b/src/com/itmill/toolkit/ui/Panel.java
index a155759761..db1f58646f 100644
--- a/src/com/itmill/toolkit/ui/Panel.java
+++ b/src/com/itmill/toolkit/ui/Panel.java
@@ -124,13 +124,11 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
// Sets the panel to be parent for the layout
layout.setParent(this);
- dependsOn(layout);
// If panel already contains a layout, move the contents to new one
// and detach old layout from the panel
if (this.layout != null) {
layout.moveComponentsFrom(this.layout);
- removeDirectDependency(this.layout);
this.layout.setParent(null);
}