From 541ca111b0540309a78f8e2a8d15f93d00176bdf Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Sun, 21 Oct 2007 16:22:39 +0000 Subject: [PATCH] Deprecated dependency-framework. Fixes #871 svn changeset:2574/svn branch:trunk --- .../toolkit/terminal/VariableOwner.java | 20 ++++----- .../itmill/toolkit/ui/AbstractComponent.java | 41 ++---------------- .../itmill/toolkit/ui/CustomComponent.java | 42 ++----------------- 3 files changed, 15 insertions(+), 88 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/VariableOwner.java b/src/com/itmill/toolkit/terminal/VariableOwner.java index 4564ceec58..b730125d34 100644 --- a/src/com/itmill/toolkit/terminal/VariableOwner.java +++ b/src/com/itmill/toolkit/terminal/VariableOwner.java @@ -62,14 +62,12 @@ import java.util.Set; public interface VariableOwner { /** - * Gets the variable change listeners this VariableOwner - * directly depends on. This list does not contain any indirect - * dependencies, for example, if A depends on B and B depends on C, the - * dependency list of A does not include C. - * + * Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit 5. + * * * @return Set of VariableOwners this component directly * depend on, null if this component does not depend * on anybody. + * @deprecated */ public Set getDirectDependencies(); @@ -86,26 +84,22 @@ public interface VariableOwner { public void changeVariables(Object source, Map variables); /** - * Makes this VariableOwner depend on the given - * VariableOwner. This means that any variable change events - * relating to depended must be sent before any such events - * that relate to this object. + * Dependencies are not needed anymore as HTML-mode is deprecated in Toolkit 5. * * @param depended * the VariableOwner component who this component * depends on. + * @deprecated */ public void dependsOn(VariableOwner depended); /** - * Removes the given component from this component's dependency list. After - * the call this component will no longer depend on depended - * wdepende direct dependency from the component. Indirect dependencies are - * not removed. + * 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); diff --git a/src/com/itmill/toolkit/ui/AbstractComponent.java b/src/com/itmill/toolkit/ui/AbstractComponent.java index 13d40bc23d..62a34ba453 100644 --- a/src/com/itmill/toolkit/ui/AbstractComponent.java +++ b/src/com/itmill/toolkit/ui/AbstractComponent.java @@ -113,11 +113,6 @@ public abstract class AbstractComponent implements Component, MethodEventSource */ private ErrorMessage componentError = null; - /** - * List of event variable change event handling dependencies. - */ - private Set dependencies = null; - /** * Immediate mode: if true, all variable changes are required to be sent * from the terminal immediately. @@ -692,39 +687,11 @@ public abstract class AbstractComponent implements Component, MethodEventSource } - /* - * Adds a variable-change dependency to this component. Don't add a JavaDoc - * comment here, we use the default documentation from implemented - * interface. - */ - public void dependsOn(VariableOwner depended) { - - // Assure that the list exists - if (dependencies == null) - dependencies = new HashSet(); - - // Add to the list of dependencies - if (depended != null) - dependencies.add(depended); - } - - /* - * Removes a dependency from the component. Don't add a JavaDoc comment - * here, we use the default documentation from implemented interface. - */ - public void removeDirectDependency(VariableOwner depended) { - - // Removes the listener if necessary - if (dependencies != null && depended != null) - dependencies.remove(depended); - } - - /* - * Gets the set of depended components. Don't add a JavaDoc comment here, we - * use the default documentation from implemented interface. - */ + /* Dependency -framework is deprecated */ + public void dependsOn(VariableOwner depended) {} + public void removeDirectDependency(VariableOwner depended) {} public Set getDirectDependencies() { - return dependencies; + return null; } /* General event framework *************************************** */ diff --git a/src/com/itmill/toolkit/ui/CustomComponent.java b/src/com/itmill/toolkit/ui/CustomComponent.java index 56615a61c1..2c5267e033 100644 --- a/src/com/itmill/toolkit/ui/CustomComponent.java +++ b/src/com/itmill/toolkit/ui/CustomComponent.java @@ -72,11 +72,6 @@ public class CustomComponent implements Component { */ private Component parent = null; - /** - * Dependencies of the component, or null. - */ - private HashSet dependencies = null; - /** * Type of the component. */ @@ -437,42 +432,13 @@ public class CustomComponent implements Component { public void changeVariables(Object source, Map variables) { } - /** - * Makes this VariableOwner depend on the given - * VariableOwner. - * - * @see com.itmill.toolkit.terminal.VariableOwner#dependsOn(com.itmill.toolkit.terminal.VariableOwner) - */ - public void dependsOn(VariableOwner depended) { - if (depended == null) - return; - if (dependencies == null) - dependencies = new HashSet(); - dependencies.add(depended); - } - - /** - * Gets the variable change listeners this VariableOwner - * directly depends on. - * - * @see com.itmill.toolkit.terminal.VariableOwner#getDirectDependencies() - */ + /* Dependency -framework is deprecated */ + public void dependsOn(VariableOwner depended) {} + public void removeDirectDependency(VariableOwner depended) {} public Set getDirectDependencies() { - return dependencies; + return null; } - /** - * Removes the given component from this component's dependency list. - * - * @see com.itmill.toolkit.terminal.VariableOwner#removeDirectDependency(com.itmill.toolkit.terminal.VariableOwner) - */ - public void removeDirectDependency(VariableOwner depended) { - if (dependencies == null) - return; - dependencies.remove(depended); - if (dependencies.isEmpty()) - dependencies = null; - } /* Event functions are not implemented by default -------------------- */ -- 2.39.5