JBoss Tools SVN: r11138 - in trunk/jbpm/docs: converter_ref and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-24 04:41:43 -0400 (Fri, 24 Oct 2008)
New Revision: 11138
Added:
trunk/jbpm/docs/converter_ref/
trunk/jbpm/docs/converter_ref/en/
trunk/jbpm/docs/converter_ref/en/images/
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_1.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_2.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_3.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_4.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_5.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_6.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_7.png
trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_8.png
trunk/jbpm/docs/converter_ref/en/master.xml
trunk/jbpm/docs/converter_ref/en/modules/
trunk/jbpm/docs/converter_ref/en/modules/bpmn2jpdl.xml
trunk/jbpm/docs/converter_ref/en/modules/overview.xml
trunk/jbpm/docs/converter_ref/pom.xml
Log:
JBIDE-2982:add doc for bpmn ->jpdl
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_4.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_4.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_5.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_7.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_7.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_8.png
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/docs/converter_ref/en/images/bpmnconvert_bpmn2jpdl_8.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/docs/converter_ref/en/master.xml
===================================================================
--- trunk/jbpm/docs/converter_ref/en/master.xml (rev 0)
+++ trunk/jbpm/docs/converter_ref/en/master.xml 2008-10-24 08:41:43 UTC (rev 11138)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3CR3/docbookx.dtd"
+
+[<!ENTITY overview SYSTEM "modules/overview.xml">
+<!ENTITY bpmn2jpdl SYSTEM "modules/bpmn2jpdl.xml">
+]>
+
+<book>
+
+ <bookinfo>
+ <title>BPMN Convert User Guide</title>
+ <author><firstname>Grid</firstname><surname>Qian</surname><email>fqian(a)redhat.com</email></author>
+ <pubdate>October 2008</pubdate>
+ <copyright>
+ <year>2008</year>
+ <holder>JBoss, a division of Red Hat Inc.</holder>
+ </copyright>
+ <releaseinfo>
+ Version: 3.0.0.beta1
+ </releaseinfo>
+<abstract>
+ <title/>
+ <para>
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/bpmn_convert_guide/p...">PDF version</ulink>
+ </para>
+</abstract>
+
+
+ </bookinfo>
+
+ <toc/>
+ &overview;
+ &bpmn2jpdl;
+</book>
Added: trunk/jbpm/docs/converter_ref/en/modules/bpmn2jpdl.xml
===================================================================
--- trunk/jbpm/docs/converter_ref/en/modules/bpmn2jpdl.xml (rev 0)
+++ trunk/jbpm/docs/converter_ref/en/modules/bpmn2jpdl.xml 2008-10-24 08:41:43 UTC (rev 11138)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="bpmn2jpdl" >
+ <title>Translate a BPMN file to a JPDL file</title>
+ <para>In this chapter we provide you with the necessary steps to translate a BPMN file to a JPDL file.</para>
+
+ <section id="createproject">
+ <title>Creating a project</title>
+ <para>Before creating a bpmn file, you should have a Project created.</para>
+ <para>Create a project by
+ <emphasis><property>New > Project... > Project</property></emphasis>
+ . Enter the following information:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Project Name: test</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>A Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_1.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Finish</property> button.</para>
+ </section>
+
+ <section id="createbpmnfile">
+ <title>Creating a bpmn file by STP BPMN editor</title>
+ <para>Create a bpmn diagram file by
+ <emphasis><property>New > Others... > Bpmn Diagram</property></emphasis>
+ . Enter the following information:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>File Name: test</para>
+ </listitem>
+ </itemizedlist>
+ <figure>
+ <title>Create BPMN Diagram</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_2.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Finish</property> button.</para>
+ <para>Open the test.bpmn_diagram file by double-click it.</para>
+ <para>Draw the bpmn diagram using STP BPMN editor. If you do not know how to use STP BPMN editor, please go to web site: www.eclipse.org/stp to get the information about STP BPMN editor.</para>
+ </section>
+
+ <section id="bpmntojpdl">
+ <title>Exporting a bpmn file to some jpdl files</title>
+ <para>A BPMN file may include more than one pool. Every pool can be mapped to a corresponding JPDL file.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Select 'test.bpmn' file and right-click it. Open the export wizard by
+ <emphasis><property>Export... > BPMN Export > BPMN -> JPDL</property></emphasis>
+ .
+ </para>
+ <figure>
+ <title>BPMN Export</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_3.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>Select the BPMN file that you want to translate.
+ </para>
+ <figure>
+ <title>Choose a BPMN file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_4.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>Select the Pools of BPMN that you want to translate.
+ </para>
+ <figure>
+ <title>Choose BPMN Pools</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_5.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>In this page, You may get error messages or warning messages that occured during the conversion. If no any messages, this page will be skipped.
+ </para>
+ <figure>
+ <title>Show Messages</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_6.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>Select the target location to save the generated JPDL files.
+ </para>
+ <figure>
+ <title>Target Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_7.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Overwrite existing resources: if you don't want to overwrite existing resources, please keep uncheck this checkbox.</para>
+ </listitem>
+ </itemizedlist>
+ <para>Click on the <property>Finish</property> button.</para>
+ <para>Then the JPDL files are generated to the target location.</para>
+ </listitem>
+ </itemizedlist>
+ <para>The generated files look like this: </para>
+ <figure>
+ <title>The Generated JPDL Files</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/bpmnconvert_bpmn2jpdl_8.png"></imagedata>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+
+</chapter>
\ No newline at end of file
Added: trunk/jbpm/docs/converter_ref/en/modules/overview.xml
===================================================================
--- trunk/jbpm/docs/converter_ref/en/modules/overview.xml (rev 0)
+++ trunk/jbpm/docs/converter_ref/en/modules/overview.xml 2008-10-24 08:41:43 UTC (rev 11138)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="overview" revisionflag="overview">
+ <title>BPMN Convert Overview</title>
+
+ <para>JBoss BPMN Convert module is a tool. Users can use it to translate a BPMN file to something else.</para>
+ <para>The BPMN file may be written by hands or by some editors. In this guide, we use STP BPMN editor to draw a BPMN file.</para>
+ <para>As a part of JBoss tools, this module realizes BPMN -> JPDL translation. Users can get a basic JPDL file from a BPMN file by using this module.</para>
+
+</chapter>
\ No newline at end of file
Added: trunk/jbpm/docs/converter_ref/pom.xml
===================================================================
--- trunk/jbpm/docs/converter_ref/pom.xml (rev 0)
+++ trunk/jbpm/docs/converter_ref/pom.xml 2008-10-24 08:41:43 UTC (rev 11138)
@@ -0,0 +1,102 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>converter-ref-guide${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>Converter_Reference_Guide</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <cssResource>
+ <directory>${pom.basedir}/${cssdir}</directory>
+ </cssResource>
+
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
+ <translation>en-US</translation>
+ </properties>
+
+</project>
16 years, 3 months
JBoss Tools SVN: r11137 - branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-24 04:09:11 -0400 (Fri, 24 Oct 2008)
New Revision: 11137
Modified:
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
Log:
JBIDE-2974:the Finish button should be disable after choose some bpmn pools in the wizard page
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-24 08:05:17 UTC (rev 11136)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-24 08:09:11 UTC (rev 11137)
@@ -129,8 +129,10 @@
public IWizardPage getNextPage(IWizardPage page) {
if (page.getName()
- .equals(B2JMessages.Bpmn_Translate_Message_WizardPage_Name)) {
+ .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
errorList = translateBpmnToStrings();
+ errorPage.setPageComplete(true);
+
if (errorList.size() == 0) {
return locationPage;
}
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-24 08:05:17 UTC (rev 11136)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-24 08:09:11 UTC (rev 11137)
@@ -31,6 +31,7 @@
private TableViewer listViewer;
+
protected ErrorMessagesPage(String pageName, String title, String description) {
super(pageName);
this.setDescription(description);
@@ -43,7 +44,7 @@
createListTitleArea(composite);
createListViewer(composite);
setControl(composite);
-
+ initializePage();
}
private Label createListTitleArea(Composite composite) {
@@ -78,11 +79,10 @@
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
-
- public boolean isPageComplete() {
- return true;
+
+ private void initializePage() {
+ this.setPageComplete(false);
}
-
public TableViewer getListViewer() {
return listViewer;
16 years, 3 months
JBoss Tools SVN: r11136 - trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-24 04:05:17 -0400 (Fri, 24 Oct 2008)
New Revision: 11136
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
Log:
JBIDE-2974:the Finish button should be disable after choose some bpmn pools in the wizard page
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-24 07:25:01 UTC (rev 11135)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-24 08:05:17 UTC (rev 11136)
@@ -129,8 +129,10 @@
public IWizardPage getNextPage(IWizardPage page) {
if (page.getName()
- .equals(B2JMessages.Bpmn_Translate_Message_WizardPage_Name)) {
+ .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
errorList = translateBpmnToStrings();
+ errorPage.setPageComplete(true);
+
if (errorList.size() == 0) {
return locationPage;
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-24 07:25:01 UTC (rev 11135)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-24 08:05:17 UTC (rev 11136)
@@ -31,6 +31,7 @@
private TableViewer listViewer;
+
protected ErrorMessagesPage(String pageName, String title, String description) {
super(pageName);
this.setDescription(description);
@@ -43,7 +44,7 @@
createListTitleArea(composite);
createListViewer(composite);
setControl(composite);
-
+ initializePage();
}
private Label createListTitleArea(Composite composite) {
@@ -78,11 +79,10 @@
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
return composite;
}
-
- public boolean isPageComplete() {
- return true;
+
+ private void initializePage() {
+ this.setPageComplete(false);
}
-
public TableViewer getListViewer() {
return listViewer;
16 years, 3 months
JBoss Tools SVN: r11135 - in branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert: b2j/wizard and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-24 03:25:01 -0400 (Fri, 24 Oct 2008)
New Revision: 11135
Modified:
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
JBIDE-2973:the checkbox for overwrite existing resources has not effort on the result
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-24 07:19:54 UTC (rev 11134)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-24 07:25:01 UTC (rev 11135)
@@ -65,16 +65,16 @@
File jpdlFolder = BPMNToUtil.createFile(parentFolder,
B2JMessages.Jpdl_Suffix, null, isOverWrite);
File diagramFolder = BPMNToUtil.createFile(
- jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, false);
File[] files = new File[strsForGenerate.length];
File processFolder = null;
int i = 0;
for (String str : strsForGenerate) {
processFolder = BPMNToUtil.createFile(diagramFolder
- .getAbsolutePath(), fileFolders[i], null, isOverWrite);
+ .getAbsolutePath(), fileFolders[i], null, false);
files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
- fileName, str, isOverWrite);
+ fileName, str, false);
i++;
}
return files;
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-24 07:19:54 UTC (rev 11134)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-24 07:25:01 UTC (rev 11135)
@@ -38,6 +38,9 @@
private List<String> generatedGpdFoldersList = new ArrayList<String>();
public void createGeneratedFile(boolean isOverWrite) {
+ if(!isOverWrite){
+ return;
+ }
String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
String location = super.getContainerPath((IContainer) super
@@ -81,7 +84,7 @@
}
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
- jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, false);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-24 07:19:54 UTC (rev 11134)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-24 07:25:01 UTC (rev 11135)
@@ -53,12 +53,15 @@
public static File createFile(String parentFolder, String fileName,
String inputStr, boolean isOverWrite) throws IOException {
File child = new File(parentFolder, fileName);
+ if(isOverWrite){
+ deleteAll(child);
+ }
if (inputStr == null) {
- if (!child.exists() || isOverWrite) {
+ if (!child.exists()) {
child.mkdir();
}
} else {
- if (!child.exists() || isOverWrite) {
+ if (!child.exists()) {
child.createNewFile();
}
FileWriter childWriter = new FileWriter(child);
@@ -71,6 +74,20 @@
return child;
}
+ public static void deleteAll(File path) {
+ if (!path.exists())
+ return;
+ if (path.isFile()) {
+ path.delete();
+ return;
+ }
+ File[] files = path.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ deleteAll(files[i]);
+ }
+ path.delete();
+ }
+
/*
* get a sax input source
*/
Modified: branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-24 07:19:54 UTC (rev 11134)
+++ branches/jbosstools-3.0.0.Beta1/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-24 07:25:01 UTC (rev 11135)
@@ -50,7 +50,7 @@
private ISelection currentSelection;
private Button button;
private IWizard wizard;
- private boolean isOverWrite;
+ private boolean isOverWrite = true;
protected GeneratedFileLocationPage(String pageName, String title,
16 years, 3 months
JBoss Tools SVN: r11134 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert: b2j/wizard and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-24 03:19:54 -0400 (Fri, 24 Oct 2008)
New Revision: 11134
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
JBIDE-2973:the checkbox for overwrite existing resources has not effort on the result
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-24 07:17:20 UTC (rev 11133)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-24 07:19:54 UTC (rev 11134)
@@ -65,16 +65,16 @@
File jpdlFolder = BPMNToUtil.createFile(parentFolder,
B2JMessages.Jpdl_Suffix, null, isOverWrite);
File diagramFolder = BPMNToUtil.createFile(
- jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, false);
File[] files = new File[strsForGenerate.length];
File processFolder = null;
int i = 0;
for (String str : strsForGenerate) {
processFolder = BPMNToUtil.createFile(diagramFolder
- .getAbsolutePath(), fileFolders[i], null, isOverWrite);
+ .getAbsolutePath(), fileFolders[i], null, false);
files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
- fileName, str, isOverWrite);
+ fileName, str, false);
i++;
}
return files;
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-24 07:17:20 UTC (rev 11133)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-24 07:19:54 UTC (rev 11134)
@@ -38,6 +38,9 @@
private List<String> generatedGpdFoldersList = new ArrayList<String>();
public void createGeneratedFile(boolean isOverWrite) {
+ if(!isOverWrite){
+ return;
+ }
String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
String location = super.getContainerPath((IContainer) super
@@ -81,7 +84,7 @@
}
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
- jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, false);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-24 07:17:20 UTC (rev 11133)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-24 07:19:54 UTC (rev 11134)
@@ -53,12 +53,15 @@
public static File createFile(String parentFolder, String fileName,
String inputStr, boolean isOverWrite) throws IOException {
File child = new File(parentFolder, fileName);
+ if(isOverWrite){
+ deleteAll(child);
+ }
if (inputStr == null) {
- if (!child.exists() || isOverWrite) {
+ if (!child.exists()) {
child.mkdir();
}
} else {
- if (!child.exists() || isOverWrite) {
+ if (!child.exists()) {
child.createNewFile();
}
FileWriter childWriter = new FileWriter(child);
@@ -71,6 +74,20 @@
return child;
}
+ public static void deleteAll(File path) {
+ if (!path.exists())
+ return;
+ if (path.isFile()) {
+ path.delete();
+ return;
+ }
+ File[] files = path.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ deleteAll(files[i]);
+ }
+ path.delete();
+ }
+
/*
* get a sax input source
*/
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-24 07:17:20 UTC (rev 11133)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-24 07:19:54 UTC (rev 11134)
@@ -50,7 +50,7 @@
private ISelection currentSelection;
private Button button;
private IWizard wizard;
- private boolean isOverWrite;
+ private boolean isOverWrite = true;
protected GeneratedFileLocationPage(String pageName, String title,
16 years, 3 months
JBoss Tools SVN: r11133 - in branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: java2xml/analyzer and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-24 03:17:20 -0400 (Fri, 24 Oct 2008)
New Revision: 11133
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
Log:
JBIDE-2867
Change the display composite to sashform
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IMappingAnalyzer.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -26,6 +26,6 @@
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType,Object sourceObject,Object targetObject);
- public DesignTimeAnalyzeResult analyzeGraphModel(SmooksConfigurationFileGenerateContext context);
+ public DesignTimeAnalyzeResult[] analyzeGraphModel(SmooksConfigurationFileGenerateContext context);
}
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -174,7 +174,7 @@
return "${" + name + "}";
}
- public DesignTimeAnalyzeResult analyzeGraphModel(
+ public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
// TODO Auto-generated method stub
return null;
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -366,12 +366,12 @@
}
- private DesignTimeAnalyzeResult checkOtherNodeConnected(
+ private DesignTimeAnalyzeResult[] checkOtherNodeConnected(
SmooksConfigurationFileGenerateContext context) {
GraphRootModel root = context.getGraphicalRootModel();
List sourceList = root.loadSourceModelList();
List targetList = root.loadTargetModelList();
- StringBuffer buffer = new StringBuffer();
+ List<DesignTimeAnalyzeResult> arList = new ArrayList<DesignTimeAnalyzeResult>();
for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
AbstractStructuredDataModel targetm = (AbstractStructuredDataModel) iterator
.next();
@@ -390,24 +390,21 @@
if (pgm != null && pgm instanceof IConnectableModel) {
if (((IConnectableModel) pgm)
.getModelTargetConnections().isEmpty()) {
- buffer
- .append("The parent of Java node \""
- + javaModel.getName()
- + "\" : \""
- + parent.getName()
- + "\" doesn't be connected by any source node!\n");
+ 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);
+
+ arList.add(dr);
}
}
}
}
}
- String result = buffer.toString();
- if ("".equals(result)) {
- return null;
- }
- DesignTimeAnalyzeResult dr = new DesignTimeAnalyzeResult();
- dr.setErrorMessage(result);
- return dr;
+ return arList.toArray(new DesignTimeAnalyzeResult[0]);
}
/**
@@ -1044,7 +1041,7 @@
return null;
}
- public DesignTimeAnalyzeResult analyzeGraphModel(
+ public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
checkRootNodeConnected(context);
return checkOtherNodeConnected(context);
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -61,6 +61,8 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;
@@ -92,6 +94,7 @@
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.analyzer.AnalyzerFactory;
@@ -141,6 +144,9 @@
public class SmooksGraphicalFormPage extends FormPage implements
ISelectionChangedListener, ISelectionProvider,
org.eclipse.emf.common.command.CommandStackListener {
+
+ private List<DesignTimeAnalyzeResult> analyzeResultList = new ArrayList<DesignTimeAnalyzeResult>();
+
private static final String REFERENCE_MODEL = "__reference_model";
protected SmooksConfigurationFileGenerateContext smooksConfigurationFileGenerateContext;
protected IViewerInitor sourceViewerInitor;
@@ -168,10 +174,10 @@
private ISelection selection;
protected MappingResourceConfigList mappingResourceConfigList;
protected AdapterFactoryEditingDomain editingDomain;
- private Label notifyLabel;
private boolean canSaveFile = true;
- private Label imageLabel;
+ private Composite designTimeAnalyzeResultRegion;
+
public ISelection getSelection() {
return selection;
}
@@ -268,37 +274,38 @@
Section.TITLE_BAR | Section.DESCRIPTION,
"Mapping Graph Edit Panel",
"Edit the source and target assosiation");
- Composite mappingMainComposite = toolkit.createComposite(section);
- GridLayout gly = new GridLayout();
- gly.numColumns = 3;
- gly.horizontalSpacing = 0;
- mappingMainComposite.setLayout(gly);
- section.setClient(mappingMainComposite);
- Composite notifyComposite = toolkit
- .createComposite(mappingMainComposite);
- GridData ngd = new GridData(GridData.FILL_HORIZONTAL);
- ngd.horizontalSpan = 3;
+ Composite mainComposite = toolkit.createComposite(section);
+ section.setClient(mainComposite);
+
+ GridLayout mainLayout = new GridLayout();
+ mainComposite.setLayout(mainLayout);
+
+ SashForm sashForm = new SashForm(mainComposite, SWT.VERTICAL);
+ GridData sashFormLd = new GridData(GridData.FILL_BOTH);
+ sashForm.setLayoutData(sashFormLd);
+
+ sashForm.setSashWidth(1);
+
+ designTimeAnalyzeResultRegion = toolkit.createComposite(sashForm);
GridLayout ngl = new GridLayout();
ngl.numColumns = 2;
- notifyComposite.setLayout(ngl);
- notifyComposite.setLayoutData(ngd);
- imageLabel = toolkit.createLabel(notifyComposite, "");
- imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry()
- .get(SmooksGraphConstants.IMAGE_EMPTY));
- notifyLabel = toolkit.createLabel(notifyComposite, "" );
- GridData nlgd = new GridData(GridData.FILL_HORIZONTAL);
- notifyLabel.setLayoutData(nlgd);
+ ngl.marginWidth = 0;
+ designTimeAnalyzeResultRegion.setLayout(ngl);
+
+ SashForm mappingMainComposite = new SashForm(sashForm, SWT.NONE);
+ mappingMainComposite.setSashWidth(1);
GridData sgd = new GridData(GridData.FILL_BOTH);
section.setLayoutData(sgd);
{
Composite composite1 = toolkit
.createComposite(mappingMainComposite);
GridLayout layout = new GridLayout();
+ layout.marginWidth = 1;
layout.marginHeight = 1;
- layout.marginWidth = 1;
+ composite1.setLayout(layout);
+
GridData gd = new GridData(GridData.FILL_BOTH);
- composite1.setLayout(layout);
sourceViewer = this.createSourceTreeViewer(composite1);
sourceViewer.getTree().setLayoutData(gd);
sourceViewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY
@@ -320,26 +327,16 @@
composite1.setLayoutData(gd);
composite1.setBackground(GraphicsConstants.groupBorderColor);
}
+
{
Composite composite2 = toolkit
.createComposite(mappingMainComposite);
- GridData composite2LData = new GridData();
- composite2LData.grabExcessHorizontalSpace = true;
- composite2LData.grabExcessVerticalSpace = true;
- composite2LData.horizontalAlignment = GridData.FILL;
- composite2LData.verticalAlignment = GridData.FILL;
- composite2.setLayoutData(composite2LData);
composite2.setLayout(new FillLayout());
this.setGraphicalViewer(createGraphicalViewer(composite2));
}
{
Composite composite3 = toolkit
.createComposite(mappingMainComposite);
- GridData composite3LData = new GridData();
- composite3LData.grabExcessHorizontalSpace = true;
- composite3LData.verticalAlignment = GridData.FILL;
- composite3LData.grabExcessVerticalSpace = true;
- composite3LData.horizontalAlignment = GridData.FILL;
GridLayout layout = new GridLayout();
layout.marginWidth = 1;
layout.marginHeight = 1;
@@ -362,8 +359,7 @@
}
{
- Composite underToolPanel = toolkit
- .createComposite(mappingMainComposite);
+ Composite underToolPanel = toolkit.createComposite(mainComposite);
GridData sgd1 = new GridData(GridData.FILL_HORIZONTAL);
GridLayout underLayout = new GridLayout();
underLayout.numColumns = 3;
@@ -416,8 +412,8 @@
// section1.setLayoutData(sgd1);
toolkit.paintBordersFor(rootMainControl);
-
form.pack();
+ sashForm.setWeights(new int[] { 8, 100 });
if (initSourceTreeViewerProviders()) {
initSourceTreeViewer();
expandSourceConnectionModel();
@@ -665,7 +661,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ * @see
+ * org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.
+ * IProgressMonitor)
*/
@Override
public void doSave(IProgressMonitor monitor) {
@@ -674,8 +672,8 @@
.openQuestion(
getSite().getShell(),
"Clean all the errors please",
- "There occurs some errors on the graphical design , please clean all errors .\n" +
- "Click \"Yes\" to return . If you don't care that , click \"No\" to save file.");
+ "There occurs some errors on the graphical design , please clean all errors .\n"
+ + "Click \"Yes\" to return . If you don't care that , click \"No\" to save file.");
if (cleanError)
return;
}
@@ -913,7 +911,7 @@
protected void initTransformViewerModel(IEditorSite site, IEditorInput input)
throws Throwable {
graphicalInformationSaver = new GraphicalInformationSaver(input);
-
+
GraphInformations graph = null;
try {
graph = graphicalInformationSaver.doLoad();
@@ -975,8 +973,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
+ * @see
+ * org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
@@ -1096,7 +1095,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent)
+ * @see
+ * org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.
+ * eclipse.ui.forms.events.HyperlinkEvent)
*/
public void linkActivated(HyperlinkEvent e) {
showCreationWizard(viewer);
@@ -1105,7 +1106,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent)
+ * @see
+ * org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse
+ * .ui.forms.events.HyperlinkEvent)
*/
public void linkEntered(HyperlinkEvent e) {
@@ -1114,7 +1117,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent)
+ * @see
+ * org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse
+ * .ui.forms.events.HyperlinkEvent)
*/
public void linkExited(HyperlinkEvent e) {
@@ -1146,7 +1151,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ * @see
+ * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets
+ * .Event)
*/
public void handleEvent(Event event) {
TreeItem item = (TreeItem) event.item;
@@ -1179,7 +1186,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent)
+ * @see
+ * org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt
+ * .events.PaintEvent)
*/
public void paintControl(PaintEvent e) {
Tree tree = (Tree) e.getSource();
@@ -1253,27 +1262,32 @@
getManagedForm().dirtyStateChanged();
}
- protected void setErrorMessage(String errorMessage) {
- imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry().get(SmooksGraphConstants.IMAGE_EMPTY));
- notifyLabel.setText("");
- canSaveFile = true;
- if (errorMessage != null) {
- imageLabel.setImage(SmooksUIActivator.getDefault()
- .getImageRegistry().get(SmooksGraphConstants.IMAGE_ERROR));
- notifyLabel.setText(errorMessage);
- canSaveFile = false;
+ protected void updateErrorMessage() {
+ for (Iterator<DesignTimeAnalyzeResult> iterator = this.analyzeResultList
+ .iterator(); iterator.hasNext();) {
+ DesignTimeAnalyzeResult result = (DesignTimeAnalyzeResult) iterator
+ .next();
+ if (result.getErrorMessage() != null) {
+ if(canSaveFile) canSaveFile = false;
+ Label imageLabel = new Label(designTimeAnalyzeResultRegion,
+ SWT.NONE);
+ GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ imageLabel.setLayoutData(gd);
+ imageLabel.setImage(SmooksUIActivator.getDefault()
+ .getImageRegistry().get(
+ SmooksGraphConstants.IMAGE_ERROR));
+ Label notifyLabel = new Label(designTimeAnalyzeResultRegion,
+ SWT.NONE);
+ GridData nlgd = new GridData(GridData.FILL_HORIZONTAL);
+ notifyLabel.setLayoutData(nlgd);
+ notifyLabel.setText(result.getErrorMessage());
+
+ }
}
}
- protected void setWarningMessage(String warningMessage) {
- imageLabel.setImage(SmooksUIActivator.getDefault().getImageRegistry().get(SmooksGraphConstants.IMAGE_EMPTY));
- notifyLabel.setText("");
- if (warningMessage != null) {
- imageLabel
- .setImage(SmooksUIActivator.getDefault().getImageRegistry()
- .get(SmooksGraphConstants.IMAGE_WARNING));
- notifyLabel.setText(warningMessage);
- }
+ protected void updateWarningMessage() {
+
}
protected void analyzeDesignGraph() {
@@ -1283,28 +1297,33 @@
SmooksConfigurationFileGenerateContext context = this
.createContext();
this.initSmooksConfigurationFileGenerateContext(context);
- DesignTimeAnalyzeResult result = analyzer
+ DesignTimeAnalyzeResult[] results = analyzer
.analyzeGraphModel(context);
- if (result != null) {
- String errorMessage = result.getErrorMessage();
- String warningMessage = result.getWarningMessage();
-
- if (errorMessage != null) {
- setErrorMessage(errorMessage);
- return;
- }
-
- if (warningMessage != null) {
- setWarningMessage(warningMessage);
- return;
- }
+ analyzeResultList.clear();
+ for (int i = 0; i < results.length; i++) {
+ analyzeResultList.add(results[i]);
}
+ updateNotifyMessage();
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
+ protected void updateNotifyMessage() {
+ canSaveFile = true;
+ Control[] children = designTimeAnalyzeResultRegion.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ Control c = children[i];
+ c.setVisible(false);
+ c.dispose();
+ c = null;
+ }
+ updateErrorMessage();
+ updateWarningMessage();
+ designTimeAnalyzeResultRegion.layout(true);
+ }
+
/**
* @return the editingDomain
*/
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -393,7 +393,7 @@
return null;
}
- public DesignTimeAnalyzeResult analyzeGraphModel(
+ public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
// TODO Auto-generated method stub
return null;
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-23 23:27:05 UTC (rev 11132)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-24 07:17:20 UTC (rev 11133)
@@ -46,7 +46,7 @@
return null;
}
- public DesignTimeAnalyzeResult analyzeGraphModel(
+ public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
// TODO Auto-generated method stub
return null;
16 years, 3 months
JBoss Tools SVN: r11132 - branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-23 19:27:05 -0400 (Thu, 23 Oct 2008)
New Revision: 11132
Modified:
branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
Log:
fix tests hanging
Modified: branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-23 22:13:10 UTC (rev 11131)
+++ branches/jbosstools-3.0.0.Beta1/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-23 23:27:05 UTC (rev 11132)
@@ -155,17 +155,17 @@
sb.append(s.substring(j));
IFile file = webContent.getFile("long.xhtml");
try {
- boolean save = ResourcesUtils.setBuildAutomatically(false);
+// boolean save = ResourcesUtils.setBuildAutomatically(false);
file.create(new ByteArrayInputStream(sb.toString().getBytes()), true, new NullProgressMonitor());
long time = System.currentTimeMillis();
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
-
+// project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle();
long dt = System.currentTimeMillis() - time;
System.out.println("validated in " + dt);
- ResourcesUtils.setBuildAutomatically(save);
+// ResourcesUtils.setBuildAutomatically(save);
- assertTrue("Validator takes more than 5s (" + (dt/1000d) + ") for validating generated long.xhtml", dt < 5000);
+ assertTrue("Validator takes more than 5s (" + ((dt-500d)/1000d) + ") for validating generated long.xhtml", dt < 5000);
} catch (CoreException e) {
JUnitUtils.fail("", e);
}
16 years, 3 months
JBoss Tools SVN: r11131 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-23 18:13:10 -0400 (Thu, 23 Oct 2008)
New Revision: 11131
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
Log:
Fixing errors in the org.jboss.tools.jsf.vpe.jsf.test tests
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-10-23 22:13:05 UTC (rev 11130)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-10-23 22:13:10 UTC (rev 11131)
@@ -75,7 +75,7 @@
job.setPriority(Job.SHORT);
job.schedule(0L);
job.join();
- TestUtil.waitForIdle();
+ TestUtil.waitForIdle(15*1000*60);
TestUtil.delay(1000L);
closeEditors();
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-23 22:13:05 UTC (rev 11130)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-10-23 22:13:10 UTC (rev 11131)
@@ -259,55 +259,59 @@
assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
- JSPMultiPageEditor part = openEditor(input);
-
- int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
+ ICompletionProposal[] results;
+ try {
+ JSPMultiPageEditor part = openEditor(input);
+
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
- // insert string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, 0, partOfString);
+ // insert string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, 0, partOfString);
- int newPosition = position + partOfString.length();
+ int newPosition = position + partOfString.length();
- // sets cursor position
- part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
- newPosition);
-
- TestUtil.waitForJobs();
- TestUtil.delay(1000);
- SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
- .getSourceEditor()).getSourceViewerConfigurationForTest();
- // errase errors which can be on start of editor(for example xuklunner
- // not found)
- setException(null);
- StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) sourceViewerConfiguration;
- IContentAssistant iContentAssistant = stvc
- .getContentAssistant((ISourceViewer) part.getSourceEditor()
- .getAdapter(ISourceViewer.class));
- assertNotNull(iContentAssistant);
- IContentAssistProcessor iContentAssistProcessor = iContentAssistant
- .getContentAssistProcessor(caName);
- assertNotNull(iContentAssistProcessor);
- ICompletionProposal[] results = iContentAssistProcessor
- .computeCompletionProposals(part.getSourceEditor()
- .getTextViewer(), newPosition);
+ // sets cursor position
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(
+ newPosition);
+
+ TestUtil.waitForJobs();
+ TestUtil.delay(1000);
+ SourceViewerConfiguration sourceViewerConfiguration = ((JSPTextEditor) part
+ .getSourceEditor()).getSourceViewerConfigurationForTest();
+ // errase errors which can be on start of editor(for example xuklunner
+ // not found)
+ setException(null);
+ StructuredTextViewerConfiguration stvc = (StructuredTextViewerConfiguration) sourceViewerConfiguration;
+ IContentAssistant iContentAssistant = stvc
+ .getContentAssistant((ISourceViewer) part.getSourceEditor()
+ .getAdapter(ISourceViewer.class));
+ assertNotNull(iContentAssistant);
+ IContentAssistProcessor iContentAssistProcessor = iContentAssistant
+ .getContentAssistProcessor(caName);
+ assertNotNull(iContentAssistProcessor);
+ results = iContentAssistProcessor
+ .computeCompletionProposals(part.getSourceEditor()
+ .getTextViewer(), newPosition);
- // remove inserted string
- part.getSourceEditor().getTextViewer().getTextWidget()
- .replaceTextRange(position, partOfString.length(), ""); //$NON-NLS-1$
- assertNotNull(results);
- assertTrue("Number of ca proposals shouldn't be a null",results.length>0); //$NON-NLS-1$
- if (isCheck) {
- for (int i = 0; i < results.length; i++) {
+ // remove inserted string
+ part.getSourceEditor().getTextViewer().getTextWidget()
+ .replaceTextRange(position, partOfString.length(), ""); //$NON-NLS-1$
+ assertNotNull(results);
+ assertTrue("Number of ca proposals shouldn't be a null",results.length>0); //$NON-NLS-1$
+ if (isCheck) {
+ for (int i = 0; i < results.length; i++) {
- String displayString = ((ICompletionProposal) results[i]).getDisplayString();
- assertNotNull(displayString);
- assertEquals(true, displayString.startsWith(partOfString));
- }
- }
+ String displayString = ((ICompletionProposal) results[i]).getDisplayString();
+ assertNotNull(displayString);
+ assertEquals(true, displayString.startsWith(partOfString));
+ }
+ }
+ } finally {
+ closeEditors();
+ TestUtil.delay(1000L);
+ }
- closeEditors();
- TestUtil.delay(1000L);
return results;
}
}
16 years, 3 months
JBoss Tools SVN: r11130 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-23 18:13:05 -0400 (Thu, 23 Oct 2008)
New Revision: 11130
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
Log:
Fixing errors in the org.jboss.tools.jsf.vpe.jsf.test tests
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-10-23 22:12:59 UTC (rev 11129)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-10-23 22:13:05 UTC (rev 11130)
@@ -71,6 +71,7 @@
clearAll();
setConnector(null);
setReferenceNode(null);
+ setPageContext(null);
}
/**
16 years, 3 months
JBoss Tools SVN: r11129 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-23 18:12:59 -0400 (Thu, 23 Oct 2008)
New Revision: 11129
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
Fixing errors in the org.jboss.tools.jsf.vpe.jsf.test tests
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-23 22:06:47 UTC (rev 11128)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-23 22:12:59 UTC (rev 11129)
@@ -1,346 +1,350 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.ui.test;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.vpe.VpeDebug;
-import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
-import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Sergey Dzmitrovich
- *
- */
-public abstract class ComponentContentTest extends VpeTest {
-
- public static final String XML_FILE_EXTENSION = ".xml"; //$NON-NLS-1$
-
- public ComponentContentTest(String name) {
- super(name);
- }
-
- /**
- *
- * there are several conditions:
- *
- * 1) xml file which contain tests must be named 'name of test page' +
- * '.xml'
- *
- * Example: test.jsp and test.jsp.xml
- *
- * 2) a tag <test> in xml file and required element in test page must have
- * the same attribute "id"
- *
- * Example: <tests>... <test id="testId" > ...<tests> - in xml file and
- * <html>... <x:testElement id="testId" > ... </html> - in test page
- *
- * @param elementPagePath
- * - path to test page
- * @throws Throwable
- */
- protected void performContentTest(String elementPagePath) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- TestUtil.delay(2000);
- VpeController controller = getVpeController((JSPMultiPageEditor) editor);
-
- // get xml test file
- File xmlTestFile = TestUtil.getComponentPath(
- elementPagePath + XML_FILE_EXTENSION, getTestProjectName())
- .getLocation().toFile();
-
- // get document
- Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
- assertNotNull(xmlTestDocument);
-
- List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
-
- for (String id : ids) {
-
- compareElements(controller, xmlTestDocument, id, id);
- }
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- *
- * @param controller
- * @param xmlTestDocument
- * @param elementId
- * @param xmlTestId
- * @return
- * @throws ComparisonException
- */
- protected void compareElements(VpeController controller,
- Document xmlTestDocument, String elementId, String xmlTestId)
- throws ComparisonException {
-
- // get element by id
- nsIDOMElement vpeElement = findElementById(controller, elementId);
- assertNotNull(vpeElement);
-
- DOMTreeDumper dumper = new DOMTreeDumper(
- VpeDebug.VISUAL_DUMP_PRINT_HASH);
- dumper.dumpToStream(System.out, vpeElement);
-
- // get test element by id - get <test id="..." > element and get his
- // first child
- Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
- .getElemenById(xmlTestDocument, xmlTestId));
-
- assertNotNull(xmlModelElement);
-
- // compare DOMs
- TestDomUtil.compareNodes(vpeElement, xmlModelElement);
-
- }
-
- /**
- * test for invisible tags
- *
- * @param elementPagePath
- * - path to test page
- * @param elementId
- * - id of element on page
- * @throws Throwable
- */
- protected void performInvisibleTagTest(String elementPagePath,
- String elementId) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- VpeController controller = getVpeController((JSPMultiPageEditor) editor);
-
- // find source element and check if it is not null
- Element sourceELement = findSourceElementById(controller, elementId);
- assertNotNull(sourceELement);
-
- // find visual element and check if it is null
- nsIDOMElement visualElement = findElementById(controller, elementId);
- assertNull(visualElement);
-
- // set show invisible tag's flag to true
- controller.getVisualBuilder().setShowInvisibleTags(true);
- controller.visualRefresh();
-
- TestUtil.waitForIdle();
-
- // find visual element and check if it is not null
- visualElement = findElementById(controller, elementId);
- assertNotNull(visualElement);
-
- // generate text for invisible tag
- String modelInvisibleTagText = generateInvisibleTagText(sourceELement
- .getNodeName());
-
- // generate dom document and get root element
- Element modelElement = TestDomUtil.getDocument(modelInvisibleTagText)
- .getDocumentElement();
- assertNotNull(modelElement);
-
- TestDomUtil.compareNodes(visualElement, modelElement);
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- * test for invisible tags which can have visible children
- *
- * @param elementPagePath
- * - path to test page
- * @param elementId
- * - id of element on page
- * @throws Throwable
- */
- protected void performInvisibleWrapperTagTest(String elementPagePath,
- String elementId) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- VpeController controller = getVpeController((JSPMultiPageEditor) editor);
-
- // find source element and check if it is not null
- Element sourceELement = findSourceElementById(controller, elementId);
- assertNotNull(sourceELement);
-
- // find visual element and check if it is null
- nsIDOMElement visualElement = findElementById(controller, elementId);
- assertNull(visualElement);
-
- // check children of non-visual
- NodeList children = sourceELement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node child = children.item(i);
- assertNotNull(findNode(controller, child));
- }
-
- // set show invisible tag's flag to true
- controller.getVisualBuilder().setShowInvisibleTags(true);
- controller.visualRefresh();
-
- TestUtil.waitForIdle();
-
- // find visual element and check if it is not null
- visualElement = findElementById(controller, elementId);
- assertNotNull(visualElement);
-
- // generate text for invisible tag
- String modelInvisibleTagText = generateInvisibleTagText(sourceELement
- .getNodeName());
-
- // generate dom document and get root element
- Element modelElement = TestDomUtil.getDocument(modelInvisibleTagText)
- .getDocumentElement();
- assertNotNull(modelElement);
-
- // compare elements
- TestDomUtil.compareNodes(visualElement, modelElement);
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- *
- * @param tagName
- * @return
- */
- private String generateInvisibleTagText(String tagName) {
- return "<span style=\"border: 1px dashed GREY; color: GREY; font-size: 12px;\" >" //$NON-NLS-1$
- + tagName + "</span>"; //$NON-NLS-1$
- }
-
- /**
- * find visual element by "id" entered in source part of vpe
- *
- * @param controller
- * @param elementId
- * @return
- */
- protected nsIDOMElement findElementById(VpeController controller,
- String elementId) {
-
- Element sourceElement = findSourceElementById(controller, elementId);
-
- VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
- sourceElement);
-
- if (nodeMapping == null)
- return null;
-
- return (nsIDOMElement) nodeMapping.getVisualNode();
- }
-
- /**
- * find visual element by "id" entered in source part of vpe
- *
- * @param controller
- * @param elementId
- * @return
- */
- protected nsIDOMNode findNode(VpeController controller, Node node) {
-
- VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
- node);
-
- if (nodeMapping == null)
- return null;
-
- return nodeMapping.getVisualNode();
- }
-
- /**
- * find source element by "id"
- *
- * @param controller
- * @param elementId
- * @return
- */
- protected Element findSourceElementById(VpeController controller,
- String elementId) {
-
- return getSourceDocument(controller).getElementById(elementId);
- }
-
- /**
- *
- * @return
- */
- abstract protected String getTestProjectName();
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.VpeDebug;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public abstract class ComponentContentTest extends VpeTest {
+
+ public static final String XML_FILE_EXTENSION = ".xml"; //$NON-NLS-1$
+
+ public ComponentContentTest(String name) {
+ super(name);
+ }
+
+ /**
+ *
+ * there are several conditions:
+ *
+ * 1) xml file which contain tests must be named 'name of test page' +
+ * '.xml'
+ *
+ * Example: test.jsp and test.jsp.xml
+ *
+ * 2) a tag <test> in xml file and required element in test page must have
+ * the same attribute "id"
+ *
+ * Example: <tests>... <test id="testId" > ...<tests> - in xml file and
+ * <html>... <x:testElement id="testId" > ... </html> - in test page
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @throws Throwable
+ */
+ protected void performContentTest(String elementPagePath) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ TestUtil.delay(2000);
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // get xml test file
+ File xmlTestFile = TestUtil.getComponentPath(
+ elementPagePath + XML_FILE_EXTENSION, getTestProjectName())
+ .getLocation().toFile();
+
+ // get document
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull(xmlTestDocument);
+
+ List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
+
+ for (String id : ids) {
+
+ compareElements(controller, xmlTestDocument, id, id);
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ *
+ * @param controller
+ * @param xmlTestDocument
+ * @param elementId
+ * @param xmlTestId
+ * @return
+ * @throws ComparisonException
+ */
+ protected void compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId, String xmlTestId)
+ throws ComparisonException {
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull(vpeElement);
+
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.dumpToStream(System.out, vpeElement);
+
+ // get test element by id - get <test id="..." > element and get his
+ // first child
+ Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
+ .getElemenById(xmlTestDocument, xmlTestId));
+
+ assertNotNull(xmlModelElement);
+
+ // compare DOMs
+ try {
+ TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+ } catch (ComparisonException e) {
+ fail(e.getMessage());
+ }
+
+ }
+
+ /**
+ * test for invisible tags
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param elementId
+ * - id of element on page
+ * @throws Throwable
+ */
+ protected void performInvisibleTagTest(String elementPagePath,
+ String elementId) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // find source element and check if it is not null
+ Element sourceELement = findSourceElementById(controller, elementId);
+ assertNotNull(sourceELement);
+
+ // find visual element and check if it is null
+ nsIDOMElement visualElement = findElementById(controller, elementId);
+ assertNull(visualElement);
+
+ // set show invisible tag's flag to true
+ controller.getVisualBuilder().setShowInvisibleTags(true);
+ controller.visualRefresh();
+
+ TestUtil.waitForIdle();
+
+ // find visual element and check if it is not null
+ visualElement = findElementById(controller, elementId);
+ assertNotNull(visualElement);
+
+ // generate text for invisible tag
+ String modelInvisibleTagText = generateInvisibleTagText(sourceELement
+ .getNodeName());
+
+ // generate dom document and get root element
+ Element modelElement = TestDomUtil.getDocument(modelInvisibleTagText)
+ .getDocumentElement();
+ assertNotNull(modelElement);
+
+ TestDomUtil.compareNodes(visualElement, modelElement);
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ * test for invisible tags which can have visible children
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param elementId
+ * - id of element on page
+ * @throws Throwable
+ */
+ protected void performInvisibleWrapperTagTest(String elementPagePath,
+ String elementId) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // find source element and check if it is not null
+ Element sourceELement = findSourceElementById(controller, elementId);
+ assertNotNull(sourceELement);
+
+ // find visual element and check if it is null
+ nsIDOMElement visualElement = findElementById(controller, elementId);
+ assertNull(visualElement);
+
+ // check children of non-visual
+ NodeList children = sourceELement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ assertNotNull(findNode(controller, child));
+ }
+
+ // set show invisible tag's flag to true
+ controller.getVisualBuilder().setShowInvisibleTags(true);
+ controller.visualRefresh();
+
+ TestUtil.waitForIdle();
+
+ // find visual element and check if it is not null
+ visualElement = findElementById(controller, elementId);
+ assertNotNull(visualElement);
+
+ // generate text for invisible tag
+ String modelInvisibleTagText = generateInvisibleTagText(sourceELement
+ .getNodeName());
+
+ // generate dom document and get root element
+ Element modelElement = TestDomUtil.getDocument(modelInvisibleTagText)
+ .getDocumentElement();
+ assertNotNull(modelElement);
+
+ // compare elements
+ TestDomUtil.compareNodes(visualElement, modelElement);
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ *
+ * @param tagName
+ * @return
+ */
+ private String generateInvisibleTagText(String tagName) {
+ return "<span style=\"border: 1px dashed GREY; color: GREY; font-size: 12px;\" >" //$NON-NLS-1$
+ + tagName + "</span>"; //$NON-NLS-1$
+ }
+
+ /**
+ * find visual element by "id" entered in source part of vpe
+ *
+ * @param controller
+ * @param elementId
+ * @return
+ */
+ protected nsIDOMElement findElementById(VpeController controller,
+ String elementId) {
+
+ Element sourceElement = findSourceElementById(controller, elementId);
+
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
+ sourceElement);
+
+ if (nodeMapping == null)
+ return null;
+
+ return (nsIDOMElement) nodeMapping.getVisualNode();
+ }
+
+ /**
+ * find visual element by "id" entered in source part of vpe
+ *
+ * @param controller
+ * @param elementId
+ * @return
+ */
+ protected nsIDOMNode findNode(VpeController controller, Node node) {
+
+ VpeNodeMapping nodeMapping = controller.getDomMapping().getNodeMapping(
+ node);
+
+ if (nodeMapping == null)
+ return null;
+
+ return nodeMapping.getVisualNode();
+ }
+
+ /**
+ * find source element by "id"
+ *
+ * @param controller
+ * @param elementId
+ * @return
+ */
+ protected Element findSourceElementById(VpeController controller,
+ String elementId) {
+
+ return getSourceDocument(controller).getElementById(elementId);
+ }
+
+ /**
+ *
+ * @return
+ */
+ abstract protected String getTestProjectName();
+
+}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-23 22:06:47 UTC (rev 11128)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-23 22:12:59 UTC (rev 11129)
@@ -193,14 +193,18 @@
/**
* Wait for idle.
*/
- public static void waitForIdle() {
+ public static void waitForIdle(long maxIdle) {
long start = System.currentTimeMillis();
while (!Job.getJobManager().isIdle()) {
delay(500);
- if ( (System.currentTimeMillis()-start) > MAX_IDLE )
+ if ( (System.currentTimeMillis()-start) > maxIdle )
throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
}
}
+
+ public static void waitForIdle() {
+ waitForIdle(MAX_IDLE);
+ }
/**
* find elements by name.
16 years, 3 months