Author: scabanovich
Date: 2009-12-23 08:23:18 -0500 (Wed, 23 Dec 2009)
New Revision: 19548
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5547
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2009-12-23 13:18:52
UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2009-12-23 13:23:18
UTC (rev 19548)
@@ -9,7 +9,8 @@
Export-Package: org.jboss.tools.esb.core,
org.jboss.tools.esb.core.model,
org.jboss.tools.esb.core.model.converters,
- org.jboss.tools.esb.core.model.handlers
+ org.jboss.tools.esb.core.model.handlers,
+ org.jboss.tools.esb.core.model.impl
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui
Bundle-Version: 2.0.0
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-23 13:18:52 UTC (rev
19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-23 13:23:18 UTC (rev
19548)
@@ -33,6 +33,10 @@
class="org.jboss.tools.esb.core.model.ESBRouteToImpl"/>
<xclass id="org.jboss.tools.esb.core.model.EJBParamImpl"
class="org.jboss.tools.esb.core.model.EJBParamImpl"/>
+ <xclass
id="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
+ class="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"
+ class="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
@@ -45,6 +49,9 @@
<xclass id="org.jboss.tools.esb.core.model.ESBResourceTree"
class="org.jboss.tools.esb.core.model.ESBResourceTree"/>
+
+ <xclass id="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"
+ class="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"/>
</extension>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-23 13:18:52
UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-23 13:23:18
UTC (rev 19548)
@@ -680,7 +680,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;saveDefault=false"
XMLSUBPATH="ftp-message-filter" name="ESBFTPMessageFilter101">
<XChildrenEntities/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23
13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23
13:23:18 UTC (rev 19548)
@@ -7,6 +7,9 @@
<MAPPING name="FileVersions">
<PAIR name="ESB1.2.0" value="FileESB120"/>
</MAPPING>
+ <MAPPING name="FilteredTreeConstraints">
+ <PAIR name="FileSystems$158"
value="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"/>
+ </MAPPING>
</MAPPINGS>
<ICONS/>
<GlobalActions kind="list"/>
@@ -286,7 +289,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+
ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter"
name="ESBFTPCache">
<XChildrenEntities/>
<XEntityRenderer>
@@ -361,7 +365,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter"
name="ESBFTPRemote">
<XChildrenEntities/>
<XEntityRenderer>
@@ -635,7 +639,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+ ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
XMLSUBPATH="listener" name="ESBListener120">
<XChildrenEntities>
@@ -1114,7 +1119,7 @@
ImplementationLoadingClass="org.jboss.tools.esb.core.model.ESBFileLoader"
ImplementingClass="org.jboss.tools.esb.core.model.ESBFileImpl"
ObjectEditorClass="%XML%"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%;editorTreeConstraint=org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"
XMLSUBPATH="jbossesb" name="FileESB120">
<XChildrenEntities>
<XChildEntity maxCount="1" name="ESBGlobals120"
required="yes"/>
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:18:52 UTC (rev 19547)
+++
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)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.model.converters;
import org.jboss.tools.common.model.XModelObject;
@@ -3,22 +13,43 @@
import org.jboss.tools.esb.core.model.SpecificActionLoader;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class FTPListenerConverter implements IPropertyConverter {
public FTPListenerConverter() {}
public void toBasic(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null &&
!"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
XModelObject cache = specific.getChildByPath("Cache");
- SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
+ if(cache != null) {
+ SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
+ }
XModelObject remote = specific.getChildByPath("Remote Filesystem Strategy");
- SpecificActionLoader.copySpecificAtttributesToBasicProperties(remote, basic);
+ if(remote != null) {
+ SpecificActionLoader.copySpecificAtttributesToBasicProperties(remote, basic);
+ }
}
public void toSpecific(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null &&
!"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
XModelObject cache = specific.getChildByPath("Cache");
- SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
+ if(cache != null) {
+ SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
+ }
XModelObject remote = specific.getChildByPath("Remote Filesystem Strategy");
- SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, remote);
+ if(remote != null) {
+ SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, remote);
+ }
}
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java 2009-12-23
13:23:18 UTC (rev 19548)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.impl;
+
+import org.jboss.tools.common.model.XFilteredTreeConstraint;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ESBTreeConstraint implements XFilteredTreeConstraint {
+
+ public boolean accepts(XModelObject object) {
+ String entity = object.getModelEntity().getName();
+ if("ESBFTPCache".equals(entity) || "ESBFTPRemote".equals(entity))
{
+ XModelObject p = object.getParent();
+ if(p != null) {
+ XModelObject filter = p.getChildByPath("Filter");
+ if(filter != null &&
!"true".equals(filter.getAttributeValue("read only"))) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public boolean isHidingAllChildren(XModelObject object) {
+ return false;
+ }
+
+ public boolean isHidingSomeChildren(XModelObject object) {
+ String entity = object.getModelEntity().getName();
+ if("ESBFTPListener120".equals(entity)) {
+ return true;
+ }
+ return false;
+ }
+
+ public void update(XModel model) {
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java 2009-12-23
13:23:18 UTC (rev 19548)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.impl;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FTPListenerSpecificPropertiesImpl extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public FTPListenerSpecificPropertiesImpl() {}
+
+ public boolean isObjectEditable() {
+ if(!super.isObjectEditable()) return false;
+ XModelObject p = getParent();
+ if(p != null) {
+ XModelObject c = p.getChildByPath("Filter");
+ if(c != null && !"true".equals(c.getAttributeValue("read
only"))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
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
(rev 0)
+++
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)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.impl;
+
+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;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FTPMessageFilterImpl extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public FTPMessageFilterImpl() {}
+
+ public String setAttributeValue(String name, String value) {
+ if("read only".equals(name) && isActive()) {
+ String ov = getAttributeValue("read only");
+ boolean changed = (value != null && !value.equals(ov));
+ String result = super.setAttributeValue(name, value);
+ if(changed) {
+ XModelObject p = getParent();
+ if(p != null) {
+ XModelImpl m = (XModelImpl)getModel();
+ m.fireStructureChanged(p, XModelTreeEvent.STRUCTURE_CHANGED, p);
+ }
+ }
+ return result;
+ } else {
+ return super.setAttributeValue(name, value);
+ }
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain