aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Root.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-12-08 17:00:10 +0200
committerLeif Åstrand <leif@vaadin.com>2011-12-08 17:00:10 +0200
commit2b824e1ab8932674d9bed130f2744b671cdb6330 (patch)
tree5374d754e39b21a48c15f435df04496e125aeff3 /src/com/vaadin/ui/Root.java
parent93155d828384a9853a2f830c9eb717d9a645637e (diff)
downloadvaadin-framework-2b824e1ab8932674d9bed130f2744b671cdb6330.tar.gz
vaadin-framework-2b824e1ab8932674d9bed130f2744b671cdb6330.zip
Fix compile errors and one failed test caused by merging
Diffstat (limited to 'src/com/vaadin/ui/Root.java')
-rw-r--r--src/com/vaadin/ui/Root.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java
index 03bb1023ac..94d29ffebd 100644
--- a/src/com/vaadin/ui/Root.java
+++ b/src/com/vaadin/ui/Root.java
@@ -813,7 +813,7 @@ public class Root extends AbstractComponentContainer implements
@Deprecated
public void addComponent(Component c) {
// Use the thread local as the instance field might not yet be inited
- if (Application.getCurrentApplication() instanceof Application.LegacyApplication) {
+ if (isLegacyApplication()) {
getContent().addComponent(c);
} else {
throw new UnsupportedOperationException(
@@ -821,6 +821,11 @@ public class Root extends AbstractComponentContainer implements
}
}
+ private boolean isLegacyApplication() {
+ return Application.getCurrentApplication() instanceof Application.LegacyApplication
+ || getApplication() instanceof Application.LegacyApplication;
+ }
+
/**
* <b>Removing a component from a root is generally not supported.</b> To
* maintain backwards compatibility, removing components is still supported
@@ -836,7 +841,7 @@ public class Root extends AbstractComponentContainer implements
@Deprecated
public void removeComponent(Component c) {
// Use the thread local as the instance field might not yet be inited
- if (Application.getCurrentApplication() instanceof Application.LegacyApplication) {
+ if (isLegacyApplication()) {
getContent().removeComponent(c);
} else {
throw new UnsupportedOperationException(
@@ -859,7 +864,7 @@ public class Root extends AbstractComponentContainer implements
@Deprecated
public void removeAllComponents() {
// Use the thread local as the instance field might not yet be inited
- if (Application.getCurrentApplication() instanceof Application.LegacyApplication) {
+ if (isLegacyApplication()) {
getContent().removeAllComponents();
} else {
throw new UnsupportedOperationException(