Commit 83def725 by s_guodong

update

parent 890cb66e
package com.brilliance.mda.runtime.mda.impl; package com.brilliance.mda.runtime.mda.impl;
import com.brilliance.mda.runtime.mda.*; import com.brilliance.mda.runtime.mda.IBaseObject;
import com.brilliance.mda.runtime.mda.IContext;
import com.brilliance.mda.runtime.mda.IModule;
import com.brilliance.mda.runtime.mda.IRule;
import com.brilliance.mda.runtime.mda.util.RuleUtils; import com.brilliance.mda.runtime.mda.util.RuleUtils;
import org.apache.poi.poifs.macros.Module;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -15,7 +17,9 @@ import java.util.List; ...@@ -15,7 +17,9 @@ import java.util.List;
public abstract class AbstractBaseObject implements IBaseObject { public abstract class AbstractBaseObject implements IBaseObject {
protected transient List<IRule> defaultRules = null; protected transient List<IRule> defaultRules = null;
protected transient IParent parent; // protected transient IParent parent;
protected transient IModule parent;
protected transient long key = -1L; protected transient long key = -1L;
...@@ -27,7 +31,7 @@ public abstract class AbstractBaseObject implements IBaseObject { ...@@ -27,7 +31,7 @@ public abstract class AbstractBaseObject implements IBaseObject {
protected transient boolean disposed = false; protected transient boolean disposed = false;
public AbstractBaseObject(IParent parent) { public AbstractBaseObject(IModule parent) {
this.parent = parent; this.parent = parent;
} }
...@@ -43,7 +47,8 @@ public abstract class AbstractBaseObject implements IBaseObject { ...@@ -43,7 +47,8 @@ public abstract class AbstractBaseObject implements IBaseObject {
this.disposed = true; this.disposed = true;
try { try {
finalize(); finalize();
} catch (Throwable throwable) {} } catch (Throwable throwable) {
}
} }
public boolean isDisposed() { public boolean isDisposed() {
...@@ -61,21 +66,15 @@ public abstract class AbstractBaseObject implements IBaseObject { ...@@ -61,21 +66,15 @@ public abstract class AbstractBaseObject implements IBaseObject {
} }
public Object setAttribute(String name, Object attribute) { public Object setAttribute(String name, Object attribute) {
if (this instanceof IParent) return null;
return ((IParent)this).setAttribute(this, name, attribute);
return this.parent.setAttribute(this, name, attribute);
} }
public Object getAttribute(String name) { public Object getAttribute(String name) {
if (this instanceof IParent) return null;
return ((IParent)this).getAttribute(this, name);
if (this.parent == null)
System.out.println(getUrl());
return this.parent.getAttribute(this, name);
} }
public IModule getParent() { public IModule getParent() {
return (IModule)this.parent; return (IModule) this.parent;
} }
public String getName() { public String getName() {
......
...@@ -13,7 +13,7 @@ public class PanelImpl extends AbstractBaseObject implements IPanel { ...@@ -13,7 +13,7 @@ public class PanelImpl extends AbstractBaseObject implements IPanel {
private String titleI18nKey; private String titleI18nKey;
public PanelImpl(IParent parent, String name, String titleI18nKey) { public PanelImpl(IModule parent, String name, String titleI18nKey) {
super(parent); super(parent);
this.name = name; this.name = name;
this.titleI18nKey = titleI18nKey; this.titleI18nKey = titleI18nKey;
...@@ -24,6 +24,11 @@ public class PanelImpl extends AbstractBaseObject implements IPanel { ...@@ -24,6 +24,11 @@ public class PanelImpl extends AbstractBaseObject implements IPanel {
this.name = path; this.name = path;
} }
public PanelImpl(IModule parent, String path) {
super(parent);
this.name = path;
}
public synchronized void dispose() { public synchronized void dispose() {
if (IPanel.log.isTraceEnabled()) if (IPanel.log.isTraceEnabled())
IPanel.log.trace("Panel disposing:" + this.url); IPanel.log.trace("Panel disposing:" + this.url);
...@@ -42,7 +47,7 @@ public class PanelImpl extends AbstractBaseObject implements IPanel { ...@@ -42,7 +47,7 @@ public class PanelImpl extends AbstractBaseObject implements IPanel {
} }
public IModule getModule() { public IModule getModule() {
return (IModule) this.parent; return this.parent;
} }
public String getTitleI18nKey() { public String getTitleI18nKey() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment