Author: scabanovich
Date: 2009-12-23 08:37:11 -0500 (Wed, 23 Dec 2009)
New Revision: 19549
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5547
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23
13:23:18 UTC (rev 19548)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23
13:37:11 UTC (rev 19549)
@@ -57,8 +57,7 @@
public XModelObject convertBasicToSpecific(XModelObject parent, XModelObject basic) {
String entity = basic.getModelEntity().getName();
if("ESBFTPListener120".equals(entity)) {
- IPropertyConverter converter = new FTPListenerConverter();
- converter.toSpecific(basic, basic);
+ FTPListenerConverter.instance.toSpecific(basic, basic);
}
//returns null because no new object is created
return null;
@@ -69,8 +68,7 @@
XModelObject basic = specific;
if("ESBFTPListener120".equals(entity)) {
basic = basic.copy();
- IPropertyConverter converter = new FTPListenerConverter();
- converter.toBasic(basic, specific);
+ FTPListenerConverter.instance.toBasic(basic, specific);
}
return basic;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23
13:23:18 UTC (rev 19548)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23
13:37:11 UTC (rev 19549)
@@ -17,6 +17,7 @@
* @author Viacheslav Kabanovich
*/
public class FTPListenerConverter implements IPropertyConverter {
+ public static FTPListenerConverter instance = new FTPListenerConverter();
public FTPListenerConverter() {}
@@ -26,6 +27,19 @@
return;
}
+ toBasicImpl(basic, specific);
+ }
+
+ public void toSpecific(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null &&
!"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
+ toSpecificImpl(basic, specific);
+ }
+
+ public void toBasicImpl(XModelObject basic, XModelObject specific) {
XModelObject cache = specific.getChildByPath("Cache");
if(cache != null) {
SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
@@ -37,12 +51,7 @@
}
}
- public void toSpecific(XModelObject basic, XModelObject specific) {
- XModelObject filter = specific.getChildByPath("Filter");
- if(filter != null &&
!"true".equals(filter.getAttributeValue("read only"))) {
- return;
- }
-
+ public void toSpecificImpl(XModelObject basic, XModelObject specific) {
XModelObject cache = specific.getChildByPath("Cache");
if(cache != null) {
SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java 2009-12-23
13:23:18 UTC (rev 19548)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java 2009-12-23
13:37:11 UTC (rev 19549)
@@ -10,10 +10,12 @@
******************************************************************************/
package org.jboss.tools.esb.core.model.impl;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+import org.jboss.tools.esb.core.model.converters.FTPListenerConverter;
/**
* @author Viacheslav Kabanovich
@@ -41,4 +43,17 @@
}
}
+ protected void onAttributeValueEdit(String name, String oldValue, String newValue)
throws XModelException {
+ if("read only".equals(name)) {
+ XModelObject p = getParent();
+ if(p != null) {
+ if("true".equals(newValue)) {
+ FTPListenerConverter.instance.toSpecificImpl(p, p);
+ } else if("true".equals(oldValue)) {
+ FTPListenerConverter.instance.toBasicImpl(p, p);
+ }
+ }
+ }
+ }
+
}