JBoss Tools SVN: r11238 - trunk/struts/plugins/org.jboss.tools.struts.debug/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-28 11:47:28 -0400 (Tue, 28 Oct 2008)
New Revision: 11238
Modified:
trunk/struts/plugins/org.jboss.tools.struts.debug/resources/meta/struts_bp.meta
Log:
JBIDE-2969
Modified: trunk/struts/plugins/org.jboss.tools.struts.debug/resources/meta/struts_bp.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.debug/resources/meta/struts_bp.meta 2008-10-28 15:47:20 UTC (rev 11237)
+++ trunk/struts/plugins/org.jboss.tools.struts.debug/resources/meta/struts_bp.meta 2008-10-28 15:47:28 UTC (rev 11238)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts BP" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="StrutsBP" VERSION="1.0"/>
<MAPPINGS/>
<ICONS/>
<GlobalActions kind="list"/>
16 years, 2 months
JBoss Tools SVN: r11237 - trunk/struts/plugins/org.jboss.tools.struts/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-28 11:47:20 -0400 (Tue, 28 Oct 2008)
New Revision: 11237
Modified:
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts10.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts11.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts12.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsgen11.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsprojects.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutswizards.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator11.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_rules.meta
trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_wizard.meta
Log:
JBIDE-2969
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="AttributeEditor">
<PAIR name="ActiveTextEditor" value="org.jboss.tools.common.model.ui.attribute.editor.StringEditor"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts10.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts10.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts10.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="Handlers">
<PAIR name="CreateConfigElement" value="org.jboss.tools.struts.model.handlers.CreateConfigElementHandler"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts11.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts11.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts11.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="FileVersions">
<PAIR name="StrutsConfig1.1" value="StrutsConfig11"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts12.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts12.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/struts12.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.0"/>
<MAPPINGS/>
<ICONS/>
<GlobalActions kind="list"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsgen11.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsgen11.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsgen11.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="AttributeEditor">
<PAIR name="AccessibleJava2" value="org.jboss.tools.common.model.ui.attribute.editor.StringEditor"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsprojects.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsprojects.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutsprojects.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="FilteredTreeConstraints">
<PAIR name="StrutsProjects$1" value="org.jboss.tools.struts.model.pv.StrutsProjectsTreeConstraint"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutswizards.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutswizards.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/strutswizards.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION MODULE="Struts Editor" VERSION="1.0"/>
+ <VERSION MODULE="Struts" VERSION="1.0"/>
<MAPPINGS>
<MAPPING name="AttributeEditor">
<PAIR name="StrutsPathEditor" value="org.jboss.tools.common.model.ui.attribute.editor.StringEditor"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator11.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator11.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator11.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.1"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.1"/>
<MAPPINGS>
<MAPPING name="FileVersions">
<PAIR name="Validation1.1.3" value="FileValidationRules11"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_rules.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_rules.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_rules.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -2,7 +2,7 @@
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
"meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.1"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.1"/>
<MAPPINGS>
<MAPPING name="AttributeEditor">
<PAIR name="CountriesList" value="org.jboss.tools.common.model.ui.attribute.editor.StringEditor"/>
Modified: trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_wizard.meta
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_wizard.meta 2008-10-28 15:47:03 UTC (rev 11236)
+++ trunk/struts/plugins/org.jboss.tools.struts/resources/meta/validator_wizard.meta 2008-10-28 15:47:20 UTC (rev 11237)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.1"/>
+ <VERSION DEPENDS="Model:1.0" MODULE="Struts" VERSION="1.1"/>
<MAPPINGS/>
<ICONS>
<GROUP name="action">
16 years, 2 months
JBoss Tools SVN: r11236 - trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-28 11:47:03 -0400 (Tue, 28 Oct 2008)
New Revision: 11236
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
JBIDE-2969
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-28 10:53:03 UTC (rev 11235)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-28 15:47:03 UTC (rev 11236)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
<XModelEntityGroup>
- <VERSION MODULE="Model" VERSION="1.0"/>
+ <VERSION MODULE="VPE" VERSION="1.0"/>
<MAPPINGS/>
<ICONS/>
<GlobalActions kind="list"/>
@@ -172,10 +172,7 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute name="location" xmlname="location">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="location" xmlname="location"/>
<XModelAttribute PROPERTIES="border=true"
default="Folder: Any Page at the Same Folder" name="scope" xmlname="scope">
<Constraint loader="ListString">
@@ -232,10 +229,11 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute name="location" xmlname="location">
- <Constraint/>
+ <Constraint loader="ListString">
+ <value name="Global: For all projects in workspace"/>
+ </Constraint>
<Editor/>
</XModelAttribute>
- <value name="Global: For all projects in workspace"/>
<XModelAttribute name="prefix">
<Constraint/>
<Editor/>
16 years, 2 months
JBoss Tools SVN: r11235 - trunk/jsf/docs/userguide/en/images/editors_features.
by jbosstools-commits@lists.jboss.org
Author: msorokin
Date: 2008-10-28 06:53:03 -0400 (Tue, 28 Oct 2008)
New Revision: 11235
Modified:
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_2.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_6.png
Log:
Corrected the images
https://jira.jboss.org/jira/browse/JBDS-416
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_2.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_6.png
===================================================================
(Binary files differ)
16 years, 2 months
JBoss Tools SVN: r11234 - trunk/esb/plugins/org.jboss.tools.esb.project.core.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-28 04:35:41 -0400 (Tue, 28 Oct 2008)
New Revision: 11234
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
Log:
JBIDE-3014: ESB facet can be enabled on everything
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-28 08:34:26 UTC (rev 11233)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-28 08:35:41 UTC (rev 11234)
@@ -12,7 +12,57 @@
<project-facet-version
facet="jst.jboss.esb"
version="4.2">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
</project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.4">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.3">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
<action
facet="jst.jboss.esb"
id="jst.jboss.esb.install"
@@ -24,10 +74,6 @@
class="org.jboss.tools.esb.core.facet.JBossESBFacetDataModelProvider">
</config-factory>
</action>
- <project-facet-version
- facet="jst.jboss.esb"
- version="4.3">
- </project-facet-version>
<template
id="template.jst.jboss.esb">
<label>
@@ -40,10 +86,6 @@
facet="jst.jboss.esb">
</fixed>
</template>
- <project-facet-version
- facet="jst.jboss.esb"
- version="4.4">
- </project-facet-version>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
16 years, 2 months
JBoss Tools SVN: r11233 - branches/jbosstools-3.0.0.Beta1/esb/plugins/org.jboss.tools.esb.project.core.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-28 04:34:26 -0400 (Tue, 28 Oct 2008)
New Revision: 11233
Modified:
branches/jbosstools-3.0.0.Beta1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
Log:
JBIDE-3014: ESB facet can be enabled on everything
Modified: branches/jbosstools-3.0.0.Beta1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- branches/jbosstools-3.0.0.Beta1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-28 08:09:14 UTC (rev 11232)
+++ branches/jbosstools-3.0.0.Beta1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-28 08:34:26 UTC (rev 11233)
@@ -12,7 +12,57 @@
<project-facet-version
facet="jst.jboss.esb"
version="4.2">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
</project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.4">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.3">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
<action
facet="jst.jboss.esb"
id="jst.jboss.esb.install"
@@ -24,10 +74,6 @@
class="org.jboss.tools.esb.core.facet.JBossESBFacetDataModelProvider">
</config-factory>
</action>
- <project-facet-version
- facet="jst.jboss.esb"
- version="4.3">
- </project-facet-version>
<template
id="template.jst.jboss.esb">
<label>
@@ -40,10 +86,6 @@
facet="jst.jboss.esb">
</fixed>
</template>
- <project-facet-version
- facet="jst.jboss.esb"
- version="4.4">
- </project-facet-version>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
16 years, 2 months
JBoss Tools SVN: r11232 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui: icons/full/obj16 and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-28 04:09:14 -0400 (Tue, 28 Oct 2008)
New Revision: 11232
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelResolveCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/AbstractSmooksPropertySection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/AbstractXMLModelAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLTargetModelAnalyzer.java
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Java2JavaResolveCommand.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/esb16.png
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ConnectionPropertySection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
Log:
JBIDE-2992
Add a new property section to edit the instance class name
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/icons/full/obj16/esb16.png
===================================================================
(Binary files differ)
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2008-10-28 08:09:14 UTC (rev 11232)
@@ -167,8 +167,13 @@
</mappingAnalyzer>
<sourceModelAnalyzer
class="org.jboss.tools.smooks.xml2java.analyzer.XMLSourceModelAnalyzer"
- name="XML"
+ name="XML Source"
typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
</sourceModelAnalyzer>
+ <targetModelAnalyzer
+ class="org.jboss.tools.smooks.xml2java.analyzer.XMLTargetModelAnalyzer"
+ name="XML Target"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ </targetModelAnalyzer>
</extension>
</plugin>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -42,7 +42,7 @@
private IEditorInput input;
protected Resource graphicalFileResource;
-
+
private IFile file = null;
/**
@@ -114,6 +114,12 @@
public void doSave(IProgressMonitor monitor, String sourceid,
String targetid) throws IOException, CoreException {
+ this.doSave(monitor, sourceid,targetid,null);
+ }
+
+ public void doSave(IProgressMonitor monitor, String sourceid,
+ String targetid, Properties properties) throws IOException,
+ CoreException {
GraphInformations graph = null;
if (graphicalFileResource != null) {
if (graphicalFileResource.getContents().isEmpty()) {
@@ -125,10 +131,15 @@
}
if (graph != null) {
initMappingTypes(graph, sourceid, targetid);
+ Params params = GraphicalFactory.eINSTANCE.createParams();
+ graph.setParams(params);
+ initParams(params, properties);
}
graphicalFileResource.save(Collections.EMPTY_MAP);
- if(this.file != null) file.refreshLocal(IResource.DEPTH_ONE, monitor);
+ if (this.file != null)
+ file.refreshLocal(IResource.DEPTH_ONE, monitor);
}
+
}
public void doSave(IProgressMonitor monitor,
@@ -136,36 +147,18 @@
CoreException {
String sourceID = context.getSourceDataTypeID();
String targetID = context.getTargetDataTypeID();
- GraphInformations graph = null;
- if (graphicalFileResource != null) {
- if (graphicalFileResource.getContents().isEmpty()) {
- graph = GraphicalFactory.eINSTANCE.createGraphInformations();
- graphicalFileResource.getContents().add(graph);
- } else {
- graph = (GraphInformations) graphicalFileResource.getContents()
- .get(0);
- }
- if (graph != null) {
- initMappingTypes(graph, sourceID, targetID);
- Params params = GraphicalFactory.eINSTANCE.createParams();
- graph.setParams(params);
- initParams(params, context);
- }
- graphicalFileResource.save(Collections.EMPTY_MAP);
- if(this.file != null) file.refreshLocal(IResource.DEPTH_ONE, monitor);
- }
-
+ Properties properties = context.getProperties();
+ this.doSave(monitor, sourceID,targetID,properties);
}
- private void initParams(Params params,
- SmooksConfigurationFileGenerateContext context) {
- Properties pros = context.getProperties();
- Enumeration<Object> keys = pros.keys();
+ private void initParams(Params params, Properties properties) {
+ if(properties == null) return;
+ Enumeration<Object> keys = properties.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
Param param = GraphicalFactory.eINSTANCE.createParam();
param.setName(key);
- param.setValue(pros.getProperty(key));
+ param.setValue(properties.getProperty(key));
params.getParam().add(param);
}
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Java2JavaResolveCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Java2JavaResolveCommand.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Java2JavaResolveCommand.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -1,74 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.javabean.analyzer;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.tools.smooks.analyzer.ResolveCommand;
-import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
-import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
-import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
-
-/**
- * @author Dart
- *
- */
-public class Java2JavaResolveCommand extends ResolveCommand {
-
- private AbstractStructuredDataModel sourceModel;
-
- private AbstractStructuredDataModel targetModel;
-
- private List<LineConnectionModel> disconnectionModel = new ArrayList<LineConnectionModel>();
-
- public void addDisconnectionModel(LineConnectionModel line){
- disconnectionModel.add(line);
- }
-
- public AbstractStructuredDataModel getSourceModel() {
- return sourceModel;
- }
-
- public void setSourceModel(AbstractStructuredDataModel sourceModel) {
- this.sourceModel = sourceModel;
- }
-
- public AbstractStructuredDataModel getTargetModel() {
- return targetModel;
- }
-
- public void setTargetModel(AbstractStructuredDataModel targetModel) {
- this.targetModel = targetModel;
- }
-
- public Java2JavaResolveCommand(
- SmooksConfigurationFileGenerateContext context) {
- super(context);
- }
-
- @Override
- public void execute() throws Exception {
- SmooksConfigurationFileGenerateContext context = getContext();
- if(context == null) throw new RuntimeException("Smooks generated context is NULL");
- if(sourceModel != null && targetModel != null){
- LineConnectionModel connectionModel = new LineConnectionModel();
- connectionModel
- .setSource((IConnectableModel) sourceModel);
- connectionModel
- .setTarget((IConnectableModel) targetModel);
- connectionModel.connect();
- return;
- }
- if(!disconnectionModel.isEmpty()){
- for (Iterator<LineConnectionModel> iterator = disconnectionModel.iterator(); iterator.hasNext();) {
- LineConnectionModel connection = (LineConnectionModel) iterator.next();
- connection.disConnect();
- }
- return;
- }
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -367,104 +367,6 @@
}
- private DesignTimeAnalyzeResult[] checkOtherNodeConnected(
- SmooksConfigurationFileGenerateContext context) {
- GraphRootModel root = context.getGraphicalRootModel();
- List sourceList = root.loadSourceModelList();
- List targetList = root.loadTargetModelList();
- List<DesignTimeAnalyzeResult> arList = new ArrayList<DesignTimeAnalyzeResult>();
- for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
- AbstractStructuredDataModel targetm = (AbstractStructuredDataModel) iterator
- .next();
- if (targetm instanceof IConnectableModel) {
- if (((IConnectableModel) targetm).getModelTargetConnections()
- .isEmpty()) {
- continue;
- }
-
- JavaBeanModel javaModel = (JavaBeanModel) targetm
- .getReferenceEntityModel();
- JavaBeanModel parent = javaModel.getParent();
- if (parent != null) {
- AbstractStructuredDataModel pgm = UIUtils.findGraphModel(
- root, parent);
- if (pgm != null && pgm instanceof IConnectableModel) {
- if (((IConnectableModel) pgm)
- .getModelTargetConnections().isEmpty()) {
- String errorMessage = "The parent of Java node \""
- + javaModel.getName()
- + "\" : \""
- + parent.getName()
- + "\" doesn't be connected by any source node";
- DesignTimeAnalyzeResult dr = new DesignTimeAnalyzeResult();
- dr.setErrorMessage(errorMessage);
- createResolveCommand(dr, context, javaModel, parent);
- arList.add(dr);
- }
- }
- }
- }
- }
- return arList.toArray(new DesignTimeAnalyzeResult[0]);
- }
-
- private void createResolveCommand(DesignTimeAnalyzeResult result,
- SmooksConfigurationFileGenerateContext context,
- JavaBeanModel currentNode, JavaBeanModel parentNode) {
- GraphRootModel root = context.getGraphicalRootModel();
- HashMap<AbstractStructuredDataModel, AbstractStructuredDataModel> tempMap = new HashMap<AbstractStructuredDataModel, AbstractStructuredDataModel>();
- // Disconnect all connections command
- Java2JavaResolveCommand disconnectCommand = new Java2JavaResolveCommand(
- context);
- CompositeResolveCommand compositeCommand = new CompositeResolveCommand(
- context);
- compositeCommand.setResolveDescription("Connect all needed connections");
- disconnectCommand
- .setResolveDescription("Disconnect all connections of the current \""
- + currentNode.getName() + "\"node");
- AbstractStructuredDataModel targetNode = UIUtils.findGraphModel(root,
- currentNode);
- if (targetNode instanceof IConnectableModel) {
- List<Object> connections = ((IConnectableModel) targetNode)
- .getModelTargetConnections();
- for (Iterator iterator = connections.iterator(); iterator.hasNext();) {
- LineConnectionModel line = (LineConnectionModel) iterator
- .next();
- AbstractStructuredDataModel source = (AbstractStructuredDataModel) line
- .getSource();
- JavaBeanModel sourceBean = (JavaBeanModel) source
- .getReferenceEntityModel();
- JavaBeanModel sourceParent = sourceBean.getParent();
- if (sourceParent == null) {
- sourceParent = sourceBean;
- }
- AbstractStructuredDataModel sourceParentNode = UIUtils
- .findGraphModel(root, sourceParent);
- // Connect the parent command
- AbstractStructuredDataModel targetParentNode = UIUtils
- .findGraphModel(root, parentNode);
- if (tempMap.get(sourceParentNode) == null) {
- Java2JavaResolveCommand connectParent = new Java2JavaResolveCommand(
- context);
- connectParent.setResolveDescription("Connect the \""
- + sourceParent.getName() + "\" to the \""
- + parentNode.getName() + "\"");
- connectParent.setSourceModel(sourceParentNode);
- connectParent.setTargetModel(targetParentNode);
- result.addResolveCommand(connectParent);
- tempMap.put(sourceParentNode,targetParentNode);
- compositeCommand.addCommand(connectParent);
- }
-
- disconnectCommand.addDisconnectionModel(line);
- }
- }
- result.addResolveCommand(disconnectCommand);
- if (!compositeCommand.isEmpty()) {
- result.addResolveCommand(compositeCommand);
- }
- }
-
/**
* If root node don't connect , it will ask user to connect them .
*
@@ -791,16 +693,28 @@
isError = true;
}
if (model != null) {
+ setCollectionsInstanceClassName(model, current);
this.setSelectorIsUsed(rootClassName);
buildSourceInputProperties(listType, model, false, isError,
current, classLoader);
}
- List list = new ArrayList();
+ List<JavaBeanModel> list = new ArrayList<JavaBeanModel>();
if (model != null)
list.add(model);
return list;
}
+ private void setCollectionsInstanceClassName(JavaBeanModel model,
+ ResourceConfigType resourceConfig) {
+ if (Collection.class.isAssignableFrom(model.getBeanClass())) {
+ String instanceName = SmooksModelUtils.getParmaText("beanClass",
+ resourceConfig);
+ if (instanceName != null) {
+ model.setBeanClassString(instanceName);
+ }
+ }
+ }
+
public Object buildSourceInputObjects(GraphInformations graphInfo,
SmooksResourceListType listType, IFile sourceFile)
throws InvocationTargetException {
@@ -1016,6 +930,7 @@
model = new JavaBeanModel(null, referenceSelector);
model.setError("don't exist");
model.setProperties(new ArrayList());
+ setCollectionsInstanceClassName(model, resourceConfig);
}
if (currentModel.getError() != null) {
currentModel.addProperty(model);
@@ -1102,6 +1017,11 @@
public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
checkRootNodeConnected(context);
- return checkOtherNodeConnected(context);
+ List<DesignTimeAnalyzeResult> typeCheckResults = UIUtils
+ .checkTargetJavaModelType(context);
+ List<DesignTimeAnalyzeResult> connectionCheckResults = UIUtils
+ .checkJavaModelNodeConnection(context);
+ typeCheckResults.addAll(connectionCheckResults);
+ return typeCheckResults.toArray(new DesignTimeAnalyzeResult[] {});
}
}
Copied: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java (from rev 11230, trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/Java2JavaResolveCommand.java)
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -0,0 +1,74 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.javabean.analyzer;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.tools.smooks.analyzer.ResolveCommand;
+import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+
+/**
+ * @author Dart
+ *
+ */
+public class JavaModelConnectionResolveCommand extends ResolveCommand {
+
+ private AbstractStructuredDataModel sourceModel;
+
+ private AbstractStructuredDataModel targetModel;
+
+ private List<LineConnectionModel> disconnectionModel = new ArrayList<LineConnectionModel>();
+
+ public void addDisconnectionModel(LineConnectionModel line){
+ disconnectionModel.add(line);
+ }
+
+ public AbstractStructuredDataModel getSourceModel() {
+ return sourceModel;
+ }
+
+ public void setSourceModel(AbstractStructuredDataModel sourceModel) {
+ this.sourceModel = sourceModel;
+ }
+
+ public AbstractStructuredDataModel getTargetModel() {
+ return targetModel;
+ }
+
+ public void setTargetModel(AbstractStructuredDataModel targetModel) {
+ this.targetModel = targetModel;
+ }
+
+ public JavaModelConnectionResolveCommand(
+ SmooksConfigurationFileGenerateContext context) {
+ super(context);
+ }
+
+ @Override
+ public void execute() throws Exception {
+ SmooksConfigurationFileGenerateContext context = getContext();
+ if(context == null) throw new RuntimeException("Smooks generated context is NULL");
+ if(sourceModel != null && targetModel != null){
+ LineConnectionModel connectionModel = new LineConnectionModel();
+ connectionModel
+ .setSource((IConnectableModel) sourceModel);
+ connectionModel
+ .setTarget((IConnectableModel) targetModel);
+ connectionModel.connect();
+ return;
+ }
+ if(!disconnectionModel.isEmpty()){
+ for (Iterator<LineConnectionModel> iterator = disconnectionModel.iterator(); iterator.hasNext();) {
+ LineConnectionModel connection = (LineConnectionModel) iterator.next();
+ connection.disConnect();
+ }
+ return;
+ }
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelConnectionResolveCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelResolveCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelResolveCommand.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelResolveCommand.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -0,0 +1,45 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.javabean.analyzer;
+
+import org.jboss.tools.smooks.analyzer.ResolveCommand;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+
+/**
+ * @author Dart
+ *
+ */
+public class JavaModelResolveCommand extends ResolveCommand {
+
+ private String instanceName = null;
+
+ private JavaBeanModel javaBean;
+
+ public JavaBeanModel getJavaBean() {
+ return javaBean;
+ }
+
+ public void setJavaBean(JavaBeanModel javaBean) {
+ this.javaBean = javaBean;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public void setInstanceName(String instanceName) {
+ this.instanceName = instanceName;
+ }
+
+ public JavaModelResolveCommand(
+ SmooksConfigurationFileGenerateContext context) {
+ super(context);
+ }
+
+ @Override
+ public void execute() throws Exception {
+ getJavaBean().setBeanClassString(instanceName);
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaModelResolveCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -28,6 +28,12 @@
*/
public class JavaBeanModel implements IValidatable {
+ private String beanClassString = null;
+
+ public void setBeanClassString(String beanClassString) {
+ this.beanClassString = beanClassString;
+ }
+
private Object waring = null;
private Object error = null;
@@ -81,6 +87,9 @@
}
public String getBeanClassString() {
+ if(beanClassString != null){
+ return this.beanClassString;
+ }
Class clazz = this.getBeanClass();
if (clazz == null)
return "<null>";
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -12,16 +12,18 @@
import org.eclipse.gef.EditPart;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.ui.AbstractSmooksPropertySection;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
@@ -29,10 +31,12 @@
* @author Dart Peng
* @Date : Oct 27, 2008
*/
-public class JavaBeanPropertiesSection extends AbstractPropertySection {
+public class JavaBeanPropertiesSection extends AbstractSmooksPropertySection {
private Text beanClassText;
+ private boolean lock = false;
+
@Override
public void createControls(Composite parent,
TabbedPropertySheetPage tabbedPropertySheetPage) {
@@ -54,34 +58,76 @@
controlComposite.setLayout(gl);
- factory.createLabel(controlComposite, "BeanClass");
+ factory.createLabel(controlComposite, "Target instance class name : ");
beanClassText = factory.createText(controlComposite, "");
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
beanClassText.setLayoutData(gd);
+ beanClassText.setEnabled(false);
+ hookBeanClasText();
}
- public void refresh() {
- super.refresh();
- beanClassText.setEnabled(false);
+ private void hookBeanClasText() {
+ beanClassText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent arg0) {
+ JavaBeanModel model = getJavaBeanModel();
+ if (model != null) {
+ model.setBeanClassString(beanClassText.getText());
+ if (isLock())
+ return;
+ fireDirty();
+ refresh();
+ }
+ }
+
+ });
+ }
+
+ public boolean isLock() {
+ return lock;
+ }
+
+ private JavaBeanModel getJavaBeanModel() {
IStructuredSelection selection = (IStructuredSelection) this
.getSelection();
Object obj = selection.getFirstElement();
if (obj == null)
- return;
+ return null;
if (obj instanceof EditPart) {
Object model = ((EditPart) obj).getModel();
if (model instanceof LineConnectionModel) {
AbstractStructuredDataModel target = (AbstractStructuredDataModel) ((LineConnectionModel) model)
.getTarget();
Object referenceObj = target.getReferenceEntityModel();
- if(referenceObj instanceof JavaBeanModel){
- beanClassText.setEnabled(true);
- String className = ((JavaBeanModel)referenceObj).getBeanClass().getName();
- beanClassText.setText(className);
+ if (referenceObj instanceof JavaBeanModel) {
+ return (JavaBeanModel) referenceObj;
}
}
}
+ return null;
}
+ public void refresh() {
+ super.refresh();
+
+ JavaBeanModel model = getJavaBeanModel();
+ if (model != null) {
+ if (!beanClassText.getEnabled())
+ beanClassText.setEnabled(true);
+ String className = model.getBeanClassString();
+ lockEventFire();
+ beanClassText.setText(className);
+ unLockEventFire();
+ }
+ }
+
+ private void unLockEventFire() {
+ lock = false;
+ }
+
+ private void lockEventFire() {
+ lock = true;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -27,6 +27,7 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.SmooksUIActivator;
@@ -34,24 +35,30 @@
* @author Dart Peng
* @Date Aug 5, 2008
*/
-public class NewJavaBeanStrucutredDataWizard extends Wizard implements IStructuredDataCreationWizard,INewWizard{
+public class NewJavaBeanStrucutredDataWizard extends Wizard implements
+ IStructuredDataCreationWizard, INewWizard {
JavaBeanConfigWizardPage page = null;
IJavaProject project = null;
Object result = null;
Properties properties = new Properties();
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@Override
public void addPages() {
super.addPages();
- if(page == null){
+ if (page == null) {
page = new JavaBeanConfigWizardPage(project);
this.addPage(page);
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
@@ -67,12 +74,12 @@
}
public void init(IEditorSite site, IEditorInput input) {
- if(input != null && input instanceof IFileEditorInput){
- IFileEditorInput fi = (IFileEditorInput)input;
+ if (input != null && input instanceof IFileEditorInput) {
+ IFileEditorInput fi = (IFileEditorInput) input;
IProject project = fi.getFile().getProject();
- if(project instanceof IJavaProject){
- this.project = (IJavaProject)project;
- }else{
+ if (project instanceof IJavaProject) {
+ this.project = (IJavaProject) project;
+ } else {
this.project = JavaCore.create(project);
}
}
@@ -87,23 +94,34 @@
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
- if(selection != null){
+ if (selection != null) {
Object obj = selection.getFirstElement();
- if(obj instanceof JavaProject){
- this.project = (JavaProject)obj;
+ if (obj instanceof JavaProject) {
+ this.project = (JavaProject) obj;
}
- if(obj instanceof IResource){
- IProject project = ((IResource)obj).getProject();
+ if (obj instanceof IResource) {
+ IProject project = ((IResource) obj).getProject();
this.project = JavaCore.create(project);
}
-
- if(project == null){
- if(obj instanceof IAdaptable){
- IResource relateResource =(IResource) ((IAdaptable)obj).getAdapter(IResource.class);
+
+ if (project == null) {
+ if (obj instanceof IAdaptable) {
+ IResource relateResource = (IResource) ((IAdaptable) obj)
+ .getAdapter(IResource.class);
IProject project = relateResource.getProject();
this.project = JavaCore.create(project);
}
}
}
}
+
+ public String getStructuredDataSourcePath() {
+ JavaBeanModel model = page.getJavaBeanModel();
+ if (model != null) {
+ Class clazz = model.getBeanClass();
+ if (clazz != null)
+ return clazz.getName();
+ }
+ return null;
+ }
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/AbstractSmooksPropertySection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/AbstractSmooksPropertySection.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/AbstractSmooksPropertySection.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -0,0 +1,35 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.ui;
+
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
+import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
+import org.jboss.tools.smooks.ui.editors.SmooksGraphicalFormPage;
+
+/**
+ * @author Dart
+ *
+ */
+public class AbstractSmooksPropertySection extends AbstractPropertySection {
+ protected void fireDirty() {
+ IStructuredSelection selection = (IStructuredSelection) this
+ .getSelection();
+ Object obj = selection.getFirstElement();
+ if (obj == null)
+ return;
+ if (obj instanceof GraphicalEditPart) {
+ GraphicalViewer viewer = (GraphicalViewer) ((GraphicalEditPart)obj).getViewer();
+ IEditorPart part = ((DefaultEditDomain)viewer.getEditDomain()).getEditorPart();
+ if(part instanceof SmooksGraphicalFormPage){
+ SmooksFormEditor editor = (SmooksFormEditor)((SmooksGraphicalFormPage)part).getEditor();
+ editor.fireEditorDirty(true);
+ }
+ }
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/AbstractSmooksPropertySection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ConnectionPropertySection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ConnectionPropertySection.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/ConnectionPropertySection.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -33,7 +33,6 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataConnectionModel;
@@ -44,7 +43,7 @@
* @author Dart Peng<br>
* Date : Sep 4, 2008
*/
-public class ConnectionPropertySection extends AbstractPropertySection {
+public class ConnectionPropertySection extends AbstractSmooksPropertySection {
private TableViewer tableViewer;
@@ -107,9 +106,11 @@
if (element instanceof PropertyModel && value instanceof String) {
if (property.equals("name")) {
((PropertyModel) element).setName((String) value);
+ fireDirty();
}
if (property.equals("value")) {
((PropertyModel) element).setValue((String) value);
+ fireDirty();
}
refresh();
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStructuredDataCreationWizard.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -13,7 +13,6 @@
import java.util.Properties;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
@@ -31,4 +30,6 @@
public Properties getProperties();
+ public String getStructuredDataSourcePath();
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -24,7 +24,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.ConnectionLayer;
import org.eclipse.emf.ecore.resource.Resource;
@@ -57,6 +56,7 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.wizard.WizardDialog;
@@ -66,15 +66,12 @@
import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.TreeEvent;
import org.eclipse.swt.events.TreeListener;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -86,7 +83,6 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IEditorInput;
@@ -123,7 +119,6 @@
import org.jboss.tools.smooks.model.SmooksFactory;
import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.model.util.SmooksModelConstants;
-import org.jboss.tools.smooks.model.util.SmooksModelUtils;
import org.jboss.tools.smooks.ui.IStructuredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.SmooksUIActivator;
@@ -719,6 +714,13 @@
context.setDataMappingRootModel(this.rootModel);
context.setSmooksConfigFile(((IFileEditorInput) getEditorInput())
.getFile());
+
+ context.setSourceViewerLabelProvider((LabelProvider)sourceViewer.getLabelProvider());
+ context.setSourceViewerContentProvider((ITreeContentProvider)sourceViewer.getContentProvider());
+
+ context.setTargetViewerLabelProvider((LabelProvider)targetViewer.getLabelProvider());
+ context.setTargetViewerContentProvider((ITreeContentProvider)targetViewer.getContentProvider());
+
context.setShell(getSite().getShell());
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -17,6 +17,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.graphical.Param;
import org.jboss.tools.smooks.model.SmooksResourceListType;
@@ -27,8 +29,7 @@
* @Date Aug 18, 2008
*/
public class SmooksConfigurationFileGenerateContext {
-
-
+
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
protected GraphRootModel dataMappingRootModel;
@@ -38,119 +39,183 @@
protected IFile smooksConfigFile = null;
protected EditingDomain domain;
+ protected ITreeContentProvider sourceViewerProvider;
+
+ protected ITreeContentProvider targetViewerProvider;
+
+ protected LabelProvider sourceViewerLabelProvider;
+
+ protected LabelProvider targetViewerLabelProvider;
+
+ public LabelProvider getSourceViewerLabelProvider() {
+ return sourceViewerLabelProvider;
+ }
+
+ public void setSourceViewerLabelProvider(LabelProvider sourceViewerLabelProvider) {
+ this.sourceViewerLabelProvider = sourceViewerLabelProvider;
+ }
+
+ public LabelProvider getTargetViewerLabelProvider() {
+ return targetViewerLabelProvider;
+ }
+
+ public void setTargetViewerLabelProvider(LabelProvider targetViewerLabelProvider) {
+ this.targetViewerLabelProvider = targetViewerLabelProvider;
+ }
+
+ public ITreeContentProvider getSourceViewerProvider() {
+ return sourceViewerProvider;
+ }
+
+ public void setSourceViewerContentProvider(ITreeContentProvider sourceViewerProvider) {
+ this.sourceViewerProvider = sourceViewerProvider;
+ }
+
+ public ITreeContentProvider getTargetViewerProvider() {
+ return targetViewerProvider;
+ }
+
+ public void setTargetViewerContentProvider(ITreeContentProvider targetViewerProvider) {
+ this.targetViewerProvider = targetViewerProvider;
+ }
+
private Shell shell;
-
+
protected String smooksType = null;
+
/**
* @return the sourceDataTypeID
*/
public String getSourceDataTypeID() {
return sourceDataTypeID;
}
+
/**
- * @param sourceDataTypeID the sourceDataTypeID to set
+ * @param sourceDataTypeID
+ * the sourceDataTypeID to set
*/
public void setSourceDataTypeID(String sourceDataTypeID) {
this.sourceDataTypeID = sourceDataTypeID;
}
+
/**
* @return the targetDataTypeID
*/
public String getTargetDataTypeID() {
return targetDataTypeID;
}
+
/**
- * @param targetDataTypeID the targetDataTypeID to set
+ * @param targetDataTypeID
+ * the targetDataTypeID to set
*/
public void setTargetDataTypeID(String targetDataTypeID) {
this.targetDataTypeID = targetDataTypeID;
}
+
/**
* @return the dataMappingRootModel
*/
public GraphRootModel getGraphicalRootModel() {
return dataMappingRootModel;
}
+
/**
- * @param dataMappingRootModel the dataMappingRootModel to set
+ * @param dataMappingRootModel
+ * the dataMappingRootModel to set
*/
public void setDataMappingRootModel(GraphRootModel dataMappingRootModel) {
this.dataMappingRootModel = dataMappingRootModel;
}
+
/**
* @return the smooksType
*/
public String getSmooksType() {
return smooksType;
}
+
/**
- * @param smooksType the smooksType to set
+ * @param smooksType
+ * the smooksType to set
*/
public void setSmooksType(String smooksType) {
this.smooksType = smooksType;
}
+
public SmooksResourceListType getSmooksResourceListModel() {
return smooksResourceListModel;
}
+
public void setSmooksResourceListModel(
SmooksResourceListType smooksResourceListModel) {
this.smooksResourceListModel = smooksResourceListModel;
}
-
- public void addParam(String name,String value){
-
+
+ public void addParam(String name, String value) {
+
}
-
- public void addParam(Param param){
-
+
+ public void addParam(Param param) {
+
}
+
public EditingDomain getDomain() {
return domain;
}
+
public void setDomain(EditingDomain domain) {
this.domain = domain;
}
+
public List getGeneratorResourceList() {
return generatorResourceList;
}
+
public void setGeneratorResourceList(List generatorResourceList) {
this.generatorResourceList = generatorResourceList;
}
-
- public void putProperty(String paramName,String paramValue){
+
+ public void putProperty(String paramName, String paramValue) {
properties.setProperty(paramName, paramValue);
}
-
- public String getProperty(String paramName){
+
+ public String getProperty(String paramName) {
return properties.getProperty(paramName);
}
-
- public void cleanProperties(){
+
+ public void cleanProperties() {
properties.clear();
}
+
public IFile getSmooksConfigFile() {
return smooksConfigFile;
}
+
public void setSmooksConfigFile(IFile smooksConfigFile) {
this.smooksConfigFile = smooksConfigFile;
}
+
public Properties getProperties() {
return properties;
}
-
- public void addProperties(Properties properties){
- if(properties == null) return;
+
+ public void addProperties(Properties properties) {
+ if (properties == null)
+ return;
Enumeration keys = properties.keys();
- while(keys.hasMoreElements()){
+ while (keys.hasMoreElements()) {
Object key = keys.nextElement();
this.properties.put(key, properties.get(key));
}
}
+
public Shell getShell() {
return shell;
}
+
public void setShell(Shell shell) {
this.shell = shell;
}
-
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -6,6 +6,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -42,6 +43,10 @@
public class SmooksConfigFileNewWizard extends Wizard implements INewWizard,
ISmooksDataCreationAddtionWizard {
+ public static final String PRO_SOURCE_DATA_PATH = "sourceDataPath";
+
+ public static final String PRO_TARGET_DATA_PATH = "targetDataPath";
+
private SmooksConfigFileNewWizardPage page;
private TypeIDSelectionWizardPage typeIDPage;
@@ -60,7 +65,8 @@
super();
setNeedsProgressMonitor(true);
super.setWindowTitle("New Smooks Configuration File");
- setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
+ setDefaultPageImageDescriptor(ModelUIImages
+ .getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
}
/**
@@ -118,9 +124,10 @@
private void doFinish(final IFile file, IProgressMonitor monitor)
throws CoreException {
// create a sample file
- String sourceTypeID = typeIDPage.getSourceID();
- String targetTypeID = typeIDPage.getTargetID();
-
+ final String sourceTypeID = typeIDPage.getSourceID();
+ final String targetTypeID = typeIDPage.getTargetID();
+ final String[] sourceDataPath = new String[] { null };
+ final String[] targetDataPath = new String[] { null };
try {
InputStream stream = openContentStream();
if (file.exists()) {
@@ -129,11 +136,12 @@
file.create(stream, true, monitor);
}
stream.close();
- GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
- file);
- ginforSave.doSave(monitor, sourceTypeID, targetTypeID);
} catch (IOException e) {
+ // ignore
}
+ final GraphicalInformationSaver ginforSave = new GraphicalInformationSaver(
+ file);
+
monitor.worked(1);
monitor.setTaskName("Opening file for editing...");
getShell().getDisplay().asyncExec(new Runnable() {
@@ -156,32 +164,41 @@
if (sourceWizard instanceof IStructuredDataCreationWizard) {
Object sourceObj = ((IStructuredDataCreationWizard) sourceWizard)
.getTreeViewerInputContents();
-// if (sourceObj instanceof List) {
-// if (!((List) sourceObj).isEmpty()) {
-// sourceObj = ((List) sourceObj).get(0);
-// }
-// }
+ sourceDataPath[0] = ((IStructuredDataCreationWizard) sourceWizard)
+ .getStructuredDataSourcePath();
input.setSourceTreeViewerInputContents(sourceObj);
}
if (targetWizard instanceof IStructuredDataCreationWizard) {
Object targetObj = ((IStructuredDataCreationWizard) targetWizard)
.getTreeViewerInputContents();
-// if (targetObj instanceof List) {
-// if (!((List) targetObj).isEmpty()) {
-// targetObj = ((List) targetObj).get(0);
-// }
-// }
+ targetDataPath[0] = ((IStructuredDataCreationWizard) targetWizard)
+ .getStructuredDataSourcePath();
input.setTargetTreeViewerInputContents(targetObj);
}
-
+ Properties properties = null;
+ if (sourceDataPath[0] != null || targetDataPath[0] != null) {
+ properties = new Properties();
+ if (sourceDataPath[0] != null) {
+ properties.setProperty(PRO_SOURCE_DATA_PATH, sourceDataPath[0]);
+ }
+ if (targetDataPath[0] != null) {
+ properties.setProperty(PRO_TARGET_DATA_PATH, targetDataPath[0]);
+ }
+ }
+ try {
+ ginforSave.doSave(null, sourceTypeID, targetTypeID, properties);
+ } catch (IOException e) {
+ } catch (CoreException e) {
+ }
IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
true);// openEditor(page, file, true);
} catch (PartInitException e) {
}
}
});
+
monitor.worked(1);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/utils/UIUtils.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -1,6 +1,9 @@
package org.jboss.tools.smooks.utils;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -12,6 +15,7 @@
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.layout.FillLayout;
@@ -20,11 +24,19 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
+import org.jboss.tools.smooks.analyzer.CompositeResolveCommand;
+import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
+import org.jboss.tools.smooks.javabean.analyzer.JavaModelConnectionResolveCommand;
+import org.jboss.tools.smooks.javabean.analyzer.JavaModelResolveCommand;
+import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.ui.SmooksUIActivator;
import org.jboss.tools.smooks.ui.ViewerInitorStore;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.TargetModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
/**
*
@@ -39,19 +51,158 @@
fill.marginWidth = marginW;
return fill;
}
-
- public static Status createErrorStatus(Throwable throwable,String message){
- while(throwable != null && throwable instanceof InvocationTargetException){
- throwable = ((InvocationTargetException)throwable).getTargetException();
+
+ public static void createJavaModelConnectionErrorResolveCommand(
+ DesignTimeAnalyzeResult result,
+ SmooksConfigurationFileGenerateContext context,
+ JavaBeanModel currentNode, JavaBeanModel parentNode) {
+ GraphRootModel root = context.getGraphicalRootModel();
+ HashMap<AbstractStructuredDataModel, AbstractStructuredDataModel> tempMap = new HashMap<AbstractStructuredDataModel, AbstractStructuredDataModel>();
+ // Disconnect all connections command
+ JavaModelConnectionResolveCommand disconnectCommand = new JavaModelConnectionResolveCommand(
+ context);
+ CompositeResolveCommand compositeCommand = new CompositeResolveCommand(
+ context);
+ compositeCommand
+ .setResolveDescription("Connect all needed connections");
+ disconnectCommand
+ .setResolveDescription("Disconnect all connections of the current \""
+ + currentNode.getName() + "\"node");
+ AbstractStructuredDataModel targetNode = UIUtils.findGraphModel(root,
+ currentNode);
+ if (targetNode instanceof IConnectableModel) {
+ List<Object> connections = ((IConnectableModel) targetNode)
+ .getModelTargetConnections();
+ for (Iterator iterator = connections.iterator(); iterator.hasNext();) {
+ LineConnectionModel line = (LineConnectionModel) iterator
+ .next();
+ AbstractStructuredDataModel source = (AbstractStructuredDataModel) line
+ .getSource();
+ Object sourceBean = (Object) source.getReferenceEntityModel();
+ Object sourceParent = context.getSourceViewerProvider()
+ .getParent(sourceBean);
+ if (sourceParent == null) {
+ sourceParent = sourceBean;
+ }
+ AbstractStructuredDataModel sourceParentNode = UIUtils
+ .findGraphModel(root, sourceParent);
+ // Connect the parent command
+ AbstractStructuredDataModel targetParentNode = UIUtils
+ .findGraphModel(root, parentNode);
+ if (tempMap.get(sourceParentNode) == null) {
+ JavaModelConnectionResolveCommand connectParent = new JavaModelConnectionResolveCommand(
+ context);
+ connectParent.setResolveDescription("Connect the \""
+ + context.getSourceViewerLabelProvider().getText(
+ sourceParent) + "\" to the \""
+ + parentNode.getName() + "\"");
+ connectParent.setSourceModel(sourceParentNode);
+ connectParent.setTargetModel(targetParentNode);
+ result.addResolveCommand(connectParent);
+ tempMap.put(sourceParentNode, targetParentNode);
+ compositeCommand.addCommand(connectParent);
+ }
+
+ disconnectCommand.addDisconnectionModel(line);
+ }
}
- return new Status(Status.ERROR,SmooksUIActivator.PLUGIN_ID,message,throwable);
+ result.addResolveCommand(disconnectCommand);
+ if (!compositeCommand.isEmpty()) {
+ result.addResolveCommand(compositeCommand);
+ }
}
-
- public static void showErrorDialog(Shell shell,Status status){
+
+ public static List<DesignTimeAnalyzeResult> checkJavaModelNodeConnection(
+ SmooksConfigurationFileGenerateContext context) {
+ GraphRootModel root = context.getGraphicalRootModel();
+ List targetList = root.loadTargetModelList();
+ List<DesignTimeAnalyzeResult> arList = new ArrayList<DesignTimeAnalyzeResult>();
+ for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel targetm = (AbstractStructuredDataModel) iterator
+ .next();
+ if (targetm instanceof IConnectableModel) {
+ if (((IConnectableModel) targetm).getModelTargetConnections()
+ .isEmpty()) {
+ continue;
+ }
+ if (!(targetm.getReferenceEntityModel() instanceof JavaBeanModel)) {
+ continue;
+ }
+ JavaBeanModel javaModel = (JavaBeanModel) targetm
+ .getReferenceEntityModel();
+ JavaBeanModel parent = javaModel.getParent();
+ if (parent != null) {
+ AbstractStructuredDataModel pgm = UIUtils.findGraphModel(
+ root, parent);
+ if (pgm != null && pgm instanceof IConnectableModel) {
+ if (((IConnectableModel) pgm)
+ .getModelTargetConnections().isEmpty()) {
+ String errorMessage = "The parent of Java node \""
+ + javaModel.getName()
+ + "\" : \""
+ + parent.getName()
+ + "\" doesn't be connected by any source node";
+ DesignTimeAnalyzeResult dr = new DesignTimeAnalyzeResult();
+ dr.setErrorMessage(errorMessage);
+ createJavaModelConnectionErrorResolveCommand(dr,
+ context, javaModel, parent);
+ arList.add(dr);
+ }
+ }
+ }
+ }
+ }
+ return arList;
+ }
+
+ public static List<DesignTimeAnalyzeResult> checkTargetJavaModelType(
+ SmooksConfigurationFileGenerateContext context) {
+ GraphRootModel root = context.getGraphicalRootModel();
+ List<DesignTimeAnalyzeResult> resultList = new ArrayList<DesignTimeAnalyzeResult>();
+ List<TargetModel> targetList = root.loadTargetModelList();
+ for (Iterator<TargetModel> iterator = targetList.iterator(); iterator
+ .hasNext();) {
+ TargetModel targetModel = (TargetModel) iterator.next();
+ Object refObj = targetModel.getReferenceEntityModel();
+ if (refObj instanceof JavaBeanModel) {
+ Class clazz = ((JavaBeanModel) refObj).getBeanClass();
+ if (clazz != null && (clazz.isInterface())) {
+ DesignTimeAnalyzeResult result = new DesignTimeAnalyzeResult();
+ result
+ .setErrorMessage("Java model \""
+ + ((JavaBeanModel) refObj).getName()
+ + "\" can't be instanced case its instance class is interface or abstractclass");
+ if (List.class.isAssignableFrom(clazz)) {
+ JavaModelResolveCommand command = new JavaModelResolveCommand(
+ context);
+ command
+ .setResolveDescription("Change the instance class to \"java.util.ArrayList\"");
+ command.setInstanceName("java.util.ArrayList");
+ command.setJavaBean((JavaBeanModel) refObj);
+ result.addResolveCommand(command);
+ }
+ resultList.add(result);
+ }
+ }
+ }
+ return resultList;
+ }
+
+ public static Status createErrorStatus(Throwable throwable, String message) {
+ while (throwable != null
+ && throwable instanceof InvocationTargetException) {
+ throwable = ((InvocationTargetException) throwable)
+ .getTargetException();
+ }
+ return new Status(Status.ERROR, SmooksUIActivator.PLUGIN_ID, message,
+ throwable);
+ }
+
+ public static void showErrorDialog(Shell shell, Status status) {
ErrorDialog.openError(shell, "Error", "error", status);
}
-
- public static Status createErrorStatus(Throwable throwable){
+
+ public static Status createErrorStatus(Throwable throwable) {
return createErrorStatus(throwable, "Error");
}
@@ -79,7 +230,8 @@
public static LineConnectionModel getFirstSourceModelViaConnection(
AbstractStructuredDataModel target) {
- if(target == null) return null;
+ if (target == null)
+ return null;
if (target instanceof IConnectableModel) {
List list = ((IConnectableModel) target)
.getModelSourceConnections();
@@ -90,10 +242,11 @@
}
return null;
}
-
+
public static LineConnectionModel getFirstTargetModelViaConnection(
AbstractStructuredDataModel source) {
- if(source == null) return null;
+ if (source == null)
+ return null;
if (source instanceof IConnectableModel) {
List list = ((IConnectableModel) source)
.getModelTargetConnections();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -17,31 +17,29 @@
*
*/
public abstract class AbstractStructuredDdataWizard extends Wizard implements
- IStructuredDataCreationWizard ,INewWizard{
+ IStructuredDataCreationWizard, INewWizard {
protected IWorkbench workbench;
-
+
protected IStructuredSelection selection;
-
+
protected AbstractFileSelectionWizardPage page = null;
- protected Object xsdElement = null;
+ protected Object xsdElement = null;
protected IWizardNode strucutredDataCreationWizardNode;
- /**
- *
- */
+
public AbstractStructuredDdataWizard() {
// TODO Auto-generated constructor stub
}
@Override
public void addPages() {
- if(page == null){
+ if (page == null) {
page = createAbstractFileSelectionWizardPage();
page.setSelection(this.selection);
}
this.addPage(page);
}
- abstract protected AbstractFileSelectionWizardPage createAbstractFileSelectionWizardPage() ;
+ abstract protected AbstractFileSelectionWizardPage createAbstractFileSelectionWizardPage();
/*
* (non-Javadoc)
@@ -53,18 +51,28 @@
xsdElement = this.page.getReturnValue();
return true;
}
+
public Object getTreeViewerInputContents() {
return xsdElement;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.ui.IStructuredDataCreationWizard#
+ * getStructuredDataSourcePath()
+ */
+ public String getStructuredDataSourcePath() {
+ return page.getFilePath();
+ }
+
public void init(IEditorSite site, IEditorInput input) {
-
+
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
this.selection = selection;
}
-
-
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -35,7 +35,7 @@
public boolean performFinish() {
filePath = page.getFilePath();
- properties.put(XML_FILE, filePath);
+// properties.put(XML_FILE, filePath);
return super.performFinish();
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/AbstractXMLModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/AbstractXMLModelAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/AbstractXMLModelAnalyzer.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.smooks.xml2java.analyzer;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Iterator;
+import java.util.List;
+
+import org.dom4j.DocumentException;
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
+import org.jboss.tools.smooks.analyzer.ITargetModelAnalyzer;
+import org.jboss.tools.smooks.graphical.GraphInformations;
+import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.xml.model.DocumentObject;
+import org.jboss.tools.smooks.xml.model.XMLObjectAnalyzer;
+
+/**
+ * @author Dart Peng<br>
+ * Date : Sep 23, 2008
+ */
+public class AbstractXMLModelAnalyzer implements ISourceModelAnalyzer , ITargetModelAnalyzer {
+
+ private String parmaKey = "";
+
+ public AbstractXMLModelAnalyzer(String paramKey){
+ this.parmaKey = paramKey;
+ }
+
+ public Object buildSourceInputObjects(GraphInformations graphInfo,
+ SmooksResourceListType listType, IFile sourceFile)
+ throws InvocationTargetException {
+ Params params = graphInfo.getParams();
+ String path = null;
+ if (params != null) {
+ List<Param> paramList = graphInfo.getParams().getParam();
+ for (Iterator<Param> iterator = paramList.iterator(); iterator
+ .hasNext();) {
+ Param param = (Param) iterator.next();
+ if (param.getName().equals(parmaKey)) {
+ path = param.getValue();
+ break;
+ }
+ }
+ }
+ if (path == null) {
+ // TODO tell user the filepath can't find or not ?
+ return null;
+// throw new InvocationTargetException(new Exception(
+// "xml file path can't find in the graphInfo file"));
+ }
+ XMLObjectAnalyzer objectBuilder = new XMLObjectAnalyzer();
+ try {
+ FileInputStream stream = new FileInputStream(path);
+ DocumentObject document = objectBuilder.analyze(stream);
+ return document;
+ } catch (FileNotFoundException e) {
+ throw new InvocationTargetException(e);
+ } catch (DocumentException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+
+ public Object buildTargetInputObjects(GraphInformations graphInfo,
+ SmooksResourceListType listType, IFile sourceFile)
+ throws InvocationTargetException {
+ return buildSourceInputObjects(graphInfo,listType,sourceFile);
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/AbstractXMLModelAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -53,7 +53,10 @@
/*
* (non-Javadoc)
*
- * @see org.jboss.tools.smooks.analyzer.IAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ * @see
+ * org.jboss.tools.smooks.analyzer.IAnalyzer#analyzeMappingGraphModel(org
+ * .jboss
+ * .tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
*/
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
@@ -203,11 +206,11 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
Object targetObject) {
- if(sourceObject instanceof DocumentObject){
- sourceObject = ((DocumentObject)sourceObject).getRootTag();
+ if (sourceObject instanceof DocumentObject) {
+ sourceObject = ((DocumentObject) sourceObject).getRootTag();
}
- if(targetObject instanceof List){
- targetObject = (JavaBeanModel) ((List)targetObject).get(0);
+ if (targetObject instanceof List) {
+ targetObject = (JavaBeanModel) ((List) targetObject).get(0);
}
if (!(sourceObject instanceof AbstractXMLObject)
|| !(targetObject instanceof JavaBeanModel)) {
@@ -218,7 +221,8 @@
ResourceConfigType rootResourceConfig = findFirstMappingResourceConfig(listType);
// if can't find the root , return null
- if(rootResourceConfig ==null) return null;
+ if (rootResourceConfig == null)
+ return null;
String xmlName = rootResourceConfig.getSelector();
AbstractXMLObject source = findXMLObjectByName(xmlName, sourceRoot);
if (source == null)
@@ -394,8 +398,12 @@
public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
- // TODO Auto-generated method stub
- return null;
+ List<DesignTimeAnalyzeResult> typeCheckResults = UIUtils
+ .checkTargetJavaModelType(context);
+ List<DesignTimeAnalyzeResult> connectionCheckResults = UIUtils
+ .checkJavaModelNodeConnection(context);
+ typeCheckResults.addAll(connectionCheckResults);
+ return typeCheckResults.toArray(new DesignTimeAnalyzeResult[] {});
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-28 06:46:22 UTC (rev 11231)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -10,63 +10,15 @@
******************************************************************************/
package org.jboss.tools.smooks.xml2java.analyzer;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.dom4j.DocumentException;
-import org.eclipse.core.resources.IFile;
-import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
-import org.jboss.tools.smooks.graphical.GraphInformations;
-import org.jboss.tools.smooks.graphical.Param;
-import org.jboss.tools.smooks.graphical.Params;
-import org.jboss.tools.smooks.model.SmooksResourceListType;
-import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
-import org.jboss.tools.smooks.xml.model.DocumentObject;
-import org.jboss.tools.smooks.xml.model.XMLObjectAnalyzer;
-
/**
* @author Dart Peng<br>
* Date : Sep 23, 2008
*/
-public class XMLSourceModelAnalyzer implements ISourceModelAnalyzer {
+public class XMLSourceModelAnalyzer extends AbstractXMLModelAnalyzer{
- public static final String XML_FILE = "xmlFile";
-
- public Object buildSourceInputObjects(GraphInformations graphInfo,
- SmooksResourceListType listType, IFile sourceFile)
- throws InvocationTargetException {
- Params params = graphInfo.getParams();
- String path = null;
- if (params != null) {
- List<Param> paramList = graphInfo.getParams().getParam();
- for (Iterator<Param> iterator = paramList.iterator(); iterator
- .hasNext();) {
- Param param = (Param) iterator.next();
- if (param.getName().equals(XML_FILE)) {
- path = param.getValue();
- break;
- }
- }
- }
- if (path == null) {
- // TODO tell user the filepath can't find or not ?
- return null;
-// throw new InvocationTargetException(new Exception(
-// "xml file path can't find in the graphInfo file"));
- }
- XMLObjectAnalyzer objectBuilder = new XMLObjectAnalyzer();
- try {
- FileInputStream stream = new FileInputStream(path);
- DocumentObject document = objectBuilder.analyze(stream);
- return document;
- } catch (FileNotFoundException e) {
- throw new InvocationTargetException(e);
- } catch (DocumentException e) {
- throw new InvocationTargetException(e);
- }
+ public XMLSourceModelAnalyzer() {
+ super("sourceDataPath");
}
+
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLTargetModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLTargetModelAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLTargetModelAnalyzer.java 2008-10-28 08:09:14 UTC (rev 11232)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.smooks.xml2java.analyzer;
+
+
+/**
+ * @author Dart Peng<br>
+ * Date : Sep 23, 2008
+ */
+public class XMLTargetModelAnalyzer extends AbstractXMLModelAnalyzer{
+
+ public XMLTargetModelAnalyzer() {
+ super("targetDataPath");
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XMLTargetModelAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 2 months
JBoss Tools SVN: r11231 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-28 02:46:22 -0400 (Tue, 28 Oct 2008)
New Revision: 11231
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkDetector.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkRegion.java
Log:
increase code coverage and optimize code
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkDetector.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkDetector.java 2008-10-28 02:33:42 UTC (rev 11230)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkDetector.java 2008-10-28 06:46:22 UTC (rev 11231)
@@ -33,53 +33,43 @@
protected String[] getPartitionTypes(IDocument document, int offset) {
String documentRegionType = null;
ITypedRegion region = null;
-
+ ArrayList<String> types = new ArrayList<String>();
+
region = (document instanceof IDocumentExtension3 ?
((IDocumentExtension3)document).getDocumentPartitioner("org.eclipse.wst.sse.core.default_structured_text_partitioning").getPartition(offset) :
document.getDocumentPartitioner().getPartition(offset));
if (region != null) {
documentRegionType = region.getType();
- } else {
- return null;
+
+ String contentType = getContentType(document);
+
+ HyperlinkPartitionerDefinition[] defs = HyperlinkPartitionerBuilder.getInstance().getHyperlinkPartitionerDefinitions(contentType, documentRegionType, null);
+
+ if(defs==null || defs.length==0) {
+ types.add(documentRegionType);
+ } else {
+ for(int i=0; i<defs.length; i++) {
+ final ITypedRegion finalDocumentRegion = region;
+ final IDocument finalDocument = document;
+ final String finalContentType = contentType;
+ IHyperlinkPartitioner hyperlinkPartitioner = defs[i].createHyperlinkPartitioner();
+ IHyperlinkRegion startHyperlinkRegion = new HyperlinkRegion(
+ finalDocumentRegion.getOffset(),
+ finalDocumentRegion.getLength(),
+ AxisUtil.getAxis(finalDocument, finalDocumentRegion.getOffset()),
+ finalContentType,
+ finalDocumentRegion.getType());
+ if((!(hyperlinkPartitioner instanceof IHyperlinkPartitionRecognizer)) ||
+ ((IHyperlinkPartitionRecognizer)hyperlinkPartitioner).recognize(document, startHyperlinkRegion)) {
+ String type = hyperlinkPartitioner.getChildPartitionType(document, startHyperlinkRegion);
+ if(type!=null && !types.contains(type)) {
+ types.add(type);
+ }
+ }
+ }
+ }
}
- String contentType = getContentType(document);
- ArrayList<String> types = new ArrayList<String>();
- HyperlinkPartitionerDefinition[] defs = HyperlinkPartitionerBuilder.getInstance().getHyperlinkPartitionerDefinitions(contentType, documentRegionType, null);
-
- if(defs==null || defs.length==0) {
- return new String[]{documentRegionType};
- }
- for(int i=0; i<defs.length; i++) {
- final ITypedRegion finalDocumentRegion = region;
- final IDocument finalDocument = document;
- final String finalContentType = contentType;
- IHyperlinkPartitioner hyperlinkPartitioner = defs[i].createHyperlinkPartitioner();
- IHyperlinkRegion startHyperlinkRegion = new IHyperlinkRegion() {
- public String getAxis() {
- return AxisUtil.getAxis(finalDocument, finalDocumentRegion.getOffset());
- }
- public String getContentType() {
- return finalContentType;
- }
- public String getType() {
- return finalDocumentRegion.getType();
- }
- public int getLength() {
- return finalDocumentRegion.getLength();
- }
- public int getOffset() {
- return finalDocumentRegion.getOffset();
- }
- };
- if((!(hyperlinkPartitioner instanceof IHyperlinkPartitionRecognizer)) ||
- ((IHyperlinkPartitionRecognizer)hyperlinkPartitioner).recognize(document, startHyperlinkRegion)) {
- String type = hyperlinkPartitioner.getChildPartitionType(document, startHyperlinkRegion);
- if(type!=null && !types.contains(type)) {
- types.add(type);
- }
- }
- }
return types.toArray(new String[types.size()]);
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkRegion.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkRegion.java 2008-10-28 02:33:42 UTC (rev 11230)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/HyperlinkRegion.java 2008-10-28 06:46:22 UTC (rev 11231)
@@ -10,24 +10,20 @@
******************************************************************************/
package org.jboss.tools.common.text.ext.hyperlink;
-public class HyperlinkRegion implements IHyperlinkRegion {
- int start;
- int length;
-
+import org.eclipse.jface.text.TypedRegion;
+
+public class HyperlinkRegion extends TypedRegion implements IHyperlinkRegion {
String axis;
String contentType;
- String type;
public HyperlinkRegion(int propStart, int propLength) {
this(propStart, propLength, null, null, null);
}
public HyperlinkRegion(int start, int length, String axis, String contentType, String type) {
- this.start = start;
- this.length = length;
+ super(start,length,type);
this.axis = axis;
this.contentType = contentType;
- this.type = type;
}
public String getAxis() {
@@ -37,28 +33,14 @@
public String getContentType() {
return contentType;
}
-
- public String getType() {
- return type;
- }
-
- public int getLength() {
- return length;
- }
-
- public int getOffset() {
- return start;
- }
-
+
public boolean equals(Object arg) {
if (!(arg instanceof IHyperlinkRegion)) return false;
IHyperlinkRegion region = (IHyperlinkRegion)arg;
- if (getOffset() != region.getOffset()) return false;
- if (getLength() != region.getLength()) return false;
- if(!areArqumentsEqual(getContentType(), region.getContentType())) return false;
- if(!areArqumentsEqual(getType(), region.getType())) return false;
- if(!areArqumentsEqual(getAxis(), region.getAxis())) return false;
- return true;
+ return getOffset() == region.getOffset()
+ && getLength() == region.getLength()
+ && areArqumentsEqual(getContentType(), region.getContentType())
+ && areArqumentsEqual(getAxis(), region.getAxis());
}
private boolean areArqumentsEqual(String s1, String s2) {
16 years, 2 months
JBoss Tools SVN: r11230 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-27 22:33:42 -0400 (Mon, 27 Oct 2008)
New Revision: 11230
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
Log:
Workaround for JBIDE-3016
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-10-28 02:31:52 UTC (rev 11229)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-10-28 02:33:42 UTC (rev 11230)
@@ -70,7 +70,6 @@
site = aSite.getViewSite();
createActions();
newPackageManager = new MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label, NEW_PACKAGE_MENU_ID);
- newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
public void fillContextMenu(IMenuManager manager) {
@@ -192,6 +191,10 @@
* @param manager
*/
private void addNewPackageActions (IMenuManager manager) {
+ //workaround for JBIDE-3016
+ if( manager.getItems().length > 0)
+ return;
+
for( int i = 0; i < newPackageActions.length; i++ ) {
NewArchiveAction action = newPackageActions[i];
ActionWrapper wrapped = new ActionWrapper(action);
16 years, 2 months
JBoss Tools SVN: r11229 - branches/jbosstools-3.0.0.Beta1/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-27 22:31:52 -0400 (Mon, 27 Oct 2008)
New Revision: 11229
Modified:
branches/jbosstools-3.0.0.Beta1/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
Log:
JBIDE-3016 - archives menu fills up under uncertain circumstances
Modified: branches/jbosstools-3.0.0.Beta1/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-10-28 01:30:14 UTC (rev 11228)
+++ branches/jbosstools-3.0.0.Beta1/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-10-28 02:31:52 UTC (rev 11229)
@@ -70,7 +70,6 @@
site = aSite.getViewSite();
createActions();
newPackageManager = new MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label, NEW_PACKAGE_MENU_ID);
- newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
public void fillContextMenu(IMenuManager manager) {
@@ -192,6 +191,10 @@
* @param manager
*/
private void addNewPackageActions (IMenuManager manager) {
+ // workaround for JBIDE-3016
+ if( manager.getItems().length > 0)
+ return;
+
for( int i = 0; i < newPackageActions.length; i++ ) {
NewArchiveAction action = newPackageActions[i];
ActionWrapper wrapped = new ActionWrapper(action);
16 years, 2 months