JBoss Tools SVN: r15941 - trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-14 22:35:37 -0400 (Sun, 14 Jun 2009)
New Revision: 15941
Modified:
trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
Log:
JBIDE-4471: get a ava.lang.NullPointerException when create local messageexchange
Modified: trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2009-06-12 21:07:44 UTC (rev 15940)
+++ trunk/bpel/plugins/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java 2009-06-15 02:35:37 UTC (rev 15941)
@@ -1049,12 +1049,15 @@
Element messageExchangesElements = ReconciliationHelper
.getBPELChildElementByLocalName(processElement,
"messageExchanges");
+
if (messageExchangesElements != null
&& (process.getMessageExchanges() == null || process
- .getMessageExchanges().getChildren() == null)) {
+ .getMessageExchanges().getChildren() == null
+ )) {
process.setMessageExchanges(xml2MessageExchanges(process
.getMessageExchanges(), messageExchangesElements));
- } else {
+ } else if(messageExchangesElements == null){
+ // add if(messageExchangesElements == null) by Grid.Qian
process.setMessageExchanges(null);
}
16 years, 10 months
JBoss Tools SVN: r15940 - trunk/jbpm/features/org.jboss.tools.flow.common.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 17:07:44 -0400 (Fri, 12 Jun 2009)
New Revision: 15940
Added:
trunk/jbpm/features/org.jboss.tools.flow.common.feature/.project
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/.project
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/.project (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/.project 2009-06-12 21:07:44 UTC (rev 15940)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.flow.common.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss Tools SVN: r15939 - trunk/jbpm/features/org.jboss.tools.flow.common.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 17:07:28 -0400 (Fri, 12 Jun 2009)
New Revision: 15939
Added:
trunk/jbpm/features/org.jboss.tools.flow.common.feature/build.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/build.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/build.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/build.properties 2009-06-12 21:07:28 UTC (rev 15939)
@@ -0,0 +1,2 @@
+bin.includes = feature.xml,\
+ feature.properties
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.properties 2009-06-12 21:07:28 UTC (rev 15939)
@@ -0,0 +1,29 @@
+###############################################################################
+# Copyright (c) 2009 JBoss by Red Hat and others.
+# All rights reserved. This program and the accompanying materials
+# are 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:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Flow Common
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+devUpdateSiteName=JBossTools Development Update Site
+
+# "description" property - description of the feature
+description=
\ No newline at end of file
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.xml (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.xml 2009-06-12 21:07:28 UTC (rev 15939)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.flow.common.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName">
+
+ <description>
+ This feature provides plugins that implement a common base for graphical flow editors
+ </description>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
+ Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+
+1. DEFINITIONS
+
+"Contribution" means:
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+ i) changes to the Program, and
+ ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program
+which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source
+code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other
+intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from
+claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control,and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers wa!
rranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with
+its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
+OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision
+valid and enforceable. If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. Everyone is permit!
ted to copy and distribute copies of this Agreement,
+but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version
+number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.flow.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss Tools SVN: r15938 - in trunk/jbpm/features: org.jboss.tools.jbpm.common.feature and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 17:07:11 -0400 (Fri, 12 Jun 2009)
New Revision: 15938
Modified:
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm.convert.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm3.sdk.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm3.tests.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/build.properties
trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml
trunk/jbpm/features/org.jboss.tools.jbpm4.tests.feature/feature.xml
trunk/jbpm/features/org.jbpm.gd.jpdl.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319 fix feature versions (add .qualifier)
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.flow.jpdl4.feature"
label="%featureName"
- version="1.0.0.CR1"
+ version="1.0.0.qualifier"
provider-name="%providerName">
<description>
Modified: trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm.common.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm.common.feature"
label="jBPM Common"
- version="1.0.0.CR1"
+ version="1.0.0.qualifier"
provider-name="JBoss by Red Hat">
<description>
Modified: trunk/jbpm/features/org.jboss.tools.jbpm.convert.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm.convert.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm.convert.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm.convert.feature"
label="%featureName"
- version="1.0.0"
+ version="1.0.0.qualifier"
provider-name="%providerName"
plugin="org.jboss.tools.jbpm.convert">
Modified: trunk/jbpm/features/org.jboss.tools.jbpm3.sdk.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm3.sdk.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm3.sdk.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm3.sdk.feature"
label="%featureName"
- version="3.2.0"
+ version="3.2.0.qualifier"
provider-name="%featureProvider">
<description>
Modified: trunk/jbpm/features/org.jboss.tools.jbpm3.tests.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm3.tests.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm3.tests.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm3.tests.feature"
label="%featureName"
- version="3.2.0"
+ version="3.2.0.qualifier"
provider-name="%featureProvider">
<description>
Modified: trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/build.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/build.properties 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/build.properties 2009-06-12 21:07:11 UTC (rev 15938)
@@ -1,6 +1,7 @@
bin.includes = feature.xml
generate.feature(a)org.jboss.tools.flow.jpdl4.source.feature=org.jboss.tools.flow.jpdl4.feature
+generate.feature(a)org.jboss.tools.flow.common.source.feature=org.jboss.tools.flow.common.feature
generate.feature(a)org.jboss.tools.jbpm.common.source.feature=org.jboss.tools.jbpm.common.feature
generate.feature(a)org.jboss.tools.jbpm.convert.source.feature=org.jboss.tools.jbpm.convert.feature
generate.feature(a)org.jbpm.gd.jpdl.source.feature=org.jbpm.gd.jpdl.feature
Modified: trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm4.sdk.feature"
label="%"
- version="4.0.0">
+ version="4.0.0.qualifier">
<description>
%description
Modified: trunk/jbpm/features/org.jboss.tools.jbpm4.tests.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm4.tests.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jboss.tools.jbpm4.tests.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jboss.tools.jbpm4.tests.feature"
label="%featureName"
- version="1.0.0"
+ version="1.0.0.qualifier"
provider-name="%featureProvider">
<description>
Modified: trunk/jbpm/features/org.jbpm.gd.jpdl.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jbpm.gd.jpdl.feature/feature.xml 2009-06-12 21:06:51 UTC (rev 15937)
+++ trunk/jbpm/features/org.jbpm.gd.jpdl.feature/feature.xml 2009-06-12 21:07:11 UTC (rev 15938)
@@ -2,7 +2,7 @@
<feature
id="org.jbpm.gd.jpdl.feature"
label="jBPM jPDL Tools"
- version="3.1.7"
+ version="3.1.7.qualifier"
provider-name="JBoss by Red Hat">
<license>
16 years, 10 months
JBoss Tools SVN: r15937 - in trunk/jbpm: plugins/org.jboss.tools.flow.jpdl4/META-INF and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 17:06:51 -0400 (Fri, 12 Jun 2009)
New Revision: 15937
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jbpm.gd.jpdl/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319 fix plugin versions (add .qualifier)
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.flow.common;singleton:=true
-Bundle-Version: 1.0.0.CR1
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.flow.common.Activator
Bundle-Vendor: %Bundle-Vendor.0
Require-Bundle:
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.flow.jpdl4;singleton:=true
-Bundle-Version: 1.0.0.CR1
+Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.flow.common;bundle-version="1.0.0",
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.jboss.tools.flow.jpdl4.multipage;singleton:=true
-Bundle-Version: 1.0.0.CR1
+Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.tools.flow.jpdl4.multipage.MultiPageEditorPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.common/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: jPDL Integration Tools
Bundle-SymbolicName: org.jboss.tools.jbpm.common;singleton:=true
-Bundle-Version: 1.0.0.CR1
+Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: JBoss by Red Hat
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.jface;bundle-version="3.4.2",
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.jboss.tools.jbpm.convert;singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Localization: plugin
Bundle-Activator: org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin
Require-Bundle: org.eclipse.ui,
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jbpm.gd.jpdl/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/plugins/org.jbpm.gd.jpdl/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.jbpm.gd.jpdl;singleton:=true
-Bundle-Version: 3.1.7
+Bundle-Version: 3.1.7.qualifier
Bundle-ClassPath: ui.jar,
lib/dom4j-1.4.jar
Bundle-Activator: org.jbpm.gd.jpdl.Plugin
Modified: trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.jboss.tools.flow.jpdl4.multipage.test
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit;bundle-version="3.8.2"
Modified: trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,6 +2,6 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.jboss.tools.flow.jpdl4.test
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %BundleName
Bundle-SymbolicName: org.jboss.tools.jbpm.common.test
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %BundleProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit,
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %BundleName
Bundle-SymbolicName: org.jboss.tools.jbpm.convert.test;singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.jbpm.convert,
org.junit,
Modified: trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF 2009-06-12 21:06:21 UTC (rev 15936)
+++ trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF 2009-06-12 21:06:51 UTC (rev 15937)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.jbpm.gd.jpdl.test;singleton:=true
-Bundle-Version: 3.1.7
+Bundle-Version: 3.1.7.qualifier
Bundle-Vendor: %bundleProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
16 years, 10 months
JBoss Tools SVN: r15936 - in trunk/jbpm/features: org.jboss.tools.flow.common.feature and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 17:06:21 -0400 (Fri, 12 Jun 2009)
New Revision: 15936
Added:
trunk/jbpm/features/org.jboss.tools.flow.common.feature/
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/build.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/license.html
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.ini
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.mappings
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/build.properties
trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/plugin.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319 add source feature/plugin for flow.common
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/build.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/build.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/build.properties 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2009 Red Hat and others.
+# All rights reserved. This program and the accompanying materials
+# are 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 - initial API and implementation
+###############################################################################
+
+bin.includes = feature.*,\
+ license.html
+
+
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,21 @@
+# properties file for org.jboss.tools.jmx.source
+featureName=Flow Common Source
+featureProvider=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=Flow Common Source
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\nMarch 17, 2005\n\nUsage Of Content\n\nTHE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\nOTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\nUSE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\nAGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\nNOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\nAGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\nAND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\nOR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\nTERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\nOF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\nBELOW, THEN YOU MAY NOT USE THE CONTENT.\n\nApplicable Licenses\n\nUnless otherwise indicated, all Content made available by the Eclipse Foundation\nis provided to you under the terms and conditio!
ns of the Eclipse Public\nLicense Version 1.0 ("EPL"). A copy of the EPL is provided with this\nContent and is also available at http\://www.eclipse.org/legal/epl-v10.html.\nFor purposes of the EPL, "Program" will mean the Content.\n\nContent includes, but is not limited to, source code, object code,\ndocumentation and other files maintained in the Eclipse.org CVS\nrepository ("Repository") in CVS modules ("Modules") and made available\nas downloadable archives ("Downloads").\n\n- Content may be structured and packaged into modules to facilitate delivering,\nextending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\nplug-in fragments ("Fragments"), and features ("Features").\n- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\nin a directory named "plugins".\n- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\nEach Feature may be packaged as a sub-directory in a directory!
named "features".\nWithin a Feature, files named "feature.xml" may co
ntain a list of the names and version\nnumbers of the Plug-ins and/or Fragments associated with that Feature.\n- Features may also include other Features ("Included Features"). Within a Feature, files\nnamed "feature.xml" may contain a list of the names and version numbers of Included Features.\n\nFeatures may also include other Features ("Included Features"). Files named\n"feature.xml" may contain a list of the names and version numbers of\nIncluded Features.\n\nThe terms and conditions governing Plug-ins and Fragments should be\ncontained in files named "about.html" ("Abouts"). The terms and\nconditions governing Features and Included Features should be contained\nin files named "license.html" ("Feature Licenses"). Abouts and Feature\nLicenses may be located in any directory of a Download or Module\nincluding, but not limited to the following locations\:\n\n- The top-level (root) directory\n- Plug-in and Fragment directories\n- Inside Plug-ins and Fragments packaged as JAR!
s\n- Sub-directories of the directory named "src" of certain Plug-ins\n- Feature directories\n\nNote\: if a Feature made available by the Eclipse Foundation is installed using the\nEclipse Update Manager, you must agree to a license ("Feature Update\nLicense") during the installation process. If the Feature contains\nIncluded Features, the Feature Update License should either provide you\nwith the terms and conditions governing the Included Features or inform\nyou where you can locate them. Feature Update Licenses may be found in\nthe "license" property of files named "feature.properties". Such Abouts,\nFeature Licenses and Feature Update Licenses contain the terms and\nconditions (or references to such terms and conditions) that govern your\nuse of the associated Content in that directory.\n\nTHE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\nTO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\nSOME OF THESE OTHER LICENSE AGREEMENTS MA!
Y INCLUDE (BUT ARE NOT LIMITED TO)\:\n\n- Common Public License Versio
n 1.0 (available at http\://www.eclipse.org/legal/cpl-v10.html)\n- Apache Software License 1.1 (available at http\://www.apache.org/licenses/LICENSE)\n- Apache Software License 2.0 (available at http\://www.apache.org/licenses/LICENSE-2.0)\n- IBM Public License 1.0 (available at http\://oss.software.ibm.com/developerworks/opensource/license10.html)\n- Metro Link Public License 1.00 (available at http\://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n- Mozilla Public License Version 1.1 (available at http\://www.mozilla.org/MPL/MPL-1.1.html)\n\nIT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\nTO USE OF THE CONTENT. If no About, Feature License or Feature Update License\nis provided, please contact the Eclipse Foundation to determine what terms and conditions\ngovern that particular Content.\n\nCryptography\n\nContent may contain encryption software. The country in which you are\ncurrently may have restrictions on the import, posse!
ssion, and use,\nand/or re-export to another country, of encryption software. BEFORE\nusing any encryption software, please check the country's laws,\nregulations and policies concerning the import, possession, or use,\nand re-export of encryption software, to see if this is permitted.\n\nJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
+
\ No newline at end of file
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/license.html
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/license.html (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/license.html 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
+ modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/license.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.ini
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.ini (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.ini 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,29 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+#featureImage=eclipse32.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (translated)
+# needed for primary features only
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+# optional
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.ini
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.mappings
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.mappings (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.mappings 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
\ No newline at end of file
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.properties 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,7 @@
+blurb=Flow Common Source\n\
+\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+(c) Copyright Red Hat contributors and others, 2009. All rights reserved.\n\
+Visit http://www.jboss.org/tools
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/about.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/build.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/build.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/build.properties 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,5 @@
+bin.includes = plugin.*,\
+ about.*,\
+ src/,\
+ META-INF/
+sourcePlugin = true
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/plugin.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/plugin.properties (rev 0)
+++ trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/plugin.properties 2009-06-12 21:06:21 UTC (rev 15936)
@@ -0,0 +1,3 @@
+pluginName = Flow Common Source
+providerName = JBoss by Red Hat
+
Property changes on: trunk/jbpm/features/org.jboss.tools.flow.common.feature/sourceTemplatePlugin/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss Tools SVN: r15935 - in trunk/jbpm/plugins: org.jboss.tools.flow.common and 20 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-06-12 16:58:42 -0400 (Fri, 12 Jun 2009)
New Revision: 15935
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.common/
trunk/jbpm/plugins/org.jboss.tools.flow.common/.classpath
trunk/jbpm/plugins/org.jboss.tools.flow.common/.project
trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/
trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.flow.common/build.properties
trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/
trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutH.gif
trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutV.gif
trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.properties
trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/
trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/elements.exsd
trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/languages.exsd
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Activator.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/HorizontalAutoLayoutAction.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ChangeConstraintCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/CreateBendpointCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteBendpointCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteConnectionCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/LabelMoveCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/MoveBendpointCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/RenameElementCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/SplitConnectionCommand.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/DropDownMenuWithDefaultAction.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericActionBarContributor.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericContextMenuProvider.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/OverviewOutlinePage.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/PaletteFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/CellEditorLocator.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/AbstractElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondAnchor.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementContainerFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RectangleElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RoundedRectangleElementFigure.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Connection.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Container.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultContainer.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Element.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Flow.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Node.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionBendpointEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditManager.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementNodeEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/LabelGraphicalNodeEditPolicy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsElementStrategy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsIncomingConnectionStrategy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsOutgoingConnectionStrategy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/SaveElementStrategy.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/LabelWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelListener.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java
trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4319
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/.classpath
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/.classpath (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/.classpath 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/.project
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/.project (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/.project 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.flow.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.flow.common;singleton:=true
+Bundle-Version: 1.0.0.CR1
+Bundle-Activator: org.jboss.tools.flow.common.Activator
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle:
+ org.eclipse.ui.views,
+ org.eclipse.draw2d,
+ org.eclipse.gef,
+ org.eclipse.jface,
+ org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide
+Bundle-ActivationPolicy: lazy
+Export-Package: org.jboss.tools.flow.common;uses:="org.eclipse.core.runtime,org.eclipse.ui.plugin,org.osgi.framework",
+ org.jboss.tools.flow.common.action,
+ org.jboss.tools.flow.common.command,
+ org.jboss.tools.flow.common.editor,
+ org.jboss.tools.flow.common.editpart,
+ org.jboss.tools.flow.common.figure,
+ org.jboss.tools.flow.common.model,
+ org.jboss.tools.flow.common.policy,
+ org.jboss.tools.flow.common.properties,
+ org.jboss.tools.flow.common.registry,
+ org.jboss.tools.flow.common.strategy,
+ org.jboss.tools.flow.common.wrapper
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/build.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/build.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/build.properties 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,11 @@
+jars.compile.order = .
+source.. = src/
+src.includes = src/,\
+ build.properties,\
+ META-INF/
+bin.includes = .,\
+ META-INF/,\
+ plugin.xml,\
+ icons/,\
+ plugin.properties
+output.. = bin/
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutH.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutH.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutV.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/icons/layoutV.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.properties 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.flow.common
+Bundle-Vendor.0 = JBoss
+Bundle-Name.0 = JBoss Tools Process Plug-in
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.xml (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.xml 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="languages" name="JBoss Tools Flow Language Extensions" schema="schema/languages.exsd"/>
+ <extension-point id="elements" name="JBoss Tools Flow Language Elements" schema="schema/elements.exsd"/>
+
+</plugin>
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/elements.exsd
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/elements.exsd (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/elements.exsd 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,266 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.flow.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.flow.common" id="elements" name="Flow Language Elements"/>
+ </appInfo>
+ <documentation>
+ This extension point provides a way to contribute language elements to a target flow language.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="element" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="element">
+ <complexType>
+ <choice minOccurs="0" maxOccurs="1">
+ <element ref="flow"/>
+ <element ref="container"/>
+ <element ref="node"/>
+ <element ref="connection"/>
+ </choice>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="language" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="figure" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="flow">
+ <complexType>
+ <attribute name="acceptsElementStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="node">
+ <complexType>
+ <sequence>
+ <element ref="figure" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="acceptsIncomingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="container">
+ <complexType>
+ <attribute name="acceptsElementStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsElementStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsIncomingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="acceptsOutgoingConnectionStrategy" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="connection" type="string">
+ </element>
+
+ <element name="figure">
+ <complexType>
+ <choice minOccurs="0" maxOccurs="1">
+ <element ref="ellipse"/>
+ <element ref="rectangle"/>
+ <element ref="rounded-rectangle"/>
+ </choice>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.flow.common.figure.ElementFigure"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="color" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ellipse" type="string">
+ </element>
+
+ <element name="rectangle" type="string">
+ </element>
+
+ <element name="rounded-rectangle" type="string">
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/elements.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/languages.exsd
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/languages.exsd (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/languages.exsd 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,113 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.flow.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.flow.common" id="language" name="JBoss Tools Flow Language Extensions"/>
+ </appinfo>
+ <documentation>
+ This extension points enables to register domain specific languages that can be edited as graphs or flows. The language is associated with an appropriate editor.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="language"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="language">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="editor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/schema/languages.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Activator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Activator.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Activator.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,64 @@
+package org.jboss.tools.flow.common;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">kris verlaenen </a>
+ */
+public class Activator extends AbstractUIPlugin {
+
+ public static final String PLUGIN_ID = "org.jboss.tools.process";
+
+ private static Activator plugin;
+
+ public Activator() {
+ plugin = this;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ private static String getUniqueIdentifier() {
+ if (getDefault() == null ) {
+ return PLUGIN_ID;
+ }
+ return getDefault().getBundle().getSymbolicName();
+ }
+
+ public static void log(Throwable t) {
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), 0,
+ "Internal error in JBoss Tools Process Plugin: ", t));
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,37 @@
+package org.jboss.tools.flow.common;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+public class Logger {
+
+ public static void logInfo(String message) {
+ log(IStatus.INFO, IStatus.OK, message, null);
+ }
+
+ public static void logError(Throwable exception) {
+ logError("Unexpected Exception", exception);
+ }
+
+ public static void logError(String message, Throwable exception) {
+ log(IStatus.ERROR, IStatus.OK, message, exception);
+ }
+
+ public static void log(int severity, int code, String message, Throwable exception) {
+ log(createStatus(severity, code, message, exception));
+ }
+
+ public static IStatus createStatus(int severity, int code, String message, Throwable exception) {
+ return new Status(
+ severity,
+ Activator.getDefault().getBundle().getSymbolicName(),
+ code,
+ message,
+ exception);
+ }
+
+ public static void log(IStatus status) {
+ Activator.getDefault().getLog().log(status);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/HorizontalAutoLayoutAction.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/HorizontalAutoLayoutAction.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/HorizontalAutoLayoutAction.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,56 @@
+package org.jboss.tools.flow.common.action;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Map;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.graph.DirectedGraph;
+import org.eclipse.draw2d.graph.Node;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.flow.common.Activator;
+
+/**
+ * Action for auto layouting a process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class HorizontalAutoLayoutAction extends VerticalAutoLayoutAction {
+
+ public static final String ID = "org.jboss.tools.process.editor.action.HorizontalAutoLayoutAction";
+
+ public HorizontalAutoLayoutAction(GraphicalViewer diagramViewer) {
+ super(diagramViewer);
+ }
+
+ protected void initialize() {
+ setId(ID);
+ setText("Auto Layout (Horizontal)");
+ setImageDescriptor(
+ ImageDescriptor.createFromURL(
+ Activator.getDefault().getBundle().getEntry("icons/layoutH.gif")));
+ setToolTipText("Auto layout the process (horizontal)");
+ }
+
+ protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
+ DirectedGraph graph = super.createDirectedGraph(mapping);
+ graph.setDirection(PositionConstants.HORIZONTAL);
+ return graph;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/HorizontalAutoLayoutAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,103 @@
+package org.jboss.tools.flow.common.action;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.graph.DirectedGraph;
+import org.eclipse.draw2d.graph.DirectedGraphLayout;
+import org.eclipse.draw2d.graph.Edge;
+import org.eclipse.draw2d.graph.Node;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.jboss.tools.flow.common.Activator;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Action for auto layouting a process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class VerticalAutoLayoutAction extends Action implements IAction {
+
+ public static final String ID = "org.jboss.tools.process.editor.action.VerticalAutoLayoutAction";
+
+ private GraphicalViewer diagramViewer;
+
+ public VerticalAutoLayoutAction(GraphicalViewer diagramViewer) {
+ this.diagramViewer = diagramViewer;
+ initialize();
+ }
+
+ protected void initialize() {
+ setId(ID);
+ setText("Auto Layout (Vertical)");
+ setImageDescriptor(
+ ImageDescriptor.createFromURL(
+ Activator.getDefault().getBundle().getEntry("icons/layoutV.gif")));
+ setToolTipText("Auto layout the process (vertical)");
+ }
+
+ public void run() {
+ Map<String, Node> mapping = new HashMap<String, Node>();
+ DirectedGraph graph = createDirectedGraph(mapping);
+ DirectedGraphLayout layout = new DirectedGraphLayout();
+ layout.visit(graph);
+ for (Map.Entry<String, Node> entry: mapping.entrySet()) {
+ Node node = entry.getValue();
+ NodeWrapper nodeWrapper =
+ ((FlowWrapper)diagramViewer.getContents().getModel()).getNodeWrapper(entry.getKey());
+ nodeWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected DirectedGraph createDirectedGraph(Map<String, Node> mapping) {
+ DirectedGraph graph = new DirectedGraph();
+ FlowWrapper processWrapper = (FlowWrapper)diagramViewer.getContents().getModel();
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
+ Node node = new Node();
+ Integer width = (Integer) elementWrapper.getConstraint().width;
+ Integer height = (Integer) elementWrapper.getConstraint().height;
+ if (width == null || width <= 0) {
+ width = 80;
+ }
+ if (height == null || height <= 0) {
+ height = 40;
+ }
+ node.setSize(new Dimension(width, height));
+ graph.nodes.add(node);
+ mapping.put(elementWrapper.getId(), node);
+ }
+ for (NodeWrapper elementWrapper: processWrapper.getNodeWrappers()) {
+ for (ConnectionWrapper connection: elementWrapper.getIncomingConnections()) {
+ Node source = mapping.get(connection.getSource().getId());
+ Node target = mapping.get(connection.getTarget().getId());
+ graph.edges.add(new Edge(source, target));
+ }
+ }
+ return graph;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/action/VerticalAutoLayoutAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,32 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class AddChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.addChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeChild(type, child);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddChildCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,63 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for adding an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class AddNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ public void execute() {
+ parent.addElement(child);
+ child.setParent(parent);
+ }
+
+ protected ContainerWrapper getParent() {
+ return parent;
+ }
+
+ protected NodeWrapper getChild() {
+ return child;
+ }
+
+ public void setChild(NodeWrapper newChild) {
+ child = newChild;
+ }
+
+ public void setParent(ContainerWrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.removeElement(child);
+ child.setParent(null);
+ }
+
+ public boolean canExecute() {
+ return parent.acceptsElement(child);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/AddNodeCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ChangeConstraintCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ChangeConstraintCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ChangeConstraintCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,50 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for changing a constraint.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ChangeConstraintCommand extends Command {
+
+ private NodeWrapper element;
+ private Rectangle constraint;
+ private Rectangle oldConstraint;
+
+ public void execute() {
+ element.setConstraint(constraint);
+ }
+
+ public void setConstraint(Rectangle rect) {
+ constraint = rect;
+ }
+
+ public void setElement(NodeWrapper element) {
+ this.element = element;
+ oldConstraint = element.getConstraint();
+ }
+
+ public void undo() {
+ element.setConstraint(oldConstraint);
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ChangeConstraintCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/CreateBendpointCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/CreateBendpointCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/CreateBendpointCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,53 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+
+/**
+ * A command for creating a bendpoint.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class CreateBendpointCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private Point location;
+ private int index;
+
+ public void execute() {
+ connection.addBendpoint(index, location);
+ }
+
+ public void setConnection(Object model) {
+ connection = (ConnectionWrapper) model;
+ }
+
+ public void setIndex(int i) {
+ index = i;
+ }
+
+ public void setLocation(Point point) {
+ location = point;
+ }
+
+ public void undo() {
+ connection.removeBendpoint(index);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/CreateBendpointCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteBendpointCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteBendpointCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteBendpointCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,51 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+
+
+/**
+ * A command for deleting a bendpoint.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class DeleteBendpointCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private Point oldLocation;
+ private int index;
+
+ public void execute() {
+ oldLocation = (Point) connection.getBendpoints().get(index);
+ connection.removeBendpoint(index);
+ }
+
+ public void setConnectionModel(Object model) {
+ connection = (ConnectionWrapper) model;
+ }
+
+ public void setIndex(int i) {
+ index = i;
+ }
+
+ public void undo() {
+ connection.addBendpoint(index, oldLocation);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteBendpointCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,36 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class DeleteChildCommand extends Command {
+
+ private Wrapper child;
+ private Wrapper parent;
+ private Object type;
+
+ public void execute() {
+ parent.removeChild(type, child);
+ }
+
+ public void setChild(Wrapper newChild) {
+ child = newChild;
+ }
+
+ public void setType(Object newType) {
+ type = newType;
+ }
+
+ public void setParent(Wrapper newParent) {
+ parent = newParent;
+ }
+
+ public void undo() {
+ parent.addChild(type, child);
+ }
+
+ public boolean canExecute() {
+ return child != null && parent != null && type != null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteChildCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteConnectionCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteConnectionCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteConnectionCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,53 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for deleting a connection.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class DeleteConnectionCommand extends Command {
+
+ private NodeWrapper source;
+ private NodeWrapper target;
+ private ConnectionWrapper connection;
+
+ public void execute() {
+ connection.disconnect();
+ }
+
+ public void setSource(NodeWrapper action) {
+ source = action;
+ }
+
+ public void setTarget(NodeWrapper action) {
+ target = action;
+ }
+
+ public void setAntecedentTaskConnection(ConnectionWrapper connection) {
+ this.connection = connection;
+ }
+
+ public void undo() {
+ connection.connect(source, target);
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteConnectionCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,130 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for deleting an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class DeleteNodeCommand extends Command {
+
+ private NodeWrapper child;
+ private ContainerWrapper parent;
+
+ private List<DeleteNodeCommand> embeddedCommands;
+
+ private List<NodeWrapper> incomingElementWrappers = new ArrayList<NodeWrapper>();
+ private List<NodeWrapper> outgoingElementWrappers = new ArrayList<NodeWrapper>();
+ private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
+
+
+ private void deleteConnections(NodeWrapper element) {
+ for (ConnectionWrapper connection: element.getIncomingConnections()) {
+ incomingElementWrappers.add(connection.getSource());
+ incomingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: element.getOutgoingConnections()) {
+ outgoingElementWrappers.add(connection.getTarget());
+ outgoingConnections.add(connection);
+ }
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.disconnect();
+ }
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.disconnect();
+ }
+ }
+
+ private void initializeEmbeddedCommands() {
+ embeddedCommands = new ArrayList<DeleteNodeCommand>();
+ ContainerWrapper container = (ContainerWrapper)child;
+ List<NodeWrapper> children = container.getNodeWrappers();
+ for (NodeWrapper w : children) {
+ DeleteNodeCommand c = new DeleteNodeCommand();
+ c.setParent(container);
+ c.setChild(w);
+ embeddedCommands.add(c);
+ }
+ }
+
+ private void executeEmbeddedCommands() {
+ if (embeddedCommands == null) {
+ initializeEmbeddedCommands();
+ }
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.execute();
+ }
+ }
+
+ public void execute() {
+ if (child instanceof ContainerWrapper) {
+ executeEmbeddedCommands();
+ }
+ deleteConnections(child);
+ parent.removeElement(child);
+ }
+
+ private void restoreConnections() {
+ int i = 0;
+ for (ConnectionWrapper connection: incomingConnections) {
+ connection.connect((NodeWrapper) incomingElementWrappers.get(i), child);
+ i++;
+ }
+ i = 0;
+ for (ConnectionWrapper connection: outgoingConnections) {
+ connection.connect(child, (NodeWrapper) outgoingElementWrappers.get(i));
+ i++;
+ }
+ incomingConnections.clear();
+ incomingElementWrappers.clear();
+ outgoingConnections.clear();
+ outgoingElementWrappers.clear();
+ }
+
+ public void setChild(NodeWrapper child) {
+ this.child = child;
+ }
+
+ public void setParent(ContainerWrapper parent) {
+ this.parent = parent;
+ }
+
+ private void undoEmbeddedCommands() {
+ for (DeleteNodeCommand c : embeddedCommands) {
+ c.undo();
+ }
+ }
+
+ public void undo() {
+ parent.addElement(child);
+ restoreConnections();
+ if (child instanceof ContainerWrapper) {
+ undoEmbeddedCommands();
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/DeleteNodeCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,80 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for creating an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementConnectionCreateCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private NodeWrapper source;
+ private NodeWrapper target;
+
+ public boolean canExecute() {
+ if (source.equals(target)) {
+ return false;
+ }
+ // Check for existence of connection already
+ for (ConnectionWrapper connection: source.getOutgoingConnections()) {
+ if (connection.getTarget().equals(target)) {
+ return false;
+ }
+ }
+ return source.acceptsOutgoingConnection(connection, target)
+ && target != null && target.acceptsIncomingConnection(connection, source);
+ }
+
+ public void execute() {
+ connection.connect(source, target);
+ }
+
+ public NodeWrapper getSource() {
+ return source;
+ }
+
+ public NodeWrapper getTarget() {
+ return target;
+ }
+
+ public void redo() {
+ connection.connect(source, target);
+ }
+
+ public void setSource(NodeWrapper source) {
+ this.source = source;
+ }
+
+ public void setConnection(ConnectionWrapper connection) {
+ this.connection = connection;
+ }
+
+ public void setTarget(NodeWrapper target) {
+ this.target = target;
+ }
+
+ public void undo() {
+ connection.disconnect();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ElementConnectionCreateCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/LabelMoveCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/LabelMoveCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/LabelMoveCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,40 @@
+package org.jboss.tools.flow.common.command;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+
+
+public class LabelMoveCommand extends Command {
+
+ LabelWrapper labelWrapper = null;
+ Point location = null;
+ IFigure parent = null;
+ Point oldOffset = null;
+ Point newOffset = null;
+
+ public LabelMoveCommand(LabelWrapper labelWrapper, IFigure parent, Point location) {
+ this.labelWrapper = labelWrapper;
+ this.parent = parent;
+ this.location = location;
+ }
+
+ public void execute() {
+ if (oldOffset == null) {
+ oldOffset = labelWrapper.getLocation();
+ }
+ if (newOffset == null) {
+ newOffset = labelWrapper.getLocation().getCopy();
+ parent.translateToAbsolute(newOffset);
+ newOffset.translate(location);
+ parent.translateToRelative(newOffset);
+ }
+ labelWrapper.setLocation(newOffset);
+ }
+
+ public void undo() {
+ labelWrapper.setLocation(oldOffset);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/LabelMoveCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/MoveBendpointCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/MoveBendpointCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/MoveBendpointCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,54 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+
+/**
+ * A command for moving a bendpoint.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class MoveBendpointCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private Point oldLocation, newLocation;
+ private int index;
+
+ public void execute() {
+ oldLocation = (Point) connection.getBendpoints().get(index);
+ connection.replaceBendpoint(index, newLocation);
+ }
+
+ public void setConnectionModel(Object model) {
+ connection = (ConnectionWrapper) model;
+ }
+
+ public void setIndex(int i) {
+ index = i;
+ }
+
+ public void setNewLocation(Point point) {
+ newLocation = point;
+ }
+
+ public void undo() {
+ connection.replaceBendpoint(index, oldLocation);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/MoveBendpointCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,73 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for reconnecting the source of a connection.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ReconnectElementConnectionSourceCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private NodeWrapper target;
+ private NodeWrapper oldSource;
+ private NodeWrapper newSource;
+
+ public boolean canExecute() {
+ if (connection.getTarget().equals(newSource)) {
+ return false;
+ }
+ for (ConnectionWrapper connection: newSource.getOutgoingConnections()) {
+ if (connection.getTarget().equals(target) && !connection.getSource().equals(oldSource)) {
+ return false;
+ }
+ }
+ return newSource.acceptsOutgoingConnection(connection, target); //XXX
+ }
+
+ public void execute() {
+ if (newSource != null) {
+ connection.disconnect();
+ connection.connect(newSource, target);
+ }
+ }
+
+ public void setSource(NodeWrapper source) {
+ this.newSource = source;
+ }
+
+ public void setConnection(ConnectionWrapper connection) {
+ this.connection = connection;
+ this.target = connection.getTarget();
+ this.oldSource = connection.getSource();
+ }
+
+ public void undo() {
+ connection.disconnect();
+ connection.connect(oldSource, target);
+ }
+
+ public void redo() {
+ connection.disconnect();
+ connection.connect(newSource, target);
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionSourceCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,74 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for reconnecting the target of a connection.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ReconnectElementConnectionTargetCommand extends Command {
+
+ private ConnectionWrapper connection;
+ private NodeWrapper oldTarget;
+ private NodeWrapper newTarget;
+ private NodeWrapper source;
+
+
+ public boolean canExecute() {
+ if (connection.getSource().equals(newTarget)) {
+ return false;
+ }
+ for (ConnectionWrapper connection: newTarget.getIncomingConnections()) {
+ if (connection.getSource().equals(source) && !connection.getTarget().equals(oldTarget)) {
+ return false;
+ }
+ }
+ return newTarget.acceptsIncomingConnection(connection, source);
+ }
+
+ public void execute() {
+ if (newTarget != null) {
+ connection.disconnect();
+ connection.connect(source, newTarget);
+ }
+ }
+
+ public void setTarget(NodeWrapper target) {
+ this.newTarget = target;
+ }
+
+ public void setConnection(ConnectionWrapper connection) {
+ this.connection = connection;
+ this.source = connection.getSource();
+ this.oldTarget = connection.getTarget();
+ }
+
+ public void undo() {
+ connection.disconnect();
+ connection.connect(source, oldTarget);
+ }
+
+ public void redo() {
+ connection.disconnect();
+ connection.connect(source, newTarget);
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/ReconnectElementConnectionTargetCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/RenameElementCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/RenameElementCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/RenameElementCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,58 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+
+/**
+ * A command for renaming an element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class RenameElementCommand extends Command {
+
+ private IPropertySource source;
+ private String name;
+ private String oldName;
+
+
+ public void execute() {
+ if (source != null) {
+ source.setPropertyValue(IPropertyId.NAME, name);
+ }
+ }
+
+ public void setName(String string) {
+ name = string;
+ }
+
+ public void setOldName(String string) {
+ oldName = string;
+ }
+
+ public void setSource(IPropertySource propertySource) {
+ source = propertySource;
+ }
+
+ public void undo() {
+ if (source != null) {
+ source.setPropertyValue(IPropertyId.NAME, oldName);
+ }
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/RenameElementCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/SplitConnectionCommand.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/SplitConnectionCommand.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/SplitConnectionCommand.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,94 @@
+package org.jboss.tools.flow.common.command;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * A command for splitting a connection.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class SplitConnectionCommand extends Command {
+
+ private FlowWrapper parent;
+ private NodeWrapper oldSource;
+ private NodeWrapper oldTarget;
+ private ConnectionWrapper oldConnection;
+ private ConnectionWrapper secondConnection;
+ private NodeWrapper newElement;
+
+ public void setNewSecondConnection(ConnectionWrapper connection) {
+ if (connection == null) {
+ throw new IllegalArgumentException("new second connection cannot be null");
+ }
+ this.secondConnection = connection;
+ }
+
+ public void execute() {
+ if (secondConnection == null) {
+ throw new IllegalStateException("new second connection is still null");
+ }
+ oldConnection.disconnect();
+ parent.addElement(newElement);
+ newElement.setParent(parent);
+ oldConnection.connect(oldSource, newElement);
+ secondConnection.connect(newElement, oldTarget);
+ }
+
+ public void setParent(FlowWrapper flow) {
+ if (flow == null) {
+ throw new IllegalArgumentException("process is null");
+ }
+ parent = flow;
+ }
+
+ public void setElementConnection(ConnectionWrapper connection) {
+ if (connection == null) {
+ throw new IllegalArgumentException("Element connection is null");
+ }
+ this.oldConnection = connection;
+ oldSource = connection.getSource();
+ oldTarget = connection.getTarget();
+ }
+
+ public void setNewElement(NodeWrapper newElement) {
+ if (newElement == null) {
+ throw new IllegalArgumentException("NewElement is null");
+ }
+ this.newElement = newElement;
+
+ }
+
+ public void undo() {
+ oldConnection.disconnect();
+ secondConnection.disconnect();
+ parent.removeElement(newElement);
+ newElement.setParent(null);
+ oldConnection.connect(oldSource, oldTarget);
+ }
+
+ public boolean canExecute() {
+ return parent.acceptsElement(newElement) &&
+ newElement.acceptsIncomingConnection(oldConnection, oldSource) &&
+ newElement.acceptsOutgoingConnection(secondConnection, oldTarget);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/command/SplitConnectionCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/DropDownMenuWithDefaultAction.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/DropDownMenuWithDefaultAction.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/DropDownMenuWithDefaultAction.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,147 @@
+package org.jboss.tools.flow.common.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+
+public class DropDownMenuWithDefaultAction extends Action implements IMenuCreator {
+
+ private Menu dropDownMenu;
+ private IAction delegate;
+ private List<Object> list;
+ private IPropertyChangeListener enabledListener;
+ private SelectionListener selectionListener;
+
+ public DropDownMenuWithDefaultAction(final IAction action) {
+ this.selectionListener = new ItemSelectionListener(this);
+ setMenuCreator(this);
+ this.dropDownMenu = null;
+ setAction(action);
+ this.list = new ArrayList<Object>();
+ }
+
+ public void dispose() {
+ if (this.dropDownMenu != null) {
+ this.dropDownMenu.dispose();
+ this.dropDownMenu = null;
+ }
+ }
+
+ public void add(final IContributionItem item) {
+ this.list.add(item);
+ }
+
+ public void add(final IAction action) {
+ this.list.add(action);
+ }
+
+ public Menu getMenu(final Control parent) {
+ if (this.dropDownMenu == null) {
+ this.dropDownMenu = new Menu(parent);
+ populateMenu();
+ }
+ return this.dropDownMenu;
+ }
+
+ public Menu getMenu(final Menu parent) {
+ if (this.dropDownMenu == null) {
+ this.dropDownMenu = new Menu(parent);
+ populateMenu();
+ }
+ return this.dropDownMenu;
+ }
+
+ private void populateMenu() {
+ for (Object object: list) {
+ if (object instanceof IContributionItem) {
+ final IContributionItem item = (IContributionItem) object;
+ item.fill(this.dropDownMenu, -1);
+ } else {
+ final IAction action = (IAction) object;
+ final ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(this.dropDownMenu, -1);
+ }
+ }
+ final MenuItem[] items = this.dropDownMenu.getItems();
+ for (int i = 0; i < items.length; i++) {
+ items[i].addSelectionListener(this.selectionListener);
+ }
+ }
+
+ public void setAction(final IAction action) {
+ if (this.enabledListener == null) {
+ this.enabledListener = new EnabledPropertyChangeListener(this);
+ }
+ setText(action.getText());
+ setToolTipText(action.getToolTipText());
+ setImageDescriptor(action.getImageDescriptor());
+ setDisabledImageDescriptor(action.getDisabledImageDescriptor());
+ setEnabled(action.isEnabled());
+ setDescription(action.getDescription());
+ setHelpListener(action.getHelpListener());
+ setHoverImageDescriptor(action.getHoverImageDescriptor());
+ if (this.delegate != null) {
+ this.delegate.removePropertyChangeListener(this.enabledListener);
+ }
+ this.delegate = action;
+ this.delegate.addPropertyChangeListener(this.enabledListener);
+ }
+
+ public void run() {
+ this.delegate.run();
+ }
+
+ public static class EnabledPropertyChangeListener implements IPropertyChangeListener {
+ private IAction action;
+
+ public EnabledPropertyChangeListener(final IAction action) {
+ this.action = action;
+ }
+
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getProperty().equals(IAction.ENABLED)) {
+ this.action.setEnabled(((Boolean) event.getNewValue())
+ .booleanValue());
+ }
+ }
+ }
+
+ public static class ItemSelectionListener implements SelectionListener {
+ private DropDownMenuWithDefaultAction dropDownMenu;
+
+ public ItemSelectionListener(
+ final DropDownMenuWithDefaultAction dropDownMenu) {
+ this.dropDownMenu = dropDownMenu;
+ }
+
+ public void widgetDefaultSelected(final SelectionEvent e) {
+ final MenuItem menuItem = (MenuItem) e.getSource();
+ if (menuItem.getData() instanceof ActionContributionItem) {
+ final ActionContributionItem item = (ActionContributionItem) menuItem
+ .getData();
+ this.dropDownMenu.setAction(item.getAction());
+ }
+ }
+
+ public void widgetSelected(final SelectionEvent e) {
+ final MenuItem menuItem = (MenuItem) e.getSource();
+ if (menuItem.getData() instanceof ActionContributionItem) {
+ final ActionContributionItem item = (ActionContributionItem) menuItem
+ .getData();
+ this.dropDownMenu.setAction(item.getAction());
+ }
+ }
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/DropDownMenuWithDefaultAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericActionBarContributor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericActionBarContributor.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericActionBarContributor.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,102 @@
+package org.jboss.tools.flow.common.editor;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.gef.ui.actions.ActionBarContributor;
+import org.eclipse.gef.ui.actions.AlignmentRetargetAction;
+import org.eclipse.gef.ui.actions.DeleteRetargetAction;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.gef.ui.actions.RedoRetargetAction;
+import org.eclipse.gef.ui.actions.UndoRetargetAction;
+import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
+import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
+import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.RetargetAction;
+import org.jboss.tools.flow.common.Activator;
+import org.jboss.tools.flow.common.action.HorizontalAutoLayoutAction;
+import org.jboss.tools.flow.common.action.VerticalAutoLayoutAction;
+
+/**
+ * Common implementation of a ActionBarContributor.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class GenericActionBarContributor extends ActionBarContributor {
+
+ protected void buildActions() {
+ addRetargetAction( new UndoRetargetAction() );
+ addRetargetAction( new RedoRetargetAction() );
+ addRetargetAction( new DeleteRetargetAction() );
+
+ addRetargetAction( new ZoomInRetargetAction() );
+ addRetargetAction( new ZoomOutRetargetAction() );
+
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.LEFT ) );
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.CENTER ) );
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.RIGHT ) );
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.TOP ) );
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.MIDDLE ) );
+ addRetargetAction( new AlignmentRetargetAction( PositionConstants.BOTTOM ) );
+
+ addRetargetAction( new RetargetAction(
+ GEFActionConstants.TOGGLE_GRID_VISIBILITY, "Grid" ));
+
+ RetargetAction verticalAutoLayoutAction = new RetargetAction(VerticalAutoLayoutAction.ID, null);
+ verticalAutoLayoutAction.setImageDescriptor(
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/layoutV.gif")));
+ addRetargetAction(verticalAutoLayoutAction);
+
+ RetargetAction horizontalAutoLayoutAction = new RetargetAction(HorizontalAutoLayoutAction.ID, null);
+ horizontalAutoLayoutAction.setImageDescriptor(
+ ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/layoutH.gif")));
+ addRetargetAction(horizontalAutoLayoutAction);
+
+ }
+
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add( getAction( ActionFactory.UNDO.getId() ) );
+ toolBarManager.add( getAction( ActionFactory.REDO.getId() ) );
+ toolBarManager.add( new Separator() );
+ toolBarManager.add( new ZoomComboContributionItem( getPage() ) );
+ toolBarManager.add( new Separator() );
+
+ DropDownMenuWithDefaultAction alignMenu = new DropDownMenuWithDefaultAction( getActionRegistry().getAction( GEFActionConstants.ALIGN_LEFT ) );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_LEFT ) );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_CENTER ) );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_RIGHT ) );
+ alignMenu.add( new Separator() );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_TOP ) );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_MIDDLE ) );
+ alignMenu.add( getActionRegistry().getAction( GEFActionConstants.ALIGN_BOTTOM ) );
+ toolBarManager.add( alignMenu );
+
+ toolBarManager.add( new Separator() );
+ toolBarManager.add( getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY) );
+
+ toolBarManager.add( new Separator());
+ toolBarManager.add( getAction(VerticalAutoLayoutAction.ID));
+ toolBarManager.add( getAction(HorizontalAutoLayoutAction.ID));
+ }
+
+ protected void declareGlobalActionKeys() {
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericActionBarContributor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericContextMenuProvider.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericContextMenuProvider.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericContextMenuProvider.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,61 @@
+package org.jboss.tools.flow.common.editor;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.actions.ActionFactory;
+
+/**
+ * Common implementation of a ContextMenuProvider.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class GenericContextMenuProvider extends ContextMenuProvider {
+
+ private ActionRegistry actionRegistry;
+
+ public GenericContextMenuProvider(GraphicalViewer viewer, ActionRegistry registry) {
+ super(viewer);
+ setActionRegistry(registry);
+ }
+
+ public void buildContextMenu(IMenuManager menu) {
+ GEFActionConstants.addStandardActionGroups(menu);
+ IAction action = getActionRegistry().getAction(ActionFactory.UNDO.getId());
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
+ action = getActionRegistry().getAction(ActionFactory.REDO.getId());
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
+ action = getActionRegistry().getAction(ActionFactory.DELETE.getId());
+ if (action.isEnabled()) {
+ menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
+ }
+ }
+
+ private ActionRegistry getActionRegistry() {
+ return actionRegistry;
+ }
+
+ public void setActionRegistry(ActionRegistry registry) {
+ actionRegistry = registry;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericContextMenuProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,403 @@
+package org.jboss.tools.flow.common.editor;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.EventObject;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.SWTGraphics;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.ContextMenuProvider;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gef.KeyStroke;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.LayerManager;
+import org.eclipse.gef.editparts.ScalableRootEditPart;
+import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.AlignmentAction;
+import org.eclipse.gef.ui.actions.DirectEditAction;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.gef.ui.actions.ToggleGridAction;
+import org.eclipse.gef.ui.parts.GraphicalEditorWithPalette;
+import org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.jboss.tools.flow.common.Activator;
+import org.jboss.tools.flow.common.action.HorizontalAutoLayoutAction;
+import org.jboss.tools.flow.common.action.VerticalAutoLayoutAction;
+import org.jboss.tools.flow.common.editpart.EditPartFactory;
+import org.jboss.tools.flow.common.registry.LanguageRegistry;
+
+/**
+ * Abstract implementation of a graphical editor.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class GenericModelEditor extends GraphicalEditorWithPalette {
+
+ private Object model;
+ private boolean savePreviouslyNeeded = false;
+ private KeyHandler sharedKeyHandler;
+ private PaletteRoot root;
+ private OverviewOutlinePage overviewOutlinePage;
+
+ private String language;
+
+ public GenericModelEditor() {
+ setEditDomain(new DefaultEditDomain(this));
+ }
+
+ protected void setModel(Object model) {
+ this.model = model;
+ }
+
+ public Object getModel() {
+ return model;
+ }
+
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ super.init(site, input);
+ initializeEditDomain();
+ initializeLanguage();
+ }
+
+ protected void initializeEditDomain() {
+ setEditDomain(new DefaultEditDomain(this));
+ getCommandStack().addCommandStackListener(this);
+ }
+
+ protected void initializeLanguage() {
+ language = LanguageRegistry.getLanguageRegisteredFor(getSite().getId());
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void createActions() {
+ super.createActions();
+ ActionRegistry registry = getActionRegistry();
+
+ IAction action = new DirectEditAction((IWorkbenchPart) this);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.LEFT);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.CENTER);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.RIGHT);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.TOP);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.MIDDLE);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+
+ action = new AlignmentAction((IWorkbenchPart) this,
+ PositionConstants.BOTTOM);
+ registry.registerAction(action);
+ getSelectionActions().add(action.getId());
+ }
+
+ public void commandStackChanged(EventObject event) {
+ if (isDirty()) {
+ if (!savePreviouslyNeeded()) {
+ setSavePreviouslyNeeded(true);
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ } else {
+ setSavePreviouslyNeeded(false);
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ super.commandStackChanged(event);
+ }
+
+ protected abstract void writeModel(OutputStream os) throws IOException;
+
+ protected void configureGraphicalViewer() {
+ super.configureGraphicalViewer();
+ getGraphicalViewer().setRootEditPart(new ScalableRootEditPart());
+ getGraphicalViewer().setEditPartFactory(createEditPartFactory());
+ getGraphicalViewer().setKeyHandler(
+ new GraphicalViewerKeyHandler(getGraphicalViewer())
+ .setParent(getCommonKeyHandler()));
+
+ IAction showGrid = new ToggleGridAction(getGraphicalViewer());
+ getActionRegistry().registerAction(showGrid);
+
+ IAction layoutVertically = new VerticalAutoLayoutAction(
+ getGraphicalViewer());
+ getActionRegistry().registerAction(layoutVertically);
+ IAction layoutHorizontally = new HorizontalAutoLayoutAction(
+ getGraphicalViewer());
+ getActionRegistry().registerAction(layoutHorizontally);
+
+ ContextMenuProvider provider = new GenericContextMenuProvider(
+ getGraphicalViewer(), getActionRegistry());
+ getGraphicalViewer().setContextMenu(provider);
+ getSite().registerContextMenu(
+ "org.jboss.tools.flow.editor.contextmenu", provider,
+ getGraphicalViewer());
+ }
+
+ protected org.eclipse.gef.EditPartFactory createEditPartFactory() {
+ return new EditPartFactory();
+ }
+
+ protected void initializeGraphicalViewer() {
+ getGraphicalViewer().setContents(model);
+ }
+
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ writeModel(out);
+ IFile file = ((IFileEditorInput) getEditorInput()).getFile();
+ file.setContents(new ByteArrayInputStream(out.toByteArray()), true,
+ false, monitor);
+ out.close();
+ getCommandStack().markSaveLocation();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void doSaveAs() {
+ SaveAsDialog dialog = new SaveAsDialog(getSite().getWorkbenchWindow()
+ .getShell());
+ dialog.setOriginalFile(((IFileEditorInput) getEditorInput()).getFile());
+ dialog.open();
+ IPath path = dialog.getResult();
+
+ if (path == null) {
+ return;
+ }
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ final IFile file = workspace.getRoot().getFile(path);
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ public void execute(final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ writeModel(out);
+ file.create(new ByteArrayInputStream(out.toByteArray()),
+ true, monitor);
+ out.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorDialog(getSite().getWorkbenchWindow().getShell())
+ .run(false, true, op);
+ setInput(new FileEditorInput(file));
+ getCommandStack().markSaveLocation();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected KeyHandler getCommonKeyHandler() {
+ if (sharedKeyHandler == null) {
+ sharedKeyHandler = new KeyHandler();
+ sharedKeyHandler
+ .put(KeyStroke.getPressed(SWT.DEL, 127, 0),
+ getActionRegistry().getAction(
+ ActionFactory.DELETE.getId()));
+ sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
+ getActionRegistry().getAction(
+ GEFActionConstants.DIRECT_EDIT));
+ }
+ return sharedKeyHandler;
+ }
+
+ public boolean isDirty() {
+ return isSaveOnCloseNeeded();
+ }
+
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ public boolean isSaveOnCloseNeeded() {
+ return getCommandStack().isDirty();
+ }
+
+ private boolean savePreviouslyNeeded() {
+ return savePreviouslyNeeded;
+ }
+
+ private void setSavePreviouslyNeeded(boolean value) {
+ savePreviouslyNeeded = value;
+ }
+
+ protected PaletteRoot getPaletteRoot() {
+ if (root == null) {
+ root = createPalette();
+ }
+ return root;
+ }
+
+ protected abstract PaletteRoot createPalette();
+
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+
+ IFile file = getFile();
+ setPartName(file.getName());
+ try {
+ InputStream is = file.getContents(false);
+ createModel(is);
+ } catch (Throwable t) {
+ Activator.log(t);
+ }
+ if (getGraphicalViewer() != null) {
+ initializeGraphicalViewer();
+ }
+ }
+
+ public IFile getFile() {
+ return ((IFileEditorInput) getEditorInput()).getFile();
+ }
+
+ public IProject getProject() {
+ IFile file = getFile();
+ if (file != null) {
+ return file.getProject();
+ }
+ return null;
+ }
+
+ protected abstract void createModel(InputStream is);
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class type) {
+ if (type == IContentOutlinePage.class) {
+ return getOverviewOutlinePage();
+ }
+ if (type == ZoomManager.class) {
+ return ((ScalableRootEditPart) getGraphicalViewer()
+ .getRootEditPart()).getZoomManager();
+ }
+ return super.getAdapter(type);
+ }
+
+ protected OverviewOutlinePage getOverviewOutlinePage() {
+ if (null == overviewOutlinePage && null != getGraphicalViewer()) {
+ ScalableRootEditPart rootEditPart = (ScalableRootEditPart) getGraphicalViewer()
+ .getRootEditPart();
+ overviewOutlinePage = new OverviewOutlinePage(rootEditPart);
+ }
+ return overviewOutlinePage;
+ }
+
+// public String getContributorId() {
+// return getSite().getId();
+// }
+
+ /**
+ * Writes the content of this editor to the given stream. Possible formats
+ * are for example SWT.IMAGE_BMP, IMAGE_GIF, IMAGE_JPEG, IMAGE_PNG.
+ *
+ * @param stream
+ * @param format
+ */
+ public void createImage(OutputStream stream, int format) {
+ SWTGraphics g = null;
+ GC gc = null;
+ Image image = null;
+ LayerManager layerManager = (LayerManager) getGraphicalViewer()
+ .getEditPartRegistry().get(LayerManager.ID);
+ IFigure figure = layerManager.getLayer(LayerConstants.PRINTABLE_LAYERS);
+ Rectangle r = figure.getBounds();
+ try {
+ image = new Image(Display.getDefault(), r.width, r.height);
+ gc = new GC(image);
+ g = new SWTGraphics(gc);
+ g.translate(r.x * -1, r.y * -1);
+ figure.paint(g);
+ ImageLoader imageLoader = new ImageLoader();
+ imageLoader.data = new ImageData[] { image.getImageData() };
+ imageLoader.save(stream, format);
+ } catch (Throwable t) {
+ Activator.log(t);
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ if (gc != null) {
+ gc.dispose();
+ }
+ if (image != null) {
+ image.dispose();
+ }
+ }
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/OverviewOutlinePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/OverviewOutlinePage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/OverviewOutlinePage.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,91 @@
+package org.jboss.tools.flow.common.editor;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.LightweightSystem;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.parts.ScrollableThumbnail;
+import org.eclipse.draw2d.parts.Thumbnail;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.ScalableRootEditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+/**
+ * Common implementation of an outline page.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class OverviewOutlinePage extends Page implements IContentOutlinePage {
+
+ private Canvas overview;
+ private ScalableRootEditPart rootEditPart;
+ private Thumbnail thumbnail;
+
+ public OverviewOutlinePage(ScalableRootEditPart rootEditPart) {
+ this.rootEditPart = rootEditPart;
+ }
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ public void createControl(Composite parent) {
+ overview = new Canvas(parent, SWT.NONE);
+ LightweightSystem lws = new LightweightSystem(overview);
+ thumbnail = new ScrollableThumbnail((Viewport) rootEditPart.getFigure());
+ thumbnail.setBorder(new MarginBorder(3));
+ thumbnail.setSource(rootEditPart
+ .getLayer(LayerConstants.PRINTABLE_LAYERS));
+ lws.setContents(thumbnail);
+ }
+
+ public void dispose() {
+ if (null != thumbnail) {
+ thumbnail.deactivate();
+ }
+ super.dispose();
+ }
+
+ public Control getControl() {
+ return overview;
+ }
+
+ public ISelection getSelection() {
+ return StructuredSelection.EMPTY;
+ }
+
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ }
+
+ public void setFocus() {
+ if (getControl() != null) {
+ getControl().setFocus();
+ }
+ }
+
+ public void setSelection(ISelection selection) {
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/OverviewOutlinePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/PaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/PaletteFactory.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/PaletteFactory.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,78 @@
+package org.jboss.tools.flow.common.editor;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.palette.MarqueeToolEntry;
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteDrawer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.PaletteGroup;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.palette.SelectionToolEntry;
+import org.eclipse.gef.palette.ToolEntry;
+
+/**
+ * Factory for creating a RuleFlow palette.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class PaletteFactory {
+
+ public PaletteRoot createPalette() {
+ PaletteRoot palette = new PaletteRoot();
+ palette.addAll(createCategories(palette));
+ return palette;
+ }
+
+ protected List<PaletteContainer> createCategories(PaletteRoot root) {
+ List<PaletteContainer> categories = new ArrayList<PaletteContainer>();
+ categories.add(createControlGroup(root));
+ categories.add(createComponentsDrawer());
+ return categories;
+ }
+
+ protected PaletteContainer createControlGroup(PaletteRoot root) {
+ PaletteGroup controlGroup = new PaletteGroup("Control Group");
+
+ List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
+
+ ToolEntry tool = new SelectionToolEntry();
+ entries.add(tool);
+ root.setDefaultEntry(tool);
+
+ tool = new MarqueeToolEntry();
+ entries.add(tool);
+
+ controlGroup.addAll(entries);
+ return controlGroup;
+ }
+
+ protected PaletteContainer createComponentsDrawer() {
+ PaletteDrawer drawer = new PaletteDrawer("Components", null);
+ List<PaletteEntry> entries = createComponentEntries();
+ drawer.addAll(entries);
+ return drawer;
+ }
+
+ protected List<PaletteEntry> createComponentEntries() {
+ return new ArrayList<PaletteEntry>();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/PaletteFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/CellEditorLocator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/CellEditorLocator.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/CellEditorLocator.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,56 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Text;
+
+import org.eclipse.jface.viewers.CellEditor;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * A CellEditorLocator for elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class CellEditorLocator implements org.eclipse.gef.tools.CellEditorLocator {
+
+ private Label label;
+
+ public CellEditorLocator(Label label) {
+ setLabel(label);
+ }
+
+ public void relocate(CellEditor cellEditor) {
+ Text text = (Text) cellEditor.getControl();
+ Point pref = text.computeSize(-1, -1);
+ Rectangle rect = label.getTextBounds().getCopy();
+ label.translateToAbsolute(rect);
+ text.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1);
+ }
+
+ protected Label getLabel() {
+ return label;
+ }
+
+ protected void setLabel(Label label) {
+ this.label = label;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/CellEditorLocator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.AbsoluteBendpoint;
+import org.eclipse.draw2d.BendpointConnectionRouter;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy;
+import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.flow.common.policy.ConnectionBendpointEditPolicy;
+import org.jboss.tools.flow.common.policy.ConnectionEditPolicy;
+import org.jboss.tools.flow.common.registry.ElementRegistry;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+/**
+ * Implementation of a connection EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ConnectionEditPart extends AbstractConnectionEditPart implements ModelListener {
+
+ public ConnectionWrapper getElementConnection() {
+ return (ConnectionWrapper) getModel();
+ }
+
+ public List<Wrapper> getModelChildren() {
+ List<Wrapper> result = new ArrayList<Wrapper>();
+ LabelWrapper label = getElementConnection().getLabel();
+ if (label != null) result.add(label);
+ return result;
+ }
+
+ protected void createEditPolicies() {
+ ConnectionEditPolicy connectionEditPolicy = new ConnectionEditPolicy();
+ connectionEditPolicy.setElementConnectionFactory(getElementConnectionFactory());
+ installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ConnectionEndpointEditPolicy());
+ installEditPolicy(EditPolicy.CONNECTION_ROLE, connectionEditPolicy);
+ installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new ConnectionBendpointEditPolicy());
+ }
+
+ protected CreationFactory getElementConnectionFactory() {
+ return ElementRegistry.getCreationFactory(getElementConnection().getElement());
+ }
+
+
+ protected Class<?> getElementConnectionType() {
+ return DefaultConnectionWrapper.class;
+ }
+
+ protected IFigure createFigure() {
+ PolylineConnection result = new PolylineConnection();
+ result.setForegroundColor(ColorConstants.gray);
+ result.setConnectionRouter(new BendpointConnectionRouter());
+ result.setTargetDecoration(new PolygonDecoration());
+ return result;
+ }
+
+ public void setSelected(int value) {
+ super.setSelected(value);
+ if (value != EditPart.SELECTED_NONE) {
+ ((PolylineConnection)getFigure()).setLineWidth(2);
+ } else {
+ ((PolylineConnection)getFigure()).setLineWidth(1);
+ }
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ConnectionWrapper.CHANGE_BENDPOINTS) {
+ refreshBendpoints();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ getElementConnection().addListener(this);
+ }
+
+ public void deactivate() {
+ getElementConnection().removeListener(this);
+ super.deactivate();
+ }
+
+ protected void refreshBendpoints() {
+ List<Point> bendpoints = getElementConnection().getBendpoints();
+ List<Point> constraint = new ArrayList<Point>();
+ for (int i = 0; i < bendpoints.size(); i++) {
+ constraint.add(new AbsoluteBendpoint((Point) bendpoints.get(i)));
+ }
+ getConnectionFigure().setRoutingConstraint(constraint);
+ }
+
+ protected void refreshVisuals() {
+ refreshBendpoints();
+ }
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ConnectionEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,81 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.MouseWheelHelper;
+import org.eclipse.gef.editparts.ViewportMouseWheelHelper;
+import org.jboss.tools.flow.common.figure.ElementContainerFigure;
+import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
+import org.jboss.tools.flow.common.wrapper.AbstractContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+public class ContainerEditPart extends ElementEditPart {
+
+ protected AbstractContainerWrapper getElementContainerElementWrapper() {
+ return (AbstractContainerWrapper) getModel();
+ }
+
+ protected IFigure createFigure() {
+ return new ElementContainerFigure();
+ }
+
+ protected void createEditPolicies() {
+ super.createEditPolicies();
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, null);
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ElementContainerLayoutEditPolicy());
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
+ refreshChildren();
+ Object changedObject = event.getChangedObject();
+ if (changedObject != null) {
+ EditPart editPart = (EditPart)getViewer().getEditPartRegistry().get(changedObject);
+ if (editPart instanceof ElementEditPart) {
+ ((ElementEditPart)editPart).performDirectEdit();
+ }
+ }
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
+ refreshChildren();
+ } else {
+ super.modelChanged(event);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class key) {
+ if (key == MouseWheelHelper.class) {
+ return new ViewportMouseWheelHelper(this);
+ }
+ return super.getAdapter(key);
+ }
+
+ protected List<NodeWrapper> getModelChildren() {
+ return getElementContainerElementWrapper().getNodeWrappers();
+ }
+
+ public IFigure getContentPane() {
+ return ((ElementContainerFigure) getFigure()).getPane();
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ContainerEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,120 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gef.EditPart;
+import org.jboss.tools.flow.common.figure.IFigureFactory;
+import org.jboss.tools.flow.common.figure.NodeFigureFactory;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class EditPartFactory implements org.eclipse.gef.EditPartFactory {
+
+ public EditPart createEditPart(EditPart context, Object model) {
+ EditPart result = null;
+ if (!(model instanceof Wrapper)) return result;
+ result = createEditPart((Wrapper)model);
+ if (result != null) {
+ result.setModel(model);
+ }
+ return result;
+ }
+
+ protected EditPart createEditPart(Wrapper wrapper) {
+ EditPart result = null;
+ if (wrapper instanceof FlowWrapper) {
+ result = createFlowEditPart((FlowWrapper)wrapper);
+ } else if (wrapper instanceof ContainerWrapper) {
+ result = createContainerEditPart((ContainerWrapper)wrapper);
+ } else if (wrapper instanceof NodeWrapper) {
+ result = createNodeEditPart((NodeWrapper)wrapper);
+ } else if (wrapper instanceof ConnectionWrapper) {
+ result = createConnectionEditPart((ConnectionWrapper)wrapper);
+ } else if (wrapper instanceof LabelWrapper) {
+ result = createLabelEditPart((LabelWrapper)wrapper);
+ }
+ return result;
+ }
+
+ protected EditPart createFlowEditPart(FlowWrapper wrapper) {
+ return createFlowEditPart(wrapper.getElement());
+ }
+
+ protected EditPart createFlowEditPart(Element element) {
+ return new RootEditPart();
+ }
+
+ protected EditPart createContainerEditPart(ContainerWrapper wrapper) {
+ Element element = wrapper.getElement();
+ if (element == null) {
+ return null;
+ } else {
+ return createContainerEditPart(element);
+ }
+ }
+
+ protected EditPart createContainerEditPart(Element element) {
+ return new ContainerEditPart();
+ }
+
+ protected EditPart createNodeEditPart(NodeWrapper wrapper) {
+ Element element = wrapper.getElement();
+ if (element == null) {
+ return null;
+ } else {
+ return createNodeEditPart(element);
+ }
+ }
+
+ protected EditPart createNodeEditPart(Element element) {
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement == null) return null;
+ NodeEditPart result = new NodeEditPart();
+ IFigureFactory figureFactory = new NodeFigureFactory(configurationElement);
+ result.setFigureFactory(figureFactory);
+ return result;
+ }
+
+ protected EditPart createConnectionEditPart(ConnectionWrapper wrapper) {
+ Element element = wrapper.getElement();
+ if (element == null) {
+ return null;
+ } else {
+ return createConnectionEditPart(element);
+ }
+ }
+
+ protected EditPart createConnectionEditPart(Element element) {
+ return new ConnectionEditPart();
+ }
+
+ protected EditPart createLabelEditPart(LabelWrapper wrapper) {
+ return new LabelEditPart();
+ }
+
+ protected EditPart createEditPart(Element element) {
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement == null) return null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children.length != 1) return null;
+ String type = children[0].getName();
+ if ("flow".equals(type)) {
+ return createFlowEditPart(element);
+ } else if ("container".equals(type)) {
+ return createContainerEditPart(element);
+ } else if ("node".equals(type)) {
+ return createNodeEditPart(element);
+ } else if ("connection".equals(type)) {
+ return createConnectionEditPart(element);
+ } else {
+ return null;
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/EditPartFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,150 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.NodeEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.jboss.tools.flow.common.figure.ElementFigure;
+import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
+import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
+import org.jboss.tools.flow.common.policy.ElementEditPolicy;
+import org.jboss.tools.flow.common.policy.ElementNodeEditPolicy;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Default implementation of an element EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class ElementEditPart extends AbstractGraphicalEditPart implements NodeEditPart, ModelListener {
+
+ private DirectEditManager manager;
+
+ public NodeWrapper getElementWrapper() {
+ return (NodeWrapper) getModel();
+ }
+
+ public ElementFigure getElementFigure() {
+ return (ElementFigure) getFigure();
+ }
+
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new ElementNodeEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ElementEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
+ }
+
+ protected List<ConnectionWrapper> getModelSourceConnections() {
+ return getElementWrapper().getOutgoingConnections();
+ }
+
+ protected List<ConnectionWrapper> getModelTargetConnections() {
+ return getElementWrapper().getIncomingConnections();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
+ return getElementFigure().getSourceConnectionAnchor();
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
+ return getElementFigure().getTargetConnectionAnchor();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ return getElementFigure().getSourceConnectionAnchor();
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ return getElementFigure().getTargetConnectionAnchor();
+ }
+
+ protected void refreshVisuals() {
+ NodeWrapper element = getElementWrapper();
+ ElementFigure figure = (ElementFigure) getFigure();
+ figure.setText(element.getName());
+ if (element.getConstraint().width == -1) {
+ element.getConstraint().width = figure.getBounds().width;
+ }
+ if (element.getConstraint().height == -1) {
+ element.getConstraint().height = figure.getBounds().height;
+ }
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this, figure, element.getConstraint());
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == NodeWrapper.ADD_ELEMENT && "incomingConnection".equals(event.getChangeDiscriminator())) {
+ refreshTargetConnections();
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT && "incomingConnection".equals(event.getChangeDiscriminator())) {
+ refreshTargetConnections();
+ } else if (event.getChangeType() == NodeWrapper.ADD_ELEMENT && "outgoingConnection".equals(event.getChangeDiscriminator())) {
+ refreshSourceConnections();
+ } else if (event.getChangeType() == NodeWrapper.REMOVE_ELEMENT && "outgoingConnection".equals(event.getChangeDiscriminator())) {
+ refreshSourceConnections();
+ } else if (event.getChangeType() == NodeWrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ public void activate() {
+ super.activate();
+ getElementWrapper().addListener(this);
+ }
+
+ public void deactivate() {
+ getElementWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ performDirectEdit();
+ } if (request.getType() == RequestConstants.REQ_OPEN) {
+ doubleClicked();
+ } else {
+ super.performRequest(request);
+ }
+ }
+
+ protected void doubleClicked() {
+ // do nothing
+ }
+
+ protected void performDirectEdit() {
+ Label label = ((ElementFigure) getFigure()).getLabel();
+ if (label == null) {
+ return;
+ }
+ if (manager == null) {
+ manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
+ }
+ manager.show();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/ElementEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,134 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Locator;
+import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gef.tools.DragEditPartsTracker;
+import org.jboss.tools.flow.common.policy.ElementDirectEditManager;
+import org.jboss.tools.flow.common.policy.ElementDirectEditPolicy;
+import org.jboss.tools.flow.common.policy.LabelGraphicalNodeEditPolicy;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class LabelEditPart extends AbstractGraphicalEditPart implements ModelListener {
+
+ private DirectEditManager manager;
+
+ @Override
+ protected IFigure createFigure() {
+ return new Label();
+ }
+
+ @Override
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new LabelGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new ElementDirectEditPolicy());
+ }
+
+ protected void refreshVisuals() {
+ String text = getLabelWrapper().getText();
+ Polyline polyline = (Polyline)((ConnectionEditPart)getParent()).getConnectionFigure();
+ Point location = ((LabelWrapper)getModel()).getLocation();
+ if (location == null) {
+ location = calculateInitialLocation(polyline, text);
+ ((LabelWrapper)getModel()).setLocation(location);
+ }
+ Label label = (Label)getFigure();
+ label.setText(text);
+ LabelConstraint constraint = new LabelConstraint(text, location, polyline);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), constraint);
+ }
+
+ private Point calculateInitialLocation(Polyline polyline, String text) {
+ Dimension textDimension = FigureUtilities.getTextExtents(text, figure.getFont());
+ return new Point(- (textDimension.width +5) , -(textDimension.height + 5));
+ }
+
+ public void performRequest(Request request) {
+ if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ performDirectEdit();
+ } else {
+ super.performRequest(request);
+ }
+ }
+
+ protected void performDirectEdit() {
+ Label label = (Label) getFigure();
+ if (label == null) {
+ return;
+ }
+ if (manager == null) {
+ manager = new ElementDirectEditManager(this, new CellEditorLocator(label));
+ }
+ manager.show();
+ }
+
+ public LabelWrapper getLabelWrapper() {
+ return (LabelWrapper)getModel();
+ }
+
+ public DragTracker getDragTracker(Request request) {
+ return new DragEditPartsTracker(this) {
+ protected EditPart getTargetEditPart() {
+ return getParent();
+ }
+ };
+ }
+
+ public void activate() {
+ super.activate();
+ getLabelWrapper().addListener(this);
+ if (getParent().getModel() instanceof Wrapper) {
+ ((Wrapper)getParent().getModel()).addListener(this);
+ }
+ }
+
+ public void deactivate() {
+ if (getParent().getModel() instanceof Wrapper) {
+ ((Wrapper)getParent().getModel()).removeListener(this);
+ }
+ getLabelWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == Wrapper.CHANGE_PROPERTY || event.getChangeType() == Wrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ private class LabelConstraint implements Locator {
+ String text;
+ Point relativeLocation;
+ Polyline polyline;
+ public LabelConstraint(String text, Point location, Polyline polyline) {
+ this.text = text;
+ this.relativeLocation = location;
+ this.polyline = polyline;
+ }
+ public void relocate(IFigure figure) {
+ Dimension minimum = FigureUtilities.getTextExtents(text, figure.getFont());
+ figure.setSize(minimum);
+ Point midPoint = polyline.getPoints().getMidpoint();
+ Point newLocation = relativeLocation.getCopy();
+ newLocation.translate(midPoint);
+ figure.setLocation(newLocation);
+ }
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/LabelEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,21 @@
+package org.jboss.tools.flow.common.editpart;
+
+import org.eclipse.draw2d.IFigure;
+import org.jboss.tools.flow.common.figure.IFigureFactory;
+
+public class NodeEditPart extends ElementEditPart {
+
+ private IFigureFactory figureFactory;
+
+ protected IFigure createFigure() {
+ if (figureFactory != null) {
+ return figureFactory.createFigure();
+ }
+ return null;
+ }
+
+ public void setFigureFactory(IFigureFactory figureFactory) {
+ this.figureFactory = figureFactory;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/NodeEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.common.editpart;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+import org.eclipse.draw2d.Animation;
+import org.eclipse.draw2d.AutomaticRouter;
+import org.eclipse.draw2d.BendpointConnectionRouter;
+import org.eclipse.draw2d.ConnectionLayer;
+import org.eclipse.draw2d.FanRouter;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ManhattanConnectionRouter;
+import org.eclipse.draw2d.ShortestPathConnectionRouter;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.SnapToGrid;
+import org.eclipse.gef.SnapToHelper;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gef.editpolicies.RootComponentEditPolicy;
+import org.eclipse.swt.SWT;
+import org.jboss.tools.flow.common.policy.ElementContainerLayoutEditPolicy;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Default implementation of a process EditPart.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class RootEditPart extends AbstractGraphicalEditPart implements ModelListener {
+
+ private FlowWrapper getWrapper() {
+ return (FlowWrapper) getModel();
+ }
+
+ protected IFigure createFigure() {
+ Figure f = new Figure();
+ f.setLayoutManager(new XYLayout());
+ return f;
+ }
+
+ protected void createEditPolicies() {
+ installEditPolicy(EditPolicy.NODE_ROLE, null);
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, null);
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new ElementContainerLayoutEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
+ }
+
+ protected List<NodeWrapper> getModelChildren() {
+ return getWrapper().getNodeWrappers();
+ }
+
+ public void activate() {
+ super.activate();
+ getWrapper().addListener(this);
+ }
+
+ public void deactivate() {
+ getWrapper().removeListener(this);
+ super.deactivate();
+ }
+
+ public void modelChanged(ModelEvent event) {
+ if (event.getChangeType() == ContainerWrapper.ADD_ELEMENT) {
+ refreshChildren();
+ } else if (event.getChangeType() == ContainerWrapper.REMOVE_ELEMENT) {
+ refreshChildren();
+ } else if (event.getChangeType() == FlowWrapper.CHANGE_VISUAL) {
+ refreshVisuals();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == SnapToHelper.class) {
+ Boolean val = (Boolean) getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED);
+ if (val != null && val.booleanValue()) {
+ return new SnapToGrid(this);
+ }
+ }
+ return super.getAdapter(adapter);
+ }
+
+ protected void refreshVisuals() {
+ Animation.markBegin();
+ ConnectionLayer layer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
+ if ((getViewer().getControl().getStyle() & SWT.MIRRORED ) == 0) {
+ layer.setAntialias(SWT.ON);
+ }
+
+ if (getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANUAL)) {
+ AutomaticRouter router = new FanRouter();
+ router.setNextRouter(new BendpointConnectionRouter());
+ layer.setConnectionRouter(router);
+ } else if (getWrapper().getRouterLayout().equals(FlowWrapper.ROUTER_LAYOUT_MANHATTAN)) {
+ layer.setConnectionRouter(new ManhattanConnectionRouter());
+ } else {
+ layer.setConnectionRouter(new ShortestPathConnectionRouter(getFigure()));
+ }
+ Animation.run(400);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editpart/RootEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/AbstractElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/AbstractElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/AbstractElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,94 @@
+package org.jboss.tools.flow.common.figure;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Panel;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Default implementation of an element Figure.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class AbstractElementFigure extends Panel implements ElementFigure {
+
+ private boolean selected;
+ private Label label = new Label();
+
+ public AbstractElementFigure() {
+ add(label);
+ customizeFigure();
+ }
+
+ public void setIcon(Image icon) {
+ label.setIcon(icon);
+ }
+
+ public void setText(String text) {
+ label.setText(text);
+ }
+
+ public Label getLabel() {
+ return label;
+ }
+
+ public void setColor(Color color) {
+ setBackgroundColor(color);
+ }
+
+ public void setBounds(Rectangle bounds) {
+ super.setBounds(bounds);
+ label.setBounds(bounds);
+ }
+
+ protected abstract void customizeFigure();
+
+ public void setSelected(boolean b) {
+ selected = b;
+ }
+
+ public boolean isSelected() {
+ return selected;
+ }
+
+ public void setFocus(boolean b) {
+ repaint();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor() {
+ return new ChopboxAnchor(this);
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor() {
+ return new ChopboxAnchor(this);
+ }
+
+ public void paint(Graphics g) {
+ int saved = g.getAntialias();
+ g.setAntialias(SWT.ON);
+ super.paint(g);
+ g.setAntialias(saved);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/AbstractElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,27 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+
+public class CrossHairDecoration extends PolygonDecoration {
+
+ public static final PointList CROSSHAIR_TIP = new PointList();
+
+ static {
+ CROSSHAIR_TIP.addPoint(0, 0);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-1, -1);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-2, 0);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ CROSSHAIR_TIP.addPoint(-1, 1);
+ CROSSHAIR_TIP.addPoint(-1, 0);
+ }
+
+ public CrossHairDecoration() {
+ setTemplate(CROSSHAIR_TIP);
+ setScale(4, 4);
+ setFill(false);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/CrossHairDecoration.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondAnchor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondAnchor.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondAnchor.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,47 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.AbstractConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class DiamondAnchor extends AbstractConnectionAnchor {
+
+ public DiamondAnchor(IFigure owner) {
+ super(owner);
+ }
+
+ public Point getLocation(Point reference) {
+ Rectangle r = Rectangle.SINGLETON;
+ r.setBounds(getOwner().getBounds());
+ r.translate(-1, -1);
+ r.resize(1, 1);
+ getOwner().translateToAbsolute(r);
+
+ Point ref = r.getCenter().negate().translate(reference);
+
+ float centerX = r.x + 0.5f * r.width;
+ float centerY = r.y + 0.5f * r.height;
+ float dx, dy;
+
+ if (Math.abs(ref.x * r.height) == Math.abs(Math.abs(ref.y)* r.width )) {
+ dx = ref.x > 0 ? r.width / 4 : - r.width / 4;
+ dy = ref.y > 0 ? r.height / 4 : - r.height / 4;
+ } else if (ref.x == 0) {
+ dx = 0;
+ dy = ref.y > 0 ? r.height / 2 : - r.height / 2;
+ } else {
+
+ float numerator = ref.x * r.height * r.width / 2;
+ float firstDenominator = Math.abs(ref.y) * r.width + ref.x * r.height;
+ float secondDenominator = Math.abs(ref.y) * r.width - ref.x * r.height;
+
+ dx = (ref.x > 0) ? numerator / firstDenominator : numerator / secondDenominator;
+ dy = dx * ref.y / ref.x;
+
+ }
+
+ return new Point(Math.round(centerX + dx), Math.round(centerY + dy));
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondAnchor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,26 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+
+public class DiamondDecoration extends PolygonDecoration {
+
+ public static final PointList DIAMOND_TIP = new PointList();
+
+ static {
+ DIAMOND_TIP.addPoint(0, 0);
+ DIAMOND_TIP.addPoint(-2, 2);
+ DIAMOND_TIP.addPoint(-4, 0);
+ DIAMOND_TIP.addPoint(-2, -2);
+ }
+
+ public DiamondDecoration() {
+ setTemplate(DIAMOND_TIP);
+ setScale(3.5, 2);
+ setFill(true);
+ setBackgroundColor(ColorConstants.white);
+ setOpaque(true);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondDecoration.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,44 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Polygon;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class DiamondElementFigure extends AbstractElementFigure {
+
+ protected Polygon diamond;
+
+ @Override
+ protected void customizeFigure() {
+ diamond = new Polygon();
+ diamond.setLineWidth(1);
+ add(diamond, 0);
+ setSize(50, 50);
+ diamond.setPoints(calculatePointList());
+ }
+
+ public void setBounds(Rectangle rectangle) {
+ super.setBounds(rectangle);
+ diamond.setPoints(calculatePointList());
+ }
+
+ private PointList calculatePointList() {
+ PointList result = new PointList();
+ Rectangle bounds = getBounds();
+ result.addPoint(bounds.x + bounds.width / 2 - diamond.getLineWidth() / 4, bounds.y + diamond.getLineWidth() / 2);
+ result.addPoint(bounds.x + bounds.width - diamond.getLineWidth(), bounds.y + bounds.height / 2 - diamond.getLineWidth() / 4);
+ result.addPoint(bounds.x + bounds.width / 2 - diamond.getLineWidth() / 4, bounds.y + bounds.height - diamond.getLineWidth());
+ result.addPoint(bounds.x + diamond.getLineWidth() / 2, bounds.y + bounds.height / 2 - diamond.getLineWidth() / 4);
+ return result;
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor() {
+ return new DiamondAnchor(this);
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor() {
+ return new DiamondAnchor(this);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/DiamondElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementContainerFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementContainerFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementContainerFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,87 @@
+package org.jboss.tools.flow.common.figure;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FreeformLayer;
+import org.eclipse.draw2d.FreeformLayout;
+import org.eclipse.draw2d.FreeformViewport;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.ScrollPane;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+public class ElementContainerFigure extends Figure implements ElementFigure {
+
+ private IFigure pane;
+ private boolean selected = false;
+
+ public ElementContainerFigure() {
+ setSize(200, 150);
+ ScrollPane scrollpane = new ScrollPane();
+ pane = new FreeformLayer();
+ pane.setLayoutManager(new FreeformLayout());
+ setLayoutManager(new StackLayout());
+ add(scrollpane);
+ scrollpane.setViewport(new FreeformViewport());
+ scrollpane.setContents(pane);
+ setBorder(new LineBorder(1));
+ }
+
+ public void setColor(Color color) {
+ setBackgroundColor(color);
+ }
+
+ public Label getLabel() {
+ return null;
+ }
+
+ public boolean isSelected() {
+ return selected;
+ }
+
+ public void setIcon(Image icon) {
+ // Do nothing
+ }
+
+ public void setSelected(boolean b) {
+ this.selected = b;
+ ((LineBorder) getBorder()).setWidth(b ? 3 : 1);
+ }
+
+ public void setText(String text) {
+ // Do nothing
+ }
+
+ public IFigure getPane() {
+ return pane;
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor() {
+ return new ChopboxAnchor(this);
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor() {
+ return new ChopboxAnchor(this);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementContainerFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,49 @@
+package org.jboss.tools.flow.common.figure;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Default implementation of an element Figure.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface ElementFigure extends IFigure {
+
+ void setIcon(Image icon);
+
+ void setColor(Color color);
+
+ void setText(String text);
+
+ void setSelected(boolean b);
+
+ boolean isSelected();
+
+ Label getLabel();
+
+ ConnectionAnchor getSourceConnectionAnchor();
+
+ ConnectionAnchor getTargetConnectionAnchor();
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/ElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,43 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.Ellipse;
+import org.eclipse.draw2d.EllipseAnchor;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+
+public class EllipseElementFigure extends AbstractElementFigure {
+
+ protected Ellipse ellipse;
+
+ protected void customizeFigure() {
+ ellipse = new Ellipse();
+ add(ellipse, 0);
+ ellipse.setBounds(getBounds());
+ setSize(40, 40);
+ }
+
+ public void setColor(Color color) {
+ ellipse.setBackgroundColor(color);
+ }
+
+ public void setBounds(Rectangle rectangle) {
+ super.setBounds(rectangle);
+ ellipse.setBounds(rectangle);
+ }
+
+ public void setSelected(boolean b) {
+ super.setSelected(b);
+ ellipse.setLineWidth(b ? 3 : 1);
+ repaint();
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor() {
+ return new EllipseAnchor(this);
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor() {
+ return new EllipseAnchor(this);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/EllipseElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,9 @@
+package org.jboss.tools.flow.common.figure;
+
+import org.eclipse.draw2d.IFigure;
+
+public interface IFigureFactory {
+
+ IFigure createFigure();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/IFigureFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,117 @@
+package org.jboss.tools.flow.common.figure;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+public class NodeFigureFactory implements IFigureFactory {
+
+ private static final HashMap<String, Image> imageMap = new HashMap<String, Image>();
+ private static final HashMap<String, Color> colorMap = new HashMap<String, Color>();
+
+ private IConfigurationElement configurationElement;
+
+ public NodeFigureFactory(IConfigurationElement configurationElement) {
+ this.configurationElement = configurationElement;
+ }
+
+ public IFigure createFigure() {
+ ElementFigure result = null;
+ IConfigurationElement figureElement = null;
+ IConfigurationElement[] children = configurationElement.getChildren("node");
+ if (children.length == 1) {
+ children = children[0].getChildren("figure");
+ if (children.length == 1) {
+ figureElement = children[0];
+ }
+ }
+ if (figureElement == null) {
+ return new RectangleElementFigure();
+ }
+ if (figureElement.getAttribute("class") != null) {
+ try {
+ return (IFigure)figureElement.createExecutableExtension("class");
+ }
+ catch (CoreException e) {
+ return null;
+ }
+ }
+ children = figureElement.getChildren();
+ if (children.length < 1) {
+ result = new RectangleElementFigure();
+ } else if ("ellipse".equals(children[0].getName())){
+ result = new EllipseElementFigure();
+ } else if ("rounded-rectangle".equals(children[0].getName())) {
+ result = new RoundedRectangleElementFigure();
+ } else {
+ result = new RectangleElementFigure();
+ }
+ if (figureElement.getAttribute("icon") != null) {
+ String iconPath = figureElement.getAttribute("icon");
+ URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+ Image icon = null;
+ if (imageMap.containsKey(url.getPath())) {
+ icon = imageMap.get(url.getPath());
+ } else {
+ icon = ImageDescriptor.createFromURL(url).createImage();
+ imageMap.put(url.getPath(), icon);
+ }
+ result.setIcon(icon);
+ } else if (configurationElement.getAttribute("figure") != null) {
+ String iconPath = configurationElement.getAttribute("figure");
+ URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
+ Image icon = null;
+ if (imageMap.containsKey(url.getPath())) {
+ icon = imageMap.get(url.getPath());
+ } else {
+ icon = ImageDescriptor.createFromURL(url).createImage();
+ imageMap.put(url.getPath(), icon);
+ }
+ result.setIcon(icon);
+ }
+ if (figureElement.getAttribute("color") != null) {
+ String colorString = figureElement.getAttribute("color");
+ Color color = null;
+ if (colorMap.containsKey(colorString)) {
+ color = colorMap.get(colorString);
+ } else {
+ try {
+ StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
+ int[] rgb = new int[3];
+ int i = 0;
+ while (tokenizer.hasMoreTokens()) {
+ rgb[i++] = Integer.parseInt(tokenizer.nextToken());
+ }
+ color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
+ colorMap.put(colorString, color);
+ } catch (NumberFormatException e) {}
+ }
+ result.setColor(color);
+ }
+ Dimension size = new Dimension(result.getSize());
+ if (figureElement.getAttribute("width") != null) {
+ try {
+ size.width = Integer.parseInt(figureElement.getAttribute("width"));
+ } catch (NumberFormatException e) {}
+ }
+ if (figureElement.getAttribute("height") != null) {
+ try {
+ size.height = Integer.parseInt(figureElement.getAttribute("height"));
+ } catch (NumberFormatException e) {}
+ }
+ result.setSize(size);
+ return result;
+ }
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/NodeFigureFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RectangleElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RectangleElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RectangleElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,34 @@
+package org.jboss.tools.flow.common.figure;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.LineBorder;
+
+public class RectangleElementFigure extends AbstractElementFigure {
+
+ protected void customizeFigure() {
+ setBorder(new LineBorder(1));
+ setSize(80, 40);
+ }
+
+ public void setSelected(boolean b) {
+ super.setSelected(b);
+ ((LineBorder) getBorder()).setWidth(b ? 3 : 1);
+ repaint();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RectangleElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RoundedRectangleElementFigure.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RoundedRectangleElementFigure.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RoundedRectangleElementFigure.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,52 @@
+package org.jboss.tools.flow.common.figure;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.RoundedRectangle;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+
+public class RoundedRectangleElementFigure extends AbstractElementFigure {
+
+ protected RoundedRectangle rectangle;
+
+ protected void customizeFigure() {
+ rectangle = new RoundedRectangle();
+ rectangle.setCornerDimensions(new Dimension(25, 25));
+ add(rectangle, 0);
+ setSize(92, 52);
+ setSelected(false);
+ }
+
+ public void setColor(Color color) {
+ rectangle.setBackgroundColor(color);
+ }
+
+ public void setBounds(Rectangle rectangle) {
+ super.setBounds(rectangle);
+ Rectangle bounds = rectangle.getCopy();
+ this.rectangle.setBounds(bounds.translate(6, 6).resize(-12, -12));
+ }
+
+ public void setSelected(boolean b) {
+ super.setSelected(b);
+ rectangle.setLineWidth(b ? 3 : 1);
+ repaint();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/figure/RoundedRectangleElementFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Connection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Connection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Connection.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,62 @@
+package org.jboss.tools.flow.common.model;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Represents a connection between two nodes in a workflow.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface Connection extends Element {
+
+ /**
+ * Returns the from node of the connection.
+ * @return the from node of the connection.
+ */
+ Node getFrom();
+
+ /**
+ * Set the from node of the connection.
+ */
+ void setFrom(Node node);
+
+ /**
+ * Returns the to node of the connection
+ * @return the to node of the connection
+ */
+ Node getTo();
+
+ /**
+ * Set the to node of the connection.
+ */
+ void setTo(Node node);
+
+ /**
+ * Returns the type of the connection at the from node
+ *
+ * @return the type of the connection at the from node
+ */
+ String getFromType();
+
+ /**
+ * Returns the type of the connection at the to node
+ *
+ * @return the type of the connection at the to node
+ */
+ String getToType();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Connection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Container.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Container.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Container.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,47 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.List;
+
+/**
+ * A container of nodes.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface Container extends Element{
+
+ /**
+ * Returns the nodes of this node container.
+ *
+ * @return the nodes of this node container
+ */
+ List<Node> getNodes();
+
+ /**
+ * Returns the node with the given id
+ *
+ * @param id
+ * the node id
+ * @return the node with the given id
+ * @throws IllegalArgumentException
+ * if an unknown id is passed
+ */
+ Node getNode(long id);
+
+ /**
+ * Method for adding a node to this node container.
+ * Note that the node will get an id unique for this node container.
+ *
+ * @param node the node to be added
+ * @throws IllegalArgumentException if <code>node</code> is null
+ */
+ void addNode(Node node);
+
+ /**
+ * Method for removing a node from this node container
+ *
+ * @param node the node to be removed
+ * @throws IllegalArgumentException if <code>node</code> is null or unknown
+ */
+ void removeNode(Node node);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Container.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,53 @@
+package org.jboss.tools.flow.common.model;
+
+
+public class DefaultConnection extends DefaultElement implements Connection {
+
+ private Node from, to;
+
+ public DefaultConnection() {
+ this(null, null);
+ }
+
+ public DefaultConnection(Node from, Node to) {
+ setFrom(from);
+ setTo(to);
+ }
+
+ public Node getFrom() {
+ return from;
+ }
+
+ public void setFrom(Node node) {
+ if (from != null) {
+ from.removeOutgoingConnection(null, this);
+ }
+ from = node;
+ if (from != null) {
+ from.addOutgoingConnection(null, this);
+ }
+ }
+
+ public Node getTo() {
+ return to;
+ }
+
+ public void setTo(Node node) {
+ if (to != null) {
+ to.removeIncomingConnection(null, this);
+ }
+ to = node;
+ if (to != null) {
+ to.addIncomingConnection(null, this);
+ }
+ }
+
+ public String getFromType() {
+ return null;
+ }
+
+ public String getToType() {
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultConnection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultContainer.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultContainer.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultContainer.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,52 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class DefaultContainer extends DefaultNode implements Container {
+
+ private String name;
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+ private ArrayList<Node> nodes = new ArrayList<Node>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public List<Node> getNodes() {
+ return nodes;
+ }
+
+ public void addNode(Node node) {
+ nodes.add(node);
+ node.setNodeContainer(this);
+ }
+
+ public void removeNode(Node node) {
+ node.setNodeContainer(null);
+ nodes.remove(node);
+ }
+
+ public Node getNode(long id) {
+ for (Node node : nodes) {
+ if (node.getId() == id) {
+ return node;
+ }
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.HashMap;
+
+public class DefaultElement implements Element {
+
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultElement.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,88 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class DefaultFlow extends DefaultElement implements Flow {
+
+ private String name;
+ private HashMap<String, Object> metaData = new HashMap<String, Object>();
+ private ArrayList<Node> nodes = new ArrayList<Node>();
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Object getMetaData(String key) {
+ return metaData.get(key);
+ }
+
+ public void setMetaData(String key, Object value) {
+ metaData.put(key, value);
+ }
+
+ public List<Node> getNodes() {
+ return nodes;
+ }
+
+ public void addNode(Node node) {
+ nodes.add(node);
+ node.setNodeContainer(this);
+ }
+
+ public void removeNode(Node node) {
+ node.setNodeContainer(null);
+ nodes.remove(node);
+ }
+
+ public String getId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPackageName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getVersion() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setId(String id) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setPackageName(String packageName) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setType(String type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setVersion(String version) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Node getNode(long id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultFlow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,77 @@
+package org.jboss.tools.flow.common.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class DefaultNode extends DefaultElement implements Node {
+
+ private long id;
+ private String name;
+ private Container container;
+
+ private List<Connection> incomingConnections = new ArrayList<Connection>();
+ private List<Connection> outgoingConnections = new ArrayList<Connection>();
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long l) {
+ id = l;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Container getNodeContainer() {
+ return container;
+ }
+
+ public void setNodeContainer(Container container) {
+ this.container = container;
+ }
+
+ public void addIncomingConnection(String type, Connection connection) {
+ incomingConnections.add(connection);
+ }
+
+ public void addOutgoingConnection(String type, Connection connection) {
+ outgoingConnections.add(connection);
+ }
+
+ public Map<String, List<Connection>> getIncomingConnections() {
+ HashMap<String, List<Connection>> result = new HashMap<String, List<Connection>>();
+ result.put(null, getIncomingConnections(null));
+ return result;
+ }
+
+ public List<Connection> getIncomingConnections(String type) {
+ return new ArrayList<Connection>(incomingConnections);
+ }
+
+ public Map<String, List<Connection>> getOutgoingConnections() {
+ HashMap<String, List<Connection>> result = new HashMap<String, List<Connection>>();
+ result.put(null, getOutgoingConnections(null));
+ return result;
+ }
+
+ public List<Connection> getOutgoingConnections(String type) {
+ return new ArrayList<Connection>(outgoingConnections);
+ }
+
+ public void removeIncomingConnection(String type, Connection connection) {
+ incomingConnections.remove(connection);
+ }
+
+ public void removeOutgoingConnection(String type, Connection connection) {
+ outgoingConnections.remove(connection);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/DefaultNode.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Element.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Element.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Element.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,9 @@
+package org.jboss.tools.flow.common.model;
+
+public interface Element {
+
+ void setMetaData(String name, Object value);
+
+ Object getMetaData(String name);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Element.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Flow.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Flow.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Flow.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,95 @@
+package org.jboss.tools.flow.common.model;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Represents a some process definition.
+ * A process has a name and a unique id.
+ * When a new version of a process is created, the name stays the same,
+ * but the id and the version of the process should be different.
+ * Different types of processes could be defined (e.g. RuleFlow).
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface Flow extends Container, Element {
+
+ /**
+ * Sets the id of this process.
+ * The id should uniquely identify this process.
+ * @param id the id of the process
+ */
+ void setId(String id);
+
+ /**
+ * Returns the id of this process.
+ * @return the id of this process
+ */
+ String getId();
+
+ /**
+ * Sets the name of this process.
+ * @param name the name of this process
+ */
+ void setName(String name);
+
+ /**
+ * Returns the name of this process.
+ * If no name is specified, null is returned.
+ * @return the name of this process
+ */
+ String getName();
+
+ /**
+ * Sets the version of this process.
+ * @param version the version of this process
+ */
+ void setVersion(String version);
+
+ /**
+ * Returns the version of this process.
+ * If no version is specified, null is returned.
+ * @return the version of this process
+ */
+ String getVersion();
+
+ /**
+ * Sets the type of this process.
+ * @param type the type of this process
+ */
+ void setType(String type);
+
+ /**
+ * Returns the type of this process.
+ * @return the type of this process
+ */
+ String getType();
+
+ /**
+ * Sets the package name of this RuleFlow process
+ *
+ * @param packageName the package name of this RuleFlow process
+ */
+ void setPackageName(String packageName);
+
+ /**
+ * Returns the package name of this RuleFlow process
+ *
+ * @return the package name of this RuleFlow process
+ */
+ String getPackageName();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Flow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Node.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Node.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Node.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,91 @@
+package org.jboss.tools.flow.common.model;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Represents a node in a workflow process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface Node extends Element {
+
+ /**
+ * Returns the id of the node
+ *
+ * @return the id of the node
+ */
+ long getId();
+
+ /**
+ * Method for setting the id of the node
+ *
+ * @param id the id of the node
+ */
+ void setId(long id);
+
+ /**
+ * Returns the name of the node
+ *
+ * @return the name of the node
+ */
+ String getName();
+
+ /**
+ * Method for setting the name of the node
+ *
+ * @param name the name of the node
+ */
+ void setName(String name);
+
+ /**
+ * Returns the incoming connections
+ *
+ * @return the incoming connections
+ */
+ Map<String, List<Connection>> getIncomingConnections();
+
+ /**
+ * Returns the outgoing connections
+ *
+ * @return the outgoing connections
+ */
+ Map<String, List<Connection>> getOutgoingConnections();
+
+ void addIncomingConnection(String type, Connection connection);
+
+ void addOutgoingConnection(String type, Connection connection);
+
+ void removeIncomingConnection(String type, Connection connection);
+
+ void removeOutgoingConnection(String type, Connection connection);
+
+ List<Connection> getIncomingConnections(String type);
+
+ List<Connection> getOutgoingConnections(String type);
+
+ Container getNodeContainer();
+
+ void setNodeContainer(Container nodeContainer);
+
+ void setMetaData(String name, Object value);
+
+ Object getMetaData(String name);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/model/Node.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionBendpointEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionBendpointEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionBendpointEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,65 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.BendpointEditPolicy;
+import org.eclipse.gef.requests.BendpointRequest;
+import org.jboss.tools.flow.common.command.CreateBendpointCommand;
+import org.jboss.tools.flow.common.command.DeleteBendpointCommand;
+import org.jboss.tools.flow.common.command.MoveBendpointCommand;
+
+/**
+ * Policy for bendpoints of connections.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ConnectionBendpointEditPolicy extends BendpointEditPolicy {
+
+ protected Command getCreateBendpointCommand(BendpointRequest request) {
+ Point point = request.getLocation();
+ getConnection().translateToRelative(point);
+
+ CreateBendpointCommand command = new CreateBendpointCommand();
+ command.setLocation(point);
+ command.setConnection(getHost().getModel());
+ command.setIndex(request.getIndex());
+
+ return command;
+ }
+
+ protected Command getDeleteBendpointCommand(BendpointRequest request) {
+ DeleteBendpointCommand command = new DeleteBendpointCommand();
+ command.setConnectionModel(getHost().getModel());
+ command.setIndex(request.getIndex());
+ return command;
+ }
+
+ protected Command getMoveBendpointCommand(BendpointRequest request) {
+ Point location = request.getLocation();
+ getConnection().translateToRelative(location);
+
+ MoveBendpointCommand command = new MoveBendpointCommand();
+ command.setConnectionModel(getHost().getModel());
+ command.setIndex(request.getIndex());
+ command.setNewLocation(location);
+
+ return command;
+
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionBendpointEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,105 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gef.requests.CreationFactory;
+import org.eclipse.gef.requests.GroupRequest;
+import org.jboss.tools.flow.common.command.DeleteConnectionCommand;
+import org.jboss.tools.flow.common.command.SplitConnectionCommand;
+import org.jboss.tools.flow.common.editpart.ConnectionEditPart;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.FlowWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for editing connections.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ConnectionEditPolicy extends org.eclipse.gef.editpolicies.ConnectionEditPolicy {
+
+ private CreationFactory elementConnectionFactory;
+
+ public void setElementConnectionFactory(CreationFactory elementConnectionFactory) {
+ this.elementConnectionFactory = elementConnectionFactory;
+ }
+
+ public Command getCommand(Request request) {
+ if (REQ_CREATE.equals(request.getType())) {
+ return getSplitConnectionCommand(request);
+ }
+ return super.getCommand(request);
+ }
+
+ private PolylineConnection getConnectionFigure() {
+ return ((PolylineConnection) ((ConnectionEditPart) getHost()).getFigure());
+ }
+
+ protected Command getDeleteCommand(GroupRequest request) {
+ DeleteConnectionCommand cmd = new DeleteConnectionCommand();
+ ConnectionWrapper connection = (ConnectionWrapper) getHost().getModel();
+ cmd.setAntecedentTaskConnection(connection);
+ cmd.setSource(connection.getSource());
+ cmd.setTarget(connection.getTarget());
+ return cmd;
+ }
+
+ protected Command getSplitConnectionCommand(Request request) {
+ if (elementConnectionFactory == null) {
+ throw new IllegalStateException("DefaultElementConnectionFactory is null");
+ }
+ SplitConnectionCommand cmd = new SplitConnectionCommand();
+ ConnectionWrapper elementConnection = (ConnectionWrapper)getHost().getModel();
+ ConnectionWrapper newSecondConnection = (ConnectionWrapper)elementConnectionFactory.getNewObject();
+ // Copy the configurationElement from the first connection as it is empty
+ ((Element)newSecondConnection.getElement()).setMetaData(
+ "configurationElement",
+ ((Element)elementConnection.getElement()).getMetaData("configurationElement"));
+ cmd.setElementConnection(elementConnection);
+ cmd.setNewSecondConnection(newSecondConnection);
+ cmd.setParent(((FlowWrapper) ((ConnectionEditPart) getHost())
+ .getSource().getParent().getModel()));
+ cmd.setNewElement(((NodeWrapper) ((CreateRequest) request).getNewObject()));
+ return cmd;
+ }
+
+ public EditPart getTargetEditPart(Request request) {
+ if (REQ_CREATE.equals(request.getType())) {
+ return getHost();
+ }
+ return null;
+ }
+
+ public void eraseTargetFeedback(Request request) {
+ if (REQ_CREATE.equals(request.getType())) {
+ getConnectionFigure().setLineWidth(1);
+ }
+ }
+
+ public void showTargetFeedback(Request request) {
+ if (REQ_CREATE.equals(request.getType())) {
+ getConnectionFigure().setLineWidth(2);
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ConnectionEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,61 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.jboss.tools.flow.common.command.AddNodeCommand;
+import org.jboss.tools.flow.common.command.ChangeConstraintCommand;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for performing layout of a process.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementContainerLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ protected Command getCreateCommand(CreateRequest request) {
+ AddNodeCommand command = new AddNodeCommand();
+ command.setParent((ContainerWrapper) getHost().getModel());
+ NodeWrapper element = (NodeWrapper) request.getNewObject();
+ element.setConstraint((Rectangle) getConstraintFor(request));
+ command.setChild(element);
+ return command;
+ }
+
+ protected Command getDeleteDependantCommand(Request request) {
+ return null;
+ }
+
+ protected Command createAddCommand(EditPart child, Object constraint) {
+ // TODO this is needed to allow dragging of elements from one container to another
+ return null;
+ }
+
+ protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
+ ChangeConstraintCommand command = new ChangeConstraintCommand();
+ command.setElement((NodeWrapper) child.getModel());
+ command.setConstraint((Rectangle)constraint);
+ return command;
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementContainerLayoutEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditManager.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditManager.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditManager.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,54 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+/**
+ * Manager for directly editing elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementDirectEditManager extends DirectEditManager {
+
+ private IPropertySource propertySource;
+
+ public ElementDirectEditManager(GraphicalEditPart source, CellEditorLocator locator) {
+ super(source, TextCellEditor.class, locator);
+ Object object = source.getModel();
+ if (object instanceof Wrapper) {
+ propertySource = (IPropertySource)((Wrapper)object).getAdapter(IPropertySource.class);
+ }
+ }
+
+ protected void initCellEditor() {
+ String initialValue = null;
+ if (propertySource != null) {
+ initialValue = (String)propertySource.getPropertyValue(IPropertyId.NAME);
+ }
+ getCellEditor().setValue(initialValue == null ? "" : initialValue);
+ Text text = (Text) getCellEditor().getControl();
+ text.selectAll();
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,58 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.DirectEditPolicy;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.command.RenameElementCommand;
+import org.jboss.tools.flow.common.figure.ElementFigure;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+/**
+ * Policy for directly editing elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementDirectEditPolicy extends DirectEditPolicy {
+
+ protected Command getDirectEditCommand(DirectEditRequest request) {
+ RenameElementCommand cmd = new RenameElementCommand();
+ cmd.setSource((Wrapper) getHost().getModel());
+ IPropertySource propertySource = (IPropertySource)((Wrapper)getHost().getModel()).getAdapter(IPropertySource.class);
+ if (propertySource != null) {
+ cmd.setOldName((String)propertySource.getPropertyValue(IPropertyId.NAME));
+ }
+ cmd.setName((String) request.getCellEditor().getValue());
+ return cmd;
+ }
+
+ protected void showCurrentEditValue(DirectEditRequest request) {
+ String value = (String) request.getCellEditor().getValue();
+ IFigure figure = getHostFigure();
+ if (figure instanceof Label) {
+ ((Label)figure).setText(value);
+ } else if (figure instanceof ElementFigure){
+ ((ElementFigure)figure).setText(value);
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementDirectEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,41 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.ComponentEditPolicy;
+import org.eclipse.gef.requests.GroupRequest;
+import org.jboss.tools.flow.common.command.DeleteNodeCommand;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for editing elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementEditPolicy extends ComponentEditPolicy {
+
+ protected Command createDeleteCommand(GroupRequest deleteRequest) {
+ ContainerWrapper parent = (ContainerWrapper) getHost().getParent().getModel();
+ DeleteNodeCommand deleteCmd = new DeleteNodeCommand();
+ deleteCmd.setParent(parent);
+ deleteCmd.setChild((NodeWrapper) (getHost().getModel()));
+ return deleteCmd;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementNodeEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementNodeEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementNodeEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,78 @@
+package org.jboss.tools.flow.common.policy;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.jboss.tools.flow.common.command.ElementConnectionCreateCommand;
+import org.jboss.tools.flow.common.command.ReconnectElementConnectionSourceCommand;
+import org.jboss.tools.flow.common.command.ReconnectElementConnectionTargetCommand;
+import org.jboss.tools.flow.common.editpart.ElementEditPart;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+
+/**
+ * Policy for editing an element node.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ElementNodeEditPolicy extends GraphicalNodeEditPolicy {
+
+ protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
+ ElementConnectionCreateCommand cmd =
+ (ElementConnectionCreateCommand) request.getStartCommand();
+ cmd.setConnection((ConnectionWrapper) request.getNewObject());
+ cmd.setTarget(getElement());
+ return cmd;
+ }
+
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ ElementConnectionCreateCommand cmd =
+ new ElementConnectionCreateCommand();
+ cmd.setConnection((ConnectionWrapper) request.getNewObject());
+ cmd.setSource(getElement());
+ request.setStartCommand(cmd);
+ return cmd;
+ }
+
+ protected ElementEditPart getActivityPart() {
+ return (ElementEditPart) getHost();
+ }
+
+ protected NodeWrapper getElement() {
+ return (NodeWrapper) getHost().getModel();
+ }
+
+ protected Command getReconnectSourceCommand(ReconnectRequest request) {
+ ReconnectElementConnectionSourceCommand cmd
+ = new ReconnectElementConnectionSourceCommand();
+ cmd.setConnection((ConnectionWrapper) request.getConnectionEditPart().getModel());
+ cmd.setSource(getElement());
+ return cmd;
+ }
+
+ protected Command getReconnectTargetCommand(ReconnectRequest request) {
+ ReconnectElementConnectionTargetCommand cmd
+ = new ReconnectElementConnectionTargetCommand();
+ cmd.setConnection((ConnectionWrapper) request.getConnectionEditPart().getModel());
+ cmd.setTarget(getElement());
+ return cmd;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/ElementNodeEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/LabelGraphicalNodeEditPolicy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/LabelGraphicalNodeEditPolicy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/LabelGraphicalNodeEditPolicy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,25 @@
+package org.jboss.tools.flow.common.policy;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.jboss.tools.flow.common.command.LabelMoveCommand;
+import org.jboss.tools.flow.common.wrapper.LabelWrapper;
+
+public class LabelGraphicalNodeEditPolicy extends NonResizableEditPolicy {
+
+ public Command getMoveCommand(ChangeBoundsRequest request) {
+ if (!(getHost().getModel() instanceof LabelWrapper)) return null;
+ LabelWrapper model = (LabelWrapper)getHost().getModel();
+ Point delta = request.getMoveDelta();
+ return new LabelMoveCommand(model, getParentFigure(), delta);
+ }
+
+ private IFigure getParentFigure() {
+ return ((GraphicalEditPart)getHost().getParent()).getFigure();
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/policy/LabelGraphicalNodeEditPolicy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,65 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+
+public class DefaultContainerWrapperPropertySource extends WrapperPropertySource implements IPropertyId {
+
+ private DefaultContainerWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultContainerWrapperPropertySource(DefaultContainerWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = wrapper;
+ }
+
+ public Object getEditableValue() {
+ return super.getEditableValue();
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,60 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+
+public class DefaultFlowWrapperPropertySource extends WrapperPropertySource implements IPropertyId {
+
+ private DefaultFlowWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultFlowWrapperPropertySource(DefaultFlowWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = (DefaultFlowWrapper)wrapper;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,64 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+
+public class DefaultNodeWrapperPropertySource extends WrapperPropertySource implements IPropertyId {
+
+ private DefaultNodeWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultNodeWrapperPropertySource(DefaultNodeWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = wrapper;
+ }
+
+ public Object getEditableValue() {
+ return super.getEditableValue();
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {
+ public String getCategory() {
+ return "General";
+ }
+ }
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null ? wrapper.getName() : "";
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,8 @@
+package org.jboss.tools.flow.common.properties;
+
+public interface IPropertyId {
+
+ String NAME = "org.jboss.tools.flow.common.model.name";
+ String LABEL = "org.jboss.tools.flow.common.model.label";
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,79 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class WrapperPropertySource implements IPropertySource {
+
+ private Wrapper wrapper;
+ private IPropertySource elementPropertySource;
+
+ public WrapperPropertySource(Wrapper wrapper) {
+ this.wrapper = wrapper;
+ if (wrapper != null && wrapper.getElement() != null) {
+ Object object = wrapper.getElement().getMetaData("propertySource");
+ if (object != null && object instanceof IPropertySource) {
+ elementPropertySource = (IPropertySource)object;
+ }
+ }
+ }
+
+ public Object getEditableValue() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getEditableValue();
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyDescriptors();
+ }
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyValue(id);
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.isPropertySet(id);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ elementPropertySource.resetPropertyValue(id);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object newValue) {
+ if (elementPropertySource != null) {
+ Object oldValue = elementPropertySource.getPropertyValue(id);
+ elementPropertySource.setPropertyValue(id, newValue);
+ wrapper.notifyListeners(Wrapper.CHANGE_PROPERTY, id, wrapper, oldValue, newValue);
+ }
+ }
+
+ protected Wrapper getWrapper() {
+ return wrapper;
+ }
+
+ protected IPropertyDescriptor[] merge(IPropertyDescriptor[] first, IPropertyDescriptor[] second) {
+ IPropertyDescriptor[] result = new IPropertyDescriptor[first.length + second.length];
+ for (int i = 0; i < first.length; i++) {
+ result[i] = first[i];
+ }
+ for (int i = first.length; i < result.length; i++) {
+ result[i] = second[i - first.length];
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,340 @@
+package org.jboss.tools.flow.common.registry;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.gef.requests.CreationFactory;
+import org.jboss.tools.flow.common.Logger;
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Container;
+import org.jboss.tools.flow.common.model.Element;
+import org.jboss.tools.flow.common.model.Flow;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultLabelWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+import org.jboss.tools.flow.common.wrapper.DefaultWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class ElementRegistry {
+
+ private static final String elementsExtensionPointId = "org.jboss.tools.flow.common.elements";
+ private static HashMap<String, IConfigurationElement> elementMap = null;
+
+
+ private static void initializeRegistry() {
+ elementMap = new HashMap<String, IConfigurationElement>();
+ IConfigurationElement[] configurationElements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(elementsExtensionPointId);
+ for (IConfigurationElement configurationElement: configurationElements) {
+ elementMap.put(configurationElement.getAttribute("id"), configurationElement);
+ }
+ }
+
+ private static Wrapper createWrapper(IConfigurationElement configurationElement)
+ throws CoreException {
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children.length > 1) return null;
+ if (children.length == 0) {
+ return createDefault(configurationElement);
+ }
+ String type = children[0].getName();
+ if ("flow".equals(type)) {
+ return createFlow(configurationElement);
+ } else if ("container".equals(type)) {
+ return createContainer(configurationElement);
+ } else if ("node".equals(type)) {
+ return createNode(configurationElement);
+ } else if ("connection".equals(type)) {
+ return createConnection(configurationElement);
+ } else {
+ return null;
+ }
+ }
+
+ private static Wrapper createDefault(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Element)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Element instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element)element).setMetaData("configurationElement", configurationElement);
+ DefaultWrapper result = new DefaultWrapper();
+ result.setElement((Element)element);
+ return result;
+ }
+
+ private static Wrapper createConnection(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Connection)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Connection instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element)element).setMetaData("configurationElement", configurationElement);
+ ConnectionWrapper result = new DefaultConnectionWrapper();
+ result.setElement((Element)element);
+ result.setLabel(new DefaultLabelWrapper(result));
+ return result;
+ }
+
+ private static Wrapper createNode(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Node)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Node instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Node)element).setMetaData("configurationElement", configurationElement);
+ DefaultNodeWrapper result = new DefaultNodeWrapper();
+ result.setElement((Element)element);
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy = createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy = createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ return result;
+ }
+
+ private static Wrapper createContainer(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element) element).setMetaData("configurationElement", configurationElement);
+ DefaultContainerWrapper result = new DefaultContainerWrapper();
+ result.setElement((Element)element);
+ AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)element);
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ AcceptsIncomingConnectionStrategy acceptsIncomingConnectionStrategy = createAcceptsIncomingConnectionStrategy(configurationElement);
+ if (acceptsIncomingConnectionStrategy != null) {
+ acceptsIncomingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsIncomingConnectionStrategy(acceptsIncomingConnectionStrategy);
+ }
+ AcceptsOutgoingConnectionStrategy acceptsOutgoingConnectionStrategy = createAcceptsOutgoingConnectionStrategy(configurationElement);
+ if (acceptsOutgoingConnectionStrategy != null) {
+ acceptsOutgoingConnectionStrategy.setNode((Node)element);
+ result.setAcceptsOutgoingConnectionStrategy(acceptsOutgoingConnectionStrategy);
+ }
+ if (element instanceof Node) {
+ ((Node)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+ private static AcceptsIncomingConnectionStrategy createAcceptsIncomingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsIncomingConnectionStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsIncomingConnectionStrategy");
+ }
+ return (AcceptsIncomingConnectionStrategy)result;
+ }
+
+ private static AcceptsOutgoingConnectionStrategy createAcceptsOutgoingConnectionStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsOutgoingConnectionStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsOutgoingConnectionStrategy");
+ }
+ return (AcceptsOutgoingConnectionStrategy)result;
+ }
+
+ private static AcceptsElementStrategy createAcceptsElementStrategy(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object result = null;
+ IConfigurationElement[] children = configurationElement.getChildren();
+ if (children[0].getAttribute("acceptsElementStrategy") != null) {
+ result = children[0].createExecutableExtension("acceptsElementStrategy");
+ }
+ return (AcceptsElementStrategy)result;
+ }
+
+ private static Wrapper createFlow(IConfigurationElement configurationElement)
+ throws CoreException {
+ Object element = configurationElement.createExecutableExtension("class");
+ if (!(element instanceof Container)) {
+ String message = "Expecting to instantiate a org.jboss.tools.flow.common.model.Container instance.";
+ Logger.logError(message, new RuntimeException(message));
+ return null;
+ }
+ ((Element) element).setMetaData("configurationElement", configurationElement);
+ DefaultFlowWrapper result = new DefaultFlowWrapper();
+ result.setElement((Element)element);
+ AcceptsElementStrategy acceptsElementStrategy = createAcceptsElementStrategy(configurationElement);
+ if (acceptsElementStrategy != null) {
+ acceptsElementStrategy.setContainer((Container)result.getElement());
+ result.setAcceptsElementStrategy(acceptsElementStrategy);
+ }
+ if (element instanceof Flow) {
+ ((Flow)element).setName(configurationElement.getAttribute("name"));
+ }
+ return result;
+ }
+
+// private static EditPart createConnectionEditPart(final IConfigurationElement configurationElement) {
+// return new ConnectionEditPart() {
+// };
+// }
+//
+// private static EditPart createNodeEditPart(final IConfigurationElement configurationElement) {
+// return new ElementEditPart() {
+// protected IFigure createFigure() {
+// ElementFigure result = null;
+// IConfigurationElement figureElement = null;
+// IConfigurationElement[] children = configurationElement.getChildren("node");
+// if (children.length == 1) {
+// children = children[0].getChildren("figure");
+// if (children.length == 1) {
+// figureElement = children[0];
+// }
+// }
+// if (figureElement == null) {
+// return new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("class") != null) {
+// try {
+// return (IFigure)figureElement.createExecutableExtension("class");
+// }
+// catch (CoreException e) {
+// return null;
+// }
+// }
+// children = figureElement.getChildren();
+// if (children.length < 1) {
+// result = new RectangleElementFigure();
+// } else if ("ellipse".equals(children[0].getName())){
+// result = new EllipseElementFigure();
+// } else if ("rounded-rectangle".equals(children[0].getName())) {
+// result = new RoundedRectangleElementFigure();
+// } else {
+// result = new RectangleElementFigure();
+// }
+// if (figureElement.getAttribute("icon") != null) {
+// String iconPath = figureElement.getAttribute("icon");
+// URL url = Platform.getBundle(figureElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// } else if (configurationElement.getAttribute("figure") != null) {
+// String iconPath = configurationElement.getAttribute("figure");
+// URL url = Platform.getBundle(configurationElement.getContributor().getName()).getEntry(iconPath);
+// Image icon = null;
+// if (imageMap.containsKey(url.getPath())) {
+// icon = imageMap.get(url.getPath());
+// } else {
+// icon = ImageDescriptor.createFromURL(url).createImage();
+// imageMap.put(url.getPath(), icon);
+// }
+// result.setIcon(icon);
+// }
+// if (figureElement.getAttribute("color") != null) {
+// String colorString = figureElement.getAttribute("color");
+// Color color = null;
+// if (colorMap.containsKey(colorString)) {
+// color = colorMap.get(colorString);
+// } else {
+// try {
+// StringTokenizer tokenizer = new StringTokenizer(colorString, ",");
+// int[] rgb = new int[3];
+// int i = 0;
+// while (tokenizer.hasMoreTokens()) {
+// rgb[i++] = Integer.parseInt(tokenizer.nextToken());
+// }
+// color = new Color(Display.getCurrent(), rgb[0], rgb[1], rgb[2]);
+// colorMap.put(colorString, color);
+// } catch (NumberFormatException e) {}
+// }
+// result.setColor(color);
+// }
+// Dimension size = new Dimension(result.getSize());
+// if (figureElement.getAttribute("width") != null) {
+// try {
+// size.width = Integer.parseInt(figureElement.getAttribute("width"));
+// } catch (NumberFormatException e) {}
+// }
+// if (figureElement.getAttribute("height") != null) {
+// try {
+// size.height = Integer.parseInt(figureElement.getAttribute("height"));
+// } catch (NumberFormatException e) {}
+// }
+// result.setSize(size);
+// return result;
+// }
+// };
+// }
+
+ public static Wrapper createWrapper(String elementId) {
+ if (elementMap == null) {
+ initializeRegistry();
+ }
+ IConfigurationElement configurationElement = elementMap.get(elementId);
+ if (configurationElement != null) {
+ try {
+ return createWrapper(configurationElement);
+ } catch (CoreException e) {
+ Logger.logError("Creating a wrapper for " + elementId + " failed.", e);
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ public static IConfigurationElement getConfigurationElement(String elementId) {
+ return elementMap.get(elementId);
+ }
+
+ public static CreationFactory getCreationFactory(final String elementId) {
+ return new CreationFactory() {
+ public Object getNewObject() {
+ return createWrapper(elementId);
+ }
+ public Object getObjectType() {
+ return elementId;
+ }
+ };
+ }
+
+ public static CreationFactory getCreationFactory(Element element) {
+ String id = null;
+ IConfigurationElement configurationElement =
+ (IConfigurationElement)element.getMetaData("configurationElement");
+ if (configurationElement != null) {
+ id = configurationElement.getAttribute("id");
+ }
+ return id == null ? null : getCreationFactory(id);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/ElementRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,40 @@
+package org.jboss.tools.flow.common.registry;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+
+public class LanguageRegistry {
+
+ private static final String languagesExtensionPointId = "org.jboss.tools.flow.common.languages";
+ private static HashMap<String, String> languageMap = null;
+
+ private static void initializeRegistry() {
+ languageMap = new HashMap<String, String>();
+ IConfigurationElement[] configurationElements =
+ Platform.getExtensionRegistry().getConfigurationElementsFor(languagesExtensionPointId);
+ for (IConfigurationElement configElement: configurationElements) {
+ String id = configElement.getAttribute("id");
+ String editor = configElement.getAttribute("editor");
+ if (id != null && editor != null) {
+ languageMap.put(editor, id);
+ }
+ }
+ }
+
+ public static boolean isLanguageRegisteredFor(String editorId) {
+ if (languageMap == null) {
+ initializeRegistry();
+ }
+ return languageMap.containsKey(editorId);
+ }
+
+ public static String getLanguageRegisteredFor(String editorId) {
+ if (languageMap == null) {
+ initializeRegistry();
+ }
+ return languageMap.get(editorId);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/LanguageRegistry.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsElementStrategy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsElementStrategy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsElementStrategy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.common.strategy;
+
+import org.jboss.tools.flow.common.model.Container;
+
+public interface AcceptsElementStrategy {
+
+ void setContainer(Container container);
+
+ boolean acceptsElement(Object element);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsElementStrategy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsIncomingConnectionStrategy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsIncomingConnectionStrategy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsIncomingConnectionStrategy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,13 @@
+package org.jboss.tools.flow.common.strategy;
+
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Node;
+
+public interface AcceptsIncomingConnectionStrategy {
+
+ void setNode(Node node);
+
+ boolean acceptsIncomingConnection(Connection connection, Node source);
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsIncomingConnectionStrategy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsOutgoingConnectionStrategy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsOutgoingConnectionStrategy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsOutgoingConnectionStrategy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,13 @@
+package org.jboss.tools.flow.common.strategy;
+
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Node;
+
+public interface AcceptsOutgoingConnectionStrategy {
+
+ void setNode(Node node);
+
+ boolean acceptsOutgoingConnection(Connection connection, Node target);
+
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/AcceptsOutgoingConnectionStrategy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/SaveElementStrategy.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/SaveElementStrategy.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/SaveElementStrategy.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.common.strategy;
+
+import org.jboss.tools.flow.common.model.Container;
+
+public interface SaveElementStrategy {
+
+ void setContainer(Container container);
+
+ boolean acceptsElement(Object element);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/strategy/SaveElementStrategy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,129 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+
+/**
+ * A connection between two model elements.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class AbstractConnectionWrapper extends AbstractWrapper implements ConnectionWrapper {
+
+ private static final long serialVersionUID = 1L;
+
+ private NodeWrapper source;
+ private NodeWrapper target;
+ private LabelWrapper label;
+ private transient List<Point> bendpoints = new ArrayList<Point>();
+
+ public void localSetSource(NodeWrapper source) {
+ this.source = source;
+ }
+
+ public void localSetTarget(NodeWrapper target) {
+ this.target = target;
+ }
+
+ public void disconnect() {
+ if (source == null) {
+ throw new IllegalStateException("Can't disconnect, source is null");
+ }
+ if (target == null) {
+ throw new IllegalStateException("Can't disconnect, target is null");
+ }
+ source.removeOutgoingConnection(this);
+ target.removeIncomingConnection(this);
+ source = null;
+ target = null;
+ }
+
+ public void connect(NodeWrapper source, NodeWrapper target) {
+ if (source == null) {
+ throw new IllegalArgumentException("source is null");
+ }
+ if (this.source != null) {
+ throw new IllegalStateException("The source of a connection cannot be changed");
+ }
+ if (target == null) {
+ throw new IllegalArgumentException("target is null");
+ }
+ if (this.target != null) {
+ throw new IllegalStateException("The target of a connection cannot be changed");
+ }
+ this.source = source;
+ this.target = target;
+ source.addOutgoingConnection(this);
+ target.addIncomingConnection(this);
+ }
+
+
+ public NodeWrapper getSource() {
+ return source;
+ }
+
+ public NodeWrapper getTarget() {
+ return target;
+ }
+
+ public void addBendpoint(int index, Point point) {
+ bendpoints.add(index, point);
+ internalSetBendpoints(bendpoints);
+ notifyListeners(CHANGE_BENDPOINTS);
+ }
+
+ public void removeBendpoint(int index) {
+ bendpoints.remove(index);
+ internalSetBendpoints(bendpoints);
+ notifyListeners(CHANGE_BENDPOINTS);
+ }
+
+ public void replaceBendpoint(int index, Point point) {
+ bendpoints.set(index, point);
+ internalSetBendpoints(bendpoints);
+ notifyListeners(CHANGE_BENDPOINTS);
+ }
+
+ protected void internalSetBendpoints(List<Point> bendPoints) {
+ }
+
+ public void localSetBendpoints(List<Point> bendpoints) {
+ this.bendpoints = bendpoints;
+ }
+
+ public List<Point> getBendpoints() {
+ if (bendpoints == null) {
+ bendpoints = internalGetBendpoints();
+ }
+ return bendpoints;
+ }
+
+ protected abstract List<Point> internalGetBendpoints();
+
+ public void setLabel(LabelWrapper label) {
+ this.label = label;
+ }
+
+ public LabelWrapper getLabel() {
+ return label;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractConnectionWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,70 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class AbstractContainerWrapper extends AbstractNodeWrapper implements ContainerWrapper {
+
+ List<NodeWrapper> elements = new ArrayList<NodeWrapper>();
+
+ public void addElement(NodeWrapper element) {
+ internalAddElement(element);
+ localAddElement(element);
+ notifyListeners(ADD_ELEMENT, "node", this, null, element);
+ }
+
+ public void localAddElement(NodeWrapper element) {
+ elements.add(element);
+ element.setParent(this);
+ }
+
+ protected abstract void internalAddElement(NodeWrapper element);
+
+ public void removeElement(NodeWrapper element) {
+ internalRemoveElement(element);
+ elements.remove(element);
+ element.setParent(null);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
+ }
+
+ protected abstract void internalRemoveElement(NodeWrapper element);
+
+ public List<NodeWrapper> getNodeWrappers() {
+ return elements;
+ }
+
+ public FlowWrapper getFlowWrapper() {
+ return getParent().getFlowWrapper();
+ }
+
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ public boolean acceptsIncomingConnection(
+ ConnectionWrapper connection, NodeWrapper source) {
+ return true;
+ }
+
+ public boolean acceptsOutgoingConnection(
+ ConnectionWrapper connection, NodeWrapper target) {
+ return true;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractContainerWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,91 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A wrapper for a process element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class AbstractFlowWrapper extends AbstractWrapper implements FlowWrapper {
+
+ private Map<String, NodeWrapper> nodeWrapperMap = new HashMap<String, NodeWrapper>();
+ private List<NodeWrapper> nodeWrapperList = new ArrayList<NodeWrapper>();
+
+ public abstract Integer getRouterLayout();
+
+ public void setRouterLayout(Integer newLayout) {
+ Integer oldLayout = getRouterLayout();
+ internalSetRouterLayout(newLayout);
+ notifyListeners(CHANGE_VISUAL, "routerLayout", this, oldLayout, newLayout);
+ }
+
+ protected void internalSetRouterLayout(Integer routerLayout) {
+ }
+
+ public List<NodeWrapper> getNodeWrappers() {
+ return Collections.unmodifiableList(
+ new ArrayList<NodeWrapper>(nodeWrapperList));
+ }
+
+ public NodeWrapper getNodeWrapper(String id) {
+ return (NodeWrapper) nodeWrapperMap.get(id);
+ }
+
+ public void addElement(NodeWrapper nodeWrapper) {
+ if (!acceptsElement(nodeWrapper)) return;
+ internalAddElement(nodeWrapper);
+ localAddElement(nodeWrapper);
+ notifyListeners(ADD_ELEMENT, "node", this, null, nodeWrapper);
+ }
+
+ public void localAddElement(NodeWrapper element) {
+ nodeWrapperMap.put(element.getId(), element);
+ nodeWrapperList.add(element);
+ element.setParent(this);
+ }
+
+ public boolean acceptsElement(NodeWrapper element) {
+ return true;
+ }
+
+ protected abstract void internalAddElement(NodeWrapper element);
+
+ public void localRemoveElement(NodeWrapper element) {
+ nodeWrapperMap.remove(element.getId());
+ nodeWrapperList.remove(element);
+ }
+
+ public void removeElement(NodeWrapper element) {
+ localRemoveElement(element);
+ internalRemoveElement(element);
+ notifyListeners(REMOVE_ELEMENT, "node", this, element, null);
+ }
+
+ protected abstract void internalRemoveElement(NodeWrapper element);
+
+ public FlowWrapper getFlowWrapper() {
+ return this;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractFlowWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,30 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.draw2d.geometry.Point;
+
+public abstract class AbstractLabelWrapper extends AbstractWrapper implements
+ LabelWrapper {
+
+ private Point location = null;
+
+ public Point getLocation() {
+ return location;
+ }
+
+ public String getText() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setLocation(Point newLocation) {
+ Point oldLocation = this.location;
+ this.location = newLocation;
+ notifyListeners(CHANGE_VISUAL, "location", this, oldLocation, newLocation);
+ }
+
+ public void setText(String text) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractLabelWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,144 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+/**
+ * Default wrapper of a model element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public abstract class AbstractNodeWrapper extends AbstractWrapper implements NodeWrapper {
+
+ protected static IPropertyDescriptor[] descriptors;
+
+ public static final String NAME = "Name";
+ static {
+ descriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name"),
+ };
+ }
+
+ private ContainerWrapper parent;
+ private LabelWrapper label;
+ private transient Rectangle constraint;
+ private List<ConnectionWrapper> incomingConnections = new ArrayList<ConnectionWrapper>();
+ private List<ConnectionWrapper> outgoingConnections = new ArrayList<ConnectionWrapper>();
+
+ public void setConstraint(Rectangle constraint) {
+ Rectangle oldConstraint = this.constraint;
+ this.constraint = constraint;
+ internalSetConstraint(constraint);
+ notifyListeners(CHANGE_VISUAL, "constraint", this, oldConstraint, constraint);
+ }
+
+ protected abstract void internalSetConstraint(Rectangle constraint);
+
+ public Rectangle getConstraint() {
+ if (constraint == null) {
+ constraint = internalGetConstraint();
+ }
+ return constraint;
+ }
+
+ protected abstract Rectangle internalGetConstraint();
+
+ public void setParent(ContainerWrapper parent) {
+ this.parent = parent;
+ }
+
+ public ContainerWrapper getParent() {
+ return parent;
+ }
+
+ public void setLabel(LabelWrapper label) {
+ this.label = label;
+ }
+
+ public LabelWrapper getLabel() {
+ return label;
+ }
+
+ public List<ConnectionWrapper> getOutgoingConnections() {
+ return Collections.unmodifiableList(outgoingConnections);
+ }
+
+ public List<ConnectionWrapper> getIncomingConnections() {
+ return Collections.unmodifiableList(incomingConnections);
+ }
+
+ public void addIncomingConnection(ConnectionWrapper connection) {
+ localAddIncomingConnection(connection);
+ internalAddIncomingConnection(connection);
+ notifyListeners(ADD_ELEMENT, "incomingConnection", this, null, connection);
+ }
+
+ public void localAddIncomingConnection(ConnectionWrapper connection) {
+ incomingConnections.add(connection);
+ }
+
+ protected void internalAddIncomingConnection(ConnectionWrapper connection) {
+ }
+
+ public void removeIncomingConnection(ConnectionWrapper connection) {
+ incomingConnections.remove(connection);
+ internalRemoveIncomingConnection(connection);
+ notifyListeners(REMOVE_ELEMENT, "incomingConnection", this, connection, null);
+ }
+
+ protected void internalRemoveIncomingConnection(ConnectionWrapper connection) {
+ }
+
+ public void addOutgoingConnection(ConnectionWrapper connection) {
+ localAddOutgoingConnection(connection);
+ internalAddOutgoingConnection(connection);
+ notifyListeners(ADD_ELEMENT, "outgoingConnection", this, null, connection);
+ }
+
+ public void localAddOutgoingConnection(ConnectionWrapper connection) {
+ outgoingConnections.add(connection);
+ }
+
+ protected void internalAddOutgoingConnection(ConnectionWrapper connection) {
+ }
+
+ public void removeOutgoingConnection(ConnectionWrapper connection) {
+ outgoingConnections.remove(connection);
+ internalRemoveOutgoingConnection(connection);
+ notifyListeners(REMOVE_ELEMENT, "outgoingConnection", this, connection, null);
+ }
+
+ protected void internalRemoveOutgoingConnection(ConnectionWrapper connection) {
+ }
+
+ public void setName(String newLocation) {
+ String oldName = getName();
+ internalSetName(newLocation);
+ notifyListeners(CHANGE_VISUAL, "name", this, oldName, newLocation);
+ }
+
+ protected void internalSetName(String name) {
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractNodeWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,163 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Element;
+
+public abstract class AbstractWrapper implements Wrapper {
+
+ private Element element;
+ private transient List<ModelListener> listeners = new ArrayList<ModelListener>();
+ private Map<Object, List<Element>> children = new HashMap<Object, List<Element>>();
+
+ public void setElement(Element element) {
+ this.element = element;
+ }
+
+ public Element getElement() {
+ return element;
+ }
+
+ public void addChild(Object type, Element element) {
+ localAddChild(type, element);
+ internalAddChild(type, element);
+ notifyListeners(ADD_ELEMENT, type, this, null, element);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void internalAddChild(Object type, Element element) {
+ Object childList = getPropertyValue(type);
+ if (childList == null || !(childList instanceof List)) return;
+ ((List)childList).add(element);
+ }
+
+ public void localAddChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) {
+ childList = new ArrayList<Element>();
+ children.put(type, childList);
+ }
+ childList.add(element);
+ }
+
+ public void removeChild(Object type, Element element) {
+ localRemoveChild(type, element);
+ internalRemoveChild(type, element);
+ notifyListeners(REMOVE_ELEMENT, type, this, element, null);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void internalRemoveChild(Object type, Element element) {
+ Object childList = getPropertyValue(type);
+ if (childList == null || !(childList instanceof List)) return;
+ ((List)childList).remove(element);
+ }
+
+ public void localRemoveChild(Object type, Element element) {
+ List<Element> childList = children.get(type);
+ if (childList == null) return;
+ childList.remove(element);
+ if (childList.isEmpty()) {
+ children.remove(type);
+ }
+ }
+
+ public List<Element> getChildren(Object type) {
+ return children.get(type);
+ }
+
+ public void setMetaData(String name, Object value) {
+ if (element != null) {
+ element.setMetaData(name, value);
+ }
+ }
+
+ public Object getMetaData(String name) {
+ if (element != null) {
+ return element.getMetaData(name);
+ }
+ return null;
+ }
+
+ public void addListener(ModelListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(ModelListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void notifyListeners(int type, Object discriminator, Object object, Object oldValue, Object newValue) {
+ notifyListeners(new ModelEvent(type, discriminator, object, oldValue, newValue));
+ }
+
+ public void notifyListeners(ModelEvent event) {
+ for (int i = 0; i < listeners.size(); i++) {
+ listeners.get(i).modelChanged(event);
+ }
+ }
+
+ public void notifyListeners(int change) {
+ notifyListeners(change, null, null, null, null);
+ }
+
+ public Object getEditableValue() {
+ if (getPropertySource() != null) {
+ getPropertySource().getEditableValue();
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (getPropertySource() != null) {
+ return getPropertySource().getPropertyDescriptors();
+ }
+ return null;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (getPropertySource() != null) {
+ return getPropertySource().getPropertyValue(id);
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (getPropertySource() != null) {
+ return getPropertySource().isPropertySet(id);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (getPropertySource() != null) {
+ getPropertySource().resetPropertyValue(id);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object newValue) {
+ if (getPropertySource() != null) {
+ Object oldValue = getPropertySource().getPropertyValue(id);
+ getPropertySource().setPropertyValue(id, newValue);
+ notifyListeners(CHANGE_PROPERTY, id, this, oldValue, newValue);
+ }
+ }
+
+ protected abstract IPropertySource getPropertySource();
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == Element.class) {
+ return element;
+ } else if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/AbstractWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,25 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+
+public interface ConnectionWrapper extends Wrapper {
+
+ int CHANGE_BENDPOINTS = 1;
+
+ NodeWrapper getSource();
+ NodeWrapper getTarget();
+
+ void disconnect();
+ void connect(NodeWrapper source, NodeWrapper target);
+
+ void addBendpoint(int index, Point location);
+ void replaceBendpoint(int index, Point newLocation);
+ void removeBendpoint(int index);
+ List<Point> getBendpoints();
+
+ void setLabel(LabelWrapper label);
+ LabelWrapper getLabel();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ConnectionWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,35 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+public interface ContainerWrapper extends Wrapper {
+
+ void addElement(NodeWrapper element);
+
+ void localAddElement(NodeWrapper element);
+
+ void removeElement(NodeWrapper element);
+
+ List<NodeWrapper> getNodeWrappers();
+
+ FlowWrapper getFlowWrapper();
+
+ boolean acceptsElement(NodeWrapper element);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ContainerWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,97 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.DefaultConnection;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.properties.WrapperPropertySource;
+
+
+public class DefaultConnectionWrapper extends AbstractConnectionWrapper {
+
+ private IPropertySource propertySource;
+
+ public Connection getConnection() {
+ return (Connection)getElement();
+ }
+
+ protected List<Point> internalGetBendpoints() {
+ return (List<Point>) stringToBendpoints((String) getConnection().getMetaData("bendpoints"));
+ }
+
+ protected void internalSetBendpoints(List<Point> bendpoints) {
+ getConnection().setMetaData("bendpoints", bendpointsToString(bendpoints));
+ }
+
+ private String bendpointsToString(List<Point> bendpoints) {
+ if (bendpoints == null) {
+ return null;
+ }
+ String result = "[";
+ for (Iterator<Point> iterator = bendpoints.iterator(); iterator.hasNext(); ) {
+ Point point = iterator.next();
+ result += point.x + "," + point.y + (iterator.hasNext() ? ";" : "");
+ }
+ result += "]";
+ return result;
+ }
+
+ private List<Point> stringToBendpoints(String s) {
+ List<Point> result = new ArrayList<Point>();
+ if (s == null) {
+ return result;
+ }
+ s = s.substring(1, s.length() - 1);
+ String[] bendpoints = s.split(";");
+ for (String bendpoint: bendpoints) {
+ String[] xy = bendpoint.split(",");
+ result.add(new Point(new Integer(xy[0]), new Integer(xy[1])));
+ }
+ return result;
+ }
+
+
+ public void connect(NodeWrapper source, NodeWrapper target) {
+ Node from = (Node)source.getElement();
+ Node to = (Node)target.getElement();
+ Connection connection = getConnection();
+ if (connection != null) {
+ connection.setTo(to);
+ connection.setFrom(from);
+ } else {
+ setElement(createConnection(from, to));
+ }
+ super.connect(source, target);
+ }
+
+ protected Connection createConnection(Node from, Node to) {
+ Connection result = new DefaultConnection(from, to);
+ if (getConnection() != null) {
+ result.setMetaData(
+ "configurationElement",
+ getConnection().getMetaData("configurationElement"));
+ }
+ return result;
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new WrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,142 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Container;
+import org.jboss.tools.flow.common.model.Flow;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.properties.DefaultContainerWrapperPropertySource;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
+
+public class DefaultContainerWrapper extends AbstractContainerWrapper {
+
+ private AcceptsElementStrategy acceptsElementStrategy;
+ private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
+ private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultContainerWrapperPropertySource propertySource;
+
+ protected void internalSetName(String name) {
+ getNode().setName(name);
+ }
+
+ protected void internalAddElement(NodeWrapper element) {
+ Node node = (Node)element.getElement();
+ List<Node> nodes = ((Flow)getFlowWrapper().getElement()).getNodes();
+ long id = 0;
+ for (Node n: nodes) {
+ if (n.getId() > id) {
+ id = n.getId();
+ }
+ }
+ node.setId(++id);
+ ((Container)getParent().getElement()).addNode(node);
+ }
+
+
+ protected void internalRemoveElement(NodeWrapper element) {
+ ((Container)getParent().getElement()).removeNode((Node)element.getElement());
+ }
+
+
+ protected Rectangle internalGetConstraint() {
+ Node node = getNode();
+ Integer x = (Integer) node.getMetaData("x");
+ Integer y = (Integer) node.getMetaData("y");
+ Integer width = (Integer) node.getMetaData("width");
+ Integer height = (Integer) node.getMetaData("height");
+ return new Rectangle(x == null ? 0 : x, y == null ? 0 : y,
+ width == null ? -1 : width, height == null ? -1 : height);
+ }
+
+
+ protected void internalSetConstraint(Rectangle constraint) {
+ Node node = getNode();
+ node.setMetaData("x", constraint.x);
+ node.setMetaData("y", constraint.y);
+ node.setMetaData("width", constraint.width);
+ node.setMetaData("height", constraint.height);
+ }
+
+
+ public String getId() {
+ long id = getNode().getId();
+ return id == -1 ? null : getNode().getId() + "";
+ }
+
+ public String getName() {
+ return getNode().getName();
+ }
+
+ public Node getNode() {
+ return (Node)getElement();
+ }
+
+ public boolean acceptsElement(NodeWrapper wrapper) {
+ if (wrapper == null) {
+ return false;
+ } else if (acceptsElementStrategy != null) {
+ return acceptsElementStrategy.acceptsElement(wrapper.getElement());
+ } else {
+ return getParent().acceptsElement(wrapper);
+ }
+ }
+
+ public void setAcceptsElementStrategy(AcceptsElementStrategy strategy) {
+ this.acceptsElementStrategy = strategy;
+ }
+
+ public void setAcceptsIncomingConnectionStrategy(AcceptsIncomingConnectionStrategy strategy) {
+ this.incomingConnectionStrategy = strategy;
+ }
+
+ public void setAcceptsOutgoingConnectionStrategy(AcceptsOutgoingConnectionStrategy strategy) {
+ this.outgoingConnectionStrategy = strategy;
+ }
+
+ public boolean acceptsIncomingConnection(
+ ConnectionWrapper connectionWrapper, NodeWrapper sourceWrapper) {
+ if (connectionWrapper == null || sourceWrapper == null) {
+ return false;
+ } else if (incomingConnectionStrategy != null) {
+ return incomingConnectionStrategy.acceptsIncomingConnection(
+ (Connection)connectionWrapper.getElement(),
+ (Node)sourceWrapper.getElement());
+ } else {
+ return super.acceptsIncomingConnection(connectionWrapper, sourceWrapper);
+ }
+ }
+
+ public boolean acceptsOutgoingConnection(
+ ConnectionWrapper connectionWrapper, NodeWrapper targetWrapper) {
+ if (connectionWrapper == null || targetWrapper == null) {
+ return false;
+ } else if (outgoingConnectionStrategy != null) {
+ return outgoingConnectionStrategy.acceptsOutgoingConnection(
+ (Connection)connectionWrapper.getElement(),
+ (Node)targetWrapper.getElement());
+ } else {
+ return super.acceptsOutgoingConnection(connectionWrapper, targetWrapper);
+ }
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultContainerWrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,80 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.DefaultFlow;
+import org.jboss.tools.flow.common.model.Flow;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.properties.DefaultFlowWrapperPropertySource;
+import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
+
+public class DefaultFlowWrapper extends AbstractFlowWrapper {
+
+ private AcceptsElementStrategy acceptsElementStrategy;
+ private DefaultFlowWrapperPropertySource propertySource;
+
+ public String getName() {
+ return ((DefaultFlow)getElement()).getName();
+ }
+
+ public void setName(String name) {
+ ((DefaultFlow)getElement()).setName(name);
+ }
+
+ public Integer getRouterLayout() {
+ Integer routerLayout = (Integer) ((Flow)getElement()).getMetaData("routerLayout");
+ if (routerLayout == null) {
+ return ROUTER_LAYOUT_MANUAL;
+ }
+ return routerLayout;
+ }
+
+ public void internalSetRouterLayout(Integer routerLayout) {
+ ((Flow)getElement()).setMetaData("routerLayout", routerLayout);
+ }
+
+ protected void internalAddElement(NodeWrapper element) {
+ Node node = (Node)element.getElement();
+ long id = 0;
+ for (Node n: ((Flow)getElement()).getNodes()) {
+ if (n.getId() > id) {
+ id = n.getId();
+ }
+ }
+ node.setId(++id);
+ ((Flow)getElement()).addNode(node);
+ }
+
+ protected void internalRemoveElement(NodeWrapper element) {
+ ((Flow)getElement()).removeNode((Node)element.getElement());
+ }
+
+ public boolean acceptsElement(NodeWrapper wrapper) {
+ if (wrapper == null) {
+ return false;
+ } else if (acceptsElementStrategy != null) {
+ return acceptsElementStrategy.acceptsElement(wrapper.getElement());
+ } else {
+ return true;
+ }
+ }
+
+ public void setAcceptsElementStrategy(AcceptsElementStrategy strategy) {
+ this.acceptsElementStrategy = strategy;
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultFlowWrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,44 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.properties.WrapperPropertySource;
+
+public class DefaultLabelWrapper extends AbstractLabelWrapper implements ModelListener {
+
+ private IPropertySource propertySource;
+
+ public DefaultLabelWrapper(Wrapper owner) {
+ if (owner != null) {
+ setElement(owner.getElement());
+ }
+ }
+
+ public void setText(String text) {
+ getPropertySource().setPropertyValue(IPropertyId.LABEL, text);
+ }
+
+ public String getText() {
+ return (String)getPropertySource().getPropertyValue(IPropertyId.LABEL);
+ }
+
+ public void modelChanged(ModelEvent event) {
+ notifyListeners(event);
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new WrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultLabelWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,125 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Connection;
+import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.properties.DefaultNodeWrapperPropertySource;
+import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
+import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
+
+public class DefaultNodeWrapper extends AbstractNodeWrapper {
+
+ private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
+ private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
+ private DefaultNodeWrapperPropertySource propertySource;
+
+ public void setNode(Node node) {
+ setElement(node);
+ }
+
+ public Node getNode() {
+ return (Node) getElement();
+ }
+
+ public String getId() {
+ long id = getNode().getId();
+ return id == -1 ? null : getNode().getId() + "";
+ }
+
+ public String getName() {
+ return getNode().getName();
+ }
+
+ protected void internalSetName(String name) {
+ getNode().setName(name);
+ }
+
+ protected void internalSetConstraint(Rectangle constraint) {
+ Node node = getNode();
+ node.setMetaData("x", constraint.x);
+ node.setMetaData("y", constraint.y);
+ node.setMetaData("width", constraint.width);
+ node.setMetaData("height", constraint.height);
+ }
+
+ public Rectangle internalGetConstraint() {
+ Node node = getNode();
+ Integer x = (Integer) node.getMetaData("x");
+ Integer y = (Integer) node.getMetaData("y");
+ Integer width = (Integer) node.getMetaData("width");
+ Integer height = (Integer) node.getMetaData("height");
+ return new Rectangle(x == null ? 0 : x, y == null ? 0 : y,
+ width == null ? -1 : width, height == null ? -1 : height);
+ }
+
+ public void setAcceptsIncomingConnectionStrategy(AcceptsIncomingConnectionStrategy strategy) {
+ this.incomingConnectionStrategy = strategy;
+ }
+
+ public void setAcceptsOutgoingConnectionStrategy(AcceptsOutgoingConnectionStrategy strategy) {
+ this.outgoingConnectionStrategy = strategy;
+ }
+
+ public boolean acceptsIncomingConnection(
+ ConnectionWrapper connectionWrapper, NodeWrapper sourceWrapper) {
+ if (connectionWrapper == null || sourceWrapper == null) {
+ return false;
+ } else if (incomingConnectionStrategy != null) {
+ return incomingConnectionStrategy.acceptsIncomingConnection(
+ (Connection)connectionWrapper.getElement(),
+ (Node)sourceWrapper.getElement());
+ } else {
+ return true;
+ }
+ }
+
+ public boolean acceptsOutgoingConnection(
+ ConnectionWrapper connectionWrapper, NodeWrapper targetWrapper) {
+ if (connectionWrapper == null || targetWrapper == null) {
+ return false;
+ } else if (outgoingConnectionStrategy != null) {
+ return outgoingConnectionStrategy.acceptsOutgoingConnection(
+ (Connection)connectionWrapper.getElement(),
+ (Node)targetWrapper.getElement());
+ } else {
+ return true;
+ }
+ }
+
+ protected void internalAddIncomingConnection(AbstractConnectionWrapper connection) {
+ getNode().addIncomingConnection("",
+ ((DefaultConnectionWrapper) connection).getConnection());
+ }
+
+ protected void internalRemoveIncomingConnection(AbstractConnectionWrapper connection) {
+ getNode().removeIncomingConnection("",
+ ((DefaultConnectionWrapper) connection).getConnection());
+ }
+
+ protected void internalAddOutgoingConnection(AbstractConnectionWrapper connection) {
+ getNode().addOutgoingConnection("",
+ ((DefaultConnectionWrapper) connection).getConnection());
+ }
+
+ protected void internalRemoveOutgoingConnection(AbstractConnectionWrapper connection) {
+ getNode().removeOutgoingConnection("",
+ ((DefaultConnectionWrapper) connection).getConnection());
+ }
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultNodeWrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,17 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.properties.WrapperPropertySource;
+
+public class DefaultWrapper extends AbstractWrapper {
+
+ private WrapperPropertySource propertySource;
+
+ protected IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new WrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,14 @@
+package org.jboss.tools.flow.common.wrapper;
+
+public interface FlowWrapper extends ContainerWrapper {
+
+ Integer ROUTER_LAYOUT_MANUAL = new Integer(0);
+ Integer ROUTER_LAYOUT_MANHATTAN = new Integer(1);
+ Integer ROUTER_LAYOUT_SHORTEST_PATH = new Integer(2);
+
+
+ NodeWrapper getNodeWrapper(String id);
+
+ Object getRouterLayout();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/FlowWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/LabelWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/LabelWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/LabelWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,13 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import org.eclipse.draw2d.geometry.Point;
+
+public interface LabelWrapper extends Wrapper {
+
+ void setText(String text);
+ String getText();
+
+ void setLocation(Point location);
+ Point getLocation();
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/LabelWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,69 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Event notifying a change in a model element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public class ModelEvent {
+
+ private int changeType;
+ private Object changeDiscriminator;
+ private Object changedObject;
+ private Object oldValue;
+ private Object newValue;
+
+// public ModelEvent(int changeType) {
+// this.changeType = changeType;
+// }
+
+// public ModelEvent(int changeType, Object changedObject) {
+// this.changeType = changeType;
+// this.changedObject = changedObject;
+// }
+
+ public ModelEvent(int changeType, Object changeDiscriminator, Object changedObject, Object oldValue, Object newValue) {
+ this.changeType = changeType;
+ this.changeDiscriminator = changeDiscriminator;
+ this.changedObject = changedObject;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+ }
+
+ public int getChangeType() {
+ return changeType;
+ }
+
+ public Object getChangeDiscriminator() {
+ return changeDiscriminator;
+ }
+
+ public Object getChangedObject() {
+ return changedObject;
+ }
+
+ public Object getOldValue() {
+ return oldValue;
+ }
+
+ public Object getNewValue() {
+ return newValue;
+ }
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelListener.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelListener.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelListener.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,28 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A listener for model events.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface ModelListener {
+
+ void modelChanged(ModelEvent event);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/ModelListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,54 @@
+package org.jboss.tools.flow.common.wrapper;
+
+/*
+ * Copyright 2005 JBoss Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * Wrapper of a model element.
+ *
+ * @author <a href="mailto:kris_verlaenen@hotmail.com">Kris Verlaenen</a>
+ */
+public interface NodeWrapper extends Wrapper {
+
+ String getId();
+ String getName();
+ void setName(String name);
+
+ void setConstraint(Rectangle constraint);
+ Rectangle getConstraint();
+
+ void setParent(ContainerWrapper parent);
+ ContainerWrapper getParent();
+
+ void setLabel(LabelWrapper label);
+ LabelWrapper getLabel();
+
+ List<ConnectionWrapper> getOutgoingConnections();
+ List<ConnectionWrapper> getIncomingConnections();
+ void addIncomingConnection(ConnectionWrapper connection);
+ void localAddIncomingConnection(ConnectionWrapper connection);
+ void removeIncomingConnection(ConnectionWrapper connection);
+ void addOutgoingConnection(ConnectionWrapper connection);
+ void localAddOutgoingConnection(ConnectionWrapper connection);
+ void removeOutgoingConnection(ConnectionWrapper connection);
+ boolean acceptsIncomingConnection(ConnectionWrapper connection, NodeWrapper source);
+ boolean acceptsOutgoingConnection(ConnectionWrapper connection, NodeWrapper target);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/NodeWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java 2009-06-12 20:58:42 UTC (rev 15935)
@@ -0,0 +1,34 @@
+package org.jboss.tools.flow.common.wrapper;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.model.Element;
+
+
+public interface Wrapper extends IAdaptable, IPropertySource, Element {
+
+// int ADD_INCOMING_CONNECTION = 1;
+// int REMOVE_INCOMING_CONNECTION = 2;
+// int ADD_OUTGOING_CONNECTION = 3;
+// int REMOVE_OUTGOING_CONNECTION = 4;
+ int CHANGE_VISUAL = 5;
+ int ADD_ELEMENT = 6;
+ int REMOVE_ELEMENT = 7;
+ int CHANGE_PROPERTY = 8;
+
+
+
+ void setElement(Element element);
+ Element getElement();
+
+ void addChild(Object type, Element element);
+ void removeChild(Object type, Element element);
+ List<Element> getChildren(Object type);
+
+ void addListener(ModelListener listener);
+ void removeListener(ModelListener listener);
+ void notifyListeners(int changeId, Object changeDiscriminator, Object changedObject, Object oldValue, Object newValue);
+
+}
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/Wrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 10 months
JBoss Tools SVN: r15934 - trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2009-06-12 15:32:28 -0400 (Fri, 12 Jun 2009)
New Revision: 15934
Modified:
trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml
Log:
included the org.jboss.tools.flow.common features
removed the org.jbpm.gd.jpdl features (only applicable to jbpm3)
removed the org.jboss.tools.jbpm.convert features (only applicable to jbpm3)
Modified: trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml
===================================================================
--- trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml 2009-06-12 17:26:58 UTC (rev 15933)
+++ trunk/jbpm/features/org.jboss.tools.jbpm4.sdk.feature/feature.xml 2009-06-12 19:32:28 UTC (rev 15934)
@@ -33,19 +33,11 @@
version="0.0.0"/>
<includes
- id="org.jboss.tools.jbpm.convert.feature"
+ id="org.jboss.tools.flow.common.feature"
version="0.0.0"/>
<includes
- id="org.jboss.tools.jbpm.convert.source.feature"
+ id="org.jboss.tools.flow.common.source.feature"
version="0.0.0"/>
- <includes
- id="org.jbpm.gd.jpdl.feature"
- version="0.0.0"/>
-
- <includes
- id="org.jbpm.gd.jpdl.source.feature"
- version="0.0.0"/>
-
</feature>
16 years, 10 months
JBoss Tools SVN: r15933 - trunk/smooks/docs/reference/en/images/quick_start.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-06-12 13:26:58 -0400 (Fri, 12 Jun 2009)
New Revision: 15933
Added:
trunk/smooks/docs/reference/en/images/quick_start/quick_start13a.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-755 - The description of Wiring item was added to the Smooks-doc. </p>
</body></html>
Added: trunk/smooks/docs/reference/en/images/quick_start/quick_start13a.png
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/quick_start/quick_start13a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Tools SVN: r15932 - trunk/smooks/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-06-12 13:26:31 -0400 (Fri, 12 Jun 2009)
New Revision: 15932
Modified:
trunk/smooks/docs/reference/en/modules/quick_start.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-755 - The description of Wiring item was added to the Smooks-doc. </p>
</body></html>
Modified: trunk/smooks/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-06-12 16:08:12 UTC (rev 15931)
+++ trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-06-12 17:26:31 UTC (rev 15932)
@@ -16,7 +16,7 @@
<section>
<title>Download Smooks Java-to-Java Example</title>
<para> Visit <ulink
- url="http://www.smooks.org/documentation/documentation-smooks-1-1-x/examples/e..."
+ url="http://svn.codehaus.org/milyn/tags/Smooks_V1.1.2/smooks-examples/java-to-..."
>here</ulink> to download the "java-to-java" example project. </para>
<tip>
<title>Tip:</title>
@@ -45,7 +45,7 @@
<para>The first wizard page is a file path creation page. Select the <emphasis>
<property>src</property>
</emphasis> folder to be the files container, and input the name
- <emphasis><property>newConfig.smooks</property>.</emphasis> Click
+ <emphasis><property>smooks-config.xml</property>.</emphasis> Click
<emphasis><property>Next</property>.</emphasis></para>
<figure>
<title>Choosing the configuration file container and the file name</title>
@@ -330,10 +330,38 @@
XML-to-Java </para>
</note>
<para> Do the same operation with the
- other properties in this and other classes.</para>
+ other properties in this and other classes.</para>
+ <para>It's also necessary to bind <emphasis>
+ <property>orderItems</property></emphasis> property of the <emphasis>
+ <property>Order</property></emphasis> to <emphasis>
+ <property>lineItems</property></emphasis> property of <emphasis>
+ <property>LineOrder</property></emphasis>.The difference from the previous steps is that the <emphasis>
+ <property>orderItems</property></emphasis> is presented by the list of <emphasis>
+ <property>Order</property></emphasis> and <emphasis>
+ <property>lineItems</property></emphasis> is the massive of <emphasis>
+ <property>LineItem</property></emphasis> .To do the binding,you should use <emphasis>
+ <property>Wiring Item</property></emphasis>.First you should create a new Binding item. This is a configuration that allows you to construct an object graph .Select <emphasis>
+ <property>example.trgmodel.LineItem[]</property></emphasis> in the Class field and orderItems in the Name field,in bean Id write lineItems.
+ Your Smooks Configuration Editor should look like this:
+ </para>
+ <figure>
+ <title> Creating Wiring Item</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/quick_start/quick_start13a.png" scale="90"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para> Then you should right click <emphasis>
+ <property>lineOrder</property></emphasis> binding item<emphasis>
+ <property>>Add Smooks Resource>Wiring</property></emphasis>.Select <emphasis>
+ <property>lineItem</property></emphasis> in Bean id Ref.
+ </para>
+ <para>The final step is to add new Wiring item to lineOrder Binding.In the Bean id Ref select lineItems and in Property select <emphasis>
+ <property>lineItems</property></emphasis>.</para>
<!--
<para>Next, you are going to bind the properties of the <property>OrderItem</property> to
- the properties of the <property>LineItem</property>.</para>
+ the properties of the <property>LineItem</property>.</paa>
<para>Select the <emphasis>
<property>"price"</property>
</emphasis> and drag it onto the <emphasis>
16 years, 10 months