JBoss Tools SVN: r20474 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2010-02-24 10:02:58 -0500 (Wed, 24 Feb 2010)
New Revision: 20474
Added:
trunk/jsf/docs/userguide/en/images/visual_page/editors_features_27a.png
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-1012 - Described CA in Insert Tag wizard.</p>
</body></html>
Added: trunk/jsf/docs/userguide/en/images/visual_page/editors_features_27a.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/editors_features_27a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2010-02-24 13:36:31 UTC (rev 20473)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2010-02-24 15:02:58 UTC (rev 20474)
@@ -311,6 +311,11 @@
<ulink url="&esblink;#ESBContentAssist">ESB XML files</ulink>
</para>
</listitem>
+ <listitem>
+ <para>
+ <link linkend="ContentAssistForInsertTag">Insert Tag Wizard</link>
+ </para>
+ </listitem>
</itemizedlist>
<para>Notice, that code completion for EL variables has icons illustrating what they are
@@ -743,7 +748,21 @@
<para>If XHTML file uses custom Facelets components, the Content Assist should also be available for them. For details, see
<link linkend="contentAssistForCustomFacelets">"Content Assist for Custom Facelets Components"</link> later in this guide.</para>
</section>
- <section id="AddingDynamicCodeAssistToCustomComponents8745">
+ <section id="ContentAssistForInsertTag">
+ <title>Content Assist for Insert Tag Wizard</title>
+ <para>Content Assist is also available for any attribute value of <emphasis>Insert Tag wizard</emphasis>.</para>
+ <figure>
+ <title>Content Assist for Insert Tag Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/editors_features_27a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section id="AddingDynamicCodeAssistToCustomComponents8745">
<title>Adding dynamic code assist to custom components that were added to JBoss
Tools Palette</title>
14 years, 3 months
JBoss Tools SVN: r20473 - in trunk/documentation/whatsnew: seam/images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-02-24 08:36:31 -0500 (Wed, 24 Feb 2010)
New Revision: 20473
Added:
trunk/documentation/whatsnew/hibernate/images/display-foreign-key-constrains.png
trunk/documentation/whatsnew/seam/images/seam_and_jpa.png
trunk/documentation/whatsnew/seam/images/seam_only.png
Log:
adding back images but this time with proper lowercase .png
Added: trunk/documentation/whatsnew/hibernate/images/display-foreign-key-constrains.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/hibernate/images/display-foreign-key-constrains.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/seam/images/seam_and_jpa.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/seam/images/seam_and_jpa.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/seam/images/seam_only.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/seam/images/seam_only.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 3 months
JBoss Tools SVN: r20472 - in trunk/documentation/whatsnew: seam/images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-02-24 08:35:26 -0500 (Wed, 24 Feb 2010)
New Revision: 20472
Removed:
trunk/documentation/whatsnew/hibernate/images/display-foreign-key-constrains.PNG
trunk/documentation/whatsnew/seam/images/seam_and_jpa.PNG
trunk/documentation/whatsnew/seam/images/seam_only.PNG
Log:
fix case errors in png files.
Deleted: trunk/documentation/whatsnew/hibernate/images/display-foreign-key-constrains.PNG
===================================================================
(Binary files differ)
Deleted: trunk/documentation/whatsnew/seam/images/seam_and_jpa.PNG
===================================================================
(Binary files differ)
Deleted: trunk/documentation/whatsnew/seam/images/seam_only.PNG
===================================================================
(Binary files differ)
14 years, 3 months
JBoss Tools SVN: r20471 - branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 08:19:24 -0500 (Wed, 24 Feb 2010)
New Revision: 20471
Modified:
branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5873
Modified: branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-02-24 13:18:09 UTC (rev 20470)
+++ branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-02-24 13:19:24 UTC (rev 20471)
@@ -3049,6 +3049,9 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
name="class" xmlname="class"/>
+ <XModelAttribute PROPERTIES="any=true" name="attributes">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -3062,6 +3065,14 @@
<AttributeData AttributeName="tag"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.common.meta.action.impl.handlers.AddAttributeToAnyElementSupport"
+ displayName="Add Attribute..." kind="action" name="CreateAttribute">
+ <EntityData EntityName="AnyElementNew">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
<XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
14 years, 3 months
JBoss Tools SVN: r20470 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-02-24 08:18:09 -0500 (Wed, 24 Feb 2010)
New Revision: 20470
Modified:
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5837
Make possible to run VPE JUnit tests one by one
- Struts VPE test are being failed on Hudson. Code to show full log has been added.
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2010-02-24 13:16:28 UTC (rev 20469)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsHTMLComponentTest.java 2010-02-24 13:18:09 UTC (rev 20470)
@@ -10,7 +10,12 @@
******************************************************************************/
package org.jboss.tools.struts.vpe.struts.test;
+import java.util.HashMap;
+
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.vpe.ui.test.ProjectsLoader;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -50,7 +55,35 @@
}
public void testImage() throws Throwable {
- performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
+ /*
+ * XXX temporary code is used to debug Struts tests on Hudson.
+ * It must be removed when the problem with the failing tests is resolved.
+ */
+ StringBuilder debugInfo = new StringBuilder();
+ debugInfo.append("projectNameToPath = ")
+ .append(ProjectsLoader.getInstance().getProjectNameToPath())
+ .append(";\n");
+
+ IProject project = ProjectsLoader.getInstance().getProject(IMPORT_PROJECT_NAME);
+ assertNotNull(debugInfo.toString(), project);
+ debugInfo.append("project = ").append(project).append(";\n")
+ .append("project.exists() = ").append(project.exists()).append(";\n")
+ .append("project.isOpen() = ").append(project.isOpen()).append(";\n");
+
+ IFolder folder = project.getFolder("WebContent/pages");
+ assertNotNull(debugInfo.toString(), folder);
+ debugInfo.append("folder = ").append(folder).append(";\n")
+ .append("folder.exists() = ").append(folder.exists()).append(";\n");
+
+ IFile testFile = (IFile) folder.findMember("components/html/image.jsp");
+ assertNotNull(debugInfo.toString(), testFile);
+ debugInfo.append("testFile = ").append(folder).append(";\n")
+ .append("testFile.exists() = ").append(testFile.exists()).append(";\n");
+
+ performTestForVpeComponent(testFile);
+ fail(debugInfo.toString());
+
+ // performTestForVpeComponent((IFile)TestUtil.getComponentPath("components/html/image.jsp", IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testImg() throws Throwable {
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java 2010-02-24 13:16:28 UTC (rev 20469)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ProjectsLoader.java 2010-02-24 13:18:09 UTC (rev 20470)
@@ -168,4 +168,13 @@
removeProject(project);
}
}
+
+ /*
+ * XXX This temporary method is used to debug Struts tests on Hudson.
+ * It must be removed when the problem with the failing tests is resolved.
+ */
+ @Deprecated
+ public Map<String, String> getProjectNameToPath() {
+ return projectNameToPath;
+ }
}
14 years, 3 months
JBoss Tools SVN: r20469 - branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 08:16:28 -0500 (Wed, 24 Feb 2010)
New Revision: 20469
Modified:
branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5873
Modified: branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
===================================================================
--- branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2010-02-24 13:13:49 UTC (rev 20468)
+++ branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2010-02-24 13:16:28 UTC (rev 20469)
@@ -80,7 +80,7 @@
String name = attrs[j].getName();
String xml = attrs[j].getXMLName();
if(xml == null || xml.length() == 0) continue;
- String value = attr.get(xml);
+ String value = attr.remove(xml);
if(value == null || value.length() == 0) {
value = attrs[j].getDefaultValue();
}
@@ -88,6 +88,17 @@
a.setAttributeValue(name, value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ attr.remove("#text");
+ StringBuffer sb = new StringBuffer();
+ for (String n: attr.keySet()) {
+ String v = attr.get(n);
+ if(sb.length() > 0) sb.append(';');
+ sb.append(n).append('=').append(v);
+ }
+ a.setAttributeValue("attributes", sb.toString());
+ }
+
XModelObject[] cs = any.getChildren();
if(cs.length > 0 && a.getModelEntity().getChildren().length > 0) {
//TODO consider case of several child entities, possibly including AnyElement
@@ -139,6 +150,13 @@
sb.append(xml).append('=').append(value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ String as = specific.getAttributeValue("attributes");
+ if(as.length() > 0) {
+ if(sb.length() > 0) sb.append(';');
+ sb.append(as);
+ }
+ }
String attributes = sb.toString();
t.setAttributeValue("attributes", attributes);
t.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + (index + 1));
14 years, 3 months
JBoss Tools SVN: r20468 - in trunk/esb/plugins/org.jboss.tools.esb.core: src/org/jboss/tools/esb/core/model/converters and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 08:13:49 -0500 (Wed, 24 Feb 2010)
New Revision: 20468
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5873
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-02-24 12:59:31 UTC (rev 20467)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-02-24 13:13:49 UTC (rev 20468)
@@ -3049,6 +3049,9 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
name="class" xmlname="class"/>
+ <XModelAttribute PROPERTIES="any=true" name="attributes">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -3062,6 +3065,14 @@
<AttributeData AttributeName="tag"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="support=org.jboss.tools.common.meta.action.impl.handlers.AddAttributeToAnyElementSupport"
+ displayName="Add Attribute..." kind="action" name="CreateAttribute">
+ <EntityData EntityName="AnyElementNew">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
<XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2010-02-24 12:59:31 UTC (rev 20467)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2010-02-24 13:13:49 UTC (rev 20468)
@@ -80,7 +80,7 @@
String name = attrs[j].getName();
String xml = attrs[j].getXMLName();
if(xml == null || xml.length() == 0) continue;
- String value = attr.get(xml);
+ String value = attr.remove(xml);
if(value == null || value.length() == 0) {
value = attrs[j].getDefaultValue();
}
@@ -88,6 +88,17 @@
a.setAttributeValue(name, value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ attr.remove("#text");
+ StringBuffer sb = new StringBuffer();
+ for (String n: attr.keySet()) {
+ String v = attr.get(n);
+ if(sb.length() > 0) sb.append(';');
+ sb.append(n).append('=').append(v);
+ }
+ a.setAttributeValue("attributes", sb.toString());
+ }
+
XModelObject[] cs = any.getChildren();
if(cs.length > 0 && a.getModelEntity().getChildren().length > 0) {
//TODO consider case of several child entities, possibly including AnyElement
@@ -139,6 +150,13 @@
sb.append(xml).append('=').append(value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ String as = specific.getAttributeValue("attributes");
+ if(as.length() > 0) {
+ if(sb.length() > 0) sb.append(';');
+ sb.append(as);
+ }
+ }
String attributes = sb.toString();
t.setAttributeValue("attributes", attributes);
t.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + (index + 1));
14 years, 3 months
JBoss Tools SVN: r20467 - branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 07:59:31 -0500 (Wed, 24 Feb 2010)
New Revision: 20467
Modified:
branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5835
Modified: branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-02-24 12:56:33 UTC (rev 20466)
+++ branches/jbosstools-3.1.x/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-02-24 12:59:31 UTC (rev 20467)
@@ -226,7 +226,12 @@
String resolveValue(String value, String dirtyvalue) {
if(dirtyvalue == null) return value;
if(dirtyvalue.trim().equals(value)) return dirtyvalue;
- if(dirtyvalue.indexOf(INTERNAL_SEPARATOR) < 0) return value;
+ if(dirtyvalue.indexOf(INTERNAL_SEPARATOR) < 0) {
+ if(value.equals(convertDirtyValue(dirtyvalue))) {
+ return dirtyvalue;
+ }
+ return value;
+ }
StringTokenizer st = new StringTokenizer(dirtyvalue, INTERNAL_SEPARATOR, true);
StringBuffer cv = new StringBuffer();
StringBuffer dv = new StringBuffer();
@@ -248,8 +253,25 @@
dv.append(t);
}
}
- return value.equals(cv.toString()) ? dv.toString() : value;
+ if(value.equals(cv.toString())) {
+ return dv.toString();
+ }
+ if(value.equals(convertDirtyValue(cv.toString()))) {
+ return dv.toString();
+ }
+ return value;
}
+
+ String convertDirtyValue(String dirtyvalue) {
+ ByteArrayInputStream sr = new ByteArrayInputStream(("a=" + dirtyvalue).getBytes());
+ Properties p = new Properties();
+ try {
+ p.load(sr);
+ } catch (IOException e) {
+ //ignore
+ }
+ return p.getProperty("a");
+ }
public void edit(XModelObject object, String body) {
XModelObject c = object.copy(0);
14 years, 3 months
JBoss Tools SVN: r20466 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 07:56:33 -0500 (Wed, 24 Feb 2010)
New Revision: 20466
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5835
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-02-24 12:36:41 UTC (rev 20465)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2010-02-24 12:56:33 UTC (rev 20466)
@@ -226,7 +226,12 @@
String resolveValue(String value, String dirtyvalue) {
if(dirtyvalue == null) return value;
if(dirtyvalue.trim().equals(value)) return dirtyvalue;
- if(dirtyvalue.indexOf(INTERNAL_SEPARATOR) < 0) return value;
+ if(dirtyvalue.indexOf(INTERNAL_SEPARATOR) < 0) {
+ if(value.equals(convertDirtyValue(dirtyvalue))) {
+ return dirtyvalue;
+ }
+ return value;
+ }
StringTokenizer st = new StringTokenizer(dirtyvalue, INTERNAL_SEPARATOR, true);
StringBuffer cv = new StringBuffer();
StringBuffer dv = new StringBuffer();
@@ -248,8 +253,25 @@
dv.append(t);
}
}
- return value.equals(cv.toString()) ? dv.toString() : value;
+ if(value.equals(cv.toString())) {
+ return dv.toString();
+ }
+ if(value.equals(convertDirtyValue(cv.toString()))) {
+ return dv.toString();
+ }
+ return value;
}
+
+ String convertDirtyValue(String dirtyvalue) {
+ ByteArrayInputStream sr = new ByteArrayInputStream(("a=" + dirtyvalue).getBytes());
+ Properties p = new Properties();
+ try {
+ p.load(sr);
+ } catch (IOException e) {
+ //ignore
+ }
+ return p.getProperty("a");
+ }
public void edit(XModelObject object, String body) {
XModelObject c = object.copy(0);
14 years, 3 months
JBoss Tools SVN: r20465 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-02-24 07:36:41 -0500 (Wed, 24 Feb 2010)
New Revision: 20465
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5873
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java 2010-02-24 11:25:27 UTC (rev 20464)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/AddAttributeToAnyElementSupport.java 2010-02-24 12:36:41 UTC (rev 20465)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.model.impl.AnyElementObjectImpl;
public class AddAttributeToAnyElementSupport extends SpecialWizardSupport {
+ static String ATTRIBUTES = "attributes"; //$NON-NLS-1$
Set<String> attributes = new HashSet<String>();
boolean edit = false;
String initialName = null;
@@ -30,7 +31,7 @@
public void reset() {
attributes.clear();
- String[][] as = ((AnyElementObjectImpl)getTarget()).getAttributes();
+ String[][] as = getAttributes();
for (int i = 0; i < as.length; i++) {
attributes.add(as[i][0]);
}
@@ -63,11 +64,11 @@
String value = p.getProperty("value"); //$NON-NLS-1$
String as = ""; //$NON-NLS-1$
if(!edit) {
- as = getTarget().getAttributeValue("attributes"); //$NON-NLS-1$
+ as = getTarget().getAttributeValue(ATTRIBUTES);
if(as.length() > 0) as += AnyElementObjectImpl.SEPARATOR;
as += name + "=" + value; //$NON-NLS-1$
} else {
- String[][] attrs = ((AnyElementObjectImpl)getTarget()).getAttributes();
+ String[][] attrs = getAttributes();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < attrs.length; i++) {
if(sb.length() > 0) sb.append(AnyElementObjectImpl.SEPARATOR);
@@ -76,7 +77,7 @@
}
as = sb.toString();
}
- getTarget().getModel().editObjectAttribute(getTarget(), "attributes", as); //$NON-NLS-1$
+ getTarget().getModel().editObjectAttribute(getTarget(), ATTRIBUTES, as);
}
protected DefaultWizardDataValidator validator = new Validator();
@@ -106,5 +107,14 @@
public boolean isFieldEditorEnabled(int stepId, String name, Properties values) {
return !edit || !name.equals(XModelObjectConstants.ATTR_NAME);
}
-
+
+ public String[][] getAttributes() {
+ XModelObject o = getTarget();
+ if(!(o instanceof AnyElementObjectImpl)) {
+ o = o.getModel().createModelObject("AnyElement", null); //$NON-NLS-1$
+ o.setAttributeValue(ATTRIBUTES, getTarget().getAttributeValue(ATTRIBUTES));
+ }
+
+ return ((AnyElementObjectImpl)o).getAttributes();
+ }
}
14 years, 3 months