diff options
author | Ralf Mollik | 2017-08-28 15:31:29 +0000 |
---|---|---|
committer | Ralf Mollik | 2017-08-28 15:31:29 +0000 |
commit | bfafebba2e5a0f41e8a388a6ef396261b7b0d7c0 (patch) | |
tree | 1bc4478875af2e16f2a9c77909227cd6c20734ab | |
download | org.eclipse.osbp.autowireHelper-bfafebba2e5a0f41e8a388a6ef396261b7b0d7c0.tar.gz org.eclipse.osbp.autowireHelper-bfafebba2e5a0f41e8a388a6ef396261b7b0d7c0.tar.xz org.eclipse.osbp.autowireHelper-bfafebba2e5a0f41e8a388a6ef396261b7b0d7c0.zip |
parallel ip - initial checkin
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
34 files changed, 6727 insertions, 0 deletions
diff --git a/.project b/.project new file mode 100644 index 0000000..4c3b9c3 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.autowireHelper.aggregator</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.sonarlint.eclipse.core.sonarlintNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/about.html b/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is 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>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/jenkins.build.config.xml b/jenkins.build.config.xml new file mode 100644 index 0000000..3b171b0 --- /dev/null +++ b/jenkins.build.config.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2016 - Loetz GmbH&Co.KG --> +<!--# 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: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> +<!--# Module specific parameters for the Jenkins Job --> +<!--#======================================================================= --> + +<jenkins> + <!-- DO NOT EDIT BELOW THIS LINE --> + <jenkins.build.dependencies> + <jenkins.build.dependency>org.eclipse.osbp.authentication</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.dsl</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.ecview.core</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.ecview.extension.api</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.runtime</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.utils</jenkins.build.dependency> + <jenkins.build.dependency>org.eclipse.osbp.utils.functionnormalizer</jenkins.build.dependency> + </jenkins.build.dependencies> +</jenkins> diff --git a/notice.html b/notice.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/notice.html @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>April 9, 2014</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 Foundation source code + repository ("Repository") in software 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 Provisioning Technology (as defined below), 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>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <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>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>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a + href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li> +</ol> + +<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> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> +</body> +</html> diff --git a/org.eclipse.osbp.autowireHelper.feature/.project b/org.eclipse.osbp.autowireHelper.feature/.project new file mode 100644 index 0000000..4920b6a --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/.project @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.autowireHelper.feature</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.FeatureBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.sonarlint.eclipse.core.sonarlintBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.sonarlint.eclipse.core.sonarlintNature</nature> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.FeatureNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.osbp.autowireHelper.feature/LICENSE.txt b/org.eclipse.osbp.autowireHelper.feature/LICENSE.txt new file mode 100644 index 0000000..ff42ad4 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/LICENSE.txt @@ -0,0 +1,161 @@ +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 warranties +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 permitted 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.
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper.feature/build.properties b/org.eclipse.osbp.autowireHelper.feature/build.properties new file mode 100644 index 0000000..b8920ff --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = license.html, epl-v10.html, feature.xml,\ + feature.properties diff --git a/org.eclipse.osbp.autowireHelper.feature/epl-v10.html b/org.eclipse.osbp.autowireHelper.feature/epl-v10.html new file mode 100644 index 0000000..b398acc --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/epl-v10.html @@ -0,0 +1,259 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Public License - Version 1.0</title> +<style type="text/css"> + body { + size: 8.5in 11.0in; + margin: 0.25in 0.5in 0.25in 0.5in; + tab-interval: 0.5in; + } + p { + margin-left: auto; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + p.list { + margin-left: 0.5in; + margin-top: 0.05em; + margin-bottom: 0.05em; + } + </style> + +</head> + +<body lang="EN-US"> + +<h2>Eclipse Public License - v 1.0</h2> + +<p>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.</p> + +<p><b>1. DEFINITIONS</b></p> + +<p>"Contribution" means:</p> + +<p class="list">a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and</p> +<p class="list">b) in the case of each subsequent Contributor:</p> +<p class="list">i) changes to the Program, and</p> +<p class="list">ii) additions to the Program;</p> +<p class="list">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.</p> + +<p>"Contributor" means any person or entity that distributes +the Program.</p> + +<p>"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.</p> + +<p>"Program" means the Contributions distributed in accordance +with this Agreement.</p> + +<p>"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.</p> + +<p><b>2. GRANT OF RIGHTS</b></p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p><b>3. REQUIREMENTS</b></p> + +<p>A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:</p> + +<p class="list">a) it complies with the terms and conditions of this +Agreement; and</p> + +<p class="list">b) its license agreement:</p> + +<p class="list">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;</p> + +<p class="list">ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;</p> + +<p class="list">iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and</p> + +<p class="list">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.</p> + +<p>When the Program is made available in source code form:</p> + +<p class="list">a) it must be made available under this Agreement; and</p> + +<p class="list">b) a copy of this Agreement must be included with each +copy of the Program.</p> + +<p>Contributors may not remove or alter any copyright notices contained +within the Program.</p> + +<p>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.</p> + +<p><b>4. COMMERCIAL DISTRIBUTION</b></p> + +<p>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.</p> + +<p>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 warranties 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.</p> + +<p><b>5. NO WARRANTY</b></p> + +<p>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.</p> + +<p><b>6. DISCLAIMER OF LIABILITY</b></p> + +<p>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.</p> + +<p><b>7. GENERAL</b></p> + +<p>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.</p> + +<p>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.</p> + +<p>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.</p> + +<p>Everyone is permitted 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.</p> + +<p>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.</p> + + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper.feature/feature.properties b/org.eclipse.osbp.autowireHelper.feature/feature.properties new file mode 100644 index 0000000..ea19fa0 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/feature.properties @@ -0,0 +1,169 @@ +############################################################################### +# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). +# 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: +# Cristiano Gavião - initial API and 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 =OSBP AutowireHelper + +# "providerName" property - name of the company that provides the feature +providerName=Eclipse OSBP + +# "description" property - description of the feature +description=This feature provides the bundles for OSBP AutowireHelper. + +# "updateSiteName" property - label for the update site +updateSiteName= + +# "copyright" property - text of the "Feature Update Copyright" +copyright=\ +Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) \n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +################ end of copyright property #################################### + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "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\n\ +February 1, 2011\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ + - Content may be structured and packaged into modules to facilitate delivering,\n\ + extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ + plug-in fragments ("Fragments"), and features ("Features").\n\ + - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ + in a directory named "plugins".\n\ + - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ + Each Feature may be packaged as a sub-directory in a directory named "features".\n\ + Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ + numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ + - Features may also include other Features ("Included Features"). Within a Feature, files\n\ + named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, 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 JARs\n\ + - Sub-directories of the directory named "src" of certain Plug-ins\n\ + - Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ + - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ + - Common Public License Version 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\ + - 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\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ + 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ + the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ + extending or updating the functionality of an Eclipse-based product.\n\ + 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ + Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ + 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ + govern the use of the Installable Software ("Installable Software Agreement") and such\n\ + Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ + with the Specification. Such Installable Software Agreement must inform the user of the\n\ + terms and conditions that govern the Installable Software and must solicit acceptance by\n\ + the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ + indication of agreement by the user, the provisioning Technology will complete installation\n\ + of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n +########### end of license property ########################################## diff --git a/org.eclipse.osbp.autowireHelper.feature/feature.xml b/org.eclipse.osbp.autowireHelper.feature/feature.xml new file mode 100644 index 0000000..456fe3c --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/feature.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) --> +<!--# 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: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> + +<feature + id="org.eclipse.osbp.autowireHelper.feature" + label="%featureName" + version="0.9.0.qualifier" + provider-name="%providerName"> + + <description> + %description + </description> + + <copyright> + %copyright + </copyright> + + <license url="%licenseURL"> + %license + </license> + + <plugin + id="org.eclipse.osbp.autowireHelper" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + +</feature> diff --git a/org.eclipse.osbp.autowireHelper.feature/license.html b/org.eclipse.osbp.autowireHelper.feature/license.html new file mode 100644 index 0000000..6e579a5 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/license.html @@ -0,0 +1,164 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</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 Foundation +source code + repository ("Repository") in software 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 Provisioning Technology (as defined below), 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>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <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>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>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, +examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of +allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This +capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about +packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install + Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to + be presented to, and accepted by, the users of the Provisioning +Technology + in accordance with the Specification. By using Provisioning +Technology in such a manner and making it available in accordance with +the + Specification, you further acknowledge your agreement to, and the +acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in +which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, +extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology +may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user +the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable +Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable +Software Agreement must inform the user of the terms and conditions that + govern + the Installable Software and must solicit acceptance by the end +user in the manner prescribed in such Installable Software Agreement. +Upon such + indication of agreement by the user, the provisioning Technology +will complete installation of the Installable Software.</li> +</ol> + +<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> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper.feature/pom.xml b/org.eclipse.osbp.autowireHelper.feature/pom.xml new file mode 100644 index 0000000..f9a81a9 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/pom.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). --> +<!--# 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: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation API and implementation --> +<!--#======================================================================= --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.osbp.autowireHelper</groupId> + <artifactId>org.eclipse.osbp.autowireHelper.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + </parent> + + <artifactId>org.eclipse.osbp.autowireHelper.feature</artifactId> + <packaging>eclipse-feature</packaging> + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho.extras</groupId> + <artifactId>tycho-source-feature-plugin</artifactId> + <version>${tychoExtrasVersion}</version> + <executions> + <execution> + <id>source-feature</id> + <phase>package</phase> + <goals> + <goal>source-feature</goal> + </goals> + </execution> + </executions> + <configuration> + <labelSuffix> (source)</labelSuffix> + </configuration> + </plugin> + <plugin> + <!-- workaround while bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=398250 + is not fixed --> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-p2-plugin</artifactId> + <version>${tycho-version}</version> + <executions> + <execution> + <id>attached-p2-metadata</id> + <phase>package</phase> + <goals> + <goal>p2-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <executions> + <execution> + <id>javadoc-jar</id> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.eclipse.osbp.autowireHelper</groupId> + <artifactId>org.eclipse.osbp.autowireHelper</artifactId> + <version>0.9.0-SNAPSHOT</version> + </dependency> + + </dependencies> + +</project> diff --git a/org.eclipse.osbp.autowireHelper.feature/src/main/javadoc/README.txt b/org.eclipse.osbp.autowireHelper.feature/src/main/javadoc/README.txt new file mode 100644 index 0000000..831da7e --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/src/main/javadoc/README.txt @@ -0,0 +1 @@ +Resource folder for javadoc resources.
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper.feature/src/overview.html b/org.eclipse.osbp.autowireHelper.feature/src/overview.html new file mode 100644 index 0000000..b315c3a --- /dev/null +++ b/org.eclipse.osbp.autowireHelper.feature/src/overview.html @@ -0,0 +1,11 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<html> +<head> + <title>OSBP Tools Graphical Entity</title> +</head> +<body> +<p>The <strong>OSBP Autowire Helper</strong> contains methods for the autowireing of UI and data DSL.</p> + +<p> </p> +</body> +</html> diff --git a/org.eclipse.osbp.autowireHelper/.project b/org.eclipse.osbp.autowireHelper/.project new file mode 100644 index 0000000..b5119e6 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/.project @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.osbp.autowireHelper</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> + <arguments> + </arguments> + </buildCommand> + <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> + <buildCommand> + <name>org.eclipse.pde.ds.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.babel.editor.rbeBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> + <nature>org.eclipse.babel.editor.rbeNature</nature> + </natures> +</projectDescription> diff --git a/org.eclipse.osbp.autowireHelper/LICENSE.txt b/org.eclipse.osbp.autowireHelper/LICENSE.txt new file mode 100644 index 0000000..ff42ad4 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/LICENSE.txt @@ -0,0 +1,161 @@ +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 warranties +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 permitted 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.
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF b/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF new file mode 100644 index 0000000..9d84508 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/META-INF/MANIFEST.MF @@ -0,0 +1,41 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: org.eclipse.osbp.autowireHelper +Bundle-SymbolicName: org.eclipse.osbp.autowireHelper;singleton:=true +Bundle-Vendor: Eclipse OSBP +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.osbp.autowirehelper.Activator +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Require-Bundle: org.slf4j.api;bundle-version="1.7.2", + javax.annotation;bundle-version="[1.1.0,1.2.0)", + com.google.inject;bundle-version="3.0.0";resolution:=optional, + org.eclipse.emf.common, + org.eclipse.emf.ecore;bundle-version="2.10.2", + org.eclipse.xtext.common.types;bundle-version="[2.7.3,2.8.0)";resolution:=optional, + org.eclipse.xtext.xbase;bundle-version="[2.7.3,2.8.0)";resolution:=optional, + org.eclipse.xtend2.lib;bundle-version="2.7.3";resolution:=optional, + org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.ecview.dsl;bundle-version="[0.9.0,0.10.0)";resolution:=optional, + org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)";resolution:=optional, + org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)";resolution:=optional, + org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)";resolution:=optional, + org.eclipse.osbp.mobile.vaadin.ecview.model;bundle-version="[0.9.0,0.10.0)";resolution:=optional, + org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.utils;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.authentication;bundle-version="[0.9.0,0.10.0)", + javax.validation.api;bundle-version="1.1.0", + org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.dsl.common.xtext;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.dsl.dto.xtext;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.dsl.entity.xtext;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)", + org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)", + org.eclipse.core.runtime;bundle-version="3.10.0", + org.eclipse.xtext.ui;bundle-version="2.7.3", + org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)", + org.apache.commons.lang;bundle-version="2.6.0" +Export-Package: org.eclipse.osbp.autowirehelper;version="0.9.0", + org.eclipse.osbp.autowirehelper.utils;version="0.9.0" +Import-Package: org.eclipse.osbp.utils.functionnormalizer.api;version="0.9.0" + diff --git a/org.eclipse.osbp.autowireHelper/about.html b/org.eclipse.osbp.autowireHelper/about.html new file mode 100644 index 0000000..64c0598 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 1, 2016</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is 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>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper/about.ini b/org.eclipse.osbp.autowireHelper/about.ini new file mode 100644 index 0000000..7df671f --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/about.ini @@ -0,0 +1,17 @@ +# 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=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage= + +# Property "appName" contains name of the application (translated) +appName=%featureName + +# Property "welcomePage" contains path to welcome page (special XML-based format) +welcomePage= diff --git a/org.eclipse.osbp.autowireHelper/about.mappings b/org.eclipse.osbp.autowireHelper/about.mappings new file mode 100644 index 0000000..4511a0a --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/about.mappings @@ -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=qualifier diff --git a/org.eclipse.osbp.autowireHelper/about.properties b/org.eclipse.osbp.autowireHelper/about.properties new file mode 100644 index 0000000..0e355a9 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/about.properties @@ -0,0 +1,26 @@ +# +# Copyright (c) 2012, 2016 - Loetz GmbH&Co.KG (Heidelberg) +# 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: +# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation +# + +# NLS_MESSAGEFORMAT_VAR + +featureName=org.eclipse.osbp.autowireHelper + +################ blurb property #################################### +featureText=\ +Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n\ +\n\ +Contributors:\n\ + Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n +################ end of blurb property #################################### diff --git a/org.eclipse.osbp.autowireHelper/build.properties b/org.eclipse.osbp.autowireHelper/build.properties new file mode 100644 index 0000000..23380e8 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/build.properties @@ -0,0 +1,13 @@ +source.. = src/,\ + xtend-gen/ +output.. = target/classes/ +bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\ + .,\ + .settings/,\ + plugin.xml,\ + license.html,\ + LICENSE.txt,\ + epl-v10.html +src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\ + LICENSE.txt,\ + epl-v10.html diff --git a/org.eclipse.osbp.autowireHelper/epl-v10.html b/org.eclipse.osbp.autowireHelper/epl-v10.html new file mode 100644 index 0000000..b398acc --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/epl-v10.html @@ -0,0 +1,259 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Public License - Version 1.0</title> +<style type="text/css"> + body { + size: 8.5in 11.0in; + margin: 0.25in 0.5in 0.25in 0.5in; + tab-interval: 0.5in; + } + p { + margin-left: auto; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + p.list { + margin-left: 0.5in; + margin-top: 0.05em; + margin-bottom: 0.05em; + } + </style> + +</head> + +<body lang="EN-US"> + +<h2>Eclipse Public License - v 1.0</h2> + +<p>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.</p> + +<p><b>1. DEFINITIONS</b></p> + +<p>"Contribution" means:</p> + +<p class="list">a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and</p> +<p class="list">b) in the case of each subsequent Contributor:</p> +<p class="list">i) changes to the Program, and</p> +<p class="list">ii) additions to the Program;</p> +<p class="list">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.</p> + +<p>"Contributor" means any person or entity that distributes +the Program.</p> + +<p>"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.</p> + +<p>"Program" means the Contributions distributed in accordance +with this Agreement.</p> + +<p>"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.</p> + +<p><b>2. GRANT OF RIGHTS</b></p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p class="list">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.</p> + +<p><b>3. REQUIREMENTS</b></p> + +<p>A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:</p> + +<p class="list">a) it complies with the terms and conditions of this +Agreement; and</p> + +<p class="list">b) its license agreement:</p> + +<p class="list">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;</p> + +<p class="list">ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;</p> + +<p class="list">iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and</p> + +<p class="list">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.</p> + +<p>When the Program is made available in source code form:</p> + +<p class="list">a) it must be made available under this Agreement; and</p> + +<p class="list">b) a copy of this Agreement must be included with each +copy of the Program.</p> + +<p>Contributors may not remove or alter any copyright notices contained +within the Program.</p> + +<p>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.</p> + +<p><b>4. COMMERCIAL DISTRIBUTION</b></p> + +<p>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.</p> + +<p>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 warranties 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.</p> + +<p><b>5. NO WARRANTY</b></p> + +<p>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.</p> + +<p><b>6. DISCLAIMER OF LIABILITY</b></p> + +<p>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.</p> + +<p><b>7. GENERAL</b></p> + +<p>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.</p> + +<p>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.</p> + +<p>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.</p> + +<p>Everyone is permitted 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.</p> + +<p>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.</p> + + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper/license.html b/org.eclipse.osbp.autowireHelper/license.html new file mode 100644 index 0000000..6e579a5 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/license.html @@ -0,0 +1,164 @@ +<!--?xml version="1.0" encoding="ISO-8859-1" ?--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Eclipse Foundation Software User Agreement</title> +</head> + +<body lang="EN-US"> +<h2>Eclipse Foundation Software User Agreement</h2> +<p>February 1, 2011</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 Foundation +source code + repository ("Repository") in software 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 Provisioning Technology (as defined below), 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>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li> + <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>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>Use of Provisioning Technology</h3> + +<p>The Eclipse Foundation makes available provisioning software, +examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of +allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This +capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about +packaging Installable Software is available at <a href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a> + ("Specification").</p> + +<p>You may use Provisioning Technology to allow other parties to install + Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to + be presented to, and accepted by, the users of the Provisioning +Technology + in accordance with the Specification. By using Provisioning +Technology in such a manner and making it available in accordance with +the + Specification, you further acknowledge your agreement to, and the +acquisition of all necessary rights to permit the following:</p> + +<ol> + <li>A series of actions may occur ("Provisioning Process") in +which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, +extending or updating the functionality of an Eclipse-based + product.</li> + <li>During the Provisioning Process, the Provisioning Technology +may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.</li> + <li>Pursuant to the Specification, you will provide to the user +the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable +Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable +Software Agreement must inform the user of the terms and conditions that + govern + the Installable Software and must solicit acceptance by the end +user in the manner prescribed in such Installable Software Agreement. +Upon such + indication of agreement by the user, the provisioning Technology +will complete installation of the Installable Software.</li> +</ol> + +<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> + +<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p> + + +</body></html>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper/model/model.ucls b/org.eclipse.osbp.autowireHelper/model/model.ucls new file mode 100644 index 0000000..78fb462 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/model/model.ucls @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8"?> +<class-diagram version="1.1.9" icons="true" always-add-relationships="false" generalizations="true" realizations="true" + associations="true" dependencies="false" nesting-relationships="true" router="FAN"> + <class id="1" language="java" name="org.eclipse.osbp.autowirehelper.JvmTypeProperties" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/JvmTypeProperties.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="225" width="320" x="41" y="37"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <class id="2" language="java" name="org.eclipse.osbp.autowirehelper.JvmTypeProperties.Info" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/JvmTypeProperties.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="-1" width="-1" x="154" y="696"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <class id="3" language="java" name="org.eclipse.osbp.autowirehelper.AutowireHelper" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="981" width="533" x="1024" y="37"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <class id="4" language="java" name="org.eclipse.osbp.autowirehelper.AutowireHelper.StrategyLayoutLayouter" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="-1" width="-1" x="822" y="733"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <class id="5" language="java" name="org.eclipse.osbp.autowirehelper.AutowireHelper.MobileLayouter" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="-1" width="-1" x="545" y="569"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <interface id="6" language="java" name="org.eclipse.osbp.autowirehelper.AutowireHelper.Layouter" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java" binary="false" + corner="BOTTOM_RIGHT"> + <position height="-1" width="-1" x="591" y="820"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </interface> + <class id="7" language="java" name="org.eclipse.osbp.autowirehelper.utils.AutowireUtil" + project="org.eclipse.osbp.autowireHelper" + file="/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java" + binary="false" corner="BOTTOM_RIGHT"> + <position height="-1" width="-1" x="677" y="252"/> + <display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </display> + </class> + <realization id="8"> + <end type="SOURCE" refId="5"/> + <end type="TARGET" refId="6"/> + </realization> + <realization id="9"> + <end type="SOURCE" refId="4"/> + <end type="TARGET" refId="6"/> + </realization> + <nesting id="10"> + <end type="SOURCE" refId="1"/> + <end type="TARGET" refId="2"/> + </nesting> + <association id="11"> + <bendpoint x="1224" y="1058"/> + <end type="SOURCE" refId="3" navigable="false"> + <attribute id="12" name="layouter"/> + <multiplicity id="13" minimum="0" maximum="1"/> + </end> + <end type="TARGET" refId="6" navigable="true"/> + <display labels="true" multiplicity="true"/> + </association> + <association id="14"> + <end type="SOURCE" refId="3" navigable="false"> + <attribute id="15" name="_autowireUtil"/> + <multiplicity id="16" minimum="0" maximum="1"/> + </end> + <end type="TARGET" refId="7" navigable="true"/> + <display labels="true" multiplicity="true"/> + </association> + <nesting id="17"> + <end type="SOURCE" refId="3"/> + <end type="TARGET" refId="4"/> + </nesting> + <association id="18"> + <end type="SOURCE" refId="2" navigable="false"> + <attribute id="19" name="parent"/> + <multiplicity id="20" minimum="0" maximum="1"/> + </end> + <end type="TARGET" refId="2" navigable="true"/> + <display labels="true" multiplicity="true"/> + </association> + <nesting id="21"> + <end type="SOURCE" refId="3"/> + <end type="TARGET" refId="5"/> + </nesting> + <nesting id="22"> + <bendpoint x="1245" y="1058"/> + <end type="SOURCE" refId="3"/> + <end type="TARGET" refId="6"/> + </nesting> + <classifier-display autosize="true" stereotype="true" package="true" initial-value="false" signature="true" + sort-features="false" accessors="true" visibility="true"> + <attributes public="true" package="true" protected="true" private="true" static="true"/> + <operations public="true" package="true" protected="true" private="true" static="true"/> + </classifier-display> + <association-display labels="true" multiplicity="true"/> +</class-diagram>
\ No newline at end of file diff --git a/org.eclipse.osbp.autowireHelper/plugin.xml b/org.eclipse.osbp.autowireHelper/plugin.xml new file mode 100644 index 0000000..b828893 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/plugin.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.osbp.ecview.dsl.autowireDelegate"> + <autowireDelegate + autowireDelegateClass="org.eclipse.osbp.autowirehelper.AutowireHelper" + id="org.eclipse.osbp.autowireHelper.autowireDelegate"> + </autowireDelegate> + </extension> +</plugin> diff --git a/org.eclipse.osbp.autowireHelper/pom.xml b/org.eclipse.osbp.autowireHelper/pom.xml new file mode 100644 index 0000000..01c3611 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/pom.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) --> +<!--# 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: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - initial API and implementation --> +<!--#======================================================================= --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.osbp.autowireHelper</groupId> + <artifactId>org.eclipse.osbp.autowireHelper.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath>..</relativePath> + </parent> + <artifactId>org.eclipse.osbp.autowireHelper</artifactId> + <build> + <sourceDirectory>src</sourceDirectory> + <resources> + <resource> + <directory>src</directory> + <excludes> + <exclude>**/*.java</exclude> + </excludes> + </resource> + </resources> + <plugins> + </plugins> + </build> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/Activator.java b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/Activator.java new file mode 100644 index 0000000..08aea98 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/Activator.java @@ -0,0 +1,48 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + package org.eclipse.osbp.autowirehelper; + +import org.eclipse.osbp.gitinfo.Loginfo; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; // NOSONAR + Loginfo li = new Loginfo(); + li.print( Activator.class.getCanonicalName(), Activator.class.getClassLoader()); + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; // NOSONAR + } + +} diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend new file mode 100644 index 0000000..c261cbf --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/AutowireHelper.xtend @@ -0,0 +1,1220 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + * + * + * This copyright notice shows up in the generated Java code + * + */ +package org.eclipse.osbp.autowirehelper + +import com.google.inject.Inject +import com.google.inject.Injector +import java.util.Collection +import java.util.LinkedList +import java.util.List +import java.util.Map +import java.util.Set +import java.util.Stack +import javax.validation.Constraint +import org.eclipse.emf.common.util.URI +import org.eclipse.emf.ecore.EObject +import org.eclipse.emf.ecore.InternalEObject +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.emf.ecore.resource.ResourceSet +import org.eclipse.emf.ecore.util.EcoreUtil +import org.eclipse.osbp.autowirehelper.utils.AutowireUtil +import org.eclipse.osbp.dsl.common.datatypes.IDto +import org.eclipse.osbp.ecview.core.common.model.binding.BindingFactory +import org.eclipse.osbp.ecview.core.common.model.binding.YBindingUpdateStrategy +import org.eclipse.osbp.ecview.core.common.model.binding.YECViewModelListBindingEndpoint +import org.eclipse.osbp.ecview.core.common.model.binding.YListBindingEndpoint +import org.eclipse.osbp.ecview.core.common.model.binding.YValueBindingEndpoint +import org.eclipse.osbp.ecview.core.common.model.core.YAlignment +import org.eclipse.osbp.ecview.core.common.model.core.YAlignmentContainer +import org.eclipse.osbp.ecview.core.common.model.core.YAuthorizationable +import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot +import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotListBindingEndpoint +import org.eclipse.osbp.ecview.core.common.model.core.YDetailBeanSlot +import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable +import org.eclipse.osbp.ecview.core.common.model.core.YLayout +import org.eclipse.osbp.ecview.core.common.model.core.YView +import org.eclipse.osbp.ecview.core.^extension.model.^extension.util.SimpleExtensionModelFactory +import org.eclipse.osbp.ecview.dsl.autowire.IAutowireDelegate +import org.eclipse.osbp.ecview.dsl.derivedstate.UiModelDerivedStateComputerx +import org.eclipse.osbp.ecview.dsl.extensions.BeanHelper +import org.eclipse.osbp.ecview.dsl.extensions.BindableTypeResolver +import org.eclipse.osbp.ecview.dsl.extensions.BindingInfoHelper +import org.eclipse.osbp.ecview.dsl.extensions.BindingInfoHelper.BindingInfo +import org.eclipse.osbp.ecview.dsl.extensions.I18nKeyProvider +import org.eclipse.osbp.ecview.dsl.extensions.OperationExtensions +import org.eclipse.osbp.ecview.dsl.extensions.OperationExtensions.OperationInfo +import org.eclipse.osbp.ecview.dsl.extensions.SuperTypeCollector +import org.eclipse.osbp.ecview.dsl.extensions.TypeHelper +import org.eclipse.osbp.ecview.^extension.api.ILayoutingStrategy +import org.eclipse.osbp.ecview.^extension.model.YColumnInfo +import org.eclipse.osbp.ecview.^extension.model.YECviewFactory +import org.eclipse.osbp.ecview.^extension.model.YStrategyLayout +import org.eclipse.osbp.ecview.^extension.model.YSubTypeSuspect +import org.eclipse.osbp.ecview.^extension.model.YSuspect +import org.eclipse.osbp.ecview.^extension.model.YTypedCompoundSuspect +import org.eclipse.osbp.ecview.^extension.model.YTypedSuspect +import org.eclipse.osbp.ecview.^extension.model.visibility.YVisibilityFactory +import org.eclipse.osbp.ecview.semantic.uimodel.UiBeanSlot +import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingEndpointAssignment +import org.eclipse.osbp.ecview.semantic.uimodel.UiEmbeddable +import org.eclipse.osbp.ecview.semantic.uimodel.UiHorizontalLayout +import org.eclipse.osbp.ecview.semantic.uimodel.UiLayout +import org.eclipse.osbp.mobile.vaadin.ecview.model.VMVerticalComponentGroup +import org.eclipse.osbp.mobile.vaadin.ecview.model.VaadinMobileFactory +import org.eclipse.osbp.runtime.common.annotations.DomainDescription +import org.eclipse.osbp.runtime.common.annotations.DomainKey +import org.eclipse.osbp.runtime.common.metric.TimeLogger +import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI +import org.eclipse.xtext.common.types.JvmDeclaredType +import org.eclipse.xtext.common.types.JvmEnumerationLiteral +import org.eclipse.xtext.common.types.JvmGenericType +import org.eclipse.xtext.common.types.JvmParameterizedTypeReference +import org.eclipse.xtext.common.types.JvmPrimitiveType +import org.eclipse.xtext.common.types.JvmType +import org.eclipse.xtext.common.types.JvmTypeReference +import org.eclipse.xtext.common.types.TypesFactory +import org.eclipse.xtext.common.types.TypesPackage +import org.eclipse.xtext.naming.IQualifiedNameProvider +import org.eclipse.xtext.resource.IReferenceDescription +import org.eclipse.xtext.ui.editor.findrefs.IReferenceFinder +import org.eclipse.xtext.util.IAcceptor +import org.eclipse.xtext.util.concurrent.IUnitOfWork + +@SuppressWarnings("restriction") +class AutowireHelper implements IAutowireDelegate { + + @Inject extension TypeHelper + @Inject extension AutowireUtil + @Inject extension IQualifiedNameProvider + @Inject BindingInfoHelper bindingInfoHelper; + @Inject + private IReferenceFinder referenceFinder; + @Inject + private Injector injector + + private VaadinMobileFactory vFactory = VaadinMobileFactory.eINSTANCE + + UiModelDerivedStateComputerx computer + boolean mobile + + YLayout yLayout + UiLayout uiLayout + + Layouter layouter + + JvmDeclaredType beanType + + final SimpleExtensionModelFactory factory = new SimpleExtensionModelFactory + + YView yView + + YBeanSlot yMainBeanslot + + override autowire(UiLayout uiLayout, UiModelDerivedStateComputerx computer, boolean mobile) { + if (!uiLayout.autowire) { + return + } + + val logger = TimeLogger.start(typeof(AutowireHelper)) + + this.computer = computer; + this.mobile = mobile; + + this.uiLayout = uiLayout; + this.yLayout = computer.associatedUi(uiLayout) + this.yView = yLayout.view + this.yMainBeanslot = getBeanSlot(uiLayout) + switch (uiLayout) { + UiHorizontalLayout: { + layouter = if(!mobile) new StrategyLayoutLayouter else new MobileLayouter + layouter.setup(uiLayout, yLayout) + } + default: + return + } + + // val userAccessService = UserServiceBinder.getUserAccessService + // val userName = userAccessService.user.userName + // val permissionList = userAccessService.findPermissionsForUser(userName) + // for (permission : permissionList.permissions){ + // println(permission) + // } + val BindableTypeResolver resolver = new BindableTypeResolver + var resolvedType = resolver.resolveType(uiLayout.autoWireSource) + if (resolvedType instanceof JvmDeclaredType) { + beanType = resolvedType as JvmDeclaredType + + // Gets the operation infos for the given type in form of a map + val opInfoMap = OperationExtensions.getOperationInfos(beanType) + + // operation info map sorted in a list + val sortedOpInfoMapList = createSortedMapList(opInfoMap) + + // creates the a suspect structure based on the operation infos + sortedOpInfoMapList.createSuspectStructure(beanType, mobile, null) + + } + + } + + /** + * Finds all sub types of the beanType + */ + def findSubTypes(JvmType dtoType, Resource resource) { + val Set<URI> result = newHashSet() + val Set<URI> jvmTypeURIs = newHashSet() + jvmTypeURIs += EcoreUtil.getURI(dtoType) + val IAcceptor<IReferenceDescription> acceptor = [ + val IReferenceDescription desc = it + if (desc.EReference == TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE) { + if (sourceEObjectUri.fragment.endsWith("/@superTypes.0")) { + val URI uri = desc.sourceEObjectUri; + result += URI.createURI(uri.toString.replace("/@superTypes.0", "")) + } + } + ] + referenceFinder.findAllReferences(jvmTypeURIs, new LocalResourceAccess(resource.resourceSet), acceptor, null) + result + } + + def YBeanSlot getBeanSlot(UiLayout uiLayout) { + var autoWireSourceTemp = uiLayout.autoWireSource + if (autoWireSourceTemp instanceof UiBindingEndpointAssignment) { + var alias = (autoWireSourceTemp as UiBindingEndpointAssignment).typedBindableAlias + if (alias instanceof UiBeanSlot) { + return computer.associatedUi(alias as UiBeanSlot) + } + } + return null + } + + def createSuspectStructure(JvmDeclaredType type, boolean mobile, YTypedCompoundSuspect parentSuspect) { + + // Gets the operation infos for the given type in form of a map + val opInfoMap = OperationExtensions.getOperationInfos(type) + + // operation info map sorted in a list + val sortedOpInfoMapList = createSortedMapList(opInfoMap) + + sortedOpInfoMapList.createSuspectStructure(type, mobile, parentSuspect) + } + + def createSuspectStructure(LinkedList<Map<String, OperationInfo>> sortedOpInfoMapList, JvmType dtoType, + boolean mobile, YTypedCompoundSuspect parentSuspect) { + if (!dtoType.isEnum) { + sortedOpInfoMapList.forEach [ + it.createSuspectStructure(mobile, parentSuspect) + ] + } + + // lets create a new suspect in form of a tree to add the sub types to it + val subTypeURIs = findSubTypes(dtoType, uiLayout.eResource) + if (!subTypeURIs.empty) { + val subtypeRootSuspect = YECviewFactory.eINSTANCE.createYSubTypeBaseSuspect + subtypeRootSuspect.tags += ILayoutingStrategy.TAG__SUBTYPES_ROOT + + // TODO load the class + subtypeRootSuspect.typeQualifiedName = dtoType.qualifiedName + layouter.add(subtypeRootSuspect) + layouter.pushHierarchy(subtypeRootSuspect) + } + subTypeURIs.forEach [ + val JvmDeclaredType subDtoJvmType = uiLayout.eResource.resourceSet.getEObject(it, true) as JvmDeclaredType + subDtoJvmType.createSubTypeDtoSuspect() + ] + if (!subTypeURIs.empty) { + layouter.popHierarchy + } + } + + def createSuspectStructure(Map<String, OperationInfo> opInfoMap, boolean mobile, + YTypedCompoundSuspect parentSuspect) { + + opInfoMap.values.forEach [ + var JvmType type = null + try { + type = getter.returnType.type + } catch (NullPointerException e) { + return + } + var YSuspect suspect + var properties = newArrayList() + if (it.field != null) { + properties.addAll(beanType.toProperties(it.field.declaringType.qualifiedName + "." + it.name)) + } + if (type.boolean) { + if(mobile) type.createMobileSwitch(it) else suspect = type.createCheckbox(it) + } else if (type.numberWithDigits) { + suspect = type.createDecimalField(it) + if (beanType.isAttribute(it.name, "NumberToUomo")) { + suspect.tags += "NumberToUomo" + } else { + var dataType = beanType.toDataType(it.name) + if (dataType != null) { + var dataTypeName = dataType.jvmTypeReference.type.identifier + if (dataTypeName.equals(Double.canonicalName)) { + suspect = type.createCustomDecimalField(it) + } + } + } + } else if (type.numberWithoutDigits) { + + // TODO Pirchner _ fix me with @ID annotation + if (!it.name.equals("id") && !it.name.equals("uuid")) { + suspect = type.createNumberField(it) + } + } else if (type.string) { + val fieldType = properties.findFirst[it.key.equals(ILayoutingStrategy.PROPERTY_KEY__FIELD_TYPE)]?.value + + // TODO Pirchner _ fix me with @ID annotation + if (!it.name.equals("id") && !it.name.equals("uuid")) { + var functionTypingAPI = new FunctionTypingAPI() + val functionImagePicker = functionTypingAPI.functionImagePickerTypeName + if (it.isDomainKey || it.isDomainDescription || + (!fieldType.nullOrEmpty && fieldType.equals(ILayoutingStrategy.PROPERTY_SUGGESTTEXT))) { + suspect = type.createSuggestTextField(it, opInfoMap) + } else if (properties.exists[key.toLowerCase.equals(ILayoutingStrategy.PROPERTY_BLOB)]) { + suspect = type.createBlopUploadComponent(it) + } else if (!fieldType.nullOrEmpty && fieldType.equals(ILayoutingStrategy.PROPERTY_RICH_TEXT)) { + suspect = type.createRichTextField(it) + } else if (!fieldType.nullOrEmpty && fieldType.equals(ILayoutingStrategy.PROPERTY_MASKED_TEXT)) { + val mask = properties.findFirst[it.key.equals(ILayoutingStrategy.PROPERTY_MASK)]?.value + suspect = type.createMaskedTextField(it, mask) + } else if (!fieldType.nullOrEmpty && fieldType.equals(ILayoutingStrategy.PROPERTY_PASSWORD)) { + suspect = type.createPasswordField(it) + } else if (properties.exists[key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_TEXTAREA)]) { + suspect = type.createTextAreaField(it) + } else if (properties.exists[key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_ORGANIZATION)]) { + suspect = type.createOrganizationComboBox(it) + } else if (properties.exists[key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_PERSPECTIVE)]) { + suspect = type.createPerspectiveComboBox(it) + } else if (properties.exists[key.equalsIgnoreCase(functionImagePicker)]) { + suspect = type.createIconComboBox(it) + } else { + suspect = type.createTextField(it) + } + } + } else if (type.date) { + suspect = type.createDateField(it) + } else if (type.enum) { + if (properties.exists[key.toLowerCase.equals(ILayoutingStrategy.PROPERTY_OPTION_GROUP)]) { + suspect = type.createEnumOptionsGroup(it) + } else { + suspect = type.createEnumComboBox(it) + } + } else if (type.byteArray) { + val fieldType = properties.findFirst[it.key.equals(ILayoutingStrategy.PROPERTY_KEY__FIELD_TYPE)]?.value + if (!fieldType.nullOrEmpty && fieldType.equals(ILayoutingStrategy.PROPERTY_RICH_TEXT)) { + suspect = type.createRichTextField(it) + } else { + suspect = type.createBlopUploadComponent(it) + } + } else if (it.domainReference) { + suspect = type.createBeanReferenceField(it) + } else if (it.field != null && it.field.collection) { + if (properties.exists[key.toLowerCase.equals(ILayoutingStrategy.PROPERTY_GRID)]) { + suspect = type.createGrid(it) + } else if (properties.exists[key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_TABLE)]) { + suspect = type.createTableField(it) + } + } else if (type.dto) { + suspect = type.createDtoSuspect(it) + } + if (parentSuspect == null) { + type.completeSuspect(it, suspect) + } else { + type.completeSuspect(it, suspect, parentSuspect) + } + for (keyAndValue : properties) { + if(suspect != null) suspect.properties.put(keyAndValue.key.toLowerCase, keyAndValue.value) + } + ] + } + + def createAuthorizationVisibilityProcessor(YAuthorizationable element, OperationInfo info) { + if (info.field != null) { + val type = info.field.eContainer as JvmGenericType + if (!info.getter.returnType.type.isClass && info.getter.returnType.type.isAllowed(type, info)) { + element.authorizationGroup = type.fullyQualifiedName.toString + element.authorizationId = info.field.simpleName + } + } + } + + def YSuspect createDtoSuspect(JvmType type, OperationInfo info) { + val dtoSuspect = YECviewFactory.eINSTANCE.createYTypedCompoundSuspect + dtoSuspect.tags += ILayoutingStrategy.TAG__DTO + if (type instanceof JvmDeclaredType) { + type.createSuspectStructure(false, dtoSuspect) + } + + return dtoSuspect + } + + /** + * A suspect that is created for each sub type of beanType.<br> + * 1) we create a compound suspect<br> + * 2) we add the compound suspect to the layout<br> + * 3) we create a typed suspect for each operation info<br> + * 4) we add the new typed suspect to the compound suspect and create a tree<br> + */ + def YSuspect createSubTypeDtoSuspect(JvmDeclaredType subDtoJvmType) { + val subTypeSuspect = YECviewFactory.eINSTANCE.createYSubTypeSuspect + subTypeSuspect.tags += ILayoutingStrategy.TAG__SUBTYPE + subTypeSuspect.typeQualifiedName = subDtoJvmType.qualifiedName + subTypeSuspect.type = computer.loadClass(uiLayout.eResource.resourceSet, subTypeSuspect.typeQualifiedName) + + // create a new beanslot with the subtype. The main slot will become bound to this slot + val YView view = computer.currentView + val YDetailBeanSlot detailSlot = view.addDetailBeanSlot(subTypeSuspect.typeQualifiedName, subTypeSuspect.type, + yMainBeanslot, ""); + detailSlot.tags += ILayoutingStrategy.TAG__SUBTYPE + + // assign the detail bean slot to the sub type suspect for bindings later + subTypeSuspect.beanSlot = detailSlot + + // add the new suspect to the layout + layouter.add(subTypeSuspect) + + // create a new child node in the suspect hierarchy + layouter.pushHierarchy(subTypeSuspect) + + // create a hierarchy for the sub dto suspects + // Gets the operation infos for the given type in form of a map and converts the + // operation info map into a sorted list + val subTypeInfos = createSortedMapList(OperationExtensions.getOperationInfos(subDtoJvmType, false)) + + subTypeInfos.createSuspectStructure(subDtoJvmType, mobile, subTypeSuspect) + + // pop the latest subDtoSuspect + layouter.popHierarchy + + return subTypeSuspect + } + + /** + * Returns true, if the type is a dto. + */ + def boolean isDto(JvmType type) { + val collector = new SuperTypeCollector() + val superTypes = collector.collectSuperTypeNames(type) + + // if any of the supertype names equals org.eclipse.osbp.dsl.common.datatypes.IDto + return superTypes.contains(typeof(IDto).name) + } + + def completeSuspect(JvmType type, OperationInfo info, YSuspect suspect) { + if (suspect != null) { + suspect.id = '''«uiLayout.generateId».«info.name»''' + + if (info.readonly) { + suspect.tags += "readonly" + } + + if (isValidationConstraint(info)) { + suspect.tags += "constraint" + var splittedId = info.id.split(":") + if (splittedId.length > 1) { + var fqClassName = splittedId.get(0) + suspect.properties.put("class", fqClassName) + } + suspect.properties.put("name", info.name) + } + + layouter.add(suspect) + if (info.field != null && info.field.collection) { + suspect.createModelListBinding(info, type, "list"); + } else { + suspect.createBinding(info.name, type, "value"); + } + + // create the authorization infos + suspect.createAuthorizationVisibilityProcessor(info) + } + } + + def completeSuspect(JvmType type, OperationInfo info, YSuspect suspect, YTypedCompoundSuspect parentSuspect) { + if (suspect != null) { + suspect.id = '''«parentSuspect.id».«info.name»''' + + if (info.readonly) { + suspect.tags += "readonly" + } + + if (isValidationConstraint(info)) { + suspect.tags += "constraint" + var splittedId = info.id.split(":") + if (splittedId.length > 1) { + var fqClassName = splittedId.get(0) + suspect.properties.put("class", fqClassName) + } + suspect.properties.put("name", info.name) + } + + parentSuspect.children.add(suspect) + if (info.field != null && info.field.collection) { + suspect.createModelListBinding(info, type, "list"); + } else { + suspect.createBinding(info.name, type, "value"); + } + + // create the authorization infos + suspect.createAuthorizationVisibilityProcessor(info) + } + } + + /** + * Sorted the attributes with the primitive types first and the rest after. Also all collections were left out. + */ + def createSortedOpInfoMapForCollections(Map<String, OperationInfo> opInfoMap) { + val sortedOpInfoList = <String, OperationInfo>newLinkedHashMap() + val nonPrimitiveOpInfoMap = <String, OperationInfo>newLinkedHashMap() + opInfoMap.forEach [ key, opInfo | + var JvmType detailType + // do not create a column if field is a collection + if (opInfo.field != null && !opInfo.field.collection) { + detailType = opInfo.getter.returnType.type + + val isPrimitive = detailType instanceof JvmPrimitiveType || detailType.getQualifiedName().equals( + typeof(String).getName()); + + if (isPrimitive) { + sortedOpInfoList.put(key, opInfo) + } else { + nonPrimitiveOpInfoMap.put(key, opInfo) + } + } + ] + sortedOpInfoList.putAll(nonPrimitiveOpInfoMap) + sortedOpInfoList + } + + /** + * Sorted the attributes in a individual but fix order. + */ + def createSortedMapList(Map<String, OperationInfo> opInfoMap) { + val sortedOpInfoList = <Map<String, OperationInfo>>newLinkedList() + + // At this moment the order of the following method is not desired. See #203. + // +++++ Due to the not existing sorting the following lines of code are replaced by ... + /* + val domainKeyOpInfoMap = <String, OperationInfo>newHashMap() + val constraintsOpInfoMap = <String, OperationInfo>newHashMap() + val indexOpInfoMap = <String, OperationInfo>newHashMap() + val stringOpInfoMap = <String, OperationInfo>newHashMap() + val restOpInfoMap = <String, OperationInfo>newHashMap() + + // extract String-OperationInfos into a new Map to display later and display all string attributes first. + opInfoMap.forEach [ key, opInfo | + val type = opInfo.getter.returnType.type + if (opInfo != null && isDomainKey(opInfo)) { + domainKeyOpInfoMap.put(key, opInfo) + } else if (opInfo != null && isIndex(opInfo)) { + indexOpInfoMap.put(key, opInfo) + } else if (type.string) { + stringOpInfoMap.put(key, opInfo) + } else { + restOpInfoMap.put(key, opInfo) + } + ] + sortedOpInfoList.add(domainKeyOpInfoMap) + sortedOpInfoList.add(indexOpInfoMap) + sortedOpInfoList.add(stringOpInfoMap) + sortedOpInfoList.add(constraintsOpInfoMap) + sortedOpInfoList.add(restOpInfoMap) + */ + // ++++ ... this line. + sortedOpInfoList.add(opInfoMap) + sortedOpInfoList + } + + def isDomainKey(OperationInfo info) { + if (info != null && info.field != null) { + for (annotationRefs : info.field.annotations) { + if (DomainKey.canonicalName.equals(annotationRefs.annotation.identifier)) { + return true + } + } + } + return false + } + + def isDomainDescription(OperationInfo info) { + if (info != null && info.field != null) { + for (annotationRefs : info.field.annotations) { + if (DomainDescription.canonicalName.equals(annotationRefs.annotation.identifier)) { + return true + } + } + } + return false + } + + def isValidationConstraint(OperationInfo info) { + if (info != null && info.field != null) { + for (annotationRefs : info.field.annotations) { + if (annotationRefs.annotation.identifier != null && + annotationRefs.annotation.identifier.startsWith(Constraint.canonicalName.toLowerCase)) { + return true + } + } + } + return false + } + + def isIndex(OperationInfo info) { + if (info != null && info.field != null) { + for (annotationRefs : info.field.annotations) { + if (DomainKey.canonicalName.equals(annotationRefs.annotation.identifier)) { + return true + } + } + } + return false + } + + /** + * Returns true, if the type is boolean + * + * @param type + * @return + */ + def isByteArray(JvmType type) { + if (type == null) + return false; + if (isArray(type, Byte) || isArray(type, Byte.TYPE)) { + return true; + } + return false; + } + + def isArray(JvmType type, Class<?> clazz) { + if (type == null) + return false; + var className = clazz.getName(); + if (className.charAt(0) == '[') { + className = clazz.getCanonicalName(); + } + className = className.concat("[]") + var result = className.equals(type.getIdentifier()); + return result; + } + + def YTypedSuspect createTextField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__TEXT + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createSuggestTextField(JvmType type, OperationInfo info, Map<String, OperationInfo> opInfoMap) { + val OperationInfo idAttInfo = opInfoMap.values.toIdInfo + if (idAttInfo == null) { + return createTextField(type, info) + } + + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__SUGGEST_TEXT + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName) + suspect.typeQualifiedName = beanType.qualifiedName + + suspect.properties.put(ILayoutingStrategy.PROPERTY__ITEM_CAPTION, info.name) + suspect.properties.put(ILayoutingStrategy.PROPERTY__ITEM_FILTER, info.name) + suspect.properties.put(ILayoutingStrategy.PROPERTY__ITEM_UUID, idAttInfo.name) + + suspect + } + + /** + * Returns the operation info for the id property. + */ + def OperationInfo getToIdInfo(Collection<OperationInfo> infos) { + + // TODO change me!!! Very bad hack for now! Needs adding an ID annotation to DTOs + for (OperationInfo info : infos) { + if (info.name.equals("id") || info.name.equals("uuid")) { + return info + } + } + return null + } + + def YTypedSuspect createTextAreaField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__TEXTAREA + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createDecimalField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__DECIMAL + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createNumberField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__NUMBER + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createCheckbox(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__BOOLEAN + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createDateField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__DATE + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createIconComboBox(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__IMAGE_PICKER + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YTypedSuspect createEnumComboBox(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__ENUM_COMBO + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + if (info.readonly) { + suspect.tags += "readonly" + } + suspect + } + + def YTypedSuspect createOrganizationComboBox(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__ORGANIZATION_COMBO + suspect.type = typeof(String) + suspect.typeQualifiedName = typeof(String).name + if (info.readonly) { + suspect.tags += "readonly" + } + suspect + } + + def YTypedSuspect createPerspectiveComboBox(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__PERSPECTIVE_COMBO + suspect.type = typeof(String) + suspect.typeQualifiedName = typeof(String).name + if (info.readonly) { + suspect.tags += "readonly" + } + suspect + } + + def YTypedSuspect createEnumOptionsGroup(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__ENUM_OPTIONS + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect.id = '''«uiLayout.generateId».«info.name»''' + if (info.readonly) { + suspect.tags += "readonly" + } + suspect + } + + def YTypedSuspect createBeanReferenceField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + var captionProperty = BeanHelper.findCaptionProperty(suspect.type) + var captionDescription = BeanHelper.findDescriptionProperty(suspect.type) + if (captionProperty != null || captionDescription != null) { + suspect.tags += ILayoutingStrategy.TAG__BEAN_REFERENCE + suspect.id = '''«uiLayout.generateId».«info.name»''' + + if (info.readonly) { + suspect.tags += "readonly" + } + + suspect.typeQualifiedName = type.qualifiedName + suspect.properties.put(ILayoutingStrategy.PROPERTY__ITEM_CAPTION, captionProperty) + suspect.properties.put(ILayoutingStrategy.PROPERTY__ITEM_DESCRIPTION, captionDescription) + } + suspect + } + + def YTypedSuspect createTableField(JvmType type, OperationInfo info) { + type.createCollection(info, ILayoutingStrategy.TAG__TABLE) + } + + def YTypedSuspect createGrid(JvmType type, OperationInfo info) { + type.createCollection(info, ILayoutingStrategy.TAG__GRID) + } + + def YTypedSuspect createCollection(JvmType type, OperationInfo info, String tag) { + val suspect = YECviewFactory.eINSTANCE.createYCollectionSuspect + val JvmParameterizedTypeReference collectionType = info.getter.returnType as JvmParameterizedTypeReference + val JvmTypeReference typeInCollection = collectionType.arguments.get(0) + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, typeInCollection.type.qualifiedName) + suspect.tags += tag + suspect.typeQualifiedName = typeInCollection.type.qualifiedName + + // Not used! Has to be removed! + // var typeRef = info.field.type + // var JvmDeclaredType argType + if (typeInCollection.type instanceof JvmDeclaredType) { + val castedType = typeInCollection.type as JvmDeclaredType + + // TODO get props from JVMType + val propMap = castedType.toFieldProperties + val opInfoMap = OperationExtensions.getOperationInfos(castedType) + val sortedOpInfoMap = createSortedOpInfoMapForCollections(opInfoMap) + sortedOpInfoMap.values.forEach [ + var JvmType detailType = it.getter.returnType.type + var YColumnInfo columnInfo = null + val isPrimitive = detailType instanceof JvmPrimitiveType; + if (it.isDomainReference) { + + // else use the domain key field and reserve them till the end + for (nestedInfo : JvmTypeProperties.getOperationInfos(detailType as JvmDeclaredType).values) { + if (nestedInfo.hasAnnotation(typeof(DomainKey))) { + val nestPropMap = (detailType as JvmDeclaredType).toFieldProperties + columnInfo = nestedInfo.type.createYColumnInfo + columnInfo.name = it.field.type.simpleName + "." + nestedInfo.attributePath + var propList = nestPropMap.get(nestedInfo.name) + columnInfo.setYColumnInfoProperties(propList) + } + } + } else { + var JvmType objectType = it.field.type.type; + if (isPrimitive) { + val primitiveTypeName = it.field.type.type.qualifiedName + val InternalEObject proxy = TypesFactory.eINSTANCE.createJvmVoid as InternalEObject + proxy.eSetProxyURI(URI.createURI(toObjectProxy(primitiveTypeName))) + objectType = EcoreUtil.resolve(proxy, uiLayout.eResource) as JvmType + } + columnInfo = objectType.createYColumnInfo + columnInfo.name = it.name + var propList = propMap.get(it.field.identifier) + columnInfo.setYColumnInfoProperties(propList) + } + if (columnInfo != null) { + + // TODO (JCD): Simple name instead of FQN till solution of ticket - #581 + columnInfo.labelI18nKey = columnInfo.name + suspect.columns += columnInfo + } + ] + } + suspect + } + + /** + * Creates a proxy object + **/ + def toObjectProxy(String primitiveTypeName) { + switch (primitiveTypeName) { + case "int": + return '''java:/Objects/java.lang.Integer#java.lang.Integer''' + default: + return '''java:/Objects/java.lang.«primitiveTypeName.toFirstUpper»#java.lang.«primitiveTypeName. + toFirstUpper»''' + } + } + + def void createMobileSwitch(JvmType type, OperationInfo info) { + val yField = vFactory.createVMSwitch + yField.initialEnabled = !info.readonly + + // yField.labelI18nKey = i18nRootKey + "." + info.name + yField.label = info.name + + layouter.add(yField) + + yField.createBinding(info, type, "value"); + } + + def YSuspect createRichTextField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + + if (type.string) { + suspect.tags += ILayoutingStrategy.TAG__RICH_TEXT__STRING + } else if (type.byteArray) { + suspect.tags += ILayoutingStrategy.TAG__RICH_TEXT__BLOB + } else { + throw new IllegalArgumentException( + "RichTextFields need to be bound to String or byte[]. " + type.qualifiedName + " is not a valid option.") + } + + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YSuspect createMaskedTextField(JvmType type, OperationInfo info, String mask) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__MASKED_TEXT_FIELD + suspect.properties.put(ILayoutingStrategy.PROPERTY_MASK, mask) + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YSuspect createMaskedDecimalField(JvmType type, OperationInfo info, String mask) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__MASKED_DECIMAL_FIELD + suspect.properties.put(ILayoutingStrategy.PROPERTY_MASK, mask) + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YSuspect createPasswordField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + + if (type.string) { + suspect.tags += ILayoutingStrategy.TAG__PASSWORD + } else { + throw new IllegalArgumentException( + "PasswordField need to be bound to String. " + type.qualifiedName + " is not a valid option.") + } + + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YSuspect createBlopUploadComponent(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__BLOB + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + def YSuspect createCustomDecimalField(JvmType type, OperationInfo info) { + val suspect = YECviewFactory.eINSTANCE.createYTypedSuspect + suspect.tags += ILayoutingStrategy.TAG__DECIMAL + suspect.type = computer.loadClass(uiLayout.eResource.resourceSet, type.qualifiedName) + suspect.typeQualifiedName = type.qualifiedName + suspect + } + + /** + * Create the bindings and install at the view + */ + def createBinding(YEmbeddable yField, OperationInfo info, JvmType type, String fieldProperty) { + + // use the autoWireSource as the model endpoint + val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.autoWireSource as UiBindingEndpointAssignment + val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint) + val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint + detailValueEndpoint.propertyPath = info.name + detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName) + + // create the field endpoint + val yFieldEndpoint = BindingFactory.eINSTANCE.createYECViewModelValueBindingEndpoint + yFieldEndpoint.element = yField + yFieldEndpoint.propertyPath = fieldProperty + yFieldEndpoint.typeQualifiedName = beanType.qualifiedName + yFieldEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName) + if (yFieldEndpoint.type != null && yFieldEndpoint.type.isAssignableFrom(typeof(EObject))) { + yFieldEndpoint.emfNsURI = yField.eClass.EPackage.nsURI + } + + // bind model to target + val yBinding = BindingFactory.eINSTANCE.createYValueBinding(); + yBinding.setTargetEndpoint(yFieldEndpoint); + yBinding.setModelEndpoint(detailValueEndpoint); + yBinding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE); + yBinding.setTargetToModelStrategy( + if(info.readonly) YBindingUpdateStrategy.NEVER else YBindingUpdateStrategy.UPDATE) + + // register the binding at the current view + yLayout.view.orCreateBindingSet.bindings += yBinding + + // set the i18n key based on the binding + // yField.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, detailValueEndpoint.propertyPath) + yField.labelI18nKey = detailValueEndpoint.propertyPath + } + + /** + * Create the bindings and install at the view + */ + def createBinding(YSuspect suspect, String propertyPath, JvmType type, String fieldProperty) { + + val YBeanSlot subTypeBeanSlot = suspect.findSubTypeBeanSlot + var YValueBindingEndpoint endpoint = null + var path = "" + + // If a subTypeBeanSlot could be found, then we need to create a binding endpoint against this beanslot. + // The main slot has a different type then detail beanslot. And we can not bind fields contained in the subtype + // to the main bean slot. Eclipse databinding requires a proper type at binding creation. + if (subTypeBeanSlot == null) { + + // use the autoWireSource as the model endpoint + val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.autoWireSource as UiBindingEndpointAssignment + val yModelEndpoint = computer.createValueBindingEndpoint(uiModelEndpoint) + val detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint + detailValueEndpoint.propertyPath = propertyPath + detailValueEndpoint.type = computer.loadClass(uiLayout.eResource.resourceSet, beanType.qualifiedName) + endpoint = detailValueEndpoint + path = detailValueEndpoint.propertyPath + } else { + endpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath) + path = propertyPath + } + + suspect.getValueBindingEndpoints().add(endpoint); + + // set the i18n key based on the binding + // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, path) + suspect.labelI18nKey = path + suspect.label = propertyPath + } + + /** + * Checks if the suspect is contained in an YSubTypeSuspect. <br> + * If so, then the detail beanslot of the YSubTypeSuspect is returned. Null otherwise. + */ + def YBeanSlot findSubTypeBeanSlot(YSuspect suspect) { + if (suspect == null) { + return null + } + if (suspect instanceof YSubTypeSuspect) { + return suspect.beanSlot + } + + val parent = suspect.eContainer + if (parent instanceof YSuspect) { + return parent.findSubTypeBeanSlot + } + return null + } + + /** + * Create the bindings and install at the view + */ + def createModelListBinding(YSuspect suspect, OperationInfo info, JvmType type, String fieldProperty) { + + // use the autoWireSource as the model endpoint + val UiBindingEndpointAssignment uiModelEndpoint = uiLayout.autoWireSource as UiBindingEndpointAssignment + val yModelEndpoint = createListBindingEndpointWithNested(uiModelEndpoint, info.name) + + suspect.getValueBindingEndpoints().add(yModelEndpoint); + + // set the i18n key based on the binding + // suspect.labelI18nKey = I18nKeyProvider.toI18nKey(beanType.qualifiedName, info.name) + suspect.labelI18nKey = info.name + suspect.label = info.name + + } + + /** + * Creates a listbinding with respect to nested collection fields. <p> + * For instance:<br> + * beanSlot contains Person. We want to bind the children of persons father to a table. + * So we need to access the children collection of the beanslot by a nested property path: <code>beanslot.father.children</code> + */ + def YListBindingEndpoint createListBindingEndpointWithNested(UiBindingEndpointAssignment epDef, String attributePath) { + if (epDef == null) { + return null + } + + var YListBindingEndpoint result = null; + val BindingInfoHelper.BindingInfo info = new BindingInfoHelper.BindingInfo() + bindingInfoHelper.collectBindingInfo(epDef, info); + + if (info.bindingRoot instanceof UiBeanSlot) { + val uiBeanSlot = info.bindingRoot as UiBeanSlot + + val YBeanSlot yBeanSlot = computer.associatedUi(uiBeanSlot) + val YBeanSlotListBindingEndpoint ep = factory.createBeanSlotListBindingEndpoint + ep.beanSlot = yBeanSlot + + ep.attributePath = toNestedCollectionPath(info, attributePath) + result = ep + } else if (info.bindingRoot instanceof UiEmbeddable) { + val YEmbeddable yElement = computer.associatedUi(info.bindingRoot) + val YECViewModelListBindingEndpoint ep = factory.createECViewModelListBindingEndpoint + ep.element = yElement + ep.propertyPath = toNestedCollectionPath(info, attributePath) + if (info.typeForBinding != null) { + ep.typeQualifiedName = info.typeForBinding.qualifiedName + ep.type = computer.loadClass(epDef.eResource.resourceSet, ep.typeQualifiedName) + } + if (yElement != null) { + ep.emfNsURI = yElement.eClass.EPackage.nsURI + } + result = ep + } + + return result + } + + def toNestedCollectionPath(BindingInfo info, String attributePath) { + val StringBuilder b = new StringBuilder + if (!info.path.toString.nullOrEmpty) { + b.append(info.path.toString) + } + + if (!attributePath.nullOrEmpty) { + if (b.length > 0) { + b.append(".") + } + b.append(attributePath) + } + val pathResult = b.toString + pathResult + } + + /** + * Creates y column info element + */ + def YColumnInfo createYColumnInfo(JvmType type) { + val YColumnInfo columnInfo = YECviewFactory.eINSTANCE.createYColumnInfo + + columnInfo.typeQualifiedName = type.qualifiedName + columnInfo.type = computer.loadClass(uiLayout.eResource.resourceSet, columnInfo.typeQualifiedName) + columnInfo + } + + /** + * Sets properties into y column info + */ + def setYColumnInfoProperties(YColumnInfo columnInfo, List<AutowireUtil.Pair> propList) { + var properties = columnInfo.properties + if (propList != null) { + for (prop : propList) { + properties.put(prop.key, prop.value) + } + } + } + + public interface Layouter { + def void setup(UiLayout uiRootLayout, YLayout yRootLayout) + + def void add(YEmbeddable element); + + def void add(YSuspect suspect); + + def void pushHierarchy(YTypedCompoundSuspect suspect); + + def void popHierarchy(); + + } + + public static class MobileLayouter implements Layouter { + + VMVerticalComponentGroup group + + override setup(UiLayout uiRootLayout, YLayout yRootLayout) { + group = VaadinMobileFactory.eINSTANCE.createVMVerticalComponentGroup + + yRootLayout.elements += group + } + + override add(YEmbeddable element) { + group.addElement(element) + } + + override add(YSuspect ySuspect) { + // layout.suspects += ySuspect + } + + override pushHierarchy(YTypedCompoundSuspect suspect) { + throw new UnsupportedOperationException("TODO: auto-generated method stub") + } + + override popHierarchy() { + throw new UnsupportedOperationException("TODO: auto-generated method stub") + } + + } + + public static class StrategyLayoutLayouter implements Layouter { + + Stack<YTypedCompoundSuspect> currentSubDtoSuspect = new Stack + YStrategyLayout layout + + override setup(UiLayout uiRootLayout, YLayout yRootLayout) { + layout = YECviewFactory.eINSTANCE.createYStrategyLayout + layout.id = "cx-StrategyLayout" + + yRootLayout.elements += layout + yRootLayout.view.visibilityProcessors += + YVisibilityFactory.eINSTANCE.createYAuthorizationVisibilityProcessor + if (yRootLayout instanceof YAlignmentContainer) { + yRootLayout.applyAlignment(layout, YAlignment.FILL_FILL) + } + } + + override add(YEmbeddable element) { + } + + override add(YSuspect ySuspect) { + if (!currentSubDtoSuspect.isEmpty) { + currentSubDtoSuspect.peek.children += ySuspect + } else { + layout.suspects += ySuspect + } + } + + override pushHierarchy(YTypedCompoundSuspect suspect) { + currentSubDtoSuspect.push(suspect) + } + + override popHierarchy() { + currentSubDtoSuspect.pop + } + + } + + /** + * The Class LocalResourceAccess. + */ + public static class LocalResourceAccess implements IReferenceFinder.ILocalResourceAccess { + + ResourceSet rs + + new(ResourceSet rs) { + this.rs = rs + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.xtext.findReferences.IReferenceFinder.IResourceAccess + * #readOnly(org.eclipse.emf.common.util.URI, + * org.eclipse.xtext.util.concurrent.IUnitOfWork) + */ + override <R> R readOnly(URI targetURI, IUnitOfWork<R, ResourceSet> work) { + return work.exec(rs); + } + } +} diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/JvmTypeProperties.java b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/JvmTypeProperties.java new file mode 100644 index 0000000..373a3c9 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/JvmTypeProperties.java @@ -0,0 +1,467 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + */ + +package org.eclipse.osbp.autowirehelper; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.osbp.autowirehelper.AutowireHelper.LocalResourceAccess; +import org.eclipse.xtext.common.types.JvmAnnotationReference; +import org.eclipse.xtext.common.types.JvmDeclaredType; +import org.eclipse.xtext.common.types.JvmFeature; +import org.eclipse.xtext.common.types.JvmField; +import org.eclipse.xtext.common.types.JvmOperation; +import org.eclipse.xtext.common.types.JvmParameterizedTypeReference; +import org.eclipse.xtext.common.types.JvmPrimitiveType; +import org.eclipse.xtext.common.types.JvmType; +import org.eclipse.xtext.common.types.JvmVisibility; +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.common.types.util.RawSuperTypes; +import org.eclipse.xtext.resource.IReferenceDescription; +import org.eclipse.xtext.ui.editor.findrefs.IReferenceFinder; +import org.eclipse.xtext.util.IAcceptor; +import org.eclipse.xtext.xbase.lib.StringExtensions; + +import com.google.inject.Inject; + +/** + * Helper class to collect all properties for a given JvmType. + */ +@SuppressWarnings("restriction") +public class JvmTypeProperties { + + @Inject + private IReferenceFinder referenceFinder; + + /** + * Normalizes the method name. + * + * @param simpleName + * @return + */ + public static String toPropertyName(String simpleName) { + if (simpleName == null) { + return null; + } + String tempName = null; + if (isSetter(simpleName)) { + tempName = StringExtensions.toFirstLower(simpleName.replaceFirst( + "set", "")); + } else if (isGetter(simpleName)) { + if (simpleName.startsWith("get")) { + tempName = StringExtensions.toFirstLower(simpleName + .replaceFirst("get", "")); + } else { + tempName = StringExtensions.toFirstLower(simpleName + .replaceFirst("is", "")); + } + } + return tempName; + } + + public static boolean isGetter(String simpleName) { + if (simpleName == null) { + return false; + } + return simpleName.startsWith("get") || simpleName.startsWith("is"); + } + + public static boolean isSetter(String simpleName) { + return simpleName != null && simpleName.startsWith("set"); + } + + /** + * Calculates the operation infos for the given type. + * + * @param type + * @return + */ + public static Map<String, Info> getOperationInfos(JvmDeclaredType type) { + return getOperationInfos(type, null); + } + + /** + * Calculates the operation infos for the given info. + * + * @param info + * @return + */ + public static Map<String, Info> getOperationInfos(Info info) { + + JvmType type = null; + if (info.isMany()) { + type = info.getParameterizedType(); + } else { + type = info.getType(); + } + + Map<String, Info> result = null; + if (type instanceof JvmDeclaredType) { + result = getOperationInfos((JvmDeclaredType) type); + } else { + result = new HashMap<String, JvmTypeProperties.Info>(); + } + // apply the info as a parent + for (Info temp : result.values()) { + temp.setParent(info); + } + + return result; + } + + /** + * Calculates the operation infos for the given type. + * + * @param type + * @param filterName + * - is used to filter only methods property names matching the + * filter name. + * @return + */ + public static Map<String, Info> getOperationInfos(JvmDeclaredType type, + String filterName) { + Map<String, Info> infos = new HashMap<String, Info>(); + for (JvmFeature feature : type.getAllFeatures()) { + if (!(feature instanceof JvmOperation)) { + continue; + } + + JvmOperation operation = (JvmOperation) feature; + if (operation.getVisibility() != JvmVisibility.PUBLIC) { + continue; + } + + if (!isSetter(operation.getSimpleName()) + && operation.getParameters().size() > 1) { + continue; + } + + String propertyName = toPropertyName(operation.getSimpleName()); + if (propertyName == null) { + continue; + } + + if (filterName != null && !filterName.equals(propertyName)) { + continue; + } + + if (operation.getSimpleName().equals("getClass")) { + continue; + } + + if (!isGetter(operation.getSimpleName()) + && !isSetter(operation.getSimpleName())) { + continue; + } + + String id = calcId(operation.getDeclaringType(), + operation.getSimpleName()); + if (!infos.containsKey(id)) { + Info info = new Info(); + info.id = id; + info.name = propertyName; + infos.put(id, info); + } + + Info info = infos.get(id); + if (isGetter(operation.getSimpleName())) { + info.getter = operation; + } else { + if (!propertyName.equals("dirty")) { + info.setter = operation; + } + } + } + + // apply readonly and create descriptions + for (Info info : infos.values()) { + if (info.getter == null) { + continue; + } + if (info.setter == null) { + info.readonly = true; + } + } + + for (JvmFeature member : type.getAllFeatures()) { + if (member instanceof JvmField) { + JvmField field = (JvmField) member; + String id = calcFieldId(field.getDeclaringType(), + field.getSimpleName()); + if (infos.containsKey(id)) { + Info info = infos.get(id); + info.setField(field); + info.type = field.getType().getType(); + info.primitive = info.type instanceof JvmPrimitiveType + || info.type.getQualifiedName().equals( + String.class.getName()); + + // collect all super types and check if collection is part + // of them + Set<String> superTypes = new RawSuperTypes() + .collectNames(info.type); + for (String typeName : superTypes) { + if (typeName.equals(Collection.class.getName())) { + info.many = true; + break; + } + } + + if (info.many) { + JvmParameterizedTypeReference typeRef = (JvmParameterizedTypeReference) field + .getType(); + if (!typeRef.getArguments().isEmpty()) { + info.parameterizedType = typeRef.getArguments() + .get(0).getType(); + } + } + } + } + } + return infos; + } + + /** + * Normalizes the name. + * + * @param declaringType + * @param simpleName + * @return + */ + public static String calcId(JvmDeclaredType declaringType, String simpleName) { + String tempName = toPropertyName(simpleName); + if (tempName == null) { + return null; + } + + return declaringType.getQualifiedName() + ":" + tempName; + } + + /** + * Normalizes the name. + * + * @param declaringType + * @param simpleName + * @return + */ + public static String calcFieldId(JvmDeclaredType declaringType, + String simpleName) { + return declaringType.getQualifiedName() + ":" + simpleName; + } + + /** + * Finds all sub types of the given dtoType. + */ + public Set<URI> findSubTypes(JvmType dtoType, ResourceSet rs) { + Set<URI> result = new HashSet<>(); + Set<URI> jvmTypeURIs = new HashSet<>(); + jvmTypeURIs.add(EcoreUtil.getURI(dtoType)); + IAcceptor<IReferenceDescription> acceptor = e -> { + if (e.getEReference() == TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE) { + if (e.getSourceEObjectUri().fragment() + .endsWith("/@superTypes.0")) { + URI uri = e.getSourceEObjectUri(); + result.add(URI.createURI(uri.toString().replace( + "/@superTypes.0", ""))); + } + } + }; + referenceFinder.findAllReferences(jvmTypeURIs, new LocalResourceAccess( + rs), acceptor, null); + return result; + } + + public static class Info implements Comparable<Info> { + + /** + * Can by any object that requested the info. For instance a YBeanSlot, + * an Entity, a JvmField,... The root should only be set for the top + * most parent. + */ + private Object root; + /** + * The parent which requested this instance of info. + */ + private Info parent; + private String id; + private String name; + private boolean readonly; + private boolean primitive; + private JvmOperation getter; + private JvmOperation setter; + private JvmField field; + private JvmType type; + private JvmType parameterizedType; + private boolean many; + + public Info getParent() { + return parent; + } + + public void setParent(Info parent) { + this.parent = parent; + } + + public Info getTopParent() { + if (getParent() != null) { + return getParent().getTopParent(); + } + return this; + } + + public Object getRoot() { + if (this.root == null && getParent() != null) { + return getParent().getRoot(); + } + return root; + } + + public void setRoot(Object root) { + this.root = root; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isReadonly() { + return readonly; + } + + public void setReadonly(boolean readonly) { + this.readonly = readonly; + } + + public JvmOperation getGetter() { + return getter; + } + + public void setGetter(JvmOperation getter) { + this.getter = getter; + } + + public JvmOperation getSetter() { + return setter; + } + + public void setSetter(JvmOperation setter) { + this.setter = setter; + } + + public JvmField getField() { + return field; + } + + public void setField(JvmField field) { + this.field = field; + } + + public boolean isPrimitive() { + return primitive; + } + + public void setPrimitive(boolean primitive) { + this.primitive = primitive; + } + + public JvmType getType() { + return type; + } + + public void setType(JvmType type) { + this.type = type; + } + + public boolean isMany() { + return many; + } + + public void setMany(boolean many) { + this.many = many; + } + + public JvmType getParameterizedType() { + return parameterizedType; + } + + public void setParameterizedType(JvmType parameterizedType) { + this.parameterizedType = parameterizedType; + } + + /** + * Returns true, if the info has an annotation matching the given + * annotationType. + * + * @param annotationType + * @return + */ + public boolean hasAnnotation(Class<?> annotationType) { + if (field == null) { + return false; + } + for (JvmAnnotationReference annotation : field.getAnnotations()) { + if (annotation.getAnnotation().getQualifiedName() + .equals(annotationType.getName())) { + return true; + } + } + return false; + } + + /** + * Returns the dot'ed attribute path for this info and its parents. For + * instance <code>person.address.name</code>. + * + * @return + */ + public String getAttributePath() { + return getAttributePath(parent, name); + } + + protected String getAttributePath(Info parent, String postFix) { + if (parent != null) { + String temp = parent.getAttributePath(); + return temp + "." + postFix; + } else { + return postFix; + } + } + + @Override + public int compareTo(Info other) { + if (name == null || other == null) { + return -1; + } + return name.compareTo(other.getName()); + } + } +} diff --git a/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend new file mode 100644 index 0000000..969920d --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/src/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.xtend @@ -0,0 +1,288 @@ +/** + * + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + * + * + * This copyright notice shows up in the generated Java code + * + */ + +package org.eclipse.osbp.autowirehelper.utils + +import java.util.List +import java.util.Map +import javax.inject.Inject +import org.apache.commons.lang.StringEscapeUtils +import org.eclipse.osbp.dsl.semantic.common.types.LDataType +import org.eclipse.osbp.dsl.semantic.common.types.LKeyAndValue +import org.eclipse.osbp.dsl.semantic.common.types.LScalarType +import org.eclipse.osbp.dsl.semantic.dto.LDtoAbstractAttribute +import org.eclipse.osbp.dsl.semantic.dto.LDtoFeature +import org.eclipse.osbp.dsl.semantic.dto.LDtoInheritedAttribute +import org.eclipse.osbp.dsl.semantic.dto.LDtoInheritedReference +import org.eclipse.osbp.dsl.semantic.entity.LEntity +import org.eclipse.osbp.ecview.dsl.extensions.BindableTypeResolver +import org.eclipse.osbp.ecview.dsl.extensions.OperationExtensions.OperationInfo +import org.eclipse.osbp.ecview.dsl.extensions.TypeHelper +import org.eclipse.osbp.ecview.semantic.uimodel.UiBeanSlot +import org.eclipse.osbp.ecview.semantic.uimodel.UiLayout +import org.eclipse.osbp.ecview.semantic.uimodel.UiModel +import org.eclipse.osbp.ecview.semantic.uimodel.UiView +import org.eclipse.osbp.ecview.semantic.uimodel.impl.UiViewImpl +import org.eclipse.osbp.runtime.common.annotations.DomainDescription +import org.eclipse.osbp.runtime.common.annotations.DomainKey +import org.eclipse.osbp.runtime.common.annotations.Properties +import org.eclipse.osbp.utils.common.EntityUtils +import org.eclipse.xtext.common.types.JvmAnnotationAnnotationValue +import org.eclipse.xtext.common.types.JvmAnnotationReference +import org.eclipse.xtext.common.types.JvmDeclaredType +import org.eclipse.xtext.common.types.JvmField +import org.eclipse.xtext.common.types.JvmStringAnnotationValue +import org.eclipse.xtext.common.types.JvmType +import org.eclipse.xtext.common.types.util.TypeReferences +import org.eclipse.xtext.naming.IQualifiedNameProvider + +class AutowireUtil { + @Inject extension IQualifiedNameProvider + @Inject extension TypeHelper + @Inject + private TypeReferences typeReferences; + + public def String generateId(UiLayout layout) { + val BindableTypeResolver resolver = new BindableTypeResolver + var resolvedType = resolver.resolveType(layout.autoWireSource) + var viewName = "" + + var parent = layout.eContainer + while (!(parent instanceof UiModel)) { + if (parent instanceof UiViewImpl) { + viewName = (parent as UiViewImpl).name + } + parent = parent.eContainer + } + var uimodel = parent as UiModel + return '''«uimodel.packageName»«IF viewName != null».«viewName»«ENDIF»«IF resolvedType != null».«resolvedType. + identifier»«ENDIF»''' + } + + public def UiView getUiView(UiLayout layout) { + var parent = layout.eContainer + while (!(parent instanceof UiViewImpl)) { + parent = parent.eContainer + } + if (parent instanceof UiViewImpl) { + return (parent as UiViewImpl) + } + } + + public def boolean isAttribute(JvmType type, String attribute, String filterName) { + var dto = EntityUtils.getDto(type) + if (dto != null) { + var attr = dto.attributes.findFirst[toName == attribute] + if (attr != null) { + var datatype = attr.toDatatype as LDataType + return datatype.name == filterName + } + } + return false + } + + /** + * Detects all the existing properties of the jvmtype corresponding attribute, the datatype of the attribute and references. + */ + public def List<Pair> toProperties(JvmDeclaredType type, String attributeName) { + val result = type.toFieldProperties.get(attributeName) + if (result != null) { + for (prop : result) { + + // unescape quotes like ¤ to avoid UTF-8 conflicts + prop.value = StringEscapeUtils.unescapeHtml(prop.value); + } + } + return if(result != null) result else newArrayList() + } + + /** + * Detects all the existing properties of the jvmtype corresponding reference and the referenced dto. + */ + public def Map<String, List<Pair>> toFieldProperties(JvmDeclaredType jvmType) { + val Map<String, List<Pair>> propMap = newHashMap() + jvmType.allFeatures.filter(typeof(JvmField)).forEach [ + val attrPropKey = '''«jvmType.qualifiedName».«it.simpleName»''' + val List<Pair> values = newArrayList() + propMap.put(attrPropKey, values) + it.annotations.filter [ e | + val result = e.annotation.identifier.equals(typeof(Properties).name) + return result + ].forEach [ + val JvmAnnotationReference ref = it; + ref.values.map[it as JvmAnnotationAnnotationValue].forEach [ av | + av.values.forEach [ + val keyAn = it.values.get(0) as JvmStringAnnotationValue + val valueAn = it.values.get(1) as JvmStringAnnotationValue + values.add(new Pair(keyAn.values.get(0), valueAn.values.get(0))) + ] + ] + ] + ] + + return propMap + } + + /** + * Detects all the existing properties of the jvmtype corresponding datatype of the attribute. + */ + public def LDataType toDataType(JvmType type, String attributeName) { + var dto = EntityUtils.getDto(type) + if (dto != null) { + var attr = dto.attributes.findFirst[toName == attributeName] + if (attr != null) { + var dataType = attr.toDatatype + if (dataType instanceof LDataType) { + return (attr.toDatatype as LDataType) + } + } + } + return null + } + + /** + * Provides the datatype of the corresponding attribute. + */ + public def List<LKeyAndValue> toDataTypeProperties(JvmType type, String attributeName) { + var dataType = type.toDataType(attributeName) + if (dataType != null) { + return dataType.properties + } + return newArrayList() + } + + def String toName(LDtoFeature feature) { + if (feature instanceof LDtoInheritedAttribute) { + return feature.inheritedFeature.name + } else if (feature instanceof LDtoInheritedReference) { + return feature.inheritedFeature.name + } else { + return feature.name + } + } + + def LScalarType toDatatype(LDtoAbstractAttribute att) { + if (att instanceof LDtoInheritedAttribute) { + return att.inheritedFeature.type + } else { + return att.type + } + } + + def boolean isBlob(JvmType type, String attribute) { + var dto = EntityUtils.getDto(type) + var attrs = dto.attributes.filter[name == attribute] + for (attr : attrs) { + var datatype = attr.type as LDataType + println(datatype) + return datatype.asBlob + } + return false + } + + def String getEntityName(UiBeanSlot uiBeanSlot) { + val entity = EntityUtils.getEntityFromDto(uiBeanSlot.jvmType.type) as LEntity + var String eName + if (entity == null) { + if (uiBeanSlot.jvmType.type == null) { + eName = "" + } else if (uiBeanSlot.jvmType.type != null) { + + // Temporary solution till final solution found. + // eName = uiBeanSlot.jvmType.type.toString + eName = "" + } + } else { + eName = entity.name + } + return eName + } + + // Helper Methods + def boolean isClass(JvmType type) { + if (typeReferences.is(type, Class)) { + return true; + } + return false; + } + + // Helper Methods + def boolean isByteArray(JvmType type) { + if (typeReferences.is(type, typeof(byte[]))) { + return true; + } + return false; + } + + def boolean isAllowed(JvmType type, JvmType beanType, OperationInfo info) { + if (type.numberWithDigits) { + return true + } else if (type.numberWithoutDigits) { + return true + } else if (type.string) { + return true + } else if (type.date) { + return true + } else if (type.byteArray) { + return true + } else if (type.boolean) { + return true + } else if (type.enum) { + return true + } else if (info.domainReference) { + switch (type) { + JvmDeclaredType: + if ((type as JvmDeclaredType).isAnnotationOf(typeof(DomainKey)) || + (type as JvmDeclaredType).isAnnotationOf(typeof(DomainDescription))) { + return true + } + } + return false + } else if (info.field != null && info.field.collection) { + return true + } + return false + } + + private def boolean isAnnotationOf(JvmDeclaredType type, Class<?> clazz) { + for (member : type.members) { + for (annotation : member.annotations) { + if (annotation.annotation.identifier.equals(clazz.canonicalName)) { + return true + } + } + } + for (superType : type.superTypes){ + if (superType.type instanceof JvmDeclaredType){ + return isAnnotationOf((superType.type as JvmDeclaredType), clazz) + } + } + return false + } + + static class Pair { + public String key + public String value + + new(String key, String value) { + this.key = key; + this.value = value; + } + + } + +} diff --git a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java new file mode 100644 index 0000000..addd820 --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/AutowireHelper.java @@ -0,0 +1,2064 @@ +/** + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + * + * + * This copyright notice shows up in the generated Java code + */ +package org.eclipse.osbp.autowirehelper; + +import com.google.common.base.Objects; +import com.google.inject.Inject; +import com.google.inject.Injector; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import javax.validation.Constraint; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.EMap; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.osbp.autowirehelper.JvmTypeProperties; +import org.eclipse.osbp.autowirehelper.utils.AutowireUtil; +import org.eclipse.osbp.dsl.common.datatypes.IDto; +import org.eclipse.osbp.dsl.semantic.common.types.LDataType; +import org.eclipse.osbp.ecview.core.common.model.binding.BindingFactory; +import org.eclipse.osbp.ecview.core.common.model.binding.YBinding; +import org.eclipse.osbp.ecview.core.common.model.binding.YBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.binding.YBindingSet; +import org.eclipse.osbp.ecview.core.common.model.binding.YBindingUpdateStrategy; +import org.eclipse.osbp.ecview.core.common.model.binding.YDetailValueBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.binding.YECViewModelListBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.binding.YECViewModelValueBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.binding.YListBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.binding.YValueBinding; +import org.eclipse.osbp.ecview.core.common.model.binding.YValueBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.core.YAlignment; +import org.eclipse.osbp.ecview.core.common.model.core.YAlignmentContainer; +import org.eclipse.osbp.ecview.core.common.model.core.YAuthorizationable; +import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot; +import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotListBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotValueBindingEndpoint; +import org.eclipse.osbp.ecview.core.common.model.core.YDetailBeanSlot; +import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable; +import org.eclipse.osbp.ecview.core.common.model.core.YLayout; +import org.eclipse.osbp.ecview.core.common.model.core.YView; +import org.eclipse.osbp.ecview.core.common.model.visibility.YVisibilityProcessor; +import org.eclipse.osbp.ecview.core.extension.model.extension.util.SimpleExtensionModelFactory; +import org.eclipse.osbp.ecview.dsl.autowire.IAutowireDelegate; +import org.eclipse.osbp.ecview.dsl.derivedstate.UiModelDerivedStateComputerx; +import org.eclipse.osbp.ecview.dsl.extensions.BeanHelper; +import org.eclipse.osbp.ecview.dsl.extensions.BindableTypeResolver; +import org.eclipse.osbp.ecview.dsl.extensions.BindingInfoHelper; +import org.eclipse.osbp.ecview.dsl.extensions.OperationExtensions; +import org.eclipse.osbp.ecview.dsl.extensions.SuperTypeCollector; +import org.eclipse.osbp.ecview.dsl.extensions.TypeHelper; +import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy; +import org.eclipse.osbp.ecview.extension.model.YCollectionSuspect; +import org.eclipse.osbp.ecview.extension.model.YColumnInfo; +import org.eclipse.osbp.ecview.extension.model.YECviewFactory; +import org.eclipse.osbp.ecview.extension.model.YStrategyLayout; +import org.eclipse.osbp.ecview.extension.model.YSubTypeBaseSuspect; +import org.eclipse.osbp.ecview.extension.model.YSubTypeSuspect; +import org.eclipse.osbp.ecview.extension.model.YSuspect; +import org.eclipse.osbp.ecview.extension.model.YTypedCompoundSuspect; +import org.eclipse.osbp.ecview.extension.model.YTypedSuspect; +import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor; +import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityFactory; +import org.eclipse.osbp.ecview.semantic.uimodel.UiBeanSlot; +import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingEndpointAssignment; +import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingExpression; +import org.eclipse.osbp.ecview.semantic.uimodel.UiEmbeddable; +import org.eclipse.osbp.ecview.semantic.uimodel.UiHorizontalLayout; +import org.eclipse.osbp.ecview.semantic.uimodel.UiLayout; +import org.eclipse.osbp.ecview.semantic.uimodel.UiTypedBindable; +import org.eclipse.osbp.mobile.vaadin.ecview.model.VMSwitch; +import org.eclipse.osbp.mobile.vaadin.ecview.model.VMVerticalComponentGroup; +import org.eclipse.osbp.mobile.vaadin.ecview.model.VaadinMobileFactory; +import org.eclipse.osbp.runtime.common.annotations.DomainDescription; +import org.eclipse.osbp.runtime.common.annotations.DomainKey; +import org.eclipse.osbp.runtime.common.metric.TimeLogger; +import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI; +import org.eclipse.xtend2.lib.StringConcatenation; +import org.eclipse.xtext.common.types.JvmAnnotationReference; +import org.eclipse.xtext.common.types.JvmAnnotationType; +import org.eclipse.xtext.common.types.JvmDeclaredType; +import org.eclipse.xtext.common.types.JvmField; +import org.eclipse.xtext.common.types.JvmGenericType; +import org.eclipse.xtext.common.types.JvmOperation; +import org.eclipse.xtext.common.types.JvmParameterizedTypeReference; +import org.eclipse.xtext.common.types.JvmPrimitiveType; +import org.eclipse.xtext.common.types.JvmType; +import org.eclipse.xtext.common.types.JvmTypeReference; +import org.eclipse.xtext.common.types.JvmVoid; +import org.eclipse.xtext.common.types.TypesFactory; +import org.eclipse.xtext.common.types.TypesPackage; +import org.eclipse.xtext.naming.IQualifiedNameProvider; +import org.eclipse.xtext.naming.QualifiedName; +import org.eclipse.xtext.resource.IReferenceDescription; +import org.eclipse.xtext.ui.editor.findrefs.IReferenceFinder; +import org.eclipse.xtext.util.IAcceptor; +import org.eclipse.xtext.util.concurrent.IUnitOfWork; +import org.eclipse.xtext.xbase.lib.CollectionLiterals; +import org.eclipse.xtext.xbase.lib.Exceptions; +import org.eclipse.xtext.xbase.lib.Extension; +import org.eclipse.xtext.xbase.lib.Functions.Function1; +import org.eclipse.xtext.xbase.lib.IterableExtensions; +import org.eclipse.xtext.xbase.lib.StringExtensions; + +@SuppressWarnings("all") +public class AutowireHelper implements IAutowireDelegate { + public interface Layouter { + public abstract void setup(final UiLayout uiRootLayout, final YLayout yRootLayout); + + public abstract void add(final YEmbeddable element); + + public abstract void add(final YSuspect suspect); + + public abstract void pushHierarchy(final YTypedCompoundSuspect suspect); + + public abstract void popHierarchy(); + } + + public static class MobileLayouter implements AutowireHelper.Layouter { + private VMVerticalComponentGroup group; + + public void setup(final UiLayout uiRootLayout, final YLayout yRootLayout) { + VMVerticalComponentGroup _createVMVerticalComponentGroup = VaadinMobileFactory.eINSTANCE.createVMVerticalComponentGroup(); + this.group = _createVMVerticalComponentGroup; + EList<YEmbeddable> _elements = yRootLayout.getElements(); + _elements.add(this.group); + } + + public void add(final YEmbeddable element) { + this.group.addElement(element); + } + + public void add(final YSuspect ySuspect) { + } + + public void pushHierarchy(final YTypedCompoundSuspect suspect) { + throw new UnsupportedOperationException("TODO: auto-generated method stub"); + } + + public void popHierarchy() { + throw new UnsupportedOperationException("TODO: auto-generated method stub"); + } + } + + public static class StrategyLayoutLayouter implements AutowireHelper.Layouter { + private Stack<YTypedCompoundSuspect> currentSubDtoSuspect = new Stack<YTypedCompoundSuspect>(); + + private YStrategyLayout layout; + + public void setup(final UiLayout uiRootLayout, final YLayout yRootLayout) { + YStrategyLayout _createYStrategyLayout = YECviewFactory.eINSTANCE.createYStrategyLayout(); + this.layout = _createYStrategyLayout; + this.layout.setId("cx-StrategyLayout"); + EList<YEmbeddable> _elements = yRootLayout.getElements(); + _elements.add(this.layout); + YView _view = yRootLayout.getView(); + EList<YVisibilityProcessor> _visibilityProcessors = _view.getVisibilityProcessors(); + YAuthorizationVisibilityProcessor _createYAuthorizationVisibilityProcessor = YVisibilityFactory.eINSTANCE.createYAuthorizationVisibilityProcessor(); + _visibilityProcessors.add(_createYAuthorizationVisibilityProcessor); + if ((yRootLayout instanceof YAlignmentContainer)) { + ((YAlignmentContainer)yRootLayout).applyAlignment(this.layout, YAlignment.FILL_FILL); + } + } + + public void add(final YEmbeddable element) { + } + + public void add(final YSuspect ySuspect) { + boolean _isEmpty = this.currentSubDtoSuspect.isEmpty(); + boolean _not = (!_isEmpty); + if (_not) { + YTypedCompoundSuspect _peek = this.currentSubDtoSuspect.peek(); + EList<YSuspect> _children = _peek.getChildren(); + _children.add(ySuspect); + } else { + EList<YSuspect> _suspects = this.layout.getSuspects(); + _suspects.add(ySuspect); + } + } + + public void pushHierarchy(final YTypedCompoundSuspect suspect) { + this.currentSubDtoSuspect.push(suspect); + } + + public void popHierarchy() { + this.currentSubDtoSuspect.pop(); + } + } + + /** + * The Class LocalResourceAccess. + */ + public static class LocalResourceAccess implements IReferenceFinder.ILocalResourceAccess { + private ResourceSet rs; + + public LocalResourceAccess(final ResourceSet rs) { + this.rs = rs; + } + + /** + * (non-Javadoc) + * + * @see + * org.eclipse.xtext.findReferences.IReferenceFinder.IResourceAccess + * #readOnly(org.eclipse.emf.common.util.URI, + * org.eclipse.xtext.util.concurrent.IUnitOfWork) + */ + public <R extends Object> R readOnly(final URI targetURI, final IUnitOfWork<R, ResourceSet> work) { + try { + return work.exec(this.rs); + } catch (Throwable _e) { + throw Exceptions.sneakyThrow(_e); + } + } + } + + @Inject + @Extension + private TypeHelper _typeHelper; + + @Inject + @Extension + private AutowireUtil _autowireUtil; + + @Inject + @Extension + private IQualifiedNameProvider _iQualifiedNameProvider; + + @Inject + private BindingInfoHelper bindingInfoHelper; + + @Inject + private IReferenceFinder referenceFinder; + + @Inject + private Injector injector; + + private VaadinMobileFactory vFactory = VaadinMobileFactory.eINSTANCE; + + private UiModelDerivedStateComputerx computer; + + private boolean mobile; + + private YLayout yLayout; + + private UiLayout uiLayout; + + private AutowireHelper.Layouter layouter; + + private JvmDeclaredType beanType; + + private final SimpleExtensionModelFactory factory = new SimpleExtensionModelFactory(); + + private YView yView; + + private YBeanSlot yMainBeanslot; + + public void autowire(final UiLayout uiLayout, final UiModelDerivedStateComputerx computer, final boolean mobile) { + boolean _isAutowire = uiLayout.isAutowire(); + boolean _not = (!_isAutowire); + if (_not) { + return; + } + final TimeLogger logger = TimeLogger.start(AutowireHelper.class); + this.computer = computer; + this.mobile = mobile; + this.uiLayout = uiLayout; + YLayout _associatedUi = computer.<YLayout>associatedUi(uiLayout); + this.yLayout = _associatedUi; + YView _view = this.yLayout.getView(); + this.yView = _view; + YBeanSlot _beanSlot = this.getBeanSlot(uiLayout); + this.yMainBeanslot = _beanSlot; + boolean _matched = false; + if (!_matched) { + if (uiLayout instanceof UiHorizontalLayout) { + _matched=true; + AutowireHelper.Layouter _xifexpression = null; + if ((!mobile)) { + _xifexpression = new AutowireHelper.StrategyLayoutLayouter(); + } else { + _xifexpression = new AutowireHelper.MobileLayouter(); + } + this.layouter = _xifexpression; + this.layouter.setup(uiLayout, this.yLayout); + } + } + if (!_matched) { + return; + } + final BindableTypeResolver resolver = new BindableTypeResolver(); + UiBindingExpression _autoWireSource = uiLayout.getAutoWireSource(); + JvmType resolvedType = resolver.resolveType(_autoWireSource); + if ((resolvedType instanceof JvmDeclaredType)) { + this.beanType = ((JvmDeclaredType) resolvedType); + final Map<String, OperationExtensions.OperationInfo> opInfoMap = OperationExtensions.getOperationInfos(this.beanType); + final LinkedList<Map<String, OperationExtensions.OperationInfo>> sortedOpInfoMapList = this.createSortedMapList(opInfoMap); + this.createSuspectStructure(sortedOpInfoMapList, this.beanType, mobile, null); + } + } + + /** + * Finds all sub types of the beanType + */ + public Set<URI> findSubTypes(final JvmType dtoType, final Resource resource) { + Set<URI> _xblockexpression = null; + { + final Set<URI> result = CollectionLiterals.<URI>newHashSet(); + final Set<URI> jvmTypeURIs = CollectionLiterals.<URI>newHashSet(); + URI _uRI = EcoreUtil.getURI(dtoType); + jvmTypeURIs.add(_uRI); + final IAcceptor<IReferenceDescription> _function = new IAcceptor<IReferenceDescription>() { + public void accept(final IReferenceDescription it) { + final IReferenceDescription desc = it; + EReference _eReference = desc.getEReference(); + boolean _equals = Objects.equal(_eReference, TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE__TYPE); + if (_equals) { + URI _sourceEObjectUri = it.getSourceEObjectUri(); + String _fragment = _sourceEObjectUri.fragment(); + boolean _endsWith = _fragment.endsWith("/@superTypes.0"); + if (_endsWith) { + final URI uri = desc.getSourceEObjectUri(); + String _string = uri.toString(); + String _replace = _string.replace("/@superTypes.0", ""); + URI _createURI = URI.createURI(_replace); + result.add(_createURI); + } + } + } + }; + final IAcceptor<IReferenceDescription> acceptor = _function; + ResourceSet _resourceSet = resource.getResourceSet(); + AutowireHelper.LocalResourceAccess _localResourceAccess = new AutowireHelper.LocalResourceAccess(_resourceSet); + this.referenceFinder.findAllReferences(jvmTypeURIs, _localResourceAccess, acceptor, null); + _xblockexpression = result; + } + return _xblockexpression; + } + + public YBeanSlot getBeanSlot(final UiLayout uiLayout) { + UiBindingExpression autoWireSourceTemp = uiLayout.getAutoWireSource(); + if ((autoWireSourceTemp instanceof UiBindingEndpointAssignment)) { + UiTypedBindable alias = ((UiBindingEndpointAssignment) autoWireSourceTemp).getTypedBindableAlias(); + if ((alias instanceof UiBeanSlot)) { + return this.computer.<YBeanSlot>associatedUi(((UiBeanSlot) alias)); + } + } + return null; + } + + public void createSuspectStructure(final JvmDeclaredType type, final boolean mobile, final YTypedCompoundSuspect parentSuspect) { + final Map<String, OperationExtensions.OperationInfo> opInfoMap = OperationExtensions.getOperationInfos(type); + final LinkedList<Map<String, OperationExtensions.OperationInfo>> sortedOpInfoMapList = this.createSortedMapList(opInfoMap); + this.createSuspectStructure(sortedOpInfoMapList, type, mobile, parentSuspect); + } + + public void createSuspectStructure(final LinkedList<Map<String, OperationExtensions.OperationInfo>> sortedOpInfoMapList, final JvmType dtoType, final boolean mobile, final YTypedCompoundSuspect parentSuspect) { + boolean _isEnum = this._typeHelper.isEnum(dtoType); + boolean _not = (!_isEnum); + if (_not) { + final Consumer<Map<String, OperationExtensions.OperationInfo>> _function = new Consumer<Map<String, OperationExtensions.OperationInfo>>() { + public void accept(final Map<String, OperationExtensions.OperationInfo> it) { + AutowireHelper.this.createSuspectStructure(it, mobile, parentSuspect); + } + }; + sortedOpInfoMapList.forEach(_function); + } + Resource _eResource = this.uiLayout.eResource(); + final Set<URI> subTypeURIs = this.findSubTypes(dtoType, _eResource); + boolean _isEmpty = subTypeURIs.isEmpty(); + boolean _not_1 = (!_isEmpty); + if (_not_1) { + final YSubTypeBaseSuspect subtypeRootSuspect = YECviewFactory.eINSTANCE.createYSubTypeBaseSuspect(); + EList<String> _tags = subtypeRootSuspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__SUBTYPES_ROOT); + String _qualifiedName = dtoType.getQualifiedName(); + subtypeRootSuspect.setTypeQualifiedName(_qualifiedName); + this.layouter.add(subtypeRootSuspect); + this.layouter.pushHierarchy(subtypeRootSuspect); + } + final Consumer<URI> _function_1 = new Consumer<URI>() { + public void accept(final URI it) { + Resource _eResource = AutowireHelper.this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + EObject _eObject = _resourceSet.getEObject(it, true); + final JvmDeclaredType subDtoJvmType = ((JvmDeclaredType) _eObject); + AutowireHelper.this.createSubTypeDtoSuspect(subDtoJvmType); + } + }; + subTypeURIs.forEach(_function_1); + boolean _isEmpty_1 = subTypeURIs.isEmpty(); + boolean _not_2 = (!_isEmpty_1); + if (_not_2) { + this.layouter.popHierarchy(); + } + } + + public void createSuspectStructure(final Map<String, OperationExtensions.OperationInfo> opInfoMap, final boolean mobile, final YTypedCompoundSuspect parentSuspect) { + Collection<OperationExtensions.OperationInfo> _values = opInfoMap.values(); + final Consumer<OperationExtensions.OperationInfo> _function = new Consumer<OperationExtensions.OperationInfo>() { + public void accept(final OperationExtensions.OperationInfo it) { + JvmType type = null; + try { + JvmOperation _getter = it.getGetter(); + JvmTypeReference _returnType = _getter.getReturnType(); + JvmType _type = _returnType.getType(); + type = _type; + } catch (final Throwable _t) { + if (_t instanceof NullPointerException) { + final NullPointerException e = (NullPointerException)_t; + return; + } else { + throw Exceptions.sneakyThrow(_t); + } + } + YSuspect suspect = null; + ArrayList<AutowireUtil.Pair> properties = CollectionLiterals.<AutowireUtil.Pair>newArrayList(); + JvmField _field = it.getField(); + boolean _notEquals = (!Objects.equal(_field, null)); + if (_notEquals) { + JvmField _field_1 = it.getField(); + JvmDeclaredType _declaringType = _field_1.getDeclaringType(); + String _qualifiedName = _declaringType.getQualifiedName(); + String _plus = (_qualifiedName + "."); + String _name = it.getName(); + String _plus_1 = (_plus + _name); + List<AutowireUtil.Pair> _properties = AutowireHelper.this._autowireUtil.toProperties(AutowireHelper.this.beanType, _plus_1); + properties.addAll(_properties); + } + boolean _isBoolean = AutowireHelper.this._typeHelper.isBoolean(type); + if (_isBoolean) { + if (mobile) { + AutowireHelper.this.createMobileSwitch(type, it); + } else { + YTypedSuspect _createCheckbox = AutowireHelper.this.createCheckbox(type, it); + suspect = _createCheckbox; + } + } else { + boolean _isNumberWithDigits = AutowireHelper.this._typeHelper.isNumberWithDigits(type); + if (_isNumberWithDigits) { + YTypedSuspect _createDecimalField = AutowireHelper.this.createDecimalField(type, it); + suspect = _createDecimalField; + String _name_1 = it.getName(); + boolean _isAttribute = AutowireHelper.this._autowireUtil.isAttribute(AutowireHelper.this.beanType, _name_1, "NumberToUomo"); + if (_isAttribute) { + EList<String> _tags = suspect.getTags(); + _tags.add("NumberToUomo"); + } else { + String _name_2 = it.getName(); + LDataType dataType = AutowireHelper.this._autowireUtil.toDataType(AutowireHelper.this.beanType, _name_2); + boolean _notEquals_1 = (!Objects.equal(dataType, null)); + if (_notEquals_1) { + JvmTypeReference _jvmTypeReference = dataType.getJvmTypeReference(); + JvmType _type_1 = _jvmTypeReference.getType(); + String dataTypeName = _type_1.getIdentifier(); + String _canonicalName = Double.class.getCanonicalName(); + boolean _equals = dataTypeName.equals(_canonicalName); + if (_equals) { + YSuspect _createCustomDecimalField = AutowireHelper.this.createCustomDecimalField(type, it); + suspect = _createCustomDecimalField; + } + } + } + } else { + boolean _isNumberWithoutDigits = AutowireHelper.this._typeHelper.isNumberWithoutDigits(type); + if (_isNumberWithoutDigits) { + boolean _and = false; + String _name_3 = it.getName(); + boolean _equals_1 = _name_3.equals("id"); + boolean _not = (!_equals_1); + if (!_not) { + _and = false; + } else { + String _name_4 = it.getName(); + boolean _equals_2 = _name_4.equals("uuid"); + boolean _not_1 = (!_equals_2); + _and = _not_1; + } + if (_and) { + YTypedSuspect _createNumberField = AutowireHelper.this.createNumberField(type, it); + suspect = _createNumberField; + } + } else { + boolean _isString = AutowireHelper.this._typeHelper.isString(type); + if (_isString) { + final Function1<AutowireUtil.Pair, Boolean> _function = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equals(ILayoutingStrategy.PROPERTY_KEY__FIELD_TYPE)); + } + }; + AutowireUtil.Pair _findFirst = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function); + String _value = null; + if (_findFirst!=null) { + _value=_findFirst.value; + } + final String fieldType = _value; + boolean _and_1 = false; + String _name_5 = it.getName(); + boolean _equals_3 = _name_5.equals("id"); + boolean _not_2 = (!_equals_3); + if (!_not_2) { + _and_1 = false; + } else { + String _name_6 = it.getName(); + boolean _equals_4 = _name_6.equals("uuid"); + boolean _not_3 = (!_equals_4); + _and_1 = _not_3; + } + if (_and_1) { + FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI(); + final String functionImagePicker = functionTypingAPI.getFunctionImagePickerTypeName(); + boolean _or = false; + boolean _or_1 = false; + boolean _isDomainKey = AutowireHelper.this.isDomainKey(it); + if (_isDomainKey) { + _or_1 = true; + } else { + boolean _isDomainDescription = AutowireHelper.this.isDomainDescription(it); + _or_1 = _isDomainDescription; + } + if (_or_1) { + _or = true; + } else { + boolean _and_2 = false; + boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(fieldType); + boolean _not_4 = (!_isNullOrEmpty); + if (!_not_4) { + _and_2 = false; + } else { + boolean _equals_5 = fieldType.equals(ILayoutingStrategy.PROPERTY_SUGGESTTEXT); + _and_2 = _equals_5; + } + _or = _and_2; + } + if (_or) { + YTypedSuspect _createSuggestTextField = AutowireHelper.this.createSuggestTextField(type, it, opInfoMap); + suspect = _createSuggestTextField; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_1 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + String _lowerCase = it.key.toLowerCase(); + return Boolean.valueOf(_lowerCase.equals(ILayoutingStrategy.PROPERTY_BLOB)); + } + }; + boolean _exists = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_1); + if (_exists) { + YSuspect _createBlopUploadComponent = AutowireHelper.this.createBlopUploadComponent(type, it); + suspect = _createBlopUploadComponent; + } else { + boolean _and_3 = false; + boolean _isNullOrEmpty_1 = StringExtensions.isNullOrEmpty(fieldType); + boolean _not_5 = (!_isNullOrEmpty_1); + if (!_not_5) { + _and_3 = false; + } else { + boolean _equals_6 = fieldType.equals(ILayoutingStrategy.PROPERTY_RICH_TEXT); + _and_3 = _equals_6; + } + if (_and_3) { + YSuspect _createRichTextField = AutowireHelper.this.createRichTextField(type, it); + suspect = _createRichTextField; + } else { + boolean _and_4 = false; + boolean _isNullOrEmpty_2 = StringExtensions.isNullOrEmpty(fieldType); + boolean _not_6 = (!_isNullOrEmpty_2); + if (!_not_6) { + _and_4 = false; + } else { + boolean _equals_7 = fieldType.equals(ILayoutingStrategy.PROPERTY_MASKED_TEXT); + _and_4 = _equals_7; + } + if (_and_4) { + final Function1<AutowireUtil.Pair, Boolean> _function_2 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equals(ILayoutingStrategy.PROPERTY_MASK)); + } + }; + AutowireUtil.Pair _findFirst_1 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_2); + String _value_1 = null; + if (_findFirst_1!=null) { + _value_1=_findFirst_1.value; + } + final String mask = _value_1; + YSuspect _createMaskedTextField = AutowireHelper.this.createMaskedTextField(type, it, mask); + suspect = _createMaskedTextField; + } else { + boolean _and_5 = false; + boolean _isNullOrEmpty_3 = StringExtensions.isNullOrEmpty(fieldType); + boolean _not_7 = (!_isNullOrEmpty_3); + if (!_not_7) { + _and_5 = false; + } else { + boolean _equals_8 = fieldType.equals(ILayoutingStrategy.PROPERTY_PASSWORD); + _and_5 = _equals_8; + } + if (_and_5) { + YSuspect _createPasswordField = AutowireHelper.this.createPasswordField(type, it); + suspect = _createPasswordField; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_3 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_TEXTAREA)); + } + }; + boolean _exists_1 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_3); + if (_exists_1) { + YTypedSuspect _createTextAreaField = AutowireHelper.this.createTextAreaField(type, it); + suspect = _createTextAreaField; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_4 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_ORGANIZATION)); + } + }; + boolean _exists_2 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_4); + if (_exists_2) { + YTypedSuspect _createOrganizationComboBox = AutowireHelper.this.createOrganizationComboBox(type, it); + suspect = _createOrganizationComboBox; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_5 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_PERSPECTIVE)); + } + }; + boolean _exists_3 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_5); + if (_exists_3) { + YTypedSuspect _createPerspectiveComboBox = AutowireHelper.this.createPerspectiveComboBox(type, it); + suspect = _createPerspectiveComboBox; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_6 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equalsIgnoreCase(functionImagePicker)); + } + }; + boolean _exists_4 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_6); + if (_exists_4) { + YTypedSuspect _createIconComboBox = AutowireHelper.this.createIconComboBox(type, it); + suspect = _createIconComboBox; + } else { + YTypedSuspect _createTextField = AutowireHelper.this.createTextField(type, it); + suspect = _createTextField; + } + } + } + } + } + } + } + } + } + } + } else { + boolean _isDate = AutowireHelper.this._typeHelper.isDate(type); + if (_isDate) { + YTypedSuspect _createDateField = AutowireHelper.this.createDateField(type, it); + suspect = _createDateField; + } else { + boolean _isEnum = AutowireHelper.this._typeHelper.isEnum(type); + if (_isEnum) { + final Function1<AutowireUtil.Pair, Boolean> _function_7 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + String _lowerCase = it.key.toLowerCase(); + return Boolean.valueOf(_lowerCase.equals(ILayoutingStrategy.PROPERTY_OPTION_GROUP)); + } + }; + boolean _exists_5 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_7); + if (_exists_5) { + YTypedSuspect _createEnumOptionsGroup = AutowireHelper.this.createEnumOptionsGroup(type, it); + suspect = _createEnumOptionsGroup; + } else { + YTypedSuspect _createEnumComboBox = AutowireHelper.this.createEnumComboBox(type, it); + suspect = _createEnumComboBox; + } + } else { + boolean _isByteArray = AutowireHelper.this.isByteArray(type); + if (_isByteArray) { + final Function1<AutowireUtil.Pair, Boolean> _function_8 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equals(ILayoutingStrategy.PROPERTY_KEY__FIELD_TYPE)); + } + }; + AutowireUtil.Pair _findFirst_2 = IterableExtensions.<AutowireUtil.Pair>findFirst(properties, _function_8); + String _value_2 = null; + if (_findFirst_2!=null) { + _value_2=_findFirst_2.value; + } + final String fieldType_1 = _value_2; + boolean _and_6 = false; + boolean _isNullOrEmpty_4 = StringExtensions.isNullOrEmpty(fieldType_1); + boolean _not_8 = (!_isNullOrEmpty_4); + if (!_not_8) { + _and_6 = false; + } else { + boolean _equals_9 = fieldType_1.equals(ILayoutingStrategy.PROPERTY_RICH_TEXT); + _and_6 = _equals_9; + } + if (_and_6) { + YSuspect _createRichTextField_1 = AutowireHelper.this.createRichTextField(type, it); + suspect = _createRichTextField_1; + } else { + YSuspect _createBlopUploadComponent_1 = AutowireHelper.this.createBlopUploadComponent(type, it); + suspect = _createBlopUploadComponent_1; + } + } else { + boolean _isDomainReference = AutowireHelper.this._typeHelper.isDomainReference(it); + if (_isDomainReference) { + YTypedSuspect _createBeanReferenceField = AutowireHelper.this.createBeanReferenceField(type, it); + suspect = _createBeanReferenceField; + } else { + boolean _and_7 = false; + JvmField _field_2 = it.getField(); + boolean _notEquals_2 = (!Objects.equal(_field_2, null)); + if (!_notEquals_2) { + _and_7 = false; + } else { + JvmField _field_3 = it.getField(); + boolean _isCollection = AutowireHelper.this._typeHelper.isCollection(_field_3); + _and_7 = _isCollection; + } + if (_and_7) { + final Function1<AutowireUtil.Pair, Boolean> _function_9 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + String _lowerCase = it.key.toLowerCase(); + return Boolean.valueOf(_lowerCase.equals(ILayoutingStrategy.PROPERTY_GRID)); + } + }; + boolean _exists_6 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_9); + if (_exists_6) { + YTypedSuspect _createGrid = AutowireHelper.this.createGrid(type, it); + suspect = _createGrid; + } else { + final Function1<AutowireUtil.Pair, Boolean> _function_10 = new Function1<AutowireUtil.Pair, Boolean>() { + public Boolean apply(final AutowireUtil.Pair it) { + return Boolean.valueOf(it.key.equalsIgnoreCase(ILayoutingStrategy.PROPERTY_TABLE)); + } + }; + boolean _exists_7 = IterableExtensions.<AutowireUtil.Pair>exists(properties, _function_10); + if (_exists_7) { + YTypedSuspect _createTableField = AutowireHelper.this.createTableField(type, it); + suspect = _createTableField; + } + } + } else { + boolean _isDto = AutowireHelper.this.isDto(type); + if (_isDto) { + YSuspect _createDtoSuspect = AutowireHelper.this.createDtoSuspect(type, it); + suspect = _createDtoSuspect; + } + } + } + } + } + } + } + } + } + } + boolean _equals_10 = Objects.equal(parentSuspect, null); + if (_equals_10) { + AutowireHelper.this.completeSuspect(type, it, suspect); + } else { + AutowireHelper.this.completeSuspect(type, it, suspect, parentSuspect); + } + for (final AutowireUtil.Pair keyAndValue : properties) { + boolean _notEquals_3 = (!Objects.equal(suspect, null)); + if (_notEquals_3) { + EMap<String, String> _properties_1 = suspect.getProperties(); + String _lowerCase = keyAndValue.key.toLowerCase(); + _properties_1.put(_lowerCase, keyAndValue.value); + } + } + } + }; + _values.forEach(_function); + } + + public void createAuthorizationVisibilityProcessor(final YAuthorizationable element, final OperationExtensions.OperationInfo info) { + JvmField _field = info.getField(); + boolean _notEquals = (!Objects.equal(_field, null)); + if (_notEquals) { + JvmField _field_1 = info.getField(); + EObject _eContainer = _field_1.eContainer(); + final JvmGenericType type = ((JvmGenericType) _eContainer); + boolean _and = false; + JvmOperation _getter = info.getGetter(); + JvmTypeReference _returnType = _getter.getReturnType(); + JvmType _type = _returnType.getType(); + boolean _isClass = this._autowireUtil.isClass(_type); + boolean _not = (!_isClass); + if (!_not) { + _and = false; + } else { + JvmOperation _getter_1 = info.getGetter(); + JvmTypeReference _returnType_1 = _getter_1.getReturnType(); + JvmType _type_1 = _returnType_1.getType(); + boolean _isAllowed = this._autowireUtil.isAllowed(_type_1, type, info); + _and = _isAllowed; + } + if (_and) { + QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(type); + String _string = _fullyQualifiedName.toString(); + element.setAuthorizationGroup(_string); + JvmField _field_2 = info.getField(); + String _simpleName = _field_2.getSimpleName(); + element.setAuthorizationId(_simpleName); + } + } + } + + public YSuspect createDtoSuspect(final JvmType type, final OperationExtensions.OperationInfo info) { + final YTypedCompoundSuspect dtoSuspect = YECviewFactory.eINSTANCE.createYTypedCompoundSuspect(); + EList<String> _tags = dtoSuspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__DTO); + if ((type instanceof JvmDeclaredType)) { + this.createSuspectStructure(((JvmDeclaredType)type), false, dtoSuspect); + } + return dtoSuspect; + } + + /** + * A suspect that is created for each sub type of beanType.<br> + * 1) we create a compound suspect<br> + * 2) we add the compound suspect to the layout<br> + * 3) we create a typed suspect for each operation info<br> + * 4) we add the new typed suspect to the compound suspect and create a tree<br> + */ + public YSuspect createSubTypeDtoSuspect(final JvmDeclaredType subDtoJvmType) { + final YSubTypeSuspect subTypeSuspect = YECviewFactory.eINSTANCE.createYSubTypeSuspect(); + EList<String> _tags = subTypeSuspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__SUBTYPE); + String _qualifiedName = subDtoJvmType.getQualifiedName(); + subTypeSuspect.setTypeQualifiedName(_qualifiedName); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _typeQualifiedName = subTypeSuspect.getTypeQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _typeQualifiedName); + subTypeSuspect.setType(_loadClass); + final YView view = this.computer.getCurrentView(); + String _typeQualifiedName_1 = subTypeSuspect.getTypeQualifiedName(); + Class<?> _type = subTypeSuspect.getType(); + final YDetailBeanSlot detailSlot = view.addDetailBeanSlot(_typeQualifiedName_1, _type, + this.yMainBeanslot, ""); + EList<String> _tags_1 = detailSlot.getTags(); + _tags_1.add(ILayoutingStrategy.TAG__SUBTYPE); + subTypeSuspect.setBeanSlot(detailSlot); + this.layouter.add(subTypeSuspect); + this.layouter.pushHierarchy(subTypeSuspect); + Map<String, OperationExtensions.OperationInfo> _operationInfos = OperationExtensions.getOperationInfos(subDtoJvmType, false); + final LinkedList<Map<String, OperationExtensions.OperationInfo>> subTypeInfos = this.createSortedMapList(_operationInfos); + this.createSuspectStructure(subTypeInfos, subDtoJvmType, this.mobile, subTypeSuspect); + this.layouter.popHierarchy(); + return subTypeSuspect; + } + + /** + * Returns true, if the type is a dto. + */ + public boolean isDto(final JvmType type) { + final SuperTypeCollector collector = new SuperTypeCollector(); + final Set<String> superTypes = collector.collectSuperTypeNames(type); + String _name = IDto.class.getName(); + return superTypes.contains(_name); + } + + public void completeSuspect(final JvmType type, final OperationExtensions.OperationInfo info, final YSuspect suspect) { + boolean _notEquals = (!Objects.equal(suspect, null)); + if (_notEquals) { + StringConcatenation _builder = new StringConcatenation(); + String _generateId = this._autowireUtil.generateId(this.uiLayout); + _builder.append(_generateId, ""); + _builder.append("."); + String _name = info.getName(); + _builder.append(_name, ""); + suspect.setId(_builder.toString()); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags = suspect.getTags(); + _tags.add("readonly"); + } + boolean _isValidationConstraint = this.isValidationConstraint(info); + if (_isValidationConstraint) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("constraint"); + String _id = info.getId(); + String[] splittedId = _id.split(":"); + int _length = splittedId.length; + boolean _greaterThan = (_length > 1); + if (_greaterThan) { + String fqClassName = splittedId[0]; + EMap<String, String> _properties = suspect.getProperties(); + _properties.put("class", fqClassName); + } + EMap<String, String> _properties_1 = suspect.getProperties(); + String _name_1 = info.getName(); + _properties_1.put("name", _name_1); + } + this.layouter.add(suspect); + boolean _and = false; + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + if (!_notEquals_1) { + _and = false; + } else { + JvmField _field_1 = info.getField(); + boolean _isCollection = this._typeHelper.isCollection(_field_1); + _and = _isCollection; + } + if (_and) { + this.createModelListBinding(suspect, info, type, "list"); + } else { + String _name_2 = info.getName(); + this.createBinding(suspect, _name_2, type, "value"); + } + this.createAuthorizationVisibilityProcessor(suspect, info); + } + } + + public void completeSuspect(final JvmType type, final OperationExtensions.OperationInfo info, final YSuspect suspect, final YTypedCompoundSuspect parentSuspect) { + boolean _notEquals = (!Objects.equal(suspect, null)); + if (_notEquals) { + StringConcatenation _builder = new StringConcatenation(); + String _id = parentSuspect.getId(); + _builder.append(_id, ""); + _builder.append("."); + String _name = info.getName(); + _builder.append(_name, ""); + suspect.setId(_builder.toString()); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags = suspect.getTags(); + _tags.add("readonly"); + } + boolean _isValidationConstraint = this.isValidationConstraint(info); + if (_isValidationConstraint) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("constraint"); + String _id_1 = info.getId(); + String[] splittedId = _id_1.split(":"); + int _length = splittedId.length; + boolean _greaterThan = (_length > 1); + if (_greaterThan) { + String fqClassName = splittedId[0]; + EMap<String, String> _properties = suspect.getProperties(); + _properties.put("class", fqClassName); + } + EMap<String, String> _properties_1 = suspect.getProperties(); + String _name_1 = info.getName(); + _properties_1.put("name", _name_1); + } + EList<YSuspect> _children = parentSuspect.getChildren(); + _children.add(suspect); + boolean _and = false; + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + if (!_notEquals_1) { + _and = false; + } else { + JvmField _field_1 = info.getField(); + boolean _isCollection = this._typeHelper.isCollection(_field_1); + _and = _isCollection; + } + if (_and) { + this.createModelListBinding(suspect, info, type, "list"); + } else { + String _name_2 = info.getName(); + this.createBinding(suspect, _name_2, type, "value"); + } + this.createAuthorizationVisibilityProcessor(suspect, info); + } + } + + /** + * Sorted the attributes with the primitive types first and the rest after. Also all collections were left out. + */ + public LinkedHashMap<String, OperationExtensions.OperationInfo> createSortedOpInfoMapForCollections(final Map<String, OperationExtensions.OperationInfo> opInfoMap) { + LinkedHashMap<String, OperationExtensions.OperationInfo> _xblockexpression = null; + { + final LinkedHashMap<String, OperationExtensions.OperationInfo> sortedOpInfoList = CollectionLiterals.<String, OperationExtensions.OperationInfo>newLinkedHashMap(); + final LinkedHashMap<String, OperationExtensions.OperationInfo> nonPrimitiveOpInfoMap = CollectionLiterals.<String, OperationExtensions.OperationInfo>newLinkedHashMap(); + final BiConsumer<String, OperationExtensions.OperationInfo> _function = new BiConsumer<String, OperationExtensions.OperationInfo>() { + public void accept(final String key, final OperationExtensions.OperationInfo opInfo) { + JvmType detailType = null; + boolean _and = false; + JvmField _field = opInfo.getField(); + boolean _notEquals = (!Objects.equal(_field, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field_1 = opInfo.getField(); + boolean _isCollection = AutowireHelper.this._typeHelper.isCollection(_field_1); + boolean _not = (!_isCollection); + _and = _not; + } + if (_and) { + JvmOperation _getter = opInfo.getGetter(); + JvmTypeReference _returnType = _getter.getReturnType(); + JvmType _type = _returnType.getType(); + detailType = _type; + boolean _or = false; + if ((detailType instanceof JvmPrimitiveType)) { + _or = true; + } else { + String _qualifiedName = detailType.getQualifiedName(); + String _name = String.class.getName(); + boolean _equals = _qualifiedName.equals(_name); + _or = _equals; + } + final boolean isPrimitive = _or; + if (isPrimitive) { + sortedOpInfoList.put(key, opInfo); + } else { + nonPrimitiveOpInfoMap.put(key, opInfo); + } + } + } + }; + opInfoMap.forEach(_function); + sortedOpInfoList.putAll(nonPrimitiveOpInfoMap); + _xblockexpression = sortedOpInfoList; + } + return _xblockexpression; + } + + /** + * Sorted the attributes in a individual but fix order. + */ + public LinkedList<Map<String, OperationExtensions.OperationInfo>> createSortedMapList(final Map<String, OperationExtensions.OperationInfo> opInfoMap) { + LinkedList<Map<String, OperationExtensions.OperationInfo>> _xblockexpression = null; + { + final LinkedList<Map<String, OperationExtensions.OperationInfo>> sortedOpInfoList = CollectionLiterals.<Map<String, OperationExtensions.OperationInfo>>newLinkedList(); + sortedOpInfoList.add(opInfoMap); + _xblockexpression = sortedOpInfoList; + } + return _xblockexpression; + } + + public boolean isDomainKey(final OperationExtensions.OperationInfo info) { + boolean _and = false; + boolean _notEquals = (!Objects.equal(info, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + _and = _notEquals_1; + } + if (_and) { + JvmField _field_1 = info.getField(); + EList<JvmAnnotationReference> _annotations = _field_1.getAnnotations(); + for (final JvmAnnotationReference annotationRefs : _annotations) { + String _canonicalName = DomainKey.class.getCanonicalName(); + JvmAnnotationType _annotation = annotationRefs.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + boolean _equals = _canonicalName.equals(_identifier); + if (_equals) { + return true; + } + } + } + return false; + } + + public boolean isDomainDescription(final OperationExtensions.OperationInfo info) { + boolean _and = false; + boolean _notEquals = (!Objects.equal(info, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + _and = _notEquals_1; + } + if (_and) { + JvmField _field_1 = info.getField(); + EList<JvmAnnotationReference> _annotations = _field_1.getAnnotations(); + for (final JvmAnnotationReference annotationRefs : _annotations) { + String _canonicalName = DomainDescription.class.getCanonicalName(); + JvmAnnotationType _annotation = annotationRefs.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + boolean _equals = _canonicalName.equals(_identifier); + if (_equals) { + return true; + } + } + } + return false; + } + + public boolean isValidationConstraint(final OperationExtensions.OperationInfo info) { + boolean _and = false; + boolean _notEquals = (!Objects.equal(info, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + _and = _notEquals_1; + } + if (_and) { + JvmField _field_1 = info.getField(); + EList<JvmAnnotationReference> _annotations = _field_1.getAnnotations(); + for (final JvmAnnotationReference annotationRefs : _annotations) { + boolean _and_1 = false; + JvmAnnotationType _annotation = annotationRefs.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + boolean _notEquals_2 = (!Objects.equal(_identifier, null)); + if (!_notEquals_2) { + _and_1 = false; + } else { + JvmAnnotationType _annotation_1 = annotationRefs.getAnnotation(); + String _identifier_1 = _annotation_1.getIdentifier(); + String _canonicalName = Constraint.class.getCanonicalName(); + String _lowerCase = _canonicalName.toLowerCase(); + boolean _startsWith = _identifier_1.startsWith(_lowerCase); + _and_1 = _startsWith; + } + if (_and_1) { + return true; + } + } + } + return false; + } + + public boolean isIndex(final OperationExtensions.OperationInfo info) { + boolean _and = false; + boolean _notEquals = (!Objects.equal(info, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field = info.getField(); + boolean _notEquals_1 = (!Objects.equal(_field, null)); + _and = _notEquals_1; + } + if (_and) { + JvmField _field_1 = info.getField(); + EList<JvmAnnotationReference> _annotations = _field_1.getAnnotations(); + for (final JvmAnnotationReference annotationRefs : _annotations) { + String _canonicalName = DomainKey.class.getCanonicalName(); + JvmAnnotationType _annotation = annotationRefs.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + boolean _equals = _canonicalName.equals(_identifier); + if (_equals) { + return true; + } + } + } + return false; + } + + /** + * Returns true, if the type is boolean + * + * @param type + * @return + */ + public boolean isByteArray(final JvmType type) { + boolean _equals = Objects.equal(type, null); + if (_equals) { + return false; + } + boolean _or = false; + boolean _isArray = this.isArray(type, Byte.class); + if (_isArray) { + _or = true; + } else { + boolean _isArray_1 = this.isArray(type, Byte.TYPE); + _or = _isArray_1; + } + if (_or) { + return true; + } + return false; + } + + public boolean isArray(final JvmType type, final Class<?> clazz) { + boolean _equals = Objects.equal(type, null); + if (_equals) { + return false; + } + String className = clazz.getName(); + char _charAt = className.charAt(0); + boolean _equals_1 = Objects.equal(Character.valueOf(_charAt), "["); + if (_equals_1) { + String _canonicalName = clazz.getCanonicalName(); + className = _canonicalName; + } + String _concat = className.concat("[]"); + className = _concat; + String _identifier = type.getIdentifier(); + boolean result = className.equals(_identifier); + return result; + } + + public YTypedSuspect createTextField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__TEXT); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createSuggestTextField(final JvmType type, final OperationExtensions.OperationInfo info, final Map<String, OperationExtensions.OperationInfo> opInfoMap) { + YTypedSuspect _xblockexpression = null; + { + Collection<OperationExtensions.OperationInfo> _values = opInfoMap.values(); + final OperationExtensions.OperationInfo idAttInfo = this.getToIdInfo(_values); + boolean _equals = Objects.equal(idAttInfo, null); + if (_equals) { + return this.createTextField(type, info); + } + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__SUGGEST_TEXT); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = this.beanType.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = this.beanType.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + EMap<String, String> _properties = suspect.getProperties(); + String _name = info.getName(); + _properties.put(ILayoutingStrategy.PROPERTY__ITEM_CAPTION, _name); + EMap<String, String> _properties_1 = suspect.getProperties(); + String _name_1 = info.getName(); + _properties_1.put(ILayoutingStrategy.PROPERTY__ITEM_FILTER, _name_1); + EMap<String, String> _properties_2 = suspect.getProperties(); + String _name_2 = idAttInfo.getName(); + _properties_2.put(ILayoutingStrategy.PROPERTY__ITEM_UUID, _name_2); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + /** + * Returns the operation info for the id property. + */ + public OperationExtensions.OperationInfo getToIdInfo(final Collection<OperationExtensions.OperationInfo> infos) { + for (final OperationExtensions.OperationInfo info : infos) { + boolean _or = false; + String _name = info.getName(); + boolean _equals = _name.equals("id"); + if (_equals) { + _or = true; + } else { + String _name_1 = info.getName(); + boolean _equals_1 = _name_1.equals("uuid"); + _or = _equals_1; + } + if (_or) { + return info; + } + } + return null; + } + + public YTypedSuspect createTextAreaField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__TEXTAREA); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createDecimalField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__DECIMAL); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createNumberField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__NUMBER); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createCheckbox(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__BOOLEAN); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createDateField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__DATE); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createIconComboBox(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__IMAGE_PICKER); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createEnumComboBox(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__ENUM_COMBO); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("readonly"); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createOrganizationComboBox(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__ORGANIZATION_COMBO); + suspect.setType(String.class); + String _name = String.class.getName(); + suspect.setTypeQualifiedName(_name); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("readonly"); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createPerspectiveComboBox(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__PERSPECTIVE_COMBO); + suspect.setType(String.class); + String _name = String.class.getName(); + suspect.setTypeQualifiedName(_name); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("readonly"); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createEnumOptionsGroup(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__ENUM_OPTIONS); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + StringConcatenation _builder = new StringConcatenation(); + String _generateId = this._autowireUtil.generateId(this.uiLayout); + _builder.append(_generateId, ""); + _builder.append("."); + String _name = info.getName(); + _builder.append(_name, ""); + suspect.setId(_builder.toString()); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("readonly"); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createBeanReferenceField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + Class<?> _type = suspect.getType(); + String captionProperty = BeanHelper.findCaptionProperty(_type); + Class<?> _type_1 = suspect.getType(); + String captionDescription = BeanHelper.findDescriptionProperty(_type_1); + boolean _or = false; + boolean _notEquals = (!Objects.equal(captionProperty, null)); + if (_notEquals) { + _or = true; + } else { + boolean _notEquals_1 = (!Objects.equal(captionDescription, null)); + _or = _notEquals_1; + } + if (_or) { + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__BEAN_REFERENCE); + StringConcatenation _builder = new StringConcatenation(); + String _generateId = this._autowireUtil.generateId(this.uiLayout); + _builder.append(_generateId, ""); + _builder.append("."); + String _name = info.getName(); + _builder.append(_name, ""); + suspect.setId(_builder.toString()); + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add("readonly"); + } + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + EMap<String, String> _properties = suspect.getProperties(); + _properties.put(ILayoutingStrategy.PROPERTY__ITEM_CAPTION, captionProperty); + EMap<String, String> _properties_1 = suspect.getProperties(); + _properties_1.put(ILayoutingStrategy.PROPERTY__ITEM_DESCRIPTION, captionDescription); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YTypedSuspect createTableField(final JvmType type, final OperationExtensions.OperationInfo info) { + return this.createCollection(type, info, ILayoutingStrategy.TAG__TABLE); + } + + public YTypedSuspect createGrid(final JvmType type, final OperationExtensions.OperationInfo info) { + return this.createCollection(type, info, ILayoutingStrategy.TAG__GRID); + } + + public YTypedSuspect createCollection(final JvmType type, final OperationExtensions.OperationInfo info, final String tag) { + YCollectionSuspect _xblockexpression = null; + { + final YCollectionSuspect suspect = YECviewFactory.eINSTANCE.createYCollectionSuspect(); + JvmOperation _getter = info.getGetter(); + JvmTypeReference _returnType = _getter.getReturnType(); + final JvmParameterizedTypeReference collectionType = ((JvmParameterizedTypeReference) _returnType); + EList<JvmTypeReference> _arguments = collectionType.getArguments(); + final JvmTypeReference typeInCollection = _arguments.get(0); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + JvmType _type = typeInCollection.getType(); + String _qualifiedName = _type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + EList<String> _tags = suspect.getTags(); + _tags.add(tag); + JvmType _type_1 = typeInCollection.getType(); + String _qualifiedName_1 = _type_1.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + JvmType _type_2 = typeInCollection.getType(); + if ((_type_2 instanceof JvmDeclaredType)) { + JvmType _type_3 = typeInCollection.getType(); + final JvmDeclaredType castedType = ((JvmDeclaredType) _type_3); + final Map<String, List<AutowireUtil.Pair>> propMap = this._autowireUtil.toFieldProperties(castedType); + final Map<String, OperationExtensions.OperationInfo> opInfoMap = OperationExtensions.getOperationInfos(castedType); + final LinkedHashMap<String, OperationExtensions.OperationInfo> sortedOpInfoMap = this.createSortedOpInfoMapForCollections(opInfoMap); + Collection<OperationExtensions.OperationInfo> _values = sortedOpInfoMap.values(); + final Consumer<OperationExtensions.OperationInfo> _function = new Consumer<OperationExtensions.OperationInfo>() { + public void accept(final OperationExtensions.OperationInfo it) { + JvmOperation _getter = it.getGetter(); + JvmTypeReference _returnType = _getter.getReturnType(); + JvmType detailType = _returnType.getType(); + YColumnInfo columnInfo = null; + final boolean isPrimitive = (detailType instanceof JvmPrimitiveType); + boolean _isDomainReference = AutowireHelper.this._typeHelper.isDomainReference(it); + if (_isDomainReference) { + Map<String, JvmTypeProperties.Info> _operationInfos = JvmTypeProperties.getOperationInfos(((JvmDeclaredType) detailType)); + Collection<JvmTypeProperties.Info> _values = _operationInfos.values(); + for (final JvmTypeProperties.Info nestedInfo : _values) { + boolean _hasAnnotation = nestedInfo.hasAnnotation(DomainKey.class); + if (_hasAnnotation) { + final Map<String, List<AutowireUtil.Pair>> nestPropMap = AutowireHelper.this._autowireUtil.toFieldProperties(((JvmDeclaredType) detailType)); + JvmType _type = nestedInfo.getType(); + YColumnInfo _createYColumnInfo = AutowireHelper.this.createYColumnInfo(_type); + columnInfo = _createYColumnInfo; + JvmField _field = it.getField(); + JvmTypeReference _type_1 = _field.getType(); + String _simpleName = _type_1.getSimpleName(); + String _plus = (_simpleName + "."); + String _attributePath = nestedInfo.getAttributePath(); + String _plus_1 = (_plus + _attributePath); + columnInfo.setName(_plus_1); + String _name = nestedInfo.getName(); + List<AutowireUtil.Pair> propList = nestPropMap.get(_name); + AutowireHelper.this.setYColumnInfoProperties(columnInfo, propList); + } + } + } else { + JvmField _field_1 = it.getField(); + JvmTypeReference _type_2 = _field_1.getType(); + JvmType objectType = _type_2.getType(); + if (isPrimitive) { + JvmField _field_2 = it.getField(); + JvmTypeReference _type_3 = _field_2.getType(); + JvmType _type_4 = _type_3.getType(); + final String primitiveTypeName = _type_4.getQualifiedName(); + JvmVoid _createJvmVoid = TypesFactory.eINSTANCE.createJvmVoid(); + final InternalEObject proxy = ((InternalEObject) _createJvmVoid); + String _objectProxy = AutowireHelper.this.toObjectProxy(primitiveTypeName); + URI _createURI = URI.createURI(_objectProxy); + proxy.eSetProxyURI(_createURI); + Resource _eResource = AutowireHelper.this.uiLayout.eResource(); + EObject _resolve = EcoreUtil.resolve(proxy, _eResource); + objectType = ((JvmType) _resolve); + } + YColumnInfo _createYColumnInfo_1 = AutowireHelper.this.createYColumnInfo(objectType); + columnInfo = _createYColumnInfo_1; + String _name_1 = it.getName(); + columnInfo.setName(_name_1); + JvmField _field_3 = it.getField(); + String _identifier = _field_3.getIdentifier(); + List<AutowireUtil.Pair> propList_1 = propMap.get(_identifier); + AutowireHelper.this.setYColumnInfoProperties(columnInfo, propList_1); + } + boolean _notEquals = (!Objects.equal(columnInfo, null)); + if (_notEquals) { + String _name_2 = columnInfo.getName(); + columnInfo.setLabelI18nKey(_name_2); + EList<YColumnInfo> _columns = suspect.getColumns(); + _columns.add(columnInfo); + } + } + }; + _values.forEach(_function); + } + _xblockexpression = suspect; + } + return _xblockexpression; + } + + /** + * Creates a proxy object + */ + public String toObjectProxy(final String primitiveTypeName) { + boolean _matched = false; + if (!_matched) { + if (Objects.equal(primitiveTypeName, "int")) { + _matched=true; + StringConcatenation _builder = new StringConcatenation(); + _builder.append("java:/Objects/java.lang.Integer#java.lang.Integer"); + return _builder.toString(); + } + } + StringConcatenation _builder_1 = new StringConcatenation(); + _builder_1.append("java:/Objects/java.lang."); + String _firstUpper = StringExtensions.toFirstUpper(primitiveTypeName); + _builder_1.append(_firstUpper, ""); + _builder_1.append("#java.lang."); + String _firstUpper_1 = StringExtensions.toFirstUpper(primitiveTypeName); + _builder_1.append(_firstUpper_1, ""); + return _builder_1.toString(); + } + + public void createMobileSwitch(final JvmType type, final OperationExtensions.OperationInfo info) { + final VMSwitch yField = this.vFactory.createVMSwitch(); + boolean _isReadonly = info.isReadonly(); + boolean _not = (!_isReadonly); + yField.setInitialEnabled(_not); + String _name = info.getName(); + yField.setLabel(_name); + this.layouter.add(yField); + this.createBinding(yField, info, type, "value"); + } + + public YSuspect createRichTextField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + boolean _isString = this._typeHelper.isString(type); + if (_isString) { + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__RICH_TEXT__STRING); + } else { + boolean _isByteArray = this.isByteArray(type); + if (_isByteArray) { + EList<String> _tags_1 = suspect.getTags(); + _tags_1.add(ILayoutingStrategy.TAG__RICH_TEXT__BLOB); + } else { + String _qualifiedName = type.getQualifiedName(); + String _plus = ("RichTextFields need to be bound to String or byte[]. " + _qualifiedName); + String _plus_1 = (_plus + " is not a valid option."); + throw new IllegalArgumentException(_plus_1); + } + } + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName_1 = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName_1); + suspect.setType(_loadClass); + String _qualifiedName_2 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_2); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YSuspect createMaskedTextField(final JvmType type, final OperationExtensions.OperationInfo info, final String mask) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__MASKED_TEXT_FIELD); + EMap<String, String> _properties = suspect.getProperties(); + _properties.put(ILayoutingStrategy.PROPERTY_MASK, mask); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YSuspect createMaskedDecimalField(final JvmType type, final OperationExtensions.OperationInfo info, final String mask) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__MASKED_DECIMAL_FIELD); + EMap<String, String> _properties = suspect.getProperties(); + _properties.put(ILayoutingStrategy.PROPERTY_MASK, mask); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YSuspect createPasswordField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + boolean _isString = this._typeHelper.isString(type); + if (_isString) { + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__PASSWORD); + } else { + String _qualifiedName = type.getQualifiedName(); + String _plus = ("PasswordField need to be bound to String. " + _qualifiedName); + String _plus_1 = (_plus + " is not a valid option."); + throw new IllegalArgumentException(_plus_1); + } + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName_1 = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName_1); + suspect.setType(_loadClass); + String _qualifiedName_2 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_2); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YSuspect createBlopUploadComponent(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__BLOB); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + public YSuspect createCustomDecimalField(final JvmType type, final OperationExtensions.OperationInfo info) { + YTypedSuspect _xblockexpression = null; + { + final YTypedSuspect suspect = YECviewFactory.eINSTANCE.createYTypedSuspect(); + EList<String> _tags = suspect.getTags(); + _tags.add(ILayoutingStrategy.TAG__DECIMAL); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = type.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + suspect.setType(_loadClass); + String _qualifiedName_1 = type.getQualifiedName(); + suspect.setTypeQualifiedName(_qualifiedName_1); + _xblockexpression = suspect; + } + return _xblockexpression; + } + + /** + * Create the bindings and install at the view + */ + public void createBinding(final YEmbeddable yField, final OperationExtensions.OperationInfo info, final JvmType type, final String fieldProperty) { + UiBindingExpression _autoWireSource = this.uiLayout.getAutoWireSource(); + final UiBindingEndpointAssignment uiModelEndpoint = ((UiBindingEndpointAssignment) _autoWireSource); + final YValueBindingEndpoint yModelEndpoint = this.computer.createValueBindingEndpoint(uiModelEndpoint); + final YDetailValueBindingEndpoint detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint(); + String _name = info.getName(); + detailValueEndpoint.setPropertyPath(_name); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = this.beanType.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + detailValueEndpoint.setType(_loadClass); + final YECViewModelValueBindingEndpoint yFieldEndpoint = BindingFactory.eINSTANCE.createYECViewModelValueBindingEndpoint(); + yFieldEndpoint.setElement(yField); + yFieldEndpoint.setPropertyPath(fieldProperty); + String _qualifiedName_1 = this.beanType.getQualifiedName(); + yFieldEndpoint.setTypeQualifiedName(_qualifiedName_1); + Resource _eResource_1 = this.uiLayout.eResource(); + ResourceSet _resourceSet_1 = _eResource_1.getResourceSet(); + String _qualifiedName_2 = this.beanType.getQualifiedName(); + Class<?> _loadClass_1 = this.computer.loadClass(_resourceSet_1, _qualifiedName_2); + yFieldEndpoint.setType(_loadClass_1); + boolean _and = false; + Class<?> _type = yFieldEndpoint.getType(); + boolean _notEquals = (!Objects.equal(_type, null)); + if (!_notEquals) { + _and = false; + } else { + Class<?> _type_1 = yFieldEndpoint.getType(); + boolean _isAssignableFrom = _type_1.isAssignableFrom(EObject.class); + _and = _isAssignableFrom; + } + if (_and) { + EClass _eClass = yField.eClass(); + EPackage _ePackage = _eClass.getEPackage(); + String _nsURI = _ePackage.getNsURI(); + yFieldEndpoint.setEmfNsURI(_nsURI); + } + final YValueBinding yBinding = BindingFactory.eINSTANCE.createYValueBinding(); + yBinding.setTargetEndpoint(yFieldEndpoint); + yBinding.setModelEndpoint(detailValueEndpoint); + yBinding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE); + YBindingUpdateStrategy _xifexpression = null; + boolean _isReadonly = info.isReadonly(); + if (_isReadonly) { + _xifexpression = YBindingUpdateStrategy.NEVER; + } else { + _xifexpression = YBindingUpdateStrategy.UPDATE; + } + yBinding.setTargetToModelStrategy(_xifexpression); + YView _view = this.yLayout.getView(); + YBindingSet _orCreateBindingSet = _view.getOrCreateBindingSet(); + EList<YBinding> _bindings = _orCreateBindingSet.getBindings(); + _bindings.add(yBinding); + String _propertyPath = detailValueEndpoint.getPropertyPath(); + yField.setLabelI18nKey(_propertyPath); + } + + /** + * Create the bindings and install at the view + */ + public void createBinding(final YSuspect suspect, final String propertyPath, final JvmType type, final String fieldProperty) { + final YBeanSlot subTypeBeanSlot = this.findSubTypeBeanSlot(suspect); + YValueBindingEndpoint endpoint = null; + String path = ""; + boolean _equals = Objects.equal(subTypeBeanSlot, null); + if (_equals) { + UiBindingExpression _autoWireSource = this.uiLayout.getAutoWireSource(); + final UiBindingEndpointAssignment uiModelEndpoint = ((UiBindingEndpointAssignment) _autoWireSource); + final YValueBindingEndpoint yModelEndpoint = this.computer.createValueBindingEndpoint(uiModelEndpoint); + final YDetailValueBindingEndpoint detailValueEndpoint = yModelEndpoint.createDetailValueEndpoint(); + detailValueEndpoint.setPropertyPath(propertyPath); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _qualifiedName = this.beanType.getQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _qualifiedName); + detailValueEndpoint.setType(_loadClass); + endpoint = detailValueEndpoint; + String _propertyPath = detailValueEndpoint.getPropertyPath(); + path = _propertyPath; + } else { + YBeanSlotValueBindingEndpoint _createBindingEndpoint = subTypeBeanSlot.createBindingEndpoint(propertyPath); + endpoint = _createBindingEndpoint; + path = propertyPath; + } + EList<YBindingEndpoint> _valueBindingEndpoints = suspect.getValueBindingEndpoints(); + _valueBindingEndpoints.add(endpoint); + suspect.setLabelI18nKey(path); + suspect.setLabel(propertyPath); + } + + /** + * Checks if the suspect is contained in an YSubTypeSuspect. <br> + * If so, then the detail beanslot of the YSubTypeSuspect is returned. Null otherwise. + */ + public YBeanSlot findSubTypeBeanSlot(final YSuspect suspect) { + boolean _equals = Objects.equal(suspect, null); + if (_equals) { + return null; + } + if ((suspect instanceof YSubTypeSuspect)) { + return ((YSubTypeSuspect)suspect).getBeanSlot(); + } + final EObject parent = suspect.eContainer(); + if ((parent instanceof YSuspect)) { + return this.findSubTypeBeanSlot(((YSuspect)parent)); + } + return null; + } + + /** + * Create the bindings and install at the view + */ + public void createModelListBinding(final YSuspect suspect, final OperationExtensions.OperationInfo info, final JvmType type, final String fieldProperty) { + UiBindingExpression _autoWireSource = this.uiLayout.getAutoWireSource(); + final UiBindingEndpointAssignment uiModelEndpoint = ((UiBindingEndpointAssignment) _autoWireSource); + String _name = info.getName(); + final YListBindingEndpoint yModelEndpoint = this.createListBindingEndpointWithNested(uiModelEndpoint, _name); + EList<YBindingEndpoint> _valueBindingEndpoints = suspect.getValueBindingEndpoints(); + _valueBindingEndpoints.add(yModelEndpoint); + String _name_1 = info.getName(); + suspect.setLabelI18nKey(_name_1); + String _name_2 = info.getName(); + suspect.setLabel(_name_2); + } + + /** + * Creates a listbinding with respect to nested collection fields. <p> + * For instance:<br> + * beanSlot contains Person. We want to bind the children of persons father to a table. + * So we need to access the children collection of the beanslot by a nested property path: <code>beanslot.father.children</code> + */ + public YListBindingEndpoint createListBindingEndpointWithNested(final UiBindingEndpointAssignment epDef, final String attributePath) { + boolean _equals = Objects.equal(epDef, null); + if (_equals) { + return null; + } + YListBindingEndpoint result = null; + final BindingInfoHelper.BindingInfo info = new BindingInfoHelper.BindingInfo(); + this.bindingInfoHelper.collectBindingInfo(epDef, info); + EObject _bindingRoot = info.getBindingRoot(); + if ((_bindingRoot instanceof UiBeanSlot)) { + EObject _bindingRoot_1 = info.getBindingRoot(); + final UiBeanSlot uiBeanSlot = ((UiBeanSlot) _bindingRoot_1); + final YBeanSlot yBeanSlot = this.computer.<YBeanSlot>associatedUi(uiBeanSlot); + final YBeanSlotListBindingEndpoint ep = this.factory.createBeanSlotListBindingEndpoint(); + ep.setBeanSlot(yBeanSlot); + String _nestedCollectionPath = this.toNestedCollectionPath(info, attributePath); + ep.setAttributePath(_nestedCollectionPath); + result = ep; + } else { + EObject _bindingRoot_2 = info.getBindingRoot(); + if ((_bindingRoot_2 instanceof UiEmbeddable)) { + EObject _bindingRoot_3 = info.getBindingRoot(); + final YEmbeddable yElement = this.computer.<YEmbeddable>associatedUi(_bindingRoot_3); + final YECViewModelListBindingEndpoint ep_1 = this.factory.createECViewModelListBindingEndpoint(); + ep_1.setElement(yElement); + String _nestedCollectionPath_1 = this.toNestedCollectionPath(info, attributePath); + ep_1.setPropertyPath(_nestedCollectionPath_1); + JvmType _typeForBinding = info.getTypeForBinding(); + boolean _notEquals = (!Objects.equal(_typeForBinding, null)); + if (_notEquals) { + JvmType _typeForBinding_1 = info.getTypeForBinding(); + String _qualifiedName = _typeForBinding_1.getQualifiedName(); + ep_1.setTypeQualifiedName(_qualifiedName); + Resource _eResource = epDef.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _typeQualifiedName = ep_1.getTypeQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _typeQualifiedName); + ep_1.setType(_loadClass); + } + boolean _notEquals_1 = (!Objects.equal(yElement, null)); + if (_notEquals_1) { + EClass _eClass = yElement.eClass(); + EPackage _ePackage = _eClass.getEPackage(); + String _nsURI = _ePackage.getNsURI(); + ep_1.setEmfNsURI(_nsURI); + } + result = ep_1; + } + } + return result; + } + + public String toNestedCollectionPath(final BindingInfoHelper.BindingInfo info, final String attributePath) { + String _xblockexpression = null; + { + final StringBuilder b = new StringBuilder(); + StringBuilder _path = info.getPath(); + String _string = _path.toString(); + boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_string); + boolean _not = (!_isNullOrEmpty); + if (_not) { + StringBuilder _path_1 = info.getPath(); + String _string_1 = _path_1.toString(); + b.append(_string_1); + } + boolean _isNullOrEmpty_1 = StringExtensions.isNullOrEmpty(attributePath); + boolean _not_1 = (!_isNullOrEmpty_1); + if (_not_1) { + int _length = b.length(); + boolean _greaterThan = (_length > 0); + if (_greaterThan) { + b.append("."); + } + b.append(attributePath); + } + final String pathResult = b.toString(); + _xblockexpression = pathResult; + } + return _xblockexpression; + } + + /** + * Creates y column info element + */ + public YColumnInfo createYColumnInfo(final JvmType type) { + YColumnInfo _xblockexpression = null; + { + final YColumnInfo columnInfo = YECviewFactory.eINSTANCE.createYColumnInfo(); + String _qualifiedName = type.getQualifiedName(); + columnInfo.setTypeQualifiedName(_qualifiedName); + Resource _eResource = this.uiLayout.eResource(); + ResourceSet _resourceSet = _eResource.getResourceSet(); + String _typeQualifiedName = columnInfo.getTypeQualifiedName(); + Class<?> _loadClass = this.computer.loadClass(_resourceSet, _typeQualifiedName); + columnInfo.setType(_loadClass); + _xblockexpression = columnInfo; + } + return _xblockexpression; + } + + /** + * Sets properties into y column info + */ + public void setYColumnInfoProperties(final YColumnInfo columnInfo, final List<AutowireUtil.Pair> propList) { + EMap<String, String> properties = columnInfo.getProperties(); + boolean _notEquals = (!Objects.equal(propList, null)); + if (_notEquals) { + for (final AutowireUtil.Pair prop : propList) { + properties.put(prop.key, prop.value); + } + } + } +} diff --git a/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java new file mode 100644 index 0000000..f5d89bb --- /dev/null +++ b/org.eclipse.osbp.autowireHelper/xtend-gen/org/eclipse/osbp/autowirehelper/utils/AutowireUtil.java @@ -0,0 +1,487 @@ +/** + * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) + * + * 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: + * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation + * + * + * This copyright notice shows up in the generated Java code + */ +package org.eclipse.osbp.autowirehelper.utils; + +import com.google.common.base.Objects; +import com.google.common.collect.Iterables; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import javax.inject.Inject; +import org.apache.commons.lang.StringEscapeUtils; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.osbp.dsl.semantic.common.types.LAttribute; +import org.eclipse.osbp.dsl.semantic.common.types.LDataType; +import org.eclipse.osbp.dsl.semantic.common.types.LKeyAndValue; +import org.eclipse.osbp.dsl.semantic.common.types.LReference; +import org.eclipse.osbp.dsl.semantic.common.types.LScalarType; +import org.eclipse.osbp.dsl.semantic.dto.LDto; +import org.eclipse.osbp.dsl.semantic.dto.LDtoAbstractAttribute; +import org.eclipse.osbp.dsl.semantic.dto.LDtoFeature; +import org.eclipse.osbp.dsl.semantic.dto.LDtoInheritedAttribute; +import org.eclipse.osbp.dsl.semantic.dto.LDtoInheritedReference; +import org.eclipse.osbp.dsl.semantic.entity.LEntity; +import org.eclipse.osbp.ecview.dsl.extensions.BindableTypeResolver; +import org.eclipse.osbp.ecview.dsl.extensions.OperationExtensions; +import org.eclipse.osbp.ecview.dsl.extensions.TypeHelper; +import org.eclipse.osbp.ecview.semantic.uimodel.UiBeanSlot; +import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingExpression; +import org.eclipse.osbp.ecview.semantic.uimodel.UiLayout; +import org.eclipse.osbp.ecview.semantic.uimodel.UiModel; +import org.eclipse.osbp.ecview.semantic.uimodel.UiView; +import org.eclipse.osbp.ecview.semantic.uimodel.impl.UiViewImpl; +import org.eclipse.osbp.runtime.common.annotations.DomainDescription; +import org.eclipse.osbp.runtime.common.annotations.DomainKey; +import org.eclipse.osbp.runtime.common.annotations.Properties; +import org.eclipse.osbp.utils.common.EntityUtils; +import org.eclipse.xtend2.lib.StringConcatenation; +import org.eclipse.xtext.common.types.JvmAnnotationAnnotationValue; +import org.eclipse.xtext.common.types.JvmAnnotationReference; +import org.eclipse.xtext.common.types.JvmAnnotationType; +import org.eclipse.xtext.common.types.JvmAnnotationValue; +import org.eclipse.xtext.common.types.JvmDeclaredType; +import org.eclipse.xtext.common.types.JvmFeature; +import org.eclipse.xtext.common.types.JvmField; +import org.eclipse.xtext.common.types.JvmMember; +import org.eclipse.xtext.common.types.JvmStringAnnotationValue; +import org.eclipse.xtext.common.types.JvmType; +import org.eclipse.xtext.common.types.JvmTypeReference; +import org.eclipse.xtext.common.types.util.TypeReferences; +import org.eclipse.xtext.naming.IQualifiedNameProvider; +import org.eclipse.xtext.xbase.lib.CollectionLiterals; +import org.eclipse.xtext.xbase.lib.Extension; +import org.eclipse.xtext.xbase.lib.Functions.Function1; +import org.eclipse.xtext.xbase.lib.InputOutput; +import org.eclipse.xtext.xbase.lib.IterableExtensions; +import org.eclipse.xtext.xbase.lib.ListExtensions; + +@SuppressWarnings("all") +public class AutowireUtil { + public static class Pair { + public String key; + + public String value; + + public Pair(final String key, final String value) { + this.key = key; + this.value = value; + } + } + + @Inject + @Extension + private IQualifiedNameProvider _iQualifiedNameProvider; + + @Inject + @Extension + private TypeHelper _typeHelper; + + @Inject + private TypeReferences typeReferences; + + public String generateId(final UiLayout layout) { + final BindableTypeResolver resolver = new BindableTypeResolver(); + UiBindingExpression _autoWireSource = layout.getAutoWireSource(); + JvmType resolvedType = resolver.resolveType(_autoWireSource); + String viewName = ""; + EObject parent = layout.eContainer(); + while ((!(parent instanceof UiModel))) { + { + if ((parent instanceof UiViewImpl)) { + String _name = ((UiViewImpl) parent).getName(); + viewName = _name; + } + EObject _eContainer = parent.eContainer(); + parent = _eContainer; + } + } + UiModel uimodel = ((UiModel) parent); + StringConcatenation _builder = new StringConcatenation(); + String _packageName = uimodel.getPackageName(); + _builder.append(_packageName, ""); + { + boolean _notEquals = (!Objects.equal(viewName, null)); + if (_notEquals) { + _builder.append("."); + _builder.append(viewName, ""); + } + } + { + boolean _notEquals_1 = (!Objects.equal(resolvedType, null)); + if (_notEquals_1) { + _builder.append("."); + String _identifier = resolvedType.getIdentifier(); + _builder.append(_identifier, ""); + } + } + return _builder.toString(); + } + + public UiView getUiView(final UiLayout layout) { + EObject parent = layout.eContainer(); + while ((!(parent instanceof UiViewImpl))) { + EObject _eContainer = parent.eContainer(); + parent = _eContainer; + } + if ((parent instanceof UiViewImpl)) { + return ((UiViewImpl) parent); + } + return null; + } + + public boolean isAttribute(final JvmType type, final String attribute, final String filterName) { + LDto dto = EntityUtils.getDto(type); + boolean _notEquals = (!Objects.equal(dto, null)); + if (_notEquals) { + List<LDtoAbstractAttribute> _attributes = dto.getAttributes(); + final Function1<LDtoAbstractAttribute, Boolean> _function = new Function1<LDtoAbstractAttribute, Boolean>() { + public Boolean apply(final LDtoAbstractAttribute it) { + String _name = AutowireUtil.this.toName(it); + return Boolean.valueOf(Objects.equal(_name, attribute)); + } + }; + LDtoAbstractAttribute attr = IterableExtensions.<LDtoAbstractAttribute>findFirst(_attributes, _function); + boolean _notEquals_1 = (!Objects.equal(attr, null)); + if (_notEquals_1) { + LScalarType _datatype = this.toDatatype(attr); + LDataType datatype = ((LDataType) _datatype); + String _name = datatype.getName(); + return Objects.equal(_name, filterName); + } + } + return false; + } + + /** + * Detects all the existing properties of the jvmtype corresponding attribute, the datatype of the attribute and references. + */ + public List<AutowireUtil.Pair> toProperties(final JvmDeclaredType type, final String attributeName) { + Map<String, List<AutowireUtil.Pair>> _fieldProperties = this.toFieldProperties(type); + final List<AutowireUtil.Pair> result = _fieldProperties.get(attributeName); + boolean _notEquals = (!Objects.equal(result, null)); + if (_notEquals) { + for (final AutowireUtil.Pair prop : result) { + String _unescapeHtml = StringEscapeUtils.unescapeHtml(prop.value); + prop.value = _unescapeHtml; + } + } + List<AutowireUtil.Pair> _xifexpression = null; + boolean _notEquals_1 = (!Objects.equal(result, null)); + if (_notEquals_1) { + _xifexpression = result; + } else { + _xifexpression = CollectionLiterals.<AutowireUtil.Pair>newArrayList(); + } + return _xifexpression; + } + + /** + * Detects all the existing properties of the jvmtype corresponding reference and the referenced dto. + */ + public Map<String, List<AutowireUtil.Pair>> toFieldProperties(final JvmDeclaredType jvmType) { + final Map<String, List<AutowireUtil.Pair>> propMap = CollectionLiterals.<String, List<AutowireUtil.Pair>>newHashMap(); + Iterable<JvmFeature> _allFeatures = jvmType.getAllFeatures(); + Iterable<JvmField> _filter = Iterables.<JvmField>filter(_allFeatures, JvmField.class); + final Consumer<JvmField> _function = new Consumer<JvmField>() { + public void accept(final JvmField it) { + StringConcatenation _builder = new StringConcatenation(); + String _qualifiedName = jvmType.getQualifiedName(); + _builder.append(_qualifiedName, ""); + _builder.append("."); + String _simpleName = it.getSimpleName(); + _builder.append(_simpleName, ""); + final String attrPropKey = _builder.toString(); + final List<AutowireUtil.Pair> values = CollectionLiterals.<AutowireUtil.Pair>newArrayList(); + propMap.put(attrPropKey, values); + EList<JvmAnnotationReference> _annotations = it.getAnnotations(); + final Function1<JvmAnnotationReference, Boolean> _function = new Function1<JvmAnnotationReference, Boolean>() { + public Boolean apply(final JvmAnnotationReference e) { + JvmAnnotationType _annotation = e.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + String _name = Properties.class.getName(); + final boolean result = _identifier.equals(_name); + return Boolean.valueOf(result); + } + }; + Iterable<JvmAnnotationReference> _filter = IterableExtensions.<JvmAnnotationReference>filter(_annotations, _function); + final Consumer<JvmAnnotationReference> _function_1 = new Consumer<JvmAnnotationReference>() { + public void accept(final JvmAnnotationReference it) { + final JvmAnnotationReference ref = it; + EList<JvmAnnotationValue> _values = ref.getValues(); + final Function1<JvmAnnotationValue, JvmAnnotationAnnotationValue> _function = new Function1<JvmAnnotationValue, JvmAnnotationAnnotationValue>() { + public JvmAnnotationAnnotationValue apply(final JvmAnnotationValue it) { + return ((JvmAnnotationAnnotationValue) it); + } + }; + List<JvmAnnotationAnnotationValue> _map = ListExtensions.<JvmAnnotationValue, JvmAnnotationAnnotationValue>map(_values, _function); + final Consumer<JvmAnnotationAnnotationValue> _function_1 = new Consumer<JvmAnnotationAnnotationValue>() { + public void accept(final JvmAnnotationAnnotationValue av) { + EList<JvmAnnotationReference> _values = av.getValues(); + final Consumer<JvmAnnotationReference> _function = new Consumer<JvmAnnotationReference>() { + public void accept(final JvmAnnotationReference it) { + EList<JvmAnnotationValue> _values = it.getValues(); + JvmAnnotationValue _get = _values.get(0); + final JvmStringAnnotationValue keyAn = ((JvmStringAnnotationValue) _get); + EList<JvmAnnotationValue> _values_1 = it.getValues(); + JvmAnnotationValue _get_1 = _values_1.get(1); + final JvmStringAnnotationValue valueAn = ((JvmStringAnnotationValue) _get_1); + EList<String> _values_2 = keyAn.getValues(); + String _get_2 = _values_2.get(0); + EList<String> _values_3 = valueAn.getValues(); + String _get_3 = _values_3.get(0); + AutowireUtil.Pair _pair = new AutowireUtil.Pair(_get_2, _get_3); + values.add(_pair); + } + }; + _values.forEach(_function); + } + }; + _map.forEach(_function_1); + } + }; + _filter.forEach(_function_1); + } + }; + _filter.forEach(_function); + return propMap; + } + + /** + * Detects all the existing properties of the jvmtype corresponding datatype of the attribute. + */ + public LDataType toDataType(final JvmType type, final String attributeName) { + LDto dto = EntityUtils.getDto(type); + boolean _notEquals = (!Objects.equal(dto, null)); + if (_notEquals) { + List<LDtoAbstractAttribute> _attributes = dto.getAttributes(); + final Function1<LDtoAbstractAttribute, Boolean> _function = new Function1<LDtoAbstractAttribute, Boolean>() { + public Boolean apply(final LDtoAbstractAttribute it) { + String _name = AutowireUtil.this.toName(it); + return Boolean.valueOf(Objects.equal(_name, attributeName)); + } + }; + LDtoAbstractAttribute attr = IterableExtensions.<LDtoAbstractAttribute>findFirst(_attributes, _function); + boolean _notEquals_1 = (!Objects.equal(attr, null)); + if (_notEquals_1) { + LScalarType dataType = this.toDatatype(attr); + if ((dataType instanceof LDataType)) { + LScalarType _datatype = this.toDatatype(attr); + return ((LDataType) _datatype); + } + } + } + return null; + } + + /** + * Provides the datatype of the corresponding attribute. + */ + public List<LKeyAndValue> toDataTypeProperties(final JvmType type, final String attributeName) { + LDataType dataType = this.toDataType(type, attributeName); + boolean _notEquals = (!Objects.equal(dataType, null)); + if (_notEquals) { + return dataType.getProperties(); + } + return CollectionLiterals.<LKeyAndValue>newArrayList(); + } + + public String toName(final LDtoFeature feature) { + if ((feature instanceof LDtoInheritedAttribute)) { + LAttribute _inheritedFeature = ((LDtoInheritedAttribute)feature).getInheritedFeature(); + return _inheritedFeature.getName(); + } else { + if ((feature instanceof LDtoInheritedReference)) { + LReference _inheritedFeature_1 = ((LDtoInheritedReference)feature).getInheritedFeature(); + return _inheritedFeature_1.getName(); + } else { + return feature.getName(); + } + } + } + + public LScalarType toDatatype(final LDtoAbstractAttribute att) { + if ((att instanceof LDtoInheritedAttribute)) { + LAttribute _inheritedFeature = ((LDtoInheritedAttribute)att).getInheritedFeature(); + return _inheritedFeature.getType(); + } else { + return att.getType(); + } + } + + public boolean isBlob(final JvmType type, final String attribute) { + LDto dto = EntityUtils.getDto(type); + List<LDtoAbstractAttribute> _attributes = dto.getAttributes(); + final Function1<LDtoAbstractAttribute, Boolean> _function = new Function1<LDtoAbstractAttribute, Boolean>() { + public Boolean apply(final LDtoAbstractAttribute it) { + String _name = it.getName(); + return Boolean.valueOf(Objects.equal(_name, attribute)); + } + }; + Iterable<LDtoAbstractAttribute> attrs = IterableExtensions.<LDtoAbstractAttribute>filter(_attributes, _function); + for (final LDtoAbstractAttribute attr : attrs) { + { + LScalarType _type = attr.getType(); + LDataType datatype = ((LDataType) _type); + InputOutput.<LDataType>println(datatype); + return datatype.isAsBlob(); + } + } + return false; + } + + public String getEntityName(final UiBeanSlot uiBeanSlot) { + JvmTypeReference _jvmType = uiBeanSlot.getJvmType(); + JvmType _type = _jvmType.getType(); + LEntity _entityFromDto = EntityUtils.getEntityFromDto(_type); + final LEntity entity = ((LEntity) _entityFromDto); + String eName = null; + boolean _equals = Objects.equal(entity, null); + if (_equals) { + JvmTypeReference _jvmType_1 = uiBeanSlot.getJvmType(); + JvmType _type_1 = _jvmType_1.getType(); + boolean _equals_1 = Objects.equal(_type_1, null); + if (_equals_1) { + eName = ""; + } else { + JvmTypeReference _jvmType_2 = uiBeanSlot.getJvmType(); + JvmType _type_2 = _jvmType_2.getType(); + boolean _notEquals = (!Objects.equal(_type_2, null)); + if (_notEquals) { + eName = ""; + } + } + } else { + String _name = entity.getName(); + eName = _name; + } + return eName; + } + + public boolean isClass(final JvmType type) { + boolean _is = this.typeReferences.is(type, Class.class); + if (_is) { + return true; + } + return false; + } + + public boolean isByteArray(final JvmType type) { + boolean _is = this.typeReferences.is(type, byte[].class); + if (_is) { + return true; + } + return false; + } + + public boolean isAllowed(final JvmType type, final JvmType beanType, final OperationExtensions.OperationInfo info) { + boolean _isNumberWithDigits = this._typeHelper.isNumberWithDigits(type); + if (_isNumberWithDigits) { + return true; + } else { + boolean _isNumberWithoutDigits = this._typeHelper.isNumberWithoutDigits(type); + if (_isNumberWithoutDigits) { + return true; + } else { + boolean _isString = this._typeHelper.isString(type); + if (_isString) { + return true; + } else { + boolean _isDate = this._typeHelper.isDate(type); + if (_isDate) { + return true; + } else { + boolean _isByteArray = this.isByteArray(type); + if (_isByteArray) { + return true; + } else { + boolean _isBoolean = this._typeHelper.isBoolean(type); + if (_isBoolean) { + return true; + } else { + boolean _isEnum = this._typeHelper.isEnum(type); + if (_isEnum) { + return true; + } else { + boolean _isDomainReference = this._typeHelper.isDomainReference(info); + if (_isDomainReference) { + boolean _matched = false; + if (!_matched) { + if (type instanceof JvmDeclaredType) { + _matched=true; + boolean _or = false; + boolean _isAnnotationOf = this.isAnnotationOf(((JvmDeclaredType) type), DomainKey.class); + if (_isAnnotationOf) { + _or = true; + } else { + boolean _isAnnotationOf_1 = this.isAnnotationOf(((JvmDeclaredType) type), DomainDescription.class); + _or = _isAnnotationOf_1; + } + if (_or) { + return true; + } + } + } + return false; + } else { + boolean _and = false; + JvmField _field = info.getField(); + boolean _notEquals = (!Objects.equal(_field, null)); + if (!_notEquals) { + _and = false; + } else { + JvmField _field_1 = info.getField(); + boolean _isCollection = this._typeHelper.isCollection(_field_1); + _and = _isCollection; + } + if (_and) { + return true; + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean isAnnotationOf(final JvmDeclaredType type, final Class<?> clazz) { + EList<JvmMember> _members = type.getMembers(); + for (final JvmMember member : _members) { + EList<JvmAnnotationReference> _annotations = member.getAnnotations(); + for (final JvmAnnotationReference annotation : _annotations) { + JvmAnnotationType _annotation = annotation.getAnnotation(); + String _identifier = _annotation.getIdentifier(); + String _canonicalName = clazz.getCanonicalName(); + boolean _equals = _identifier.equals(_canonicalName); + if (_equals) { + return true; + } + } + } + EList<JvmTypeReference> _superTypes = type.getSuperTypes(); + for (final JvmTypeReference superType : _superTypes) { + JvmType _type = superType.getType(); + if ((_type instanceof JvmDeclaredType)) { + JvmType _type_1 = superType.getType(); + return this.isAnnotationOf(((JvmDeclaredType) _type_1), clazz); + } + } + return false; + } +} @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--#======================================================================= --> +<!--# Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany). --> +<!--# 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: --> +<!--# Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation API and implementation --> +<!--#======================================================================= --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.eclipse.osbp.releng.maven</groupId> + <artifactId>org.eclipse.osbp.releng.maven.parent.tycho</artifactId> + <version>0.9.0-SNAPSHOT</version> + <relativePath/> + </parent> + + <groupId>org.eclipse.osbp.autowireHelper</groupId> + <artifactId>org.eclipse.osbp.autowireHelper.aggregator</artifactId> + <version>0.9.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <url>${osbp.site.repository.url}</url> + <scm> + <url>${osbp.scm.url}</url> + <connection>${osbp.scm.connection}</connection> + <developerConnection>${osbp.scm.connection.dev}</developerConnection> + <tag>HEAD</tag> + </scm> + <distributionManagement> + <site> + <id>gh-pages</id> + <name>OSBP GitHub Pages</name> + <url>${distribution.site.url}</url> + </site> + </distributionManagement> + + <properties> + + </properties> + + <modules> + <module>org.eclipse.osbp.autowireHelper</module> + <module>org.eclipse.osbp.autowireHelper.feature</module> + </modules> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>target-platform-configuration</artifactId> + <version>${tycho-version}</version> + <configuration> + <resolver>p2</resolver> + <pomDependencies>consider</pomDependencies> + <environments> + <environment> + <os>win32</os> + <ws>win32</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86</arch> + </environment> + <environment> + <os>linux</os> + <ws>gtk</ws> + <arch>x86_64</arch> + </environment> + <environment> + <os>macosx</os> + <ws>cocoa</ws> + <arch>x86_64</arch> + </environment> + </environments> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> |