diff --git a/src/main/java/io/bitsquare/gui/CachedViewCB.java b/src/main/java/io/bitsquare/gui/CachedViewCB.java index 7cf515af7f..43e40c7aa5 100644 --- a/src/main/java/io/bitsquare/gui/CachedViewCB.java +++ b/src/main/java/io/bitsquare/gui/CachedViewCB.java @@ -24,21 +24,34 @@ import java.util.ResourceBundle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static com.google.common.base.Preconditions.checkNotNull; + /** * If caching is used for loader we use the CachedViewController for turning the controller into sleep mode if not * active and awake it at reactivation. */ -public class CachedViewCB extends ViewCB { +public class CachedViewCB extends ViewCB { private static final Logger log = LoggerFactory.getLogger(CachedViewCB.class); + protected static final Activatable EMPTY_MODEL = new Activatable() { + @Override + public void activate() { + } + + @Override + public void deactivate() { + } + }; + public CachedViewCB(M model) { - super(model); + super(checkNotNull(model, "Model must not be null")); } public CachedViewCB() { - this(null); + this((M) EMPTY_MODEL); } + /** * Get called form GUI framework when the UI is ready. * In caching controllers the initialize is only used for static UI setup. diff --git a/src/main/java/io/bitsquare/gui/ViewCB.java b/src/main/java/io/bitsquare/gui/ViewCB.java index 698cc881ef..7634f4bce9 100644 --- a/src/main/java/io/bitsquare/gui/ViewCB.java +++ b/src/main/java/io/bitsquare/gui/ViewCB.java @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory; /** * Non caching version for code behind classes using the PM pattern */ -public class ViewCB implements Initializable { +public class ViewCB implements Initializable { private static final Logger log = LoggerFactory.getLogger(ViewCB.class); diff --git a/src/main/java/io/bitsquare/gui/main/funds/FundsViewCB.java b/src/main/java/io/bitsquare/gui/main/funds/FundsViewCB.java index 3a2261e824..3d7610c4e7 100644 --- a/src/main/java/io/bitsquare/gui/main/funds/FundsViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/funds/FundsViewCB.java @@ -51,7 +51,6 @@ public class FundsViewCB extends CachedViewCB { @Inject FundsViewCB(ViewLoader viewLoader, Navigation navigation) { - super(); this.viewLoader = viewLoader; this.navigation = navigation; }