parallel ip - initial checkin
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/.project b/.project
new file mode 100644
index 0000000..e6dd65b
--- /dev/null
+++ b/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <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..256900f
--- /dev/null
+++ b/jenkins.build.config.xml
@@ -0,0 +1,34 @@
+<?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.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.preferences</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.runtime</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.runtime.web</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.ui.api</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.utils</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.utils.blob</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.utils.functionnormalizer</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.utils.ui</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.vaaclipse</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.functionlibrary</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.functionlibrary.common</jenkins.build.dependency>
+ <jenkins.build.dependency>org.eclipse.osbp.xtext.i18n</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.ecview.extension.editparts.emf/.project b/org.eclipse.osbp.ecview.extension.editparts.emf/.project
new file mode 100644
index 0000000..90c60fc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.editparts.emf</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/LICENSE.txt b/org.eclipse.osbp.ecview.extension.editparts.emf/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..00d6add
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/META-INF/MANIFEST.MF
@@ -0,0 +1,43 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.editparts.emf
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.editparts.emf
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore.xmi;bundle-version="2.8.0",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
+ org.eclipse.core.databinding;bundle-version="[1.4.2,1.5.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.core.databinding.beans;bundle-version="1.2.200",
+ org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.eclipse.osbp.ui.api.functionlibrary;version="0.9.0",
+ org.eclipse.osbp.ui.api.useraccess;version="0.9.0",
+ org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.event;version="1.3.0",
+ org.slf4j;version="1.6.4"
+Service-Component: OSGI-INF/*.xml
+Export-Package: org.eclipse.osbp.ecview.extension.editparts.emf;
+ uses:="org.eclipse.osbp.ecview.core.common.editpart.binding,
+ org.eclipse.osbp.ecview.extension.editparts,
+ org.eclipse.osbp.ecview.core.common.editpart.emf.common,
+ org.eclipse.osbp.ecview.core.common.editpart,
+ org.eclipse.osbp.ecview.extension.model,
+ org.eclipse.osbp.ecview.extension.editparts.presentation,
+ org.eclipse.emf.common.notify,
+ org.osgi.service.component,
+ org.eclipse.osbp.ecview.core.common.editpart.emf";version="0.9.0",
+ org.eclipse.osbp.ecview.extension.editparts.emf.enhancer;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.editparts.emf.strategies;version="0.9.0"
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/editPartManager.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/editPartManager.xml
new file mode 100644
index 0000000..9677fc8
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/editPartManager.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false" name="org.eclipse.osbp.ecview.extension.editparts.editpartmanager">
+ <implementation class="org.eclipse.osbp.ecview.extension.editparts.emf.EditpartManager"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.editpart.IEditPartManager"/>
+ </service>
+</scr:component>
+
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.components.services.ContextSensitiveLayoutSelector.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.components.services.ContextSensitiveLayoutSelector.xml
new file mode 100644
index 0000000..ccddd39
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.components.services.ContextSensitiveLayoutSelector.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.editparts.emf.components.services.ContextSensitiveLayoutSelector">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IContextSensitiveLayoutSelector"/>
+ </service>
+ <reference bind="bind" cardinality="1..1" interface="org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService" policy="static" unbind="unbind"/>
+ <implementation class="org.eclipse.osbp.ecview.extension.editparts.emf.components.services.ContextSensitiveLayoutSelector"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.AltEnterFocusingEnhancer.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.AltEnterFocusingEnhancer.xml
new file mode 100644
index 0000000..b6ad345
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.AltEnterFocusingEnhancer.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.AltEnterFocusingEnhancer">
+ <property name="ecview.focusing.enhancer.id" value="AltEnterFocusingEnhancer"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.AltEnterFocusingEnhancer"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.EnterTabFocusingEnhancer.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.EnterTabFocusingEnhancer.xml
new file mode 100644
index 0000000..9eb7af2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.EnterTabFocusingEnhancer.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.EnterTabFocusingEnhancer">
+ <property name="ecview.focusing.enhancer.id" value="EnterTabFocusingEnhancer"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.EnterTabFocusingEnhancer"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.TabEnterFocusingEnhancer.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.TabEnterFocusingEnhancer.xml
new file mode 100644
index 0000000..8f1c4f2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.TabEnterFocusingEnhancer.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.TabEnterFocusingEnhancer">
+ <property name="ecview.focusing.enhancer.id" value="TabEnterFocusingEnhancer"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.editparts.emf.enhancer.TabEnterFocusingEnhancer"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/about.html b/org.eclipse.osbp.ecview.extension.editparts.emf/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/about.ini b/org.eclipse.osbp.ecview.extension.editparts.emf/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/about.mappings b/org.eclipse.osbp.ecview.extension.editparts.emf/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/about.properties b/org.eclipse.osbp.ecview.extension.editparts.emf/about.properties
new file mode 100644
index 0000000..d818da2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.editparts.emf
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/build.properties b/org.eclipse.osbp.ecview.extension.editparts.emf/build.properties
new file mode 100644
index 0000000..abe24e1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/build.properties
@@ -0,0 +1,12 @@
+source.. = src/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ LICENSE.txt,\
+ license.html
+output.. = target/classes
+src.includes = about.properties, about.mappings, about.ini, about.html, LICENSE.txt,\
+ license.html
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/epl-v10.html b/org.eclipse.osbp.ecview.extension.editparts.emf/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/license.html b/org.eclipse.osbp.ecview.extension.editparts.emf/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/notice.html b/org.eclipse.osbp.ecview.extension.editparts.emf/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/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.ecview.extension.editparts.emf/pom.xml b/org.eclipse.osbp.ecview.extension.editparts.emf/pom.xml
new file mode 100644
index 0000000..d3d1a14
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/pom.xml
@@ -0,0 +1,37 @@
+<?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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.editparts.emf</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Contains the EMF based ui controller</description>
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source/>
+ <target/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java
new file mode 100644
index 0000000..f1a7534
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/EditpartManager.java
@@ -0,0 +1,238 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.common.AbstractEditpartManager;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.extension.editparts.emf.components.BlobUploadComponentEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.components.ContentSensitiveLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.components.CustomDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.components.IconComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.components.PairComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.CustomDecimalConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.DecimalToUomoConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.NumericToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.NumericToUomoConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.ObjectToStringConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.PriceToStringConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.QuantityToStringConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.SimpleDecimalConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.converter.StringToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DefaultLayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DelegatingFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.strategies.DelegatingLayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.visibility.AuthorizationVisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.emf.visibility.SubTypeVisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.extension.model.YBlobUploadComponent;
+import org.eclipse.osbp.ecview.extension.model.YContentSensitiveLayout;
+import org.eclipse.osbp.ecview.extension.model.YCustomDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YDefaultLayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingLayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YIconComboBox;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YMaskedDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YMaskedNumericField;
+import org.eclipse.osbp.ecview.extension.model.YMaskedTextField;
+import org.eclipse.osbp.ecview.extension.model.YPrefixedMaskedTextField;
+import org.eclipse.osbp.ecview.extension.model.YPairComboBox;
+import org.eclipse.osbp.ecview.extension.model.YQuantityTextField;
+import org.eclipse.osbp.ecview.extension.model.YRichTextArea;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterPackage;
+import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YDecimalToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToResourceConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YObjectToStringConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YPriceToStringConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YQuantityToStringConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YSimpleDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YStringToResourceConverter;
+import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityPackage;
+import org.osgi.service.component.ComponentContext;
+
+/**
+ * An implementation of IEditPartManager for eObjects with
+ * nsURI=http://eclipse.org/emf/emfclient/uimodel.
+ */
+public class EditpartManager extends AbstractEditpartManager {
+
+ /**
+ * Activate.
+ *
+ * @param context
+ * the context
+ */
+ protected void activate(ComponentContext context) {
+
+ }
+
+ /**
+ * Deactivate.
+ *
+ * @param context
+ * the context
+ */
+ protected void deactivate(ComponentContext context) {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.editpart.IEditPartManager#isFor(java
+ * .lang.Object)
+ */
+ @Override
+ public boolean isFor(Object element) {
+ if (element instanceof EObject) {
+ String uriString = ((EObject) element).eClass().getEPackage().getNsURI();
+ return uriString.equals(YECviewPackage.eNS_URI) || uriString.equals(YConverterPackage.eNS_URI)
+ || uriString.equals(YVisibilityPackage.eNS_URI);
+ } else if (element instanceof String) {
+ return element.equals(YECviewPackage.eNS_URI) || element.equals(YConverterPackage.eNS_URI)
+ || element.equals(YVisibilityPackage.eNS_URI);
+ }
+ return false;
+ }
+
+ /**
+ * Creates a new instance of the edit part.
+ *
+ * @param <A>
+ * an instance of {@link IElementEditpart}
+ * @param yElement
+ * the model element
+ * @return editpart
+ */
+ @SuppressWarnings("unchecked")
+ protected <A extends IElementEditpart> A createEditpart(IViewContext context, Object yElement) {
+ // asserts that no editpart was created already for the given element
+ assertOneEditpartForModelelement(yElement);
+
+ ElementEditpart<YElement> result = null;
+ if (yElement instanceof YStrategyLayout) {
+ result = createNewInstance(StrategyLayoutEditpart.class);
+ } else if (yElement instanceof YDefaultLayoutingStrategy) {
+ result = createNewInstance(DefaultLayoutingStrategyEditpart.class);
+ } else if (yElement instanceof YDelegatingLayoutingStrategy) {
+ result = createNewInstance(DelegatingLayoutingStrategyEditpart.class);
+ } else if (yElement instanceof YSuspect) {
+ result = createNewInstance(SuspectEditpart.class);
+ } else if (yElement instanceof YSuspectInfo) {
+ result = createNewInstance(SuspectLayoutingInfoEditpart.class);
+ } else if (yElement instanceof YLayoutingInfo) {
+ result = createNewInstance(LayoutingInfoEditpart.class);
+ } else if (yElement instanceof YDelegatingFocusingStrategy) {
+ result = createNewInstance(DelegatingFocusingStrategyEditpart.class);
+ // custom component BlobUploadComponent
+ } else if (yElement instanceof YBlobUploadComponent) {
+ result = createNewInstance(BlobUploadComponentEditpart.class);
+ } else if (yElement instanceof YCustomDecimalField) {
+ result = createNewInstance(CustomDecimalFieldEditpart.class);
+ } else if (yElement instanceof YObjectToStringConverter) {
+ result = createNewInstance(ObjectToStringConverterEditpart.class);
+ } else if (yElement instanceof YStringToResourceConverter) {
+ result = createNewInstance(StringToResourceConverterEditpart.class);
+ } else if (yElement instanceof YNumericToResourceConverter) {
+ result = createNewInstance(NumericToResourceConverterEditpart.class);
+ } else if (yElement instanceof YQuantityToStringConverter) {
+ result = createNewInstance(QuantityToStringConverterEditpart.class);
+ } else if (yElement instanceof YPriceToStringConverter) {
+ result = createNewInstance(PriceToStringConverterEditpart.class);
+ } else if (yElement instanceof YNumericToUomoConverter) {
+ result = createNewInstance(NumericToUomoConverterEditpart.class);
+ } else if (yElement instanceof YDecimalToUomoConverter) {
+ result = createNewInstance(DecimalToUomoConverterEditpart.class);
+ } else if (yElement instanceof YCustomDecimalConverter) {
+ result = createNewInstance(CustomDecimalConverterEditpart.class);
+ } else if (yElement instanceof YSimpleDecimalConverter) {
+ result = createNewInstance(SimpleDecimalConverterEditpart.class);
+ } else if (yElement instanceof YQuantityTextField) {
+ result = createNewInstance(QuantityTextfieldEditpart.class);
+ } else if (yElement instanceof YAuthorizationVisibilityProcessor) {
+ result = createNewInstance(AuthorizationVisibilityProcessorEditpart.class);
+ } else if (yElement instanceof YIconComboBox) {
+ result = createNewInstance(IconComboBoxEditpart.class);
+ } else if (yElement instanceof YPairComboBox) {
+ result = createNewInstance(PairComboBoxEditpart.class);
+ } else if (yElement instanceof YContentSensitiveLayout) {
+ result = createNewInstance(ContentSensitiveLayoutEditpart.class);
+ } else if (yElement instanceof YSubTypeVisibilityProcessor) {
+ result = createNewInstance(SubTypeVisibilityProcessorEditpart.class);
+ } else if (yElement instanceof YRichTextArea) {
+ result = createNewInstance(RichTextAreaEditpart.class);
+ } else if (yElement instanceof YMaskedTextField) {
+ result = createNewInstance(MaskedTextFieldEditpart.class);
+ } else if (yElement instanceof YMaskedNumericField) {
+ result = createNewInstance(MaskedNumericFieldEditpart.class);
+ } else if (yElement instanceof YMaskedDecimalField) {
+ result = createNewInstance(MaskedDecimalFieldEditpart.class);
+ } else if (yElement instanceof YPrefixedMaskedTextField) {
+ result = createNewInstance(PrefixedMaskedTextFieldEditpart.class);
+ }
+
+ if (result != null) {
+ result.initialize(context, (YElement) yElement);
+ }
+
+ return (A) result;
+ }
+
+ /**
+ * Returns a new instance of the type.
+ *
+ * @param type
+ * The type of the editpart for which an instance should be
+ * created.
+ * @return editPart
+ * @throws InstantiationException
+ * e
+ * @throws IllegalAccessException
+ * e
+ */
+ protected IElementEditpart newInstance(Class<? extends IElementEditpart> type) throws InstantiationException, IllegalAccessException {
+ try {
+ Constructor<? extends IElementEditpart> c = type.getDeclaredConstructor(new Class<?>[0]);
+ if (!c.isAccessible()) {
+ c.setAccessible(true);
+ return c.newInstance(new Object[0]);
+ }
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException(e);
+ } catch (SecurityException e) {
+ throw new IllegalStateException(e);
+ } catch (IllegalArgumentException e) {
+ throw new IllegalStateException(e);
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException(e);
+ }
+
+ return type.newInstance();
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/LayoutingInfoEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/LayoutingInfoEditpart.java
new file mode 100644
index 0000000..277af5e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/LayoutingInfoEditpart.java
@@ -0,0 +1,329 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.extension.editparts.IInternalLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IInternalSuspectLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of {@link ISuspectEditpart}.
+ */
+public class LayoutingInfoEditpart extends ElementEditpart<YLayoutingInfo>
+ implements IInternalLayoutingInfoEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(LayoutingInfoEditpart.class);
+
+ /** The suspect infos. */
+ private List<ISuspectLayoutingInfoEditpart> suspectInfos;
+
+ /** The content. */
+ private IEmbeddableEditpart content;
+
+ /** The active. */
+ private boolean active;
+
+ /**
+ * A default constructor.
+ */
+ protected LayoutingInfoEditpart() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelAdd(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAdd(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YLAYOUTING_INFO__ACTIVE_SUSPECT_INFOS:
+ YSuspectInfo ySuspectLayoutingInfo = (YSuspectInfo) notification
+ .getNewValue();
+
+ ISuspectLayoutingInfoEditpart editPart = (ISuspectLayoutingInfoEditpart) getEditpart(getContext(), ySuspectLayoutingInfo);
+ internalAddSuspectLayoutingInfo(editPart);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelRemove(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YLAYOUTING_INFO__ACTIVE_SUSPECT_INFOS:
+ YSuspectInfo ySuspectLayoutingInfo = (YSuspectInfo) notification
+ .getOldValue();
+
+ ISuspectLayoutingInfoEditpart editPart = (ISuspectLayoutingInfoEditpart) getEditpart(getContext(),ySuspectLayoutingInfo);
+ internalRemoveSuspectLayoutingInfo(editPart);
+
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YLAYOUTING_INFO__CONTENT:
+ internalSetContent((YEmbeddable) notification.getNewValue());
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Ensures that the internal bindings are loaded properly.
+ */
+ private void ensureSuspectLayoutingInfosLoaded() {
+ if (suspectInfos == null) {
+ internalLoadSuspectLayoutingInfos();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all bindings.
+ */
+ protected void internalLoadSuspectLayoutingInfos() {
+ checkDisposed();
+
+ if (suspectInfos == null) {
+ suspectInfos = new ArrayList<ISuspectLayoutingInfoEditpart>();
+ for (YSuspectInfo yBindingEP : getModel().getActiveSuspectInfos()) {
+ ISuspectLayoutingInfoEditpart editPart = getEditpart(getContext(),yBindingEP);
+ internalAddSuspectLayoutingInfo(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of bindings.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddSuspectLayoutingInfo(
+ ISuspectLayoutingInfoEditpart editpart) {
+ checkDisposed();
+
+ ensureSuspectLayoutingInfosLoaded();
+ if (!suspectInfos.contains(editpart)) {
+ suspectInfos.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of bindings.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveSuspectLayoutingInfo(
+ ISuspectLayoutingInfoEditpart editpart) {
+ checkDisposed();
+
+ if (suspectInfos != null && editpart != null) {
+ editpart.dispose();
+ suspectInfos.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the suspect layouting infos.
+ *
+ * @return the suspect layouting infos
+ */
+ public List<ISuspectLayoutingInfoEditpart> getSuspectLayoutingInfos() {
+ ensureSuspectLayoutingInfosLoaded();
+ return Collections.unmodifiableList(suspectInfos);
+ }
+
+ /**
+ * Set the new content.
+ *
+ * @param yEmbeddable
+ * the y embeddable
+ */
+ protected void internalSetContent(YEmbeddable yEmbeddable) {
+ ensureContentLoaded();
+
+ IEmbeddableEditpart newContent = getEditpart(getContext(),yEmbeddable);
+
+ if (this.content == newContent) {
+ return;
+ }
+
+ IEmbeddableEditpart oldContent = this.content;
+ this.content = newContent;
+
+ if (oldContent != null) {
+ oldContent.dispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+
+ LOGGER.info("Disposing " + toString());
+
+ active = false;
+ // lazy loading: edit parts also have to be disposed if they have
+ // not been loaded yet, but exist in the model.
+ if (suspectInfos != null
+ || getModel().getActiveSuspectInfos().size() > 0) {
+ List<ISuspectLayoutingInfoEditpart> tempElements = getSuspectLayoutingInfos();
+ synchronized (suspectInfos) {
+ for (ISuspectLayoutingInfoEditpart editpart : tempElements
+ .toArray(new ISuspectLayoutingInfoEditpart[tempElements
+ .size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ suspectInfos = null;
+
+ if (content != null) {
+ content.dispose();
+ content = null;
+ }
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart#getView()
+ */
+ public IViewEditpart getView() {
+ YView yView = ((YStrategyLayout) getModel().eContainer()).getView();
+ return yView != null ? (IViewEditpart) getEditpart(getContext(),yView) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart#getParent()
+ */
+ @Override
+ public IStrategyLayoutEditpart getParent() {
+ YStrategyLayout cxLayout = (YStrategyLayout) getModel().eContainer();
+ return cxLayout != null ? (IStrategyLayoutEditpart) getEditpart(getContext(),cxLayout)
+ : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart#getContent()
+ */
+ @Override
+ public IEmbeddableEditpart getContent() {
+ ensureContentLoaded();
+ return content;
+ }
+
+ /**
+ * Ensures that the internal bindings are loaded properly.
+ */
+ private void ensureContentLoaded() {
+ if (content == null) {
+ content = getEditpart(getContext(),getModel().getContent());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.IInternalLayoutingInfoEditpart#activate()
+ */
+ @Override
+ public void activate() {
+ if (active) {
+ return;
+ }
+
+ checkDisposed();
+ try {
+ for (ISuspectLayoutingInfoEditpart suspect : getSuspectLayoutingInfos()) {
+ ((IInternalSuspectLayoutingInfoEditpart) suspect).activate();
+ }
+
+ // set the first field to be focused
+ if (getModel().getFirstFocus() != null) {
+ YView yView = (YView) getView().getModel();
+ YEmbeddable yTarget = getModel().getFirstFocus().getTarget();
+ if (yTarget != null && yTarget instanceof YFocusable) {
+ yView.setCurrentFocus((YFocusable) yTarget);
+ }
+ }
+
+ } finally {
+ active = true;
+ }
+ }
+
+ @Override
+ public void postActivate() {
+ for (ISuspectLayoutingInfoEditpart suspect : getSuspectLayoutingInfos()) {
+ ((IInternalSuspectLayoutingInfoEditpart) suspect).postActivate();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#requestDispose()
+ */
+ @Override
+ public void requestDispose() {
+ if (getParent() == null) {
+ return;
+ }
+ getParent().deactivate(this);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedDecimalFieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedDecimalFieldEditpart.java
new file mode 100644
index 0000000..cfb7a6d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedDecimalFieldEditpart.java
@@ -0,0 +1,30 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YMaskedDecimalField;
+
+public class MaskedDecimalFieldEditpart extends
+ FieldEditpart<YMaskedDecimalField> implements
+ IMaskedDecimalFieldEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected MaskedDecimalFieldEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedNumericFieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedNumericFieldEditpart.java
new file mode 100644
index 0000000..c52dbc3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedNumericFieldEditpart.java
@@ -0,0 +1,30 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedNumericFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YMaskedNumericField;
+
+public class MaskedNumericFieldEditpart extends
+ FieldEditpart<YMaskedNumericField> implements
+ IMaskedNumericFieldEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected MaskedNumericFieldEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedTextFieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedTextFieldEditpart.java
new file mode 100644
index 0000000..5d47ab1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/MaskedTextFieldEditpart.java
@@ -0,0 +1,29 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YMaskedTextField;
+
+public class MaskedTextFieldEditpart extends FieldEditpart<YMaskedTextField>
+ implements IMaskedTextFieldEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected MaskedTextFieldEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/PrefixedMaskedTextFieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/PrefixedMaskedTextFieldEditpart.java
new file mode 100644
index 0000000..ced0762
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/PrefixedMaskedTextFieldEditpart.java
@@ -0,0 +1,30 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IPrefixedMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YPrefixedMaskedTextField;
+
+public class PrefixedMaskedTextFieldEditpart extends
+ FieldEditpart<YPrefixedMaskedTextField> implements
+ IPrefixedMaskedTextFieldEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected PrefixedMaskedTextFieldEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/QuantityTextfieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/QuantityTextfieldEditpart.java
new file mode 100644
index 0000000..6867c1f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/QuantityTextfieldEditpart.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IQuantityTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectEditpart;
+import org.eclipse.osbp.ecview.extension.model.YQuantityTextField;
+
+/**
+ * Implementation of {@link ISuspectEditpart}.
+ */
+public class QuantityTextfieldEditpart extends
+ FieldEditpart<YQuantityTextField> implements IQuantityTextFieldEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected QuantityTextfieldEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/RichTextAreaEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/RichTextAreaEditpart.java
new file mode 100644
index 0000000..0aabb9f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/RichTextAreaEditpart.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IRichTextAreaEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectEditpart;
+import org.eclipse.osbp.ecview.extension.model.YRichTextArea;
+
+/**
+ * Implementation of {@link ISuspectEditpart}.
+ */
+public class RichTextAreaEditpart extends
+ FieldEditpart<YRichTextArea> implements IRichTextAreaEditpart {
+
+ /**
+ * A default constructor.
+ */
+ protected RichTextAreaEditpart() {
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/StrategyLayoutEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/StrategyLayoutEditpart.java
new file mode 100644
index 0000000..150139c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/StrategyLayoutEditpart.java
@@ -0,0 +1,850 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IKeyStrokeDefinitionEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.validation.IValidatorEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.visibility.IVisibilityProcessorEditpart;
+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.extension.api.IFocusingEnhancer;
+import org.eclipse.osbp.ecview.extension.editparts.IInternalFocusingEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IInternalLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.presentation.IStrategyLayoutPresentation;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.ILayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeCallback;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The implementation of the IStrategyLayoutEditpart.
+ */
+public class StrategyLayoutEditpart extends EmbeddableEditpart<YStrategyLayout>
+ implements IStrategyLayoutEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(StrategyLayoutEditpart.class);
+
+ /** The suspects. */
+ private List<ISuspectEditpart> suspects;
+
+ /** The focusing strategies. */
+ private List<IFocusingStrategyEditpart> focusingStrategies;
+
+ /** The layouting strategy. */
+ private ILayoutingStrategyEditpart layoutingStrategy;
+
+ /** The layouting info. */
+ private ILayoutingInfoEditpart layoutingInfo;
+
+ /** The keystroke callbacks. */
+ private HashMap<IFocusingStrategyEditpart, KeyStrokeCallback> keystrokeCallbacks = new HashMap<IFocusingStrategyEditpart, KeyStrokeCallback>();
+
+ /**
+ * Instantiates a new strategy layout editpart.
+ */
+ protected StrategyLayoutEditpart() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.editpart.datatypes.IDatatypeEditpart
+ * .DatatypeBridge#getDatatypeValidators()
+ */
+ @Override
+ public List<IValidatorEditpart> getDatatypeValidators() {
+ return Collections.emptyList();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * getSuspects()
+ */
+ @Override
+ public List<ISuspectEditpart> getSuspects() {
+ checkDisposed();
+
+ if (suspects == null) {
+ internalLoadSuspects();
+ }
+ return Collections.unmodifiableList(suspects);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#
+ * initialize(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ public void initialize(IViewContext context, YStrategyLayout model) {
+
+ checkDisposed();
+
+ // register the adapter first to find this editpart later...
+ EObject eObject = castEObject(model);
+ try {
+ // avoid delivery during init
+ ((BasicEObjectImpl) eObject).eSetDeliver(false);
+ if (!eObject.eAdapters().contains(this)) {
+ eObject.eAdapters().add(this);
+ }
+
+ // initialize the default strategies if required
+ //
+ if (model.getLayoutingStrategy() == null) {
+ model.setLayoutingStrategy(YECviewFactory.eINSTANCE
+ .createYDefaultLayoutingStrategy());
+ }
+ this.layoutingStrategy = getEditpart(getContext(),
+ model.getLayoutingStrategy());
+
+ if (model.getFocusingStrategies().isEmpty()) {
+ enhanceDefaultFocusing(model);
+ }
+
+ super.initialize(context, model);
+ } finally {
+ ((BasicEObjectImpl) eObject).eSetDeliver(true);
+ }
+ }
+
+ protected void registerAdapter(Adapter adapter) {
+ // not here!
+ }
+
+ protected void checkAdapter(YStrategyLayout model) {
+ // not here!
+ }
+
+ /**
+ * Enhance default focusing.
+ *
+ * @param model
+ * the model
+ */
+ private void enhanceDefaultFocusing(YStrategyLayout model) {
+ IFocusingEnhancer applier = findFocusingEnhancer(model
+ .getDefaultFocusingEnhancerId());
+ if (applier != null) {
+ applier.enhanceFocusing(model);
+ }
+ }
+
+ /**
+ * Find focusing enhancer.
+ *
+ * @param defaultFocusingEnhancerId
+ * the default focusing enhancer id
+ * @return the i focusing enhancer
+ */
+ private IFocusingEnhancer findFocusingEnhancer(
+ String defaultFocusingEnhancerId) {
+ if (defaultFocusingEnhancerId != null) {
+ return findFocusingEnhancerService(defaultFocusingEnhancerId);
+ } else {
+ return findDefaultFocusingEnhancerService();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * findFocusingEnhancerService(java.lang.String)
+ */
+ public IFocusingEnhancer findFocusingEnhancerService(String id) {
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+
+ try {
+ Collection<ServiceReference<IFocusingEnhancer>> references = context
+ .getServiceReferences(IFocusingEnhancer.class, String
+ .format("(ecview.focusing.enhancer.id=%s)", id));
+ if (!references.isEmpty()) {
+ IFocusingEnhancer provider = context.getService(references
+ .iterator().next());
+ return provider;
+ }
+ } catch (InvalidSyntaxException e) {
+ LOGGER.warn("{}", e);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * findDefaultFocusingEnhancerService()
+ */
+ public IFocusingEnhancer findDefaultFocusingEnhancerService() {
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+
+ try {
+ Collection<ServiceReference<IFocusingEnhancer>> references = context
+ .getServiceReferences(IFocusingEnhancer.class,
+ "(ecview.focusing.enhancer.default=true)");
+ if (!references.isEmpty()) {
+ IFocusingEnhancer provider = context.getService(references
+ .iterator().next());
+ return provider;
+ }
+ } catch (InvalidSyntaxException e) {
+ LOGGER.warn("{}", e);
+ }
+ return null;
+ }
+
+ /**
+ * Clients may override and return a proper default focusing strategy.
+ *
+ * @return the default focusing strategy
+ */
+ protected YFocusingStrategy getDefaultFocusingStrategy() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#render
+ * (java.lang.Object)
+ */
+ @Override
+ public Object render(Object parentWidget) {
+ if (this.layoutingStrategy != null) {
+ // call the layout strategy before rendering -> Will set the content
+ this.layoutingStrategy.layout();
+ }
+
+ internalActivateLayoutingInfo();
+
+ internalActivateFocusingStrategies();
+
+ Object result = super.render(parentWidget);
+
+ internalPostActivateLayoutingInfo();
+
+ return result;
+ }
+
+ /**
+ * Returns true, if the presenter is present.
+ *
+ * @return true, if is presentation present
+ */
+ protected boolean isPresentationPresent() {
+ return internalGetPresentation() != null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#
+ * getPresentation()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public IStrategyLayoutPresentation<?> getPresentation() {
+ return super.getPresentation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSTRATEGY_LAYOUT__LAYOUTING_STRATEGY:
+ internalSetLayoutingStrategy((YLayoutingStrategy) notification
+ .getNewValue());
+ break;
+ case YECviewPackage.YSTRATEGY_LAYOUT__LAYOUTING_INFO:
+ internalSetLayoutingInfo((YLayoutingInfo) notification
+ .getNewValue());
+ break;
+ case YECviewPackage.YSTRATEGY_LAYOUT__DEFAULT_FOCUSING_ENHANCER_ID:
+ enhanceDefaultFocusing(getModel());
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Set the new content.
+ *
+ * @param cxInfo
+ * the cx info
+ */
+ protected void internalSetLayoutingInfo(YLayoutingInfo cxInfo) {
+ ILayoutingInfoEditpart newEditpart = getEditpart(getContext(), cxInfo);
+
+ if (this.layoutingInfo == newEditpart) {
+ return;
+ }
+
+ if (this.layoutingInfo != null) {
+ getPresentation().setContent(null);
+ this.layoutingInfo.dispose();
+ }
+
+ this.layoutingInfo = newEditpart;
+
+ if (isRendered()) {
+ internalActivateLayoutingInfo();
+ }
+ }
+
+ /**
+ * Internal activate layouting info.
+ */
+ protected void internalActivateLayoutingInfo() {
+ if (this.layoutingInfo != null) {
+ // refresh the content
+ IEmbeddableEditpart contentEP = this.layoutingInfo.getContent();
+ getPresentation().setContent(contentEP);
+
+ ((IInternalLayoutingInfoEditpart) this.layoutingInfo).activate();
+
+ YView yView = (YView) getView().getModel();
+ for (YVisibilityProcessor yP : yView.getVisibilityProcessors()) {
+ IVisibilityProcessorEditpart ep = getEditpart(getContext(), yP);
+ if (ep != null) {
+ ep.fire();
+ }
+ }
+ }
+ }
+
+ protected void internalPostActivateLayoutingInfo() {
+ if (this.layoutingInfo != null) {
+ ((IInternalLayoutingInfoEditpart) this.layoutingInfo)
+ .postActivate();
+ }
+ }
+
+ /**
+ * Internal activate focusing strategies.
+ */
+ protected void internalActivateFocusingStrategies() {
+ for (IFocusingStrategyEditpart strategyEP : getFocusingStrategies()) {
+ internalActivateFocusingStrategy(strategyEP);
+ }
+ }
+
+ /**
+ * Internally activate the focusing strategy.
+ *
+ * @param strategy
+ * the strategy
+ */
+ protected void internalActivateFocusingStrategy(
+ final IFocusingStrategyEditpart strategy) {
+ if (strategy != null) {
+ IKeyStrokeDefinitionEditpart keyStrokeDefEditpart = strategy
+ .getKeyStrokeDefinition();
+
+ if (keyStrokeDefEditpart == null) {
+ LOGGER.error("Focusing strategy not activated, since missing key stroke definitions. Strategy: "
+ + strategy.getId());
+ return;
+ }
+
+ KeyStrokeCallback callback = new KeyStrokeCallback() {
+ @Override
+ public void callback(Object source, Object target) {
+ requestFocusing(source, target, strategy);
+ }
+ };
+ keystrokeCallbacks.put(strategy, callback);
+ getPresentation().registerKeyStroke(keyStrokeDefEditpart, callback);
+ ((IInternalFocusingEditpart) strategy).activate();
+ }
+ }
+
+ /**
+ * Internally deactivate the focusing strategy.
+ *
+ * @param strategy
+ * the strategy
+ */
+ protected void internalDectivateFocusingStrategy(
+ final IFocusingStrategyEditpart strategy) {
+ if (strategy != null) {
+ KeyStrokeCallback callback = keystrokeCallbacks.remove(strategy);
+ if (callback != null) {
+ getPresentation().unregisterKeyStroke(callback);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * deactivate
+ * (org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart)
+ */
+ @Override
+ public void deactivate(ILayoutingInfoEditpart info) {
+ if (info == null || info != this.layoutingInfo) {
+ return;
+ }
+ getModel().setLayoutingInfo(null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#activate
+ * (org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart)
+ */
+ @Override
+ public void activate(ILayoutingInfoEditpart info) {
+ getModel().setLayoutingInfo((YLayoutingInfo) info.getModel());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * requestLayouting()
+ */
+ @Override
+ public void requestLayouting() {
+ if (!isRendered()) {
+ return;
+ }
+
+ if (this.layoutingStrategy != null) {
+ // call the layout strategy before rendering -> Will set the content
+ this.layoutingStrategy.layout();
+ }
+ }
+
+ /**
+ * Adds the focusing strategy.
+ *
+ * @param strategy
+ * the strategy
+ */
+ protected void internalAddFocusingStrategy(
+ IFocusingStrategyEditpart strategy) {
+ checkDisposed();
+
+ if (focusingStrategies == null) {
+ internalLoadFocusingStrategies();
+ }
+ if (!focusingStrategies.contains(strategy)) {
+ focusingStrategies.add(strategy);
+
+ if (isRendered()) {
+ internalActivateFocusingStrategy(strategy);
+ }
+ }
+ }
+
+ /**
+ * Removes the focusing strategy.
+ *
+ * @param strategy
+ * the strategy
+ */
+ protected void internalRemoveFocusingStrategy(
+ IFocusingStrategyEditpart strategy) {
+ checkDisposed();
+
+ if (focusingStrategies != null && strategy != null) {
+
+ // deactivate and dispose the strategy
+ internalDectivateFocusingStrategy(strategy);
+ strategy.dispose();
+
+ focusingStrategies.remove(strategy);
+ }
+ }
+
+ /**
+ * Set the layout strategy.
+ *
+ * @param cxStrategy
+ * the cx strategy
+ */
+ protected void internalSetLayoutingStrategy(YLayoutingStrategy cxStrategy) {
+ ILayoutingStrategyEditpart newEitpart = getEditpart(getContext(),
+ cxStrategy);
+
+ if (this.layoutingStrategy != null) {
+ layoutingStrategy.dispose();
+ }
+
+ this.layoutingStrategy = newEitpart;
+
+ if (this.layoutingStrategy == null) {
+ getModel().setLayoutingStrategy(
+ YECviewFactory.eINSTANCE.createYDefaultLayoutingStrategy());
+ } else {
+ this.layoutingStrategy.layout();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void handleModelAdd(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSTRATEGY_LAYOUT__SUSPECTS:
+ YSuspect yElement = (YSuspect) notification.getNewValue();
+
+ ISuspectEditpart editPart = (ISuspectEditpart) getEditpart(
+ getContext(), yElement);
+ internalAddSuspect(editPart);
+ break;
+ case YECviewPackage.YSTRATEGY_LAYOUT__FOCUSING_STRATEGIES:
+ IFocusingStrategyEditpart focusingEditPart = (IFocusingStrategyEditpart) getEditpart(
+ getContext(),
+ (YFocusingStrategy) notification.getNewValue());
+ internalAddFocusingStrategy(focusingEditPart);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelMove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSTRATEGY_LAYOUT__SUSPECTS:
+ YSuspect yElement = (YSuspect) notification.getNewValue();
+
+ ISuspectEditpart editPart = (ISuspectEditpart) getEditpart(
+ getContext(), yElement);
+ internalMoveSuspect(editPart, notification.getPosition());
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void handleModelRemove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSTRATEGY_LAYOUT__SUSPECTS:
+ YSuspect yElement = (YSuspect) notification.getOldValue();
+
+ ISuspectEditpart editPart = (ISuspectEditpart) getEditpart(
+ getContext(), yElement);
+ internalRemoveSuspect(editPart);
+ break;
+ case YECviewPackage.YSTRATEGY_LAYOUT__FOCUSING_STRATEGIES:
+ IFocusingStrategyEditpart focusingEditPart = (IFocusingStrategyEditpart) getEditpart(
+ getContext(),
+ (YFocusingStrategy) notification.getOldValue());
+ internalRemoveFocusingStrategy(focusingEditPart);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#
+ * handleModelRemoveMany(int, org.eclipse.emf.common.notify.Notification)
+ */
+ protected void handleModelRemoveMany(int featureId,
+ Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSTRATEGY_LAYOUT__FOCUSING_STRATEGIES:
+
+ @SuppressWarnings("unchecked")
+ List<YFocusingStrategy> oldValues = (List<YFocusingStrategy>) notification
+ .getOldValue();
+ for (YFocusingStrategy cxFocusingStrategy : oldValues) {
+ IFocusingStrategyEditpart focusingEditPart = (IFocusingStrategyEditpart) getEditpart(
+ getContext(), cxFocusingStrategy);
+ internalRemoveFocusingStrategy(focusingEditPart);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of suspects.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddSuspect(ISuspectEditpart editpart) {
+ checkDisposed();
+
+ if (suspects == null) {
+ internalLoadSuspects();
+ }
+ if (!suspects.contains(editpart)) {
+ suspects.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and to move the given editpart in
+ * the list of suspects.
+ *
+ * @param editpart
+ * The editpart to be inserted
+ * @param index
+ * The index to move the suspect.
+ */
+ protected void internalMoveSuspect(ISuspectEditpart editpart, int index) {
+ checkDisposed();
+
+ if (suspects == null) {
+ internalLoadSuspects();
+ } else if (!suspects.contains(editpart)) {
+ throw new RuntimeException(String.format(
+ "Editpart %s is not contained in elements",
+ editpart.getId()));
+ } else {
+ suspects.remove(editpart);
+ suspects.add(index, editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of suspects.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveSuspect(ISuspectEditpart editpart) {
+ checkDisposed();
+
+ if (suspects != null && editpart != null) {
+ suspects.remove(editpart);
+ }
+ }
+
+ /**
+ * Is called to load and initialize all suspects.
+ */
+ protected void internalLoadSuspects() {
+ checkDisposed();
+
+ if (suspects == null) {
+ suspects = new ArrayList<ISuspectEditpart>();
+ for (YSuspect yElement : getModel().getSuspects()) {
+ ISuspectEditpart editPart = getEditpart(getContext(), yElement);
+ internalAddSuspect(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to load and initialize all focusing strategies.
+ */
+ protected void internalLoadFocusingStrategies() {
+ checkDisposed();
+
+ if (focusingStrategies == null) {
+ focusingStrategies = new ArrayList<IFocusingStrategyEditpart>();
+ for (YFocusingStrategy yElement : getModel()
+ .getFocusingStrategies()) {
+ IFocusingStrategyEditpart editPart = getEditpart(getContext(),
+ yElement);
+ internalAddFocusingStrategy(editPart);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#
+ * internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+
+ LOGGER.info("Disposing " + toString());
+
+ if (layoutingInfo != null) {
+ layoutingInfo.dispose();
+ layoutingInfo = null;
+ }
+
+ // lazy loading: edit parts also have to be disposed if they have
+ // not been loaded yet, but exist in the model.
+ if (suspects != null || getModel().getSuspects().size() > 0) {
+ List<ISuspectEditpart> tempElements = getSuspects();
+ synchronized (suspects) {
+ for (ISuspectEditpart editpart : tempElements
+ .toArray(new ISuspectEditpart[tempElements.size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ suspects = null;
+
+ if (layoutingStrategy != null) {
+ layoutingStrategy.dispose();
+ layoutingStrategy = null;
+ }
+
+ if (focusingStrategies != null
+ || getModel().getFocusingStrategies().size() > 0) {
+ List<IFocusingStrategyEditpart> tempElements = getFocusingStrategies();
+ synchronized (focusingStrategies) {
+ for (IFocusingStrategyEditpart editpart : tempElements
+ .toArray(new IFocusingStrategyEditpart[tempElements
+ .size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ focusingStrategies = null;
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * ONLY FOR TESTS!.
+ *
+ * @return the focusingStrategy
+ */
+ public List<IFocusingStrategyEditpart> getFocusingStrategies() {
+ internalLoadFocusingStrategies();
+
+ return focusingStrategies != null ? Collections
+ .unmodifiableList(focusingStrategies) : Collections
+ .<IFocusingStrategyEditpart> emptyList();
+ }
+
+ /**
+ * ONLY FOR TESTS!.
+ *
+ * @return the layoutingStrategy
+ */
+ public ILayoutingStrategyEditpart getLayoutingStrategy() {
+ return layoutingStrategy;
+ }
+
+ /**
+ * Gets the keystroke callbacks.
+ *
+ * @return the keystrokeCallbacks
+ */
+ public HashMap<IFocusingStrategyEditpart, KeyStrokeCallback> getKeystrokeCallbacks() {
+ return keystrokeCallbacks;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * requestFocusing(java.lang.Object, java.lang.Object,
+ * org.eclipse.osbp.ecview
+ * .extension.editparts.strategies.IFocusingStrategyEditpart)
+ */
+ @Override
+ public void requestFocusing(Object source, Object target,
+ IFocusingStrategyEditpart strategy) {
+ strategy.focus(source, target);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * requestRefresh(org.eclipse.osbp.ecview.extension.editparts.strategies.
+ * IFocusingStrategyEditpart)
+ */
+ @Override
+ public void requestRefresh(final IFocusingStrategyEditpart strategy) {
+ internalDectivateFocusingStrategy(strategy);
+ internalActivateFocusingStrategy(strategy);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart#
+ * resetToDefaultFocusing()
+ */
+ @Override
+ public void resetToDefaultFocusing() {
+ enhanceDefaultFocusing(getModel());
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectEditpart.java
new file mode 100644
index 0000000..c28c383
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectEditpart.java
@@ -0,0 +1,480 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.editpart.ICommandEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.binding.IBindableEndpointEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.visibility.IVisibilityProcessorEditpart;
+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.core.YCommand;
+import org.eclipse.osbp.ecview.core.common.model.core.YCommandSet;
+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.extension.editparts.ISuspectEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of {@link ISuspectEditpart}.
+ */
+public class SuspectEditpart extends ElementEditpart<YSuspect> implements
+ ISuspectEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(SuspectEditpart.class);
+
+ /** The bindings. */
+ private List<IBindableEndpointEditpart> bindings;
+
+ /** The commands. */
+ private List<ICommandEditpart> commands;
+
+ /** The visibility processors. */
+ private List<IVisibilityProcessorEditpart> visibilityProcessors;
+
+ /**
+ * A default constructor.
+ */
+ protected SuspectEditpart() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+ //
+ // @Override
+ // protected void doInitPresentation(IWidgetPresentation<?> presentation) {
+ // IFieldPresentation<?> fieldPresentation = (IFieldPresentation<?>)
+ // presentation;
+ //
+ // if (fieldPresentation == null) {
+ // LOGGER.warn("Presentation is null for " + getModel());
+ // return;
+ // }
+ // }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelAdd(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAdd(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSUSPECT__VALUE_BINDING_ENDPOINTS:
+ YBindingEndpoint yBindingEndpoint = (YBindingEndpoint) notification
+ .getNewValue();
+
+ IBindableEndpointEditpart editPart = (IBindableEndpointEditpart) getEditpart(getContext(),yBindingEndpoint);
+ internalAddBindingEndpoint(editPart);
+ break;
+ case YECviewPackage.YSUSPECT__COMMANDS:
+ YCommand yCommand = (YCommand) notification.getNewValue();
+
+ ICommandEditpart cEditPart = (ICommandEditpart) getEditpart(getContext(),yCommand);
+ internalAddCommand(cEditPart);
+ break;
+ case YECviewPackage.YSUSPECT__VISIBILITY_PROCESSORS:
+ YVisibilityProcessor yProcessor = (YVisibilityProcessor) notification
+ .getNewValue();
+
+ IVisibilityProcessorEditpart pEditPart = (IVisibilityProcessorEditpart) getEditpart(getContext(),yProcessor);
+ internalAddVisibilityProcessor(pEditPart);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelRemove(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSUSPECT__VALUE_BINDING_ENDPOINTS:
+ YBindingEndpoint yBindingEndpoint = (YBindingEndpoint) notification
+ .getOldValue();
+
+ IBindableEndpointEditpart editPart = (IBindableEndpointEditpart) getEditpart(getContext(),yBindingEndpoint);
+ internalRemoveBindingEndpoint(editPart);
+ break;
+ case YECviewPackage.YSUSPECT__COMMANDS:
+ YCommand yCommand = (YCommand) notification.getOldValue();
+
+ ICommandEditpart cEditPart = (ICommandEditpart) getEditpart(getContext(),yCommand);
+ internalRemoveCommand(cEditPart);
+ break;
+ case YECviewPackage.YSUSPECT__VISIBILITY_PROCESSORS:
+ YVisibilityProcessor yProcessor = (YVisibilityProcessor) notification
+ .getOldValue();
+
+ IVisibilityProcessorEditpart pEditPart = (IVisibilityProcessorEditpart) getEditpart(getContext(),yProcessor);
+ internalRemoveVisibilityProcessor(pEditPart);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * Ensures that the internal bindings are loaded properly.
+ */
+ private void ensureBindingEndpointsLoaded() {
+ if (bindings == null) {
+ internalLoadBindingEndpoints();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all bindings.
+ */
+ protected void internalLoadBindingEndpoints() {
+ checkDisposed();
+
+ if (bindings == null) {
+ bindings = new ArrayList<IBindableEndpointEditpart>();
+ for (YBindingEndpoint yBindingEP : getModel()
+ .getValueBindingEndpoints()) {
+ IBindableEndpointEditpart editPart = getEditpart(getContext(),yBindingEP);
+ internalAddBindingEndpoint(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of bindings.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddBindingEndpoint(IBindableEndpointEditpart editpart) {
+ checkDisposed();
+
+ ensureBindingEndpointsLoaded();
+ if (!bindings.contains(editpart)) {
+ bindings.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of bindings.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveBindingEndpoint(
+ IBindableEndpointEditpart editpart) {
+ checkDisposed();
+
+ if (bindings != null && editpart != null) {
+ bindings.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the binding endpoints.
+ *
+ * @return the binding endpoints
+ */
+ public List<IBindableEndpointEditpart> getBindingEndpoints() {
+ ensureBindingEndpointsLoaded();
+ return Collections.unmodifiableList(bindings);
+ }
+
+ /**
+ * Ensures that the internal commands are loaded properly.
+ */
+ private void ensureCommandsLoaded() {
+ if (commands == null) {
+ internalLoadCommands();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all commands.
+ */
+ protected void internalLoadCommands() {
+ checkDisposed();
+
+ if (commands == null) {
+ commands = new ArrayList<ICommandEditpart>();
+ for (YCommand yCommand : getModel().getCommands()) {
+ ICommandEditpart editPart = getEditpart(getContext(),yCommand);
+ internalAddCommand(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of commands.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddCommand(ICommandEditpart editpart) {
+ checkDisposed();
+
+ ensureCommandsLoaded();
+ if (!commands.contains(editpart)) {
+ commands.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of commands.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveCommand(ICommandEditpart editpart) {
+ checkDisposed();
+
+ if (commands != null && editpart != null) {
+ commands.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the commands.
+ *
+ * @return the commands
+ */
+ public List<ICommandEditpart> getCommands() {
+ ensureCommandsLoaded();
+ return Collections.unmodifiableList(commands);
+ }
+
+ /**
+ * Ensures that the internal visibilityProcessors are loaded properly.
+ */
+ private void ensureVisibilityProcessorLoaded() {
+ if (visibilityProcessors == null) {
+ internalLoadVisibilityProcessors();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all visibilityProcessors.
+ */
+ protected void internalLoadVisibilityProcessors() {
+ checkDisposed();
+
+ if (visibilityProcessors == null) {
+ visibilityProcessors = new ArrayList<IVisibilityProcessorEditpart>();
+ for (YVisibilityProcessor yVisibilityProcessor : getModel()
+ .getVisibilityProcessors()) {
+ IVisibilityProcessorEditpart editPart = getEditpart(getContext(),yVisibilityProcessor);
+ internalAddVisibilityProcessor(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of visibilityProcessors.
+ *
+ * @param editpart
+ * the editpart
+ */
+ protected void internalAddVisibilityProcessor(
+ IVisibilityProcessorEditpart editpart) {
+ checkDisposed();
+
+ ensureVisibilityProcessorLoaded();
+ if (!visibilityProcessors.contains(editpart)) {
+ visibilityProcessors.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of visibilityProcessors.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveVisibilityProcessor(
+ IVisibilityProcessorEditpart editpart) {
+ checkDisposed();
+
+ if (visibilityProcessors != null && editpart != null) {
+ visibilityProcessors.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the visibility processors.
+ *
+ * @return the visibility processors
+ */
+ public List<IVisibilityProcessorEditpart> getVisibilityProcessors() {
+ ensureVisibilityProcessorLoaded();
+ return Collections.unmodifiableList(visibilityProcessors);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+
+ LOGGER.info("Disposing " + toString());
+
+ // lazy loading: edit parts also have to be disposed if they have
+ // not been loaded yet, but exist in the model.
+ if (bindings != null
+ || getModel().getValueBindingEndpoints().size() > 0) {
+ List<IBindableEndpointEditpart> tempElements = getBindingEndpoints();
+ synchronized (bindings) {
+ for (IBindableEndpointEditpart editpart : tempElements
+ .toArray(new IBindableEndpointEditpart[tempElements
+ .size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ bindings = null;
+
+ if (commands != null || getModel().getCommands().size() > 0) {
+ List<ICommandEditpart> tempElements = getCommands();
+ synchronized (commands) {
+ for (ICommandEditpart editpart : tempElements
+ .toArray(new ICommandEditpart[tempElements.size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ commands = null;
+
+ if (visibilityProcessors != null
+ || getModel().getVisibilityProcessors().size() > 0) {
+ List<IVisibilityProcessorEditpart> tempElements = getVisibilityProcessors();
+ synchronized (visibilityProcessors) {
+ for (IVisibilityProcessorEditpart editpart : tempElements
+ .toArray(new IVisibilityProcessorEditpart[tempElements
+ .size()])) {
+ editpart.dispose();
+ }
+ }
+ }
+ visibilityProcessors = null;
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+/**
+ // * Is called to created the presenter for this edit part.<br>
+ // * We are forwarding to the element presentation.
+ // */
+ // protected <A extends IWidgetPresentation<?>> A createPresenter() {
+ // IViewEditpart viewEditPart = getView();
+ // if (viewEditPart == null) {
+ // LOGGER.info("View is null");
+ // return null;
+ // }
+ //
+/**
+/**
+ // YEmbeddable yEmbeddable = getModel().getElement();
+ // IEmbeddableEditpart editpart = getEditpart(getContext(),yEmbeddable);
+ // return DelegatingPresenterFactory.getInstance().createPresentation(
+ // viewEditPart.getContext(), editpart);
+ // }
+
+ // @Override
+ // public Object render(Object parentWidget) {
+ // internalActivate();
+ //
+ // return getPresentation().createWidget(parentWidget);
+ // }
+ //
+ // @Override
+ // public void unrender() {
+ // getPresentation().unrender();
+ //
+ // internalDeactivate();
+ // }
+
+ /**
+ * Internally activates the suspect.
+ */
+ protected void internalActivate() {
+
+ YView yView = (YView) getView();
+
+ // activate bindings
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.getTransientBindings().addAll(getModel().getAssociatedBindings());
+
+ // activate commands
+ YCommandSet yCommandSet = yView.getCommandSet();
+ yCommandSet.getTransientCommands().addAll(getModel().getCommands());
+
+ // activate visibilityProcessors
+ yView.getTransientVisibilityProcessors().addAll(
+ getModel().getVisibilityProcessors());
+
+ }
+
+ /**
+ * Gets the view.
+ *
+ * @return the view
+ */
+ public IViewEditpart getView() {
+ YView yView = ((YStrategyLayout) getModel().eContainer()).getView();
+ return yView != null ? (IViewEditpart) getEditpart(getContext(),yView) : null;
+ }
+
+ /**
+ * Internally deactivates the suspect.
+ */
+ protected void internalDeactivate() {
+ YView yView = (YView) getView();
+
+ // deactivate bindings
+ YBindingSet yBindingSet = yView.getOrCreateBindingSet();
+ yBindingSet.getTransientBindings().removeAll(getModel().getAssociatedBindings());
+
+ // deactivate commands
+ YCommandSet yCommandSet = yView.getCommandSet();
+ yCommandSet.getTransientCommands().removeAll(getModel().getCommands());
+
+ // deactivate visibilityProcessors
+ yView.getTransientVisibilityProcessors().removeAll(
+ getModel().getVisibilityProcessors());
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectLayoutingInfoEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectLayoutingInfoEditpart.java
new file mode 100644
index 0000000..07c27e3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/SuspectLayoutingInfoEditpart.java
@@ -0,0 +1,354 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.binding.IBindingEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.binding.IBindingSetEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.visibility.IVisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBinding;
+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.extension.editparts.IInternalSuspectLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ILayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.ISuspectLayoutingInfoEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Implementation of {@link ISuspectLayoutingInfoEditpart}.
+ */
+public class SuspectLayoutingInfoEditpart extends ElementEditpart<YSuspectInfo>
+ implements IInternalSuspectLayoutingInfoEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(SuspectLayoutingInfoEditpart.class);
+
+ /** The bindings. */
+ private List<IBindingEditpart<?>> bindings;
+
+ /** The vps. */
+ private List<IVisibilityProcessorEditpart> vps;
+
+ /** The binding set. */
+ private IBindingSetEditpart bindingSet;
+
+ /** The active. */
+ private boolean active;
+
+ /**
+ * A default constructor.
+ */
+ protected SuspectLayoutingInfoEditpart() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#
+ * handleModelAdd(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAdd(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSUSPECT_INFO__BINDINGS:
+ YBinding yBinding = (YBinding) notification.getNewValue();
+
+ IBindingEditpart<?> editPart = (IBindingEditpart<?>) getEditpart(
+ getContext(), yBinding);
+ internalAddBinding(editPart);
+
+ if (active) {
+ bindingSet.addTransientBinding(editPart);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#
+ * handleModelRemove(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YSUSPECT_INFO__BINDINGS:
+ YBinding yBinding = (YBinding) notification.getOldValue();
+
+ IBindingEditpart<?> editPart = (IBindingEditpart<?>) getEditpart(
+ getContext(), yBinding);
+ internalRemoveBinding(editPart);
+
+ if (active) {
+ bindingSet.removeTransientBinding(editPart);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * Ensures that the internal bindings are loaded properly.
+ */
+ private void ensureBindingsLoaded() {
+ if (bindings == null) {
+ internalLoadBindings();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all bindings.
+ */
+ protected void internalLoadBindings() {
+ checkDisposed();
+
+ if (bindings == null) {
+ bindings = new ArrayList<IBindingEditpart<?>>();
+ for (YBinding yBindingEP : getModel().getBindings()) {
+ IBindingEditpart<?> editPart = getEditpart(getContext(),
+ yBindingEP);
+ internalAddBinding(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of bindings.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddBinding(IBindingEditpart<?> editpart) {
+ checkDisposed();
+
+ ensureBindingsLoaded();
+ if (!bindings.contains(editpart)) {
+ bindings.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of bindings.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveBinding(IBindingEditpart<?> editpart) {
+ checkDisposed();
+
+ if (bindings != null && editpart != null) {
+ bindings.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the bindings.
+ *
+ * @return the bindings
+ */
+ public List<IBindingEditpart<?>> getBindings() {
+ ensureBindingsLoaded();
+ return Collections.unmodifiableList(bindings);
+ }
+
+ /**
+ * Ensures that the internal vps are loaded properly.
+ */
+ private void ensureVPsLoaded() {
+ if (vps == null) {
+ internalLoadVPs();
+ }
+ }
+
+ /**
+ * Is called to load and initialize all VPs.
+ */
+ protected void internalLoadVPs() {
+ checkDisposed();
+
+ if (vps == null) {
+ vps = new ArrayList<IVisibilityProcessorEditpart>();
+ for (YVisibilityProcessor yModel : getModel()
+ .getVisibilityProcessors()) {
+ IVisibilityProcessorEditpart editPart = getEditpart(
+ getContext(), yModel);
+ internalAddVP(editPart);
+ }
+ }
+ }
+
+ /**
+ * Is called to change the internal state and add the given editpart to the
+ * list of vps.
+ *
+ * @param editpart
+ * The editpart to be added
+ */
+ protected void internalAddVP(IVisibilityProcessorEditpart editpart) {
+ checkDisposed();
+
+ ensureVPsLoaded();
+ if (!vps.contains(editpart)) {
+ vps.add(editpart);
+ }
+ }
+
+ /**
+ * Is called to change the internal state and remove the given editpart from
+ * the list of vps.
+ *
+ * @param editpart
+ * The editpart to be removed
+ */
+ protected void internalRemoveVP(IVisibilityProcessorEditpart editpart) {
+ checkDisposed();
+
+ if (vps != null && editpart != null) {
+ vps.remove(editpart);
+ }
+ }
+
+ /**
+ * Gets the vps.
+ *
+ * @return the vps
+ */
+ public List<IVisibilityProcessorEditpart> getVPs() {
+ ensureVPsLoaded();
+ return Collections.unmodifiableList(vps);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#
+ * internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+
+ try {
+ LOGGER.info("Disposing " + toString());
+
+ active = false;
+
+ for (IVisibilityProcessorEditpart vp : getVPs()) {
+ vp.dispose();
+ }
+ vps = null;
+
+ for (IBindingEditpart<?> binding : getBindings()) {
+ // remove the binding -> Will be automatically disposed
+ bindingSet.removeTransientBinding(binding);
+ }
+ bindings = null;
+ bindingSet = null;
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.editparts.ISuspectLayoutingInfoEditpart
+ * #getView()
+ */
+ public IViewEditpart getView() {
+ YView yView = ((YStrategyLayout) getModel().eContainer().eContainer())
+ .getView();
+ ;
+ return yView != null ? (IViewEditpart) getEditpart(getContext(), yView)
+ : null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#
+ * requestDispose()
+ */
+ public void requestDispose() {
+ throw new UnsupportedOperationException("Implement later or remove");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.extension.editparts.ISuspectLayoutingInfoEditpart
+ * #getParent()
+ */
+ @Override
+ public ILayoutingInfoEditpart getParent() {
+ YLayoutingInfo cxLayout = (YLayoutingInfo) getModel().eContainer();
+ return cxLayout != null ? (ILayoutingInfoEditpart) getEditpart(
+ getContext(), cxLayout) : null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.editparts.
+ * IInternalSuspectLayoutingInfoEditpart#activate()
+ */
+ @Override
+ public void activate() {
+ if (active) {
+ return;
+ }
+
+ try {
+ // hold a reference to the bindingSet
+ bindingSet = getView().getBindingSet();
+ for (IBindingEditpart<?> binding : getBindings()) {
+ // else add it
+ bindingSet.addTransientBinding(binding);
+ }
+ } finally {
+ active = true;
+ }
+ }
+
+ @Override
+ public void postActivate() {
+ for (IVisibilityProcessorEditpart vp : getVPs()) {
+ vp.activate();
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/BlobUploadComponentEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/BlobUploadComponentEditpart.java
new file mode 100644
index 0000000..41d537c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/BlobUploadComponentEditpart.java
@@ -0,0 +1,38 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.components;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.validation.IValidatorEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IBlobUploadComponentEditpart;
+import org.eclipse.osbp.ecview.extension.model.YBlobUploadComponent;
+
+/**
+ * The Class BlobUploadComponentEditpart.
+ */
+public class BlobUploadComponentEditpart extends FieldEditpart<YBlobUploadComponent> implements
+ IBlobUploadComponentEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart#getDatatypeValidators()
+ */
+ @Override
+ public List<IValidatorEditpart> getDatatypeValidators() {
+ return Collections.emptyList();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/ContentSensitiveLayoutEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/ContentSensitiveLayoutEditpart.java
new file mode 100644
index 0000000..d850fcc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/ContentSensitiveLayoutEditpart.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.components;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.LayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IContentSensitiveLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.model.YContentSensitiveLayout;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The implementation of the IStrategyLayoutEditpart.
+ */
+public class ContentSensitiveLayoutEditpart extends
+ LayoutEditpart<YContentSensitiveLayout> implements
+ IContentSensitiveLayoutEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ContentSensitiveLayoutEditpart.class);
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/CustomDecimalFieldEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/CustomDecimalFieldEditpart.java
new file mode 100644
index 0000000..f750917
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/CustomDecimalFieldEditpart.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
+ * Florian Pirchner - Initial implementation
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.components;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.ICustomDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YCustomDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+
+/**
+ * The implementation of the IUiDecimalFieldEditpart.
+ */
+public class CustomDecimalFieldEditpart extends FieldEditpart<YCustomDecimalField>
+ implements ICustomDecimalFieldEditpart {
+
+ public CustomDecimalFieldEditpart() {
+ super(YECviewPackage.Literals.YCUSTOM_DECIMAL_FIELD__DATATYPE);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/IconComboBoxEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/IconComboBoxEditpart.java
new file mode 100644
index 0000000..af222d2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/IconComboBoxEditpart.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
+ * Florian Pirchner - Initial implementation
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.components;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IIconComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YIconComboBox;
+
+/**
+ * The implementation of the IUiComboBoxEditpart.
+ */
+public class IconComboBoxEditpart extends FieldEditpart<YIconComboBox>
+ implements IIconComboBoxEditpart {
+
+ public IconComboBoxEditpart() {
+ super(YECviewPackage.Literals.YICON_COMBO_BOX__DATATYPE);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/PairComboBoxEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/PairComboBoxEditpart.java
new file mode 100644
index 0000000..39d7b5f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/PairComboBoxEditpart.java
@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
+ * Florian Pirchner - Initial implementation
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.components;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.FieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IPairComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.model.YPairComboBox;
+
+/**
+ * The implementation of the IPairComboBoxEditpart.
+ */
+public class PairComboBoxEditpart extends FieldEditpart<YPairComboBox> implements IPairComboBoxEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java
new file mode 100644
index 0000000..ffe227e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/components/services/ContextSensitiveLayoutSelector.java
@@ -0,0 +1,42 @@
+/**
+ *
+ * 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.ecview.extension.editparts.emf.components.services;
+
+import org.eclipse.osbp.ecview.extension.api.IContextSensitiveLayoutSelector;
+import org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+
+@Component
+public class ContextSensitiveLayoutSelector implements
+ IContextSensitiveLayoutSelector {
+
+ private IFunctionLibraryService service;
+
+ @Override
+ public String selectComponent(Object dto) {
+ return (String) service.callFunctionLibrary(FUNCTION_GROUP, FUNCTION_NAME, dto);
+ }
+
+ @Reference(cardinality=ReferenceCardinality.MANDATORY)
+ void bind(IFunctionLibraryService service) {
+ this.service = service;
+ }
+
+ void unbind(IFunctionLibraryService service) {
+ this.service = null;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/CustomDecimalConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/CustomDecimalConverterEditpart.java
new file mode 100644
index 0000000..611979d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/CustomDecimalConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.ICustomDecimalConverterEditpart;
+
+/**
+ * The Class CustomDecimalConverterEditpart.
+ */
+public class CustomDecimalConverterEditpart extends ConverterEditpart
+ implements ICustomDecimalConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/DecimalToUomoConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/DecimalToUomoConverterEditpart.java
new file mode 100644
index 0000000..f3cdcb5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/DecimalToUomoConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IDecimalToUomoConverterEditpart;
+
+/**
+ * The Class DecimalToUomoConverterEditpart.
+ */
+public class DecimalToUomoConverterEditpart extends ConverterEditpart
+ implements IDecimalToUomoConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToResourceConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToResourceConverterEditpart.java
new file mode 100644
index 0000000..1a35ab6
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToResourceConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.INumericToResourceConverterEditpart;
+
+/**
+ * The Class NumericToResourceConverterEditpart.
+ */
+public class NumericToResourceConverterEditpart extends ConverterEditpart
+ implements INumericToResourceConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToUomoConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToUomoConverterEditpart.java
new file mode 100644
index 0000000..a2471f5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/NumericToUomoConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.INumericToUomoConverterEditpart;
+
+/**
+ * The Class NumericToUomoConverterEditpart.
+ */
+public class NumericToUomoConverterEditpart extends ConverterEditpart
+ implements INumericToUomoConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/ObjectToStringConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/ObjectToStringConverterEditpart.java
new file mode 100644
index 0000000..911ae63
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/ObjectToStringConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IObjectToStringConverterEditpart;
+
+/**
+ * The Class ObjectToStringConverterEditpart.
+ */
+public class ObjectToStringConverterEditpart extends ConverterEditpart
+ implements IObjectToStringConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/PriceToStringConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/PriceToStringConverterEditpart.java
new file mode 100644
index 0000000..6625bcd
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/PriceToStringConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IPriceToStringConverterEditpart;
+
+/**
+ * The Class PriceToStringConverterEditpart.
+ */
+public class PriceToStringConverterEditpart extends ConverterEditpart implements
+ IPriceToStringConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/QuantityToStringConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/QuantityToStringConverterEditpart.java
new file mode 100644
index 0000000..bbfbb6b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/QuantityToStringConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IQuantityToStringConverterEditpart;
+
+/**
+ * The Class QuantityToStringConverterEditpart.
+ */
+public class QuantityToStringConverterEditpart extends ConverterEditpart
+ implements IQuantityToStringConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/SimpleDecimalConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/SimpleDecimalConverterEditpart.java
new file mode 100644
index 0000000..5dc595e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/SimpleDecimalConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.ISimpleDecimalConverterEditpart;
+
+/**
+ * The Class SimpleDecimalConverterEditpart.
+ */
+public class SimpleDecimalConverterEditpart extends ConverterEditpart
+ implements ISimpleDecimalConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/StringToResourceConverterEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/StringToResourceConverterEditpart.java
new file mode 100644
index 0000000..69f80c9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/converter/StringToResourceConverterEditpart.java
@@ -0,0 +1,25 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.converter;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IStringToResourceConverterEditpart;
+
+/**
+ * The Class StringToResourceConverterEditpart.
+ */
+public class StringToResourceConverterEditpart extends ConverterEditpart
+ implements IStringToResourceConverterEditpart {
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/AltEnterFocusingEnhancer.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/AltEnterFocusingEnhancer.java
new file mode 100644
index 0000000..290f6f3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/AltEnterFocusingEnhancer.java
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.enhancer;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * The Class AltEnterFocusingEnhancer.
+ */
+@Component(property={"ecview.focusing.enhancer.id=AltEnterFocusingEnhancer"})
+public class AltEnterFocusingEnhancer implements IFocusingEnhancer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer#enhanceFocusing(org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void enhanceFocusing(YStrategyLayout yLayout) {
+ yLayout.getFocusingStrategies().clear();
+
+ YDelegatingFocusingStrategy yStgy1 = YECviewFactory.eINSTANCE.createYDelegatingFocusingStrategy();
+ yStgy1.setDelegateStrategyId("cx.altenter.forward");
+ yLayout.getFocusingStrategies().add(yStgy1);
+
+ YDelegatingFocusingStrategy yStgy2 = YECviewFactory.eINSTANCE.createYDelegatingFocusingStrategy();
+ yStgy2.setDelegateStrategyId("cx.enter.backward");
+ yLayout.getFocusingStrategies().add(yStgy2);
+
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/EnterTabFocusingEnhancer.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/EnterTabFocusingEnhancer.java
new file mode 100644
index 0000000..260e34b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/EnterTabFocusingEnhancer.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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.enhancer;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * The Class EnterTabFocusingEnhancer.
+ */
+@Component(property = {
+ "ecview.focusing.enhancer.id=EnterTabFocusingEnhancer"})
+public class EnterTabFocusingEnhancer implements IFocusingEnhancer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer#enhanceFocusing(org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void enhanceFocusing(YStrategyLayout cxLayout) {
+ cxLayout.getFocusingStrategies().clear();
+
+ YDelegatingFocusingStrategy yStgy1 = YECviewFactory.eINSTANCE
+ .createYDelegatingFocusingStrategy();
+ yStgy1.setDelegateStrategyId("cx.enter.forward");
+ cxLayout.getFocusingStrategies().add(yStgy1);
+
+ YDelegatingFocusingStrategy yStgy2 = YECviewFactory.eINSTANCE
+ .createYDelegatingFocusingStrategy();
+ yStgy2.setDelegateStrategyId("cx.tab.backward");
+ cxLayout.getFocusingStrategies().add(yStgy2);
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/TabEnterFocusingEnhancer.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/TabEnterFocusingEnhancer.java
new file mode 100644
index 0000000..341da86
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/enhancer/TabEnterFocusingEnhancer.java
@@ -0,0 +1,45 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.enhancer;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * The Class TabEnterFocusingEnhancer.
+ */
+@Component(property={"ecview.focusing.enhancer.id=TabEnterFocusingEnhancer"})
+public class TabEnterFocusingEnhancer implements IFocusingEnhancer {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer#enhanceFocusing(org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void enhanceFocusing(YStrategyLayout cxLayout) {
+ cxLayout.getFocusingStrategies().clear();
+
+ YDelegatingFocusingStrategy yStgy1 = YECviewFactory.eINSTANCE.createYDelegatingFocusingStrategy();
+ yStgy1.setDelegateStrategyId("cx.enter.backward");
+ cxLayout.getFocusingStrategies().add(yStgy1);
+
+ YDelegatingFocusingStrategy yStgy2 = YECviewFactory.eINSTANCE.createYDelegatingFocusingStrategy();
+ yStgy2.setDelegateStrategyId("cx.tab.forward");
+ cxLayout.getFocusingStrategies().add(yStgy2);
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DefaultLayoutingStrategyEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DefaultLayoutingStrategyEditpart.java
new file mode 100644
index 0000000..fa832cc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DefaultLayoutingStrategyEditpart.java
@@ -0,0 +1,148 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.strategies;
+
+import java.util.Collection;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IDefaultLayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YDefaultLayoutingStrategy;
+import org.eclipse.osbp.runtime.common.event.IEventBroker;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * See {@link IFocusingStrategyEditpart}.
+ */
+public class DefaultLayoutingStrategyEditpart extends
+ LayoutingStrategyEditpart<YDefaultLayoutingStrategy> implements
+ IDefaultLayoutingStrategyEditpart, EventHandler {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(DefaultLayoutingStrategyEditpart.class);
+
+ /**
+ * The default constructor.
+ */
+ protected DefaultLayoutingStrategyEditpart() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.emf.strategies.LayoutingStrategyEditpart#initialize(org.eclipse.osbp.ecview.extension.model.YLayoutingStrategy)
+ */
+ @Override
+ public void initialize(IViewContext context, YDefaultLayoutingStrategy model) {
+ super.initialize(context, model);
+
+ setDefaultStrategy();
+
+ IViewContext viewContext = getView().getContext();
+ IEventBroker eventBroker = viewContext.getService(IEventBroker.class
+ .getName());
+ if (eventBroker == null) {
+ LOGGER.error("Eventbroker not available!");
+ return;
+ }
+
+ eventBroker.subscribe(ILayoutingStrategyProvider.ACTIVE_PROVIDER_TOPIC, this);
+ }
+
+ /**
+ * Sets the default strategy.
+ */
+ protected void setDefaultStrategy() {
+// IViewContext viewContext = getView().getContext();
+ ILayoutingStrategyProvider provider = findDefaultService();
+// ILayoutingStrategyProvider provider = viewContext
+// .getService(ILayoutingStrategyProvider.class.getName());
+ if (provider == null) {
+ LOGGER.error("IDefaultLayoutingStrategyProvider not available!");
+ return;
+ }
+ this.strategy = provider.getStrategy();
+ }
+
+
+ /**
+ * Finds the default service.
+ *
+ * @return the i layouting strategy provider
+ */
+ private ILayoutingStrategyProvider findDefaultService() {
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+
+ try {
+ Collection<ServiceReference<ILayoutingStrategyProvider>> references = context
+ .getServiceReferences(ILayoutingStrategyProvider.class,
+ "(ecview.layouting.id=Default)");
+ if (!references.isEmpty()) {
+ ILayoutingStrategyProvider provider = context
+ .getService(references.iterator().next());
+ return provider;
+ }
+ } catch (InvalidSyntaxException e) {
+ LOGGER.warn("{}", e);
+ }
+ return null;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.osgi.service.event.EventHandler#handleEvent(org.osgi.service.event.Event)
+ */
+ @Override
+ public void handleEvent(Event event) {
+ checkDisposed();
+
+ ILayoutingStrategyProvider result = (ILayoutingStrategyProvider) event
+ .getProperty(IEventBroker.DATA);
+ if (result != null) {
+ this.strategy = result.getStrategy();
+
+ // call the parent to do layouting
+ getParent().requestLayouting();
+ } else {
+ LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.emf.strategies.LayoutingStrategyEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ IEventBroker eventBroker = getView().getContext().getService(
+ IEventBroker.class.getName());
+ if (eventBroker == null) {
+ LOGGER.error("Eventbroker not available! Could not unsubscribe.");
+ } else {
+ eventBroker.unsubscribe(this);
+ }
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingFocusingStrategyEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingFocusingStrategyEditpart.java
new file mode 100644
index 0000000..d039d95
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingFocusingStrategyEditpart.java
@@ -0,0 +1,165 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.strategies;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IDelegatingFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * See {@link IDelegatingFocusingStrategyEditpart}.
+ */
+public class DelegatingFocusingStrategyEditpart extends
+ FocusingStrategyEditpart<YDelegatingFocusingStrategy> implements
+ IDelegatingFocusingStrategyEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(DefaultLayoutingStrategyEditpart.class);
+
+ /**
+ * The default constructor.
+ */
+ protected DelegatingFocusingStrategyEditpart() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#initialize(org.eclipse.osbp.ecview.core.common.model.core.YElement)
+ */
+ @Override
+ public void initialize(IViewContext context, YDelegatingFocusingStrategy model) {
+ applyInitialStrategy(model);
+
+ super.initialize(context, model);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YDELEGATING_FOCUSING_STRATEGY__DELEGATE_STRATEGY_ID:
+ internalSetDelegate(notification.getNewStringValue());
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Applies the initial strategy and ensures that key strokes are available.
+ *
+ * @param model
+ * the model
+ */
+ protected void applyInitialStrategy(YDelegatingFocusingStrategy model) {
+ IFocusingStrategyProvider result = findService(model
+ .getDelegateStrategyId());
+ if (result != null) {
+ this.strategy = result.getStrategy();
+ } else {
+ LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ }
+
+ internalSetKeystroke(model);
+ }
+
+ /**
+ * Internal set delegate.
+ *
+ * @param id
+ * the id
+ */
+ public void internalSetDelegate(String id) {
+ checkDisposed();
+
+ IFocusingStrategyProvider result = findService(id);
+ if (result != null) {
+ this.strategy = result.getStrategy();
+ // key key stroke definitions
+ internalSetKeystroke();
+ } else {
+ LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ }
+ }
+
+ /**
+ * Finds the service with the given id.
+ *
+ * @param id
+ * the id
+ * @return the i focusing strategy provider
+ */
+ private IFocusingStrategyProvider findService(String id) {
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+
+ try {
+ Collection<ServiceReference<IFocusingStrategyProvider>> references = context
+ .getServiceReferences(IFocusingStrategyProvider.class,
+ String.format("(ecview.focusing.id=%s)", id));
+ if (!references.isEmpty()) {
+ IFocusingStrategyProvider provider = context
+ .getService(references.iterator().next());
+ return provider;
+ }
+ } catch (InvalidSyntaxException e) {
+ LOGGER.warn("{}", e);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.emf.strategies.FocusingStrategyEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ LOGGER.info("Disposing " + toString());
+
+ viewContext = null;
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.emf.strategies.FocusingStrategyEditpart#doFocus(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ protected void doFocus(Object source, Object target) {
+ checkDisposed();
+
+ if (strategy != null) {
+ strategy.focus(source, target, (YStrategyLayout) getParent()
+ .getModel());
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingLayoutingStrategyEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingLayoutingStrategyEditpart.java
new file mode 100644
index 0000000..405ab0d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/DelegatingLayoutingStrategyEditpart.java
@@ -0,0 +1,162 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.strategies;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IDelegatingLayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YDelegatingLayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * See {@link IFocusingStrategyEditpart}.
+ */
+public class DelegatingLayoutingStrategyEditpart extends
+ LayoutingStrategyEditpart<YDelegatingLayoutingStrategy> implements
+ IDelegatingLayoutingStrategyEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(DelegatingLayoutingStrategyEditpart.class);
+
+ /**
+ * The default constructor.
+ */
+ protected DelegatingLayoutingStrategyEditpart() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#initialize(org.eclipse.osbp.ecview.core.common.model.core.YElement)
+ */
+ @Override
+ public void initialize(IViewContext context, YDelegatingLayoutingStrategy model) {
+ applyInitialStrategy(model);
+
+ super.initialize(context, model);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YDELEGATING_LAYOUTING_STRATEGY__DELEGATE_STRATEGY_ID:
+ internalSetDelegate(notification.getNewStringValue());
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Applies the initial strategy and ensures that key strokes are available.
+ *
+ * @param model
+ * the model
+ */
+ protected void applyInitialStrategy(YDelegatingLayoutingStrategy model) {
+ ILayoutingStrategyProvider result = findService(model
+ .getDelegateStrategyId());
+ if (result != null) {
+ this.strategy = result.getStrategy();
+ } else {
+ LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ }
+ }
+
+ /**
+ * Internal set delegate.
+ *
+ * @param id
+ * the id
+ */
+ public void internalSetDelegate(String id) {
+ checkDisposed();
+
+ ILayoutingStrategyProvider result = findService(id);
+ if (result != null) {
+ this.strategy = result.getStrategy();
+ } else {
+ LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ }
+ }
+
+ /**
+ * Finds the service with the given id.
+ *
+ * @param id
+ * the id
+ * @return the i layouting strategy provider
+ */
+ private ILayoutingStrategyProvider findService(String id) {
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+
+ try {
+ Collection<ServiceReference<ILayoutingStrategyProvider>> references = context
+ .getServiceReferences(ILayoutingStrategyProvider.class,
+ String.format("(ecview.layouting.id=%s)", id));
+ if (!references.isEmpty()) {
+ ILayoutingStrategyProvider provider = context
+ .getService(references.iterator().next());
+ return provider;
+ }
+ } catch (InvalidSyntaxException e) {
+ LOGGER.warn("{}", e);
+ }
+ return null;
+ }
+
+ // @Override
+ // public void handleEvent(Event event) {
+ // checkDisposed();
+ //
+ // ILayoutingStrategyProvider result = (ILayoutingStrategyProvider) event
+ // .getProperty(IEventBroker.DATA);
+ // if (result != null) {
+ // this.strategy = result.getStrategy();
+ //
+/**
+ // getParent().requestLayouting();
+ // } else {
+ // LOGGER.warn("Strategy was null. So current strategy was not replaced.");
+ // }
+ // }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.emf.strategies.LayoutingStrategyEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/FocusingStrategyEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/FocusingStrategyEditpart.java
new file mode 100644
index 0000000..4117d1f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/FocusingStrategyEditpart.java
@@ -0,0 +1,232 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.strategies;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IKeyStrokeDefinitionEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YKeyStrokeDefinition;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.model.core.impl.custom.KeyStrokeUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.editparts.IInternalFocusingEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YFocusingStrategy;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * See {@link IFocusingStrategyEditpart}.
+ *
+ * @param <M>
+ * the generic type
+ */
+public abstract class FocusingStrategyEditpart<M extends YFocusingStrategy>
+ extends ElementEditpart<M> implements IInternalFocusingEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(FocusingStrategyEditpart.class);
+
+ /** The strategy. */
+ protected IFocusingStrategy strategy;
+
+ /** The key stroke def. */
+ private IKeyStrokeDefinitionEditpart keyStrokeDef;
+
+ /** The view context. */
+ protected IViewContext viewContext;
+
+ /**
+ * The default constructor.
+ */
+ protected FocusingStrategyEditpart() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IStrategyLayoutEditpart getParent() {
+ YElement yParent = (YElement) getModel().eContainer();
+ return yParent != null ? (IStrategyLayoutEditpart) getEditpart(getContext(),yParent) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart#getView()
+ */
+ @Override
+ public IViewEditpart getView() {
+ YView yView = getModel().getView();
+ return yView != null ? (IViewEditpart) getEditpart(getContext(),yView) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.strategies.IFocusingStrategyEditpart#focus(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void focus(Object source, Object target) {
+ doFocus(source, target);
+ }
+
+ /**
+ * Do focus.
+ *
+ * @param source
+ * the source
+ * @param target
+ * the target
+ */
+ protected abstract void doFocus(Object source, Object target);
+
+ /**
+ * Internal set keystroke.
+ */
+ protected void internalSetKeystroke() {
+ internalSetKeystroke(getModel());
+ }
+
+ /**
+ * Creates the keystroke based on internal definitions or by the strategy.
+ *
+ * @param model
+ * the model
+ * @model
+ */
+ protected void internalSetKeystroke(M model) {
+ if (model.getKeyStrokeDefinition() == null) {
+ if (strategy == null) {
+ throw new IllegalStateException("Strategy must not be null!");
+ }
+ KeyStrokeDefinition tempDef = strategy.getKeyStrokeDefinition();
+ YKeyStrokeDefinition yDef = KeyStrokeUtil.from(tempDef);
+ model.setTempStrokeDefinition(yDef);
+ }
+ }
+
+ /**
+ * Set the new content.
+ *
+ * @param yDefinition
+ * the y definition
+ */
+ protected void internalSetKeyStrokeDefinition(
+ YKeyStrokeDefinition yDefinition) {
+ ensureKeyStrokeDefinitionLoaded();
+
+ IKeyStrokeDefinitionEditpart newDefinition = getEditpart(getContext(),yDefinition);
+ if (this.keyStrokeDef == newDefinition) {
+ return;
+ }
+
+ IKeyStrokeDefinitionEditpart oldDefinition = this.keyStrokeDef;
+ this.keyStrokeDef = newDefinition;
+
+ if (oldDefinition != null) {
+ oldDefinition.dispose();
+ }
+
+ if (this.keyStrokeDef == null) {
+ ensureKeyStrokeDefinitionLoaded();
+ }
+
+ // request refresh at the layout
+ getParent().requestRefresh(this);
+ }
+
+ /**
+ * Ensures that the internal keystroke definitions are loaded properly.
+ */
+ private void ensureKeyStrokeDefinitionLoaded() {
+ if (keyStrokeDef == null) {
+ keyStrokeDef = getEditpart(getContext(),getModel().getKeyStrokeDefinition());
+ }
+
+ if (keyStrokeDef == null) {
+ keyStrokeDef = getEditpart(getContext(),getModel().getTempStrokeDefinition());
+ }
+ }
+
+ /**
+ * Returns the keyStrokeDefinition editpart.
+ *
+ * @return the keyStrokeDef
+ */
+ public IKeyStrokeDefinitionEditpart getKeyStrokeDefinition() {
+ ensureKeyStrokeDefinitionLoaded();
+ return keyStrokeDef;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case YECviewPackage.YFOCUSING_STRATEGY__KEY_STROKE_DEFINITION:
+ internalSetKeyStrokeDefinition((YKeyStrokeDefinition) notification
+ .getNewValue());
+ break;
+ case YECviewPackage.YFOCUSING_STRATEGY__TEMP_STROKE_DEFINITION:
+ // if there is not defined keystroke definition, then use the temp
+ // one
+ if (getModel().getKeyStrokeDefinition() == null) {
+ internalSetKeyStrokeDefinition((YKeyStrokeDefinition) notification
+ .getNewValue());
+ }
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.IInternalFocusingEditpart#activate()
+ */
+ @Override
+ public void activate() {
+ viewContext = getView().getContext();
+ }
+
+ /**
+ * ONLY FOR TESTS!.
+ *
+ * @return the strategy
+ */
+ public IFocusingStrategy getStrategy() {
+ return strategy;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ strategy = null;
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/LayoutingStrategyEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/LayoutingStrategyEditpart.java
new file mode 100644
index 0000000..6a3878f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/strategies/LayoutingStrategyEditpart.java
@@ -0,0 +1,157 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.strategies;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IViewEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.strategies.ILayoutingStrategyEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * See {@link ILayoutingStrategyEditpart}.
+ *
+ * @param <M>
+ * the generic type
+ */
+public abstract class LayoutingStrategyEditpart<M extends YLayoutingStrategy>
+ extends ElementEditpart<M> implements ILayoutingStrategyEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(LayoutingStrategyEditpart.class);
+
+ /** The strategy. */
+ protected ILayoutingStrategy strategy;
+
+ /** The layouting info. */
+ private YLayoutingInfo layoutingInfo;
+
+ /** The y view. */
+ protected YView yView;
+
+ /**
+ * The default constructor.
+ */
+ protected LayoutingStrategyEditpart() {
+ }
+
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IStrategyLayoutEditpart getParent() {
+ YElement yParent = (YElement) getModel().eContainer();
+ return yParent != null ? (IStrategyLayoutEditpart) getEditpart(getContext(),yParent) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#initialize(org.eclipse.osbp.ecview.core.common.model.core.YElement)
+ */
+ public void initialize(IViewContext context, M model) {
+ super.initialize(context, model);
+
+ yView = getModel().getView();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.strategies.ILayoutingStrategyEditpart#getView()
+ */
+ @Override
+ public IViewEditpart getView() {
+ return yView != null ? (IViewEditpart) getEditpart(getContext(),yView) : null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ strategy = null;
+ yView = null;
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#requestDispose()
+ */
+ @Override
+ public void requestDispose() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Creates a new layouting info.
+ *
+ * @return the y layouting info
+ */
+ protected YLayoutingInfo createLayoutingInfo() {
+ YLayoutingInfo info = YECviewFactory.eINSTANCE
+ .createYLayoutingInfo();
+ info.setLayout(getLayout());
+ return info;
+ }
+
+ /**
+ * Gets the layout.
+ *
+ * @return the layout
+ */
+ protected YStrategyLayout getLayout() {
+ return (YStrategyLayout) getParent().getModel();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.strategies.ILayoutingStrategyEditpart#layout()
+ */
+ @Override
+ public void layout() {
+ checkDisposed();
+
+ if (strategy != null) {
+ layoutingInfo = createLayoutingInfo();
+ // reset the layouting info
+ getLayout().setLayoutingInfo(null);
+ strategy.layout(layoutingInfo);
+ // now set the layoutInfo again
+ getLayout().setLayoutingInfo(layoutingInfo);
+ }
+ }
+
+ /**
+ * ONLY FOR TESTS!.
+ *
+ * @return the strategy
+ */
+ public ILayoutingStrategy getStrategy() {
+ return strategy;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/util/OsECViewUtil.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/util/OsECViewUtil.java
new file mode 100644
index 0000000..dbb6346
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/util/OsECViewUtil.java
@@ -0,0 +1,43 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.util;
+
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.IFocusingEnhancer;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class OsECViewUtil.
+ */
+public class OsECViewUtil extends ModelUtil {
+
+ /**
+ * Sets the focusing enhancer.
+ *
+ * @param layout
+ * the layout
+ * @param focusingEnhancerId
+ * the focusing enhancer id
+ */
+ public void setFocusingEnhancer(YStrategyLayout layout,
+ String focusingEnhancerId) {
+ IStrategyLayoutEditpart strategyEditpart = ModelUtil
+ .findEditpart(layout);
+ IFocusingEnhancer enhancer = strategyEditpart
+ .findFocusingEnhancerService(focusingEnhancerId);
+ layout.getFocusingStrategies().clear();
+ enhancer.enhanceFocusing(layout);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java
new file mode 100644
index 0000000..76e4a62
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessor.java
@@ -0,0 +1,324 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.visibility;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YField;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.notification.ILifecycleEvent;
+import org.eclipse.osbp.ecview.core.common.notification.ILifecycleHandler;
+import org.eclipse.osbp.ecview.core.common.notification.ILifecycleService;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityHandler;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityManager;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Action;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission;
+import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
+
+/**
+ * The Class AuthorizationVisibilityProcessor.
+ */
+public class AuthorizationVisibilityProcessor implements IVisibilityProcessor,
+ ILifecycleHandler {
+
+ /** The handlers. */
+ private Set<Handler> handlers = new HashSet<>();
+
+ /** The input. */
+ @SuppressWarnings("unused")
+ private Object input;
+
+ /** The context. */
+ private IViewContext context;
+
+ /** The lifecycle service. */
+ private ILifecycleService lifecycleService;
+
+ /** The y view. */
+ private YView yView;
+
+ /** The manager. */
+ private IVisibilityManager manager;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#init
+ * (org.eclipse.osbp.ecview.core.common.visibility.IVisibilityManager)
+ */
+ @Override
+ public void init(IVisibilityManager manager) {
+ this.manager = manager;
+ List<YEmbeddable> yEmbeddables = collectAllEmbeddables();
+ for (YEmbeddable target : yEmbeddables) {
+ // do not create handlers for layouts, tabSheets,...
+ if (target instanceof YField) {
+ handlers.add(new Handler(manager, target));
+ }
+ }
+ lifecycleService = context
+ .getService(ILifecycleService.class.getName());
+ lifecycleService.addHandler(this);
+
+ /*
+ * This VP is not triggered by changing data. And at this point, the vp
+ * becomes activated the first time -> we need to fire initially.
+ *
+ * PLEASE DO NOT REMOVE!
+ */
+ fire();
+ }
+
+ /**
+ * Setup.
+ *
+ * @param context
+ * the context
+ * @param yVP
+ * the y vp
+ */
+ public void setup(IViewContext context,
+ YAuthorizationVisibilityProcessor yVP) {
+
+ yView = (YView) context.getViewEditpart().getModel();
+
+ this.context = context;
+ }
+
+ /**
+ * Find all embeddables in the given yView.<br>
+ * The ui is rendered now.
+ *
+ * @return the list
+ */
+ private List<YEmbeddable> collectAllEmbeddables() {
+ List<YEmbeddable> yEmbeddables = new ArrayList<>();
+ TreeIterator<EObject> iter = EcoreUtil
+ .getAllProperContents(yView, true);
+ while (iter.hasNext()) {
+ EObject eObject = iter.next();
+ if (eObject instanceof YEmbeddable) {
+ yEmbeddables.add((YEmbeddable) eObject);
+ }
+ }
+ return yEmbeddables;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.notification.ILifecycleHandler#
+ * notifyLifecycle
+ * (org.eclipse.osbp.ecview.core.common.notification.ILifecycleEvent)
+ */
+ @Override
+ public void notifyLifecycle(ILifecycleEvent event) {
+ Object model = event.getEditpart().getModel();
+ if (model instanceof YEmbeddable) {
+ Handler handler = findHandler((YEmbeddable) model);
+ if (ILifecycleEvent.TYPE_UNRENDERED.equals(event.getType())) {
+ if (handler != null) {
+ handlers.remove(handler);
+ }
+ } else if (ILifecycleEvent.TYPE_DISPOSED.equals(event.getType())) {
+ if (handler != null) {
+ handlers.remove(handler);
+ }
+ if (model == yView) {
+ // means the view was disposed!
+ internalDispose();
+ }
+ } else if (ILifecycleEvent.TYPE_RENDERED.equals(event.getType())) {
+ if (handler == null) {
+ handlers.add(new Handler(manager, (YEmbeddable) model));
+ }
+ }
+ }
+ }
+
+ /**
+ * Internal dispose.
+ */
+ private void internalDispose() {
+ lifecycleService.removeHandler(this);
+ lifecycleService = null;
+
+ handlers.clear();
+ handlers = null;
+
+ manager = null;
+ context = null;
+ yView = null;
+ }
+
+ /**
+ * Returns the handler for the given model or <code>null</code> if no
+ * handler is available.
+ *
+ * @param model
+ * the model
+ * @return the handler
+ */
+ private Handler findHandler(YEmbeddable model) {
+ for (Handler handler : handlers) {
+ if (handler.model == model) {
+ return handler;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#fire
+ * ()
+ */
+ @Override
+ public void fire() {
+ doFire();
+
+ for (Handler handler : handlers) {
+ handler.apply();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#setInput
+ * (java.lang.Object)
+ */
+ @Override
+ public void setInput(Object input) {
+ this.input = input;
+
+ fire();
+ }
+
+ /**
+ * Do fire.
+ */
+ public void doFire() {
+ IUserAccessService userAccessService = context
+ .getService(IUserAccessService.class.getName());
+ for (Handler handler : handlers) {
+ handler.handle(userAccessService);
+ }
+ }
+
+ /**
+ * The Class Handler.
+ */
+ private static class Handler {
+
+ /** The target. */
+ private IVisibilityHandler target;
+
+ /** The field id. */
+ private String fieldId;
+
+ /** The entity name. */
+ private String dtoName;
+
+ /** The entity property. */
+ private String dtoProperty;
+
+ /** The model. */
+ private YEmbeddable model;
+
+ /**
+ * Instantiates a new handler.
+ *
+ * @param manager
+ * the manager
+ * @param model
+ * the model
+ */
+ public Handler(IVisibilityManager manager, YEmbeddable model) {
+ this.model = model;
+ fieldId = model.getId();
+ dtoName = model.getAuthorizationGroup();
+ dtoProperty = model.getAuthorizationId();
+
+ target = manager.getById(fieldId);
+ }
+
+ /**
+ * Handle.
+ *
+ * @param userAccessService
+ * the user access service
+ */
+ public void handle(IUserAccessService userAccessService) {
+
+ if (target == null) {
+ return;
+ }
+
+ target.setVisible(false);
+ target.setEditable(false);
+ target.setEnabled(false);
+ if (userAccessService == null) {
+ target.setVisible(true);
+ } else {
+ if(userAccessService.isPermitted(Permission.forDto(dtoName, Action.readable)).isPermitted()) {
+ target.setVisible(true);
+ target.setEditable(true);
+ target.setEnabled(true);
+ boolean nameVisible = !userAccessService.isPermitted(
+ Permission.forDtoProperty(dtoName, dtoProperty,
+ Action.invisible)).isPermitted();
+ if (nameVisible) {
+ boolean nameEnabled = !userAccessService.isPermitted(
+ Permission.forDtoProperty(dtoName, dtoProperty,
+ Action.disabled)).isPermitted();
+ if (nameEnabled) {
+ boolean nameEditable = !userAccessService.isPermitted(
+ Permission.forDtoProperty(dtoName, dtoProperty,
+ Action.noneditable)).isPermitted();
+ target.setEditable(nameEditable);
+ } else {
+ target.setEnabled(nameEnabled);
+ }
+ } else {
+ target.setVisible(nameVisible);
+ }
+ }
+ }
+ }
+
+ /**
+ * Apply.
+ */
+ public void apply() {
+ if (target != null) {
+ target.apply();
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessorEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessorEditpart.java
new file mode 100644
index 0000000..2909012
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/AuthorizationVisibilityProcessorEditpart.java
@@ -0,0 +1,44 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.visibility;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.visibility.VisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.editparts.visibility.IAuthorizationVisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.extension.model.visibility.YAuthorizationVisibilityProcessor;
+
+/**
+ * The Class AuthorizationVisibilityProcessorEditpart.
+ */
+public class AuthorizationVisibilityProcessorEditpart extends
+ VisibilityProcessorEditpart<YAuthorizationVisibilityProcessor>
+ implements IAuthorizationVisibilityProcessorEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.visibility.VisibilityProcessorEditpart#loadProcessor()
+ */
+ protected IVisibilityProcessor loadProcessor() {
+ if (processor != null) {
+ return processor;
+ }
+
+ AuthorizationVisibilityProcessor temp = new AuthorizationVisibilityProcessor();
+ temp.setup(getViewContext(getModel()), getModel());
+
+ processor = temp;
+
+ return processor;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessor.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessor.java
new file mode 100644
index 0000000..4f12e70
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessor.java
@@ -0,0 +1,93 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.visibility;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityHandler;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityManager;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
+
+/**
+ * The Class SubTypeVisibilityProcessor.
+ */
+public class SubTypeVisibilityProcessor implements IVisibilityProcessor {
+
+ /** The input. */
+ @SuppressWarnings("unused")
+ private Object input;
+
+ /** The manager. */
+ private IVisibilityManager manager;
+
+ private YSubTypeVisibilityProcessor yVP;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#init
+ * (org.eclipse.osbp.ecview.core.common.visibility.IVisibilityManager)
+ */
+ @Override
+ public void init(IVisibilityManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * Setup.
+ *
+ * @param context
+ * the context
+ * @param yVP
+ * the y vp
+ */
+ public void setup(IViewContext context, YSubTypeVisibilityProcessor yVP) {
+ this.yVP = yVP;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#fire
+ * ()
+ */
+ @Override
+ public void fire() {
+ IVisibilityHandler handler = manager.getById(yVP.getTarget().getId());
+ if (handler != null) {
+ if (yVP.matchesType(input != null ? input.getClass() : null)) {
+ handler.setVisible(true);
+ } else {
+ handler.setVisible(false);
+ }
+ handler.apply();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor#setInput
+ * (java.lang.Object)
+ */
+ @Override
+ public void setInput(Object input) {
+ this.input = input;
+
+ fire();
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessorEditpart.java b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessorEditpart.java
new file mode 100644
index 0000000..0b6b8c8
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.editparts.emf/src/org/eclipse/osbp/ecview/extension/editparts/emf/visibility/SubTypeVisibilityProcessorEditpart.java
@@ -0,0 +1,47 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.editparts.emf.visibility;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.visibility.VisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.core.common.visibility.IVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.editparts.visibility.ISubTypeVisibilityProcessorEditpart;
+import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
+
+/**
+ * The Class AuthorizationVisibilityProcessorEditpart.
+ */
+public class SubTypeVisibilityProcessorEditpart extends
+ VisibilityProcessorEditpart<YSubTypeVisibilityProcessor> implements
+ ISubTypeVisibilityProcessorEditpart {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.visibility.
+ * VisibilityProcessorEditpart#loadProcessor()
+ */
+ protected IVisibilityProcessor loadProcessor() {
+ if (processor != null) {
+ return processor;
+ }
+
+ SubTypeVisibilityProcessor temp = new SubTypeVisibilityProcessor();
+ temp.setup(getViewContext(getModel()), getModel());
+
+ processor = temp;
+
+ return processor;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.feature/.project b/org.eclipse.osbp.ecview.extension.feature/.project
new file mode 100644
index 0000000..a9714fa
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.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.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.ecview.extension.feature/LICENSE.txt b/org.eclipse.osbp.ecview.extension.feature/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.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.ecview.extension.feature/about.html b/org.eclipse.osbp.ecview.extension.feature/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/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.ecview.extension.feature/build.properties b/org.eclipse.osbp.ecview.extension.feature/build.properties
new file mode 100644
index 0000000..9234d19
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/build.properties
@@ -0,0 +1,2 @@
+bin.includes = license.html, feature.xml,\
+ feature.properties
diff --git a/org.eclipse.osbp.ecview.extension.feature/epl-v10.html b/org.eclipse.osbp.ecview.extension.feature/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.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.ecview.extension.feature/feature.properties b/org.eclipse.osbp.ecview.extension.feature/feature.properties
new file mode 100644
index 0000000..caa500e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/feature.properties
@@ -0,0 +1,159 @@
+# 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 Extensions for ECView
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse OSBP
+
+# "description" property - description of the feature
+description= OSBP Extensions for ECView
+
+# "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.ecview.extension.feature/feature.xml b/org.eclipse.osbp.ecview.extension.feature/feature.xml
new file mode 100644
index 0000000..d52a950
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/feature.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--#======================================================================= -->
+<feature
+ id="org.eclipse.osbp.ecview.extension.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.ecview.extension.editparts.emf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.presentation.vaadin"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.strategy"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.services"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.widgetset"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.grid.editparts.emf"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.grid.presentation"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osbp.ecview.extension.grid.presentation.clientside"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.osbp.ecview.extension.feature/license.html b/org.eclipse.osbp.ecview.extension.feature/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.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.ecview.extension.feature/notice.html b/org.eclipse.osbp.ecview.extension.feature/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/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.ecview.extension.feature/pom.xml b/org.eclipse.osbp.ecview.extension.feature/pom.xml
new file mode 100644
index 0000000..0d5c9cd
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/pom.xml
@@ -0,0 +1,72 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.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>
+ <description>OSBP Extensions for ECView</description>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.feature/src/main/javadoc/README.txt b/org.eclipse.osbp.ecview.extension.feature/src/main/javadoc/README.txt
new file mode 100644
index 0000000..831da7e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.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.ecview.extension.feature/src/overview.html b/org.eclipse.osbp.ecview.extension.feature/src/overview.html
new file mode 100644
index 0000000..672ac18
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.feature/src/overview.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>OSBP Tools Graphical Entity</title>
+</head>
+<body>
+<p>The <strong>OSBP Ecview Extension </strong>provides basic Ecview extension bundles.</p>
+</body>
+</html>
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.project b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.project
new file mode 100644
index 0000000..b281e2c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.editparts.emf</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/LICENSE.txt b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..140e1ab
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.grid.editparts.emf
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.editparts.emf
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore.xmi;bundle-version="2.8.0",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
+ org.eclipse.core.databinding;bundle-version="[1.4.2,1.5.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.core.databinding.beans;bundle-version="1.2.200",
+ org.eclipse.osbp.runtime.common;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.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.event;version="1.3.0",
+ org.slf4j;version="1.6.4"
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager.xml
+Export-Package: org.eclipse.osbp.ecview.extension.grid.editparts.emf;version="0.9.0"
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager.xml b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager.xml
new file mode 100644
index 0000000..c70b0f0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager">
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.editparts.emf.EditpartManager"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.editpart.IEditPartManager"/>
+ </service>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/about.html b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/about.ini b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/about.mappings b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/about.properties b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/about.properties
new file mode 100644
index 0000000..fab86d7
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.grid.editparts.emf
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/build.properties b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/build.properties
new file mode 100644
index 0000000..5e2c27a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/build.properties
@@ -0,0 +1,14 @@
+source.. = src/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/epl-v10.html b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/license.html b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/notice.html b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/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.ecview.extension.grid.editparts.emf/pom.xml b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/pom.xml
new file mode 100644
index 0000000..7c119ef
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/pom.xml
@@ -0,0 +1,37 @@
+<?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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.editparts.emf</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Contains the EMF based ui controller for Vaadin Grid</description>
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source/>
+ <target/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/EditpartManager.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/EditpartManager.java
new file mode 100644
index 0000000..18ad543
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/EditpartManager.java
@@ -0,0 +1,200 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IEditPartManager;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.common.AbstractEditpartManager;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridDelegateCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridBooleanRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridButtonRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridDateRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridDelegateRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridHtmlRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridImageRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridIndicatorRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridNumberRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridPriceRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridProgressbarRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridQuantityRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridTextRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridBooleanRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridButtonRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDelegateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridHtmlRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridImageRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridIndicatorRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridNumberRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridPriceRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridProgressBarRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridQuantityRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridTextRenderer;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * An implementation of IEditPartManager for eObjects with
+ * nsURI=http://eclipse.org/emf/emfclient/uimodel.
+ */
+@Component(immediate = true, service = { IEditPartManager.class })
+public class EditpartManager extends AbstractEditpartManager {
+
+ /**
+ * Activate.
+ *
+ * @param context
+ * the context
+ */
+ protected void activate(ComponentContext context) {
+
+ }
+
+ /**
+ * Deactivate.
+ *
+ * @param context
+ * the context
+ */
+ protected void deactivate(ComponentContext context) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.IEditPartManager#isFor(java.lang.Object)
+ */
+ @Override
+ public boolean isFor(Object element) {
+ if (element instanceof EObject) {
+ String uriString = ((EObject) element).eClass().getEPackage()
+ .getNsURI();
+ return uriString.equals(CxGridPackage.eNS_URI)
+ || uriString.equals(CxGridRendererPackage.eNS_URI);
+ } else if (element instanceof String) {
+ return element.equals(CxGridPackage.eNS_URI)
+ || element.equals(CxGridRendererPackage.eNS_URI);
+ }
+ return false;
+ }
+
+ /**
+ * Creates a new instance of the edit part.
+ *
+ * @param <A>
+ * an instance of {@link IElementEditpart}
+ * @param yElement
+ * the model element
+ * @return editpart
+ */
+ @SuppressWarnings("unchecked")
+ protected <A extends IElementEditpart> A createEditpart(IViewContext context, Object yElement) {
+ // asserts that no editpart was created already for the given element
+ assertOneEditpartForModelelement(yElement);
+
+ ElementEditpart<YElement> result = null;
+ if (yElement instanceof CxGrid) {
+ result = createNewInstance(GridEditpart.class);
+ } else if (yElement instanceof CxGridColumn) {
+ result = createNewInstance(GridColumnEditpart.class);
+ } else if (yElement instanceof CxGridDelegateCellStyleGenerator) {
+ result = createNewInstance(GridDelegateCellStyleGeneratorEditpart.class);
+ } else if (yElement instanceof CxGridHeaderRow) {
+ result = createNewInstance(GridHeaderRowEditpart.class);
+ } else if (yElement instanceof CxGridFooterRow) {
+ result = createNewInstance(GridFooterRowEditpart.class);
+ } else if (yElement instanceof CxGridMetaCell) {
+ result = createNewInstance(GridMetaCellEditpart.class);
+ } else if (yElement instanceof CxGridDateRenderer) {
+ result = createNewInstance(GridDateRendererEditpart.class);
+ } else if (yElement instanceof CxGridButtonRenderer) {
+ result = createNewInstance(GridButtonRendererEditpart.class);
+ } else if (yElement instanceof CxGridHtmlRenderer) {
+ result = createNewInstance(GridHtmlRendererEditpart.class);
+ } else if (yElement instanceof CxGridImageRenderer) {
+ result = createNewInstance(GridImageRendererEditpart.class);
+ } else if (yElement instanceof CxGridNumberRenderer) {
+ result = createNewInstance(GridNumberRendererEditpart.class);
+ } else if (yElement instanceof CxGridProgressBarRenderer) {
+ result = createNewInstance(GridProgressbarRendererEditpart.class);
+ } else if (yElement instanceof CxGridTextRenderer) {
+ result = createNewInstance(GridTextRendererEditpart.class);
+ } else if (yElement instanceof CxGridDelegateRenderer) {
+ result = createNewInstance(GridDelegateRendererEditpart.class);
+ } else if (yElement instanceof CxGridBooleanRenderer) {
+ result = createNewInstance(GridBooleanRendererEditpart.class);
+ } else if (yElement instanceof CxGridQuantityRenderer) {
+ result = createNewInstance(GridQuantityRendererEditpart.class);
+ } else if (yElement instanceof CxGridPriceRenderer) {
+ result = createNewInstance(GridPriceRendererEditpart.class);
+ } else if (yElement instanceof CxGridIndicatorRenderer) {
+ result = createNewInstance(GridIndicatorRendererEditpart.class);
+ }
+
+ if (result != null) {
+ result.initialize(context,(YElement) yElement);
+ }
+
+ return (A) result;
+ }
+
+ /**
+ * Returns a new instance of the type.
+ *
+ * @param type
+ * The type of the editpart for which an instance should be
+ * created.
+ * @return editPart
+ * @throws InstantiationException
+ * e
+ * @throws IllegalAccessException
+ * e
+ */
+ protected IElementEditpart newInstance(
+ Class<? extends IElementEditpart> type)
+ throws InstantiationException, IllegalAccessException {
+ try {
+ Constructor<? extends IElementEditpart> c = type
+ .getDeclaredConstructor(new Class<?>[0]);
+ if (!c.isAccessible()) {
+ c.setAccessible(true);
+ return c.newInstance(new Object[0]);
+ }
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException(e);
+ } catch (SecurityException e) {
+ throw new IllegalStateException(e);
+ } catch (IllegalArgumentException e) {
+ throw new IllegalStateException(e);
+ } catch (InvocationTargetException e) {
+ throw new IllegalStateException(e);
+ }
+
+ return type.newInstance();
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridColumnEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridColumnEditpart.java
new file mode 100644
index 0000000..49dad9d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridColumnEditpart.java
@@ -0,0 +1,314 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IFieldEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YConverter;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSearchField;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ISearchFieldEditpart;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererRefreshHandler;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRenderer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridColumnEditpart.
+ */
+public class GridColumnEditpart extends ElementEditpart<CxGridColumn> implements
+ IGridColumnEditpart, IGridRendererRefreshHandler {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridColumnEditpart.class);
+
+ /** The column. */
+ private ColumnReference column;
+
+ /**
+ * Instantiates a new grid column editpart.
+ */
+ protected GridColumnEditpart() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+ @Override
+ public void setColumnReference(ColumnReference column) {
+ checkDisposed();
+
+ ColumnReference oldColumn = this.column;
+ if (oldColumn != null && oldColumn != column) {
+ LOGGER.debug("Disposing old column " + oldColumn);
+ oldColumn.dispose();
+ }
+
+ this.column = column;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart#getColumnReference()
+ */
+ @Override
+ public ColumnReference getColumnReference() {
+ checkDisposed();
+
+ return column;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID_COLUMN__CONVERTER:
+ YConverter oldConverter = (YConverter) notification.getOldValue();
+ updateConverter((IConverterEditpart) ModelUtil.getEditpart(
+ viewContext, oldConverter));
+ break;
+ case CxGridPackage.CX_GRID_COLUMN__RENDERER:
+ CxGridRenderer oldRenderer = (CxGridRenderer) notification
+ .getOldValue();
+ updateRenderer((IGridRendererEditpart) ModelUtil.getEditpart(
+ viewContext, oldRenderer));
+ break;
+ case CxGridPackage.CX_GRID_COLUMN__EDITOR_FIELD:
+ YField oldField = (YField) notification.getOldValue();
+ updateEditorField((IFieldEditpart) ModelUtil.getEditpart(
+ viewContext, oldField));
+ break;
+ case CxGridPackage.CX_GRID_COLUMN__SEARCH_FIELD:
+ YSearchField oldSearchField = (YSearchField) notification
+ .getOldValue();
+ updateFilterField((ISearchFieldEditpart) ModelUtil.getEditpart(
+ viewContext, oldSearchField));
+ break;
+ default:
+ updateProperties();
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Update renderer.
+ *
+ * @param oldRendererEditpart
+ * the old renderer editpart
+ */
+ protected void updateRenderer(IGridRendererEditpart oldRendererEditpart) {
+ checkDisposed();
+
+ // dispose the old renderer
+ if (oldRendererEditpart != null) {
+ LOGGER.debug("Disposing old renderer " + oldRendererEditpart);
+ oldRendererEditpart.dispose();
+ }
+
+ if (column != null) {
+ Object renderer = null;
+ CxGridRenderer cxRenderer = getModel().getRenderer();
+ if (cxRenderer != null) {
+ IGridRendererEditpart editpart = getEditpart(viewContext,
+ cxRenderer);
+ renderer = editpart.createDelegate();
+ }
+
+ Object converter = null;
+ YConverter cxConverter = getModel().getConverter();
+ if (cxConverter != null) {
+ IConverterEditpart editpart = getEditpart(viewContext,
+ cxConverter);
+ if (editpart != null) {
+ converter = editpart.getDelegate();
+ }
+ }
+
+ column.setRenderer(renderer, converter);
+ }
+ }
+
+ /**
+ * Update converter.
+ *
+ * @param oldConverterEditpart
+ * the old converter editpart
+ */
+ protected void updateConverter(IConverterEditpart oldConverterEditpart) {
+ checkDisposed();
+
+ // dispose the old converter
+ if (oldConverterEditpart != null) {
+ LOGGER.debug("Disposing old converter " + oldConverterEditpart);
+ oldConverterEditpart.dispose();
+ }
+
+ if (column != null) {
+ Object result = null;
+ YConverter cxConverter = getModel().getConverter();
+ if (cxConverter != null) {
+ IConverterEditpart editpart = ModelUtil.getEditpart(
+ viewContext, cxConverter);
+ result = editpart.getDelegate();
+ }
+ column.setConverter(result);
+ }
+ }
+
+ /**
+ * Update properties.
+ */
+ protected void updateProperties() {
+ checkDisposed();
+
+ if (column != null) {
+ column.updateProperties();
+ }
+ }
+
+ /**
+ * Update editor field.
+ *
+ * @param oldField
+ * the old field
+ */
+ protected void updateEditorField(IFieldEditpart oldField) {
+ checkDisposed();
+
+ // dispose the old field
+ if (oldField != null) {
+ LOGGER.debug("Disposing old editorField " + oldField);
+ oldField.dispose();
+ }
+
+ if (column != null) {
+ column.updateEditorField();
+ }
+ }
+
+ /**
+ * Update filter field.
+ *
+ * @param oldField
+ * the old field
+ */
+ protected void updateFilterField(ISearchFieldEditpart oldField) {
+ checkDisposed();
+
+ // dispose the old field
+ if (oldField != null) {
+ LOGGER.debug("Disposing old filterField " + oldField);
+ oldField.dispose();
+ }
+
+ CxGridColumn cxColumn = getModel();
+ CxGrid cxGrid = cxColumn.getGrid();
+ IGridEditpart ep = getEditpart(viewContext, cxGrid);
+ if (ep.isRendered()) {
+ IGridPresentation<CxGrid> gridPresentation = ep.getPresentation();
+ gridPresentation.updateFilter();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart#initializeColumn()
+ */
+ @Override
+ public void initializeColumn() {
+ checkDisposed();
+
+ updateRenderer(null);
+ updateConverter(null);
+ updateEditorField(null);
+ updateProperties();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererRefreshHandler#refreshRenderer()
+ */
+ @Override
+ public void refreshRenderer() {
+ updateRenderer(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ if (column != null) {
+ column.dispose();
+ column = null;
+ }
+
+ YConverter cxConverter = getModel().getConverter();
+ if (cxConverter != null) {
+ IElementEditpart ep = ModelUtil.findEditpart(cxConverter);
+ if (ep != null) {
+ ep.dispose();
+ }
+ }
+
+ CxGridRenderer cxRenderer = getModel().getRenderer();
+ if (cxRenderer != null) {
+ IElementEditpart ep = ModelUtil.findEditpart(cxRenderer);
+ if (ep != null) {
+ ep.dispose();
+ }
+ }
+
+ YField cxField = getModel().getEditorField();
+ if (cxField != null) {
+ IElementEditpart ep = ModelUtil.findEditpart(cxField);
+ if (ep != null) {
+ ep.dispose();
+ }
+ }
+
+ // we need to dispose the related meta cells here too.
+ // Otherwise the components will not become unrendered
+ for (CxGridMetaCell metaCell : getModel().getUsedInMetaCells()) {
+ YEmbeddable yEmbeddable = metaCell.getElement();
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(yEmbeddable);
+ if (ep != null) {
+ ep.dispose();
+ }
+ }
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridDelegateCellStyleGeneratorEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridDelegateCellStyleGeneratorEditpart.java
new file mode 100644
index 0000000..216aa21
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridDelegateCellStyleGeneratorEditpart.java
@@ -0,0 +1,54 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.extension.grid.CxGridCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.editparts.DelegatingGridCellStyleGeneratorFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridDelegateCellStyleGeneratorEditpart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The implementation of the IOpenDialogCommandEditpart.
+ */
+public class GridDelegateCellStyleGeneratorEditpart extends
+ ElementEditpart<CxGridCellStyleGenerator> implements
+ IGridDelegateCellStyleGeneratorEditpart {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridDelegateCellStyleGeneratorEditpart.class);
+
+ /** The delegate. */
+ private Object delegate;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+ @Override
+ public Object getDelegate() {
+ checkDisposed();
+
+ if (delegate == null) {
+ delegate = DelegatingGridCellStyleGeneratorFactory.getInstance()
+ .createCellStyleGenerator(getViewContext(getModel()), this);
+
+ LOGGER.info("Created cellStyleGenerator for " + getModel());
+ }
+
+ return delegate;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpart.java
new file mode 100644
index 0000000..b7f8976
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpart.java
@@ -0,0 +1,327 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.validation.IValidatorEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YMemento;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation;
+import org.eclipse.osbp.ecview.extension.grid.util.CxGridUtil;
+import org.eclipse.osbp.runtime.common.memento.IMementoHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridEditpart.
+ */
+public class GridEditpart extends EmbeddableEditpart<CxGrid> implements
+ IGridEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridEditpart.class);
+
+ /** The grid content adapter. */
+ private GridEditpartController gridContentAdapter;
+
+ /**
+ * Returns the gridEditpart if it could be found in the parent hierarchy of
+ * the given eObject.
+ *
+ * @param context
+ * the view context
+ * @param eObject
+ * the e object
+ * @return the grid
+ */
+ public static IGridEditpart getGrid(IViewContext context, EObject eObject) {
+ CxGrid cxGrid = CxGridUtil.getGrid(eObject);
+ if (cxGrid != null) {
+ return getEditpart(context, cxGrid);
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the grid presentation if available.
+ *
+ * @param context
+ * the view context
+ * @param eObject
+ * the e object
+ * @return the grid presentation
+ */
+ public static IGridPresentation<?> getGridPresentation(
+ IViewContext context, EObject eObject) {
+ IGridEditpart editpart = getGrid(context, eObject);
+ return (IGridPresentation<?>) (editpart != null ? editpart
+ .getPresentation() : null);
+ }
+
+ /**
+ * Instantiates a new grid editpart.
+ */
+ protected GridEditpart() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+ @Override
+ public void initialize(IViewContext context, CxGrid model) {
+ super.initialize(context, model);
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#initialize(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ // attach the notification dispatcher
+ gridContentAdapter = new GridEditpartController(context);
+ model.eAdapters().add(gridContentAdapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart#setFilter(java.util.Map)
+ */
+ @Override
+ public void setFilter(Map<String, Object> filter) {
+ if (isPresentationPresent()) {
+ getPresentation().setFilter(filter);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#render(java.lang.Object)
+ */
+ @Override
+ public Object render(Object parentWidget) {
+ return super.render(parentWidget);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.datatypes.IDatatypeEditpart.DatatypeBridge#getDatatypeValidators()
+ */
+ @Override
+ public List<IValidatorEditpart> getDatatypeValidators() {
+ return Collections.emptyList();
+ }
+
+ /**
+ * Returns true, if the presenter is present.
+ *
+ * @return true, if is presentation present
+ */
+ protected boolean isPresentationPresent() {
+ return internalGetPresentation() != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#getPresentation()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public IGridPresentation<?> getPresentation() {
+ return super.getPresentation();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#doInitPresentation(org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation)
+ */
+ @Override
+ protected void doInitPresentation(IWidgetPresentation<?> presentation) {
+ super.doInitPresentation(presentation);
+
+ // initialize the presentation with the memento before rendering
+ //
+ YMemento yMemento = loadMemento(getModel().getMementoId());
+ if (yMemento != null) {
+ ((IMementoHandler) getPresentation()).applyMemento(yMemento);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID__SELECTION_TYPE:
+ if (isRendered()) {
+ getPresentation().updateSelectionType();
+ }
+ break;
+ case CxGridPackage.CX_GRID__FILTERING_VISIBLE:
+ if (isRendered()) {
+ getPresentation().updateFilter();
+ }
+ break;
+ case CxGridPackage.CX_GRID__CUSTOM_FILTERS:
+ if (isRendered()) {
+ getPresentation().updateFilter();
+ }
+ break;
+ case CxGridPackage.CX_GRID__CELL_STYLE_GENERATOR:
+ if (isRendered()) {
+ getPresentation().updateCellStyleGenerator();
+ }
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelAdd(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAdd(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID__COLUMNS:
+ if (isRendered()) {
+ getPresentation().updateColumns();
+ }
+ break;
+ case CxGridPackage.CX_GRID__HEADERS:
+ if (isRendered()) {
+ getPresentation().updateHeader();
+ }
+ break;
+ case CxGridPackage.CX_GRID__FOOTERS:
+ if (isRendered()) {
+ getPresentation().updateFooter();
+ }
+ break;
+ default:
+ super.handleModelAdd(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelAddMany(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAddMany(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID__COLUMNS:
+ if (isRendered()) {
+ getPresentation().updateColumns();
+ }
+ break;
+ case CxGridPackage.CX_GRID__HEADERS:
+ if (isRendered()) {
+ getPresentation().updateHeader();
+ }
+ break;
+ case CxGridPackage.CX_GRID__FOOTERS:
+ if (isRendered()) {
+ getPresentation().updateFooter();
+ }
+ break;
+ default:
+ super.handleModelAddMany(featureId, notification);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelRemove(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemove(int featureId, Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID__COLUMNS:
+ if (isRendered()) {
+ getPresentation().updateColumns();
+ }
+ break;
+ case CxGridPackage.CX_GRID__HEADERS:
+ if (isRendered()) {
+ getPresentation().updateHeader();
+ }
+ break;
+ case CxGridPackage.CX_GRID__FOOTERS:
+ if (isRendered()) {
+ getPresentation().updateFooter();
+ }
+ break;
+ default:
+ super.handleModelRemove(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelRemoveMany(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemoveMany(int featureId,
+ Notification notification) {
+ checkDisposed();
+
+ switch (featureId) {
+ case CxGridPackage.CX_GRID__COLUMNS:
+ if (isRendered()) {
+ getPresentation().updateColumns();
+ }
+ break;
+ case CxGridPackage.CX_GRID__HEADERS:
+ if (isRendered()) {
+ getPresentation().updateHeader();
+ }
+ break;
+ case CxGridPackage.CX_GRID__FOOTERS:
+ if (isRendered()) {
+ getPresentation().updateFooter();
+ }
+ default:
+ super.handleModelRemove(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.EmbeddableEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+
+ getModel().eAdapters().remove(gridContentAdapter);
+ gridContentAdapter = null;
+
+ } finally {
+ super.internalDispose();
+ }
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpartController.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpartController.java
new file mode 100644
index 0000000..c6d4e15
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridEditpartController.java
@@ -0,0 +1,113 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * This class automatically connects to all EObjects in the containment chain as
+ * long as the EClass is part of the CxGridPackage. <br>
+ * Editparts are automatically added and removed from the EObjects.
+ */
+public class GridEditpartController extends EContentAdapter {
+
+ private final IViewContext context;
+
+ public GridEditpartController(IViewContext context) {
+ this.context = context;
+ }
+
+ /**
+ * Add this adapter only to EObjects from grid package.
+ *
+ * @param notifier
+ * the notifier
+ */
+ protected void addAdapter(Notifier notifier) {
+ for (Adapter adapter : notifier.eAdapters()) {
+ if (adapter == this) {
+ return;
+ }
+ }
+
+ if (notifier instanceof EObject) {
+ EObject e = (EObject) notifier;
+
+ if (isProperPackage(e)) {
+ notifier.eAdapters().add(this);
+ initEditpart(notifier);
+ }
+ }
+ }
+
+ /**
+ * Checks if is proper package.
+ *
+ * @param e
+ * the e
+ * @return true, if is proper package
+ */
+ protected boolean isProperPackage(EObject e) {
+ String nsURI = e.eClass().getEPackage().getNsURI();
+ return nsURI.equals(CxGridPackage.eNS_URI)
+ || nsURI.equals(CxGridRendererPackage.eNS_URI);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.ecore.util.EContentAdapter#removeAdapter(org.eclipse.emf.common.notify.Notifier)
+ */
+ @Override
+ protected void removeAdapter(Notifier notifier) {
+ super.removeAdapter(notifier);
+
+ disposeEditpart(notifier);
+ }
+
+ /**
+ * Initializes the editpart.
+ *
+ * @param notifier
+ * the notifier
+ */
+ protected void initEditpart(Notifier notifier) {
+ if (notifier instanceof YElement) {
+ ElementEditpart.getEditpart(context, (YElement) notifier);
+ }
+ }
+
+ /**
+ * Disposes the editpart if available.
+ *
+ * @param notifier
+ * the notifier
+ */
+ protected void disposeEditpart(Notifier notifier) {
+ if (notifier instanceof YElement) {
+ IElementEditpart ep = ElementEditpart
+ .findEditPartFor((YElement) notifier);
+ if (ep != null) {
+ ep.requestDispose();
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridFooterRowEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridFooterRowEditpart.java
new file mode 100644
index 0000000..a318601
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridFooterRowEditpart.java
@@ -0,0 +1,38 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridFooterRowEditpart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridFooterRowEditpart.
+ */
+public class GridFooterRowEditpart extends GridMetaRowEditpart implements
+ IGridFooterRowEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridFooterRowEditpart.class);
+
+ /**
+ * Instantiates a new grid footer row editpart.
+ */
+ protected GridFooterRowEditpart() {
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridHeaderRowEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridHeaderRowEditpart.java
new file mode 100644
index 0000000..a37009d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridHeaderRowEditpart.java
@@ -0,0 +1,42 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridHeaderRowEditpart;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridHeaderRowEditpart.
+ */
+public class GridHeaderRowEditpart extends GridMetaRowEditpart implements
+ IGridHeaderRowEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridHeaderRowEditpart.class);
+
+ /**
+ * Instantiates a new grid header row editpart.
+ */
+ protected GridHeaderRowEditpart() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaCellEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaCellEditpart.java
new file mode 100644
index 0000000..eeb9342
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaCellEditpart.java
@@ -0,0 +1,104 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridMetaCellEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridMetaCellEditpart.
+ */
+public class GridMetaCellEditpart extends ElementEditpart<CxGridMetaCell>
+ implements IGridMetaCellEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridMetaCellEditpart.class);
+
+ /**
+ * Instantiates a new grid meta cell editpart.
+ */
+ protected GridMetaCellEditpart() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#createModel()
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridPackage.CX_GRID_META_CELL__ELEMENT:
+ disposeElement((YEmbeddable) notification.getOldValue());
+ case CxGridPackage.CX_GRID_META_CELL__LABEL:
+ case CxGridPackage.CX_GRID_META_CELL__LABEL_I1_8N_KEY:
+ case CxGridPackage.CX_GRID_META_CELL__USE_HTML:
+ IGridPresentation<?> presentation = GridEditpart
+ .getGridPresentation(viewContext, getModel());
+ if (presentation != null) {
+ CxGridMetaRow parent = (CxGridMetaRow) getModel().eContainer();
+ if (parent instanceof CxGridHeaderRow) {
+ presentation.updateHeader();
+ } else if (parent instanceof CxGridFooterRow) {
+ presentation.updateFooter();
+ } else {
+ throw new IllegalArgumentException(
+ "Not a supported option!");
+ }
+ }
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Dispose element.
+ *
+ * @param yEmbeddable
+ * the y embeddable
+ */
+ protected void disposeElement(YEmbeddable yEmbeddable) {
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(yEmbeddable);
+ if (ep != null) {
+ ep.dispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ disposeElement(getModel().getElement());
+ } finally {
+ super.internalDispose();
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaRowEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaRowEditpart.java
new file mode 100644
index 0000000..bb4a951
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/GridMetaRowEditpart.java
@@ -0,0 +1,135 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridMetaRowEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation;
+import org.eclipse.osbp.ecview.extension.grid.util.CxGridUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class GridMetaRowEditpart.
+ */
+public abstract class GridMetaRowEditpart extends
+ ElementEditpart<CxGridMetaRow> implements IGridMetaRowEditpart {
+
+ /** The Constant LOGGER. */
+ @SuppressWarnings("unused")
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridMetaRowEditpart.class);
+
+ /** The cx grid. */
+ private CxGrid cxGrid;
+
+ /**
+ * Instantiates a new grid meta row editpart.
+ */
+ protected GridMetaRowEditpart() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#initialize(org.eclipse.osbp.ecview.core.common.model.core.YElement)
+ */
+ @Override
+ public void initialize(IViewContext context, CxGridMetaRow model) {
+ super.initialize(context, model);
+
+ cxGrid = CxGridUtil.getGrid(model);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelAdd(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelAdd(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridPackage.CX_GRID_META_ROW__CUSTOM_CELLS:
+ updateCustomCellsPresentation();
+ break;
+ case CxGridPackage.CX_GRID_META_ROW__GROUPINGS:
+ updateRowsPresentation();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelRemove(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelRemove(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridPackage.CX_GRID_META_ROW__CUSTOM_CELLS:
+ updateCustomCellsPresentation();
+ break;
+ case CxGridPackage.CX_GRID_META_ROW__GROUPINGS:
+ updateRowsPresentation();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+
+ /**
+ * Update custom cells presentation.
+ */
+ protected void updateCustomCellsPresentation() {
+ IGridPresentation<?> presentation = GridEditpart.getGridPresentation(
+ viewContext, getModel());
+ if (presentation != null) {
+ presentation.updateColumns();
+ }
+ }
+
+ /**
+ * Update rows presentation.
+ */
+ protected void updateRowsPresentation() {
+ IGridPresentation<?> presentation = GridEditpart.getGridPresentation(
+ viewContext, cxGrid);
+ if (presentation != null) {
+ if (getModel() instanceof CxGridHeaderRow) {
+ presentation.updateHeader();
+ } else if (getModel() instanceof CxGridFooterRow) {
+ presentation.updateFooter();
+ } else {
+ throw new IllegalArgumentException("Not a supported option!");
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ cxGrid = null;
+ } finally {
+ super.internalDispose();
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridBooleanRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridBooleanRendererEditpart.java
new file mode 100644
index 0000000..e488d91
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridBooleanRendererEditpart.java
@@ -0,0 +1,35 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridBooleanRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridBooleanRenderer;
+
+/**
+ * The Class GridBooleanRendererEditpart.
+ */
+public class GridBooleanRendererEditpart extends
+ GridRendererEditpart<CxGridBooleanRenderer> implements IGridBooleanRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridButtonRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridButtonRendererEditpart.java
new file mode 100644
index 0000000..2b0fb0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridButtonRendererEditpart.java
@@ -0,0 +1,50 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridButtonRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridButtonRendererEditpart.
+ */
+public class GridButtonRendererEditpart extends
+ GridRendererEditpart<CxGridDateRenderer> implements IGridButtonRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_BUTTON_RENDERER__NULL_REPRESENTATION:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDateRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDateRendererEditpart.java
new file mode 100644
index 0000000..f5a0954
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDateRendererEditpart.java
@@ -0,0 +1,50 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridDateRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridDateRendererEditpart.
+ */
+public class GridDateRendererEditpart extends
+ GridRendererEditpart<CxGridDateRenderer> implements IGridDateRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_DATE_RENDERER__DATE_FORMAT:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDelegateRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDelegateRendererEditpart.java
new file mode 100644
index 0000000..bcfed6b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridDelegateRendererEditpart.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDelegateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridDelegateRendererEditpart.
+ */
+public class GridDelegateRendererEditpart extends
+ GridRendererEditpart<CxGridDelegateRenderer> {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_DELEGATE_RENDERER__DELEGATE_ID:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridHtmlRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridHtmlRendererEditpart.java
new file mode 100644
index 0000000..80b54d6
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridHtmlRendererEditpart.java
@@ -0,0 +1,50 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridHtmlRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridHtmlRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridHtmlRendererEditpart.
+ */
+public class GridHtmlRendererEditpart extends
+ GridRendererEditpart<CxGridHtmlRenderer> implements IGridHtmlRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_HTML_RENDERER__NULL_REPRESENTATION:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridImageRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridImageRendererEditpart.java
new file mode 100644
index 0000000..e69fcc5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridImageRendererEditpart.java
@@ -0,0 +1,46 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridImageRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridImageRenderer;
+
+/**
+ * The Class GridImageRendererEditpart.
+ */
+public class GridImageRendererEditpart extends
+ GridRendererEditpart<CxGridImageRenderer> implements IGridImageRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridIndicatorRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridIndicatorRendererEditpart.java
new file mode 100644
index 0000000..ce493a2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridIndicatorRendererEditpart.java
@@ -0,0 +1,35 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridHtmlRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridHtmlRenderer;
+
+/**
+ * The Class GridIndicatorRendererEditpart.
+ */
+public class GridIndicatorRendererEditpart extends
+ GridRendererEditpart<CxGridHtmlRenderer> implements
+ IGridHtmlRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridNumberRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridNumberRendererEditpart.java
new file mode 100644
index 0000000..3016db3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridNumberRendererEditpart.java
@@ -0,0 +1,50 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridNumberRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridNumberRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridNumberRendererEditpart.
+ */
+public class GridNumberRendererEditpart extends
+ GridRendererEditpart<CxGridNumberRenderer> implements IGridNumberRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridPriceRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridPriceRendererEditpart.java
new file mode 100644
index 0000000..49fb829
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridPriceRendererEditpart.java
@@ -0,0 +1,52 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridPriceRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridPriceRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridPriceRendererEditpart.
+ */
+public class GridPriceRendererEditpart extends
+ GridRendererEditpart<CxGridPriceRenderer> implements IGridPriceRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_PRICE_RENDERER__NULL_REPRESENTATION:
+ case CxGridRendererPackage.CX_GRID_PRICE_RENDERER__VALUE_PROPERTY_PATH:
+ case CxGridRendererPackage.CX_GRID_PRICE_RENDERER__CURRENCY_PROPERTY_PATH:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridProgressbarRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridProgressbarRendererEditpart.java
new file mode 100644
index 0000000..e78f6cb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridProgressbarRendererEditpart.java
@@ -0,0 +1,34 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridProgressbarRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridProgressBarRenderer;
+
+/**
+ * The Class GridProgressbarRendererEditpart.
+ */
+public class GridProgressbarRendererEditpart extends
+ GridRendererEditpart<CxGridProgressBarRenderer> implements IGridProgressbarRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridQuantityRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridQuantityRendererEditpart.java
new file mode 100644
index 0000000..63b8245
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridQuantityRendererEditpart.java
@@ -0,0 +1,52 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridQuantityRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridQuantityRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+
+/**
+ * The Class GridQuantityRendererEditpart.
+ */
+public class GridQuantityRendererEditpart extends
+ GridRendererEditpart<CxGridQuantityRenderer> implements IGridQuantityRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart#handleModelSet(int, org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ protected void handleModelSet(int featureId, Notification notification) {
+ switch (featureId) {
+ case CxGridRendererPackage.CX_GRID_QUANTITY_RENDERER__NULL_REPRESENTATION:
+ case CxGridRendererPackage.CX_GRID_QUANTITY_RENDERER__VALUE_PROPERTY_PATH:
+ case CxGridRendererPackage.CX_GRID_QUANTITY_RENDERER__UOM_PROPERTY_PATH:
+ markDirty();
+ break;
+ default:
+ super.handleModelSet(featureId, notification);
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridRendererEditpart.java
new file mode 100644
index 0000000..5e10f67
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridRendererEditpart.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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:
+ * Florian Pirchner - Initial implementation
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.emf.ElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererRefreshHandler;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRenderer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The implementation of the IOpenDialogCommandEditpart.
+ */
+public abstract class GridRendererEditpart<M extends CxGridRenderer> extends
+ ElementEditpart<M> implements IGridRendererEditpart {
+
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridRendererEditpart.class);
+
+ @Override
+ public Object createDelegate() {
+ return internalCreateDelegate();
+ }
+
+ /**
+ * Tells its container, that the renderer needs to become refreshed.
+ */
+ protected void notifyRefreshHandler() {
+ CxGridRenderer cxRenderer = getModel();
+ YElement container = (YElement) cxRenderer.eContainer();
+ IElementEditpart containerEp = getEditpart(viewContext, container);
+ if (containerEp instanceof IGridRendererRefreshHandler) {
+ ((IGridRendererRefreshHandler) containerEp).refreshRenderer();
+ }
+ }
+
+ /**
+ * Resets the delegate and notifies the parent. So it will be instantiated
+ * again at next request.
+ */
+ protected void markDirty() {
+ LOGGER.debug("Renderer is marked as dirty: " + getModel());
+
+ notifyRefreshHandler();
+ }
+
+ protected abstract Object internalCreateDelegate();
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridTextRendererEditpart.java b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridTextRendererEditpart.java
new file mode 100644
index 0000000..c7f288e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.editparts.emf/src/org/eclipse/osbp/ecview/extension/grid/editparts/emf/renderer/GridTextRendererEditpart.java
@@ -0,0 +1,35 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.DelegatingGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridTextRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridTextRenderer;
+
+/**
+ * The Class GridTextRendererEditpart.
+ */
+public class GridTextRendererEditpart extends
+ GridRendererEditpart<CxGridTextRenderer> implements IGridTextRendererEditpart {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.emf.renderer.GridRendererEditpart#internalCreateDelegate()
+ */
+ @Override
+ protected Object internalCreateDelegate() {
+ return DelegatingGridRendererFactory.getInstance().createRenderer(
+ getViewContext(getModel()), this);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/.project b/org.eclipse.osbp.ecview.extension.grid.model.editor/.project
new file mode 100644
index 0000000..9f4ae96
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.model.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3ae5058
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.model.editor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin$Implementation
+Bundle-Vendor: Eclipse OSBP
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.osbp.ecview.extension.grid.memento.presentation,
+ org.eclipse.osbp.ecview.extension.grid.presentation,
+ org.eclipse.osbp.ecview.extension.grid.renderer.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.osbp.ecview.extension.grid.model.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport,
+ org.eclipse.osbp.ecview.core.common.model.edit;visibility:=reexport,
+ org.eclipse.osbp.ecview.core.extension.model.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/about.html b/org.eclipse.osbp.ecview.extension.grid.model.editor/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/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.ecview.extension.grid.model.editor/build.properties b/org.eclipse.osbp.ecview.extension.grid.model.editor/build.properties
new file mode 100644
index 0000000..95711fa
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/build.properties
@@ -0,0 +1,13 @@
+# All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.
+#
+# Contributors:
+# Florian Pirchner - initial API and implementation
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridMementoModelFile.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridMementoModelFile.gif
new file mode 100644
index 0000000..9d55bb2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridMementoModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridModelFile.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridModelFile.gif
new file mode 100644
index 0000000..682f807
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridRendererModelFile.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridRendererModelFile.gif
new file mode 100644
index 0000000..b251792
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/obj16/CxGridRendererModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGrid.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGrid.gif
new file mode 100644
index 0000000..11a2240
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGrid.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridMemento.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridMemento.gif
new file mode 100644
index 0000000..dcf7f89
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridMemento.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridRenderer.gif b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridRenderer.gif
new file mode 100644
index 0000000..97fd1e1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/icons/full/wizban/NewCxGridRenderer.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/notice.html b/org.eclipse.osbp.ecview.extension.grid.model.editor/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/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.ecview.extension.grid.model.editor/plugin.properties b/org.eclipse.osbp.ecview.extension.grid.model.editor/plugin.properties
new file mode 100644
index 0000000..bbbde95
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/plugin.properties
@@ -0,0 +1,81 @@
+#
+# 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:
+# Florian Pirchner - Initial implementation
+#
+
+pluginName = CxGrid Editor
+providerName = www.example.org
+
+_UI_CxGridEditor_menu = &CxGrid Editor
+_UI_CxGridRendererEditor_menu = &CxGridRenderer Editor
+_UI_CxGridMementoEditor_menu = &CxGridMemento Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_Wizard_category = Example EMF Model Creation Wizards
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_CxGridModelWizard_label = CxGrid Model
+_UI_CxGridModelWizard_description = Create a new CxGrid model
+
+_UI_CxGridEditor_label = CxGrid Model Editor
+
+_UI_CxGridEditorFilenameDefaultBase = My
+_UI_CxGridEditorFilenameExtensions = cxgrid
+
+_UI_CxGridRendererModelWizard_label = CxGridRenderer Model
+_UI_CxGridRendererModelWizard_description = Create a new CxGridRenderer model
+
+_UI_CxGridRendererEditor_label = CxGridRenderer Model Editor
+
+_UI_CxGridRendererEditorFilenameDefaultBase = My
+_UI_CxGridRendererEditorFilenameExtensions = cxgridrenderer
+
+_UI_CxGridMementoModelWizard_label = CxGridMemento Model
+_UI_CxGridMementoModelWizard_description = Create a new CxGridMemento model
+
+_UI_CxGridMementoEditor_label = CxGridMemento Model Editor
+
+_UI_CxGridMementoEditorFilenameDefaultBase = My
+_UI_CxGridMementoEditorFilenameExtensions = cxgridmemento
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/plugin.xml b/org.eclipse.osbp.ecview.extension.grid.model.editor/plugin.xml
new file mode 100644
index 0000000..4266f77
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/plugin.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+#
+# 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:
+# Florian Pirchner - Initial implementation
+#
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated cxgrid -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.grid.presentation.CxGridModelWizardID"
+ name="%_UI_CxGridModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.grid.presentation.CxGridModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/CxGridModelFile.gif">
+ <description>%_UI_CxGridModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated cxgrid -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.grid.presentation.CxGridEditorID"
+ name="%_UI_CxGridEditor_label"
+ icon="icons/full/obj16/CxGridModelFile.gif"
+ extensions="cxgrid"
+ class="org.eclipse.osbp.ecview.extension.grid.presentation.CxGridEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.grid.presentation.CxGridActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated cxgrid -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.grid.renderer.presentation.CxGridRendererModelWizardID"
+ name="%_UI_CxGridRendererModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.grid.renderer.presentation.CxGridRendererModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/CxGridRendererModelFile.gif">
+ <description>%_UI_CxGridRendererModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated cxgrid -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.grid.renderer.presentation.CxGridRendererEditorID"
+ name="%_UI_CxGridRendererEditor_label"
+ icon="icons/full/obj16/CxGridRendererModelFile.gif"
+ extensions="cxgridrenderer"
+ class="org.eclipse.osbp.ecview.extension.grid.renderer.presentation.CxGridRendererEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.grid.renderer.presentation.CxGridRendererActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated cxgrid -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.grid.memento.presentation.CxGridMementoModelWizardID"
+ name="%_UI_CxGridMementoModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.grid.memento.presentation.CxGridMementoModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/CxGridMementoModelFile.gif">
+ <description>%_UI_CxGridMementoModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated cxgrid -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.grid.memento.presentation.CxGridMementoEditorID"
+ name="%_UI_CxGridMementoEditor_label"
+ icon="icons/full/obj16/CxGridMementoModelFile.gif"
+ extensions="cxgridmemento"
+ class="org.eclipse.osbp.ecview.extension.grid.memento.presentation.CxGridMementoEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.grid.memento.presentation.CxGridMementoActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoActionBarContributor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoActionBarContributor.java
new file mode 100644
index 0000000..8c0f7d9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoActionBarContributor.java
@@ -0,0 +1,443 @@
+/**
+ *
+ * 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.ecview.extension.grid.memento.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the CxGridMemento model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridMementoActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridMementoActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("cxgridmemento-settings"));
+ toolBarManager.add(new Separator("cxgridmemento-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoEditor_menu"), "org.eclipse.osbp.ecview.extension.grid.mementoMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoEditor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoEditor.java
new file mode 100644
index 0000000..f7551e7
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoEditor.java
@@ -0,0 +1,1868 @@
+/**
+ *
+ * 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.ecview.extension.grid.memento.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.grid.memento.provider.CxGridMementoItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.provider.CxGridRendererItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a CxGridMemento model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridMementoEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(CxGridMementoEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(CxGridMementoEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == CxGridMementoEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(CxGridMementoEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == CxGridMementoEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(CxGridMementoEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridMementoEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridRendererItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridMementoItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridMementoEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ CxGridMementoEditor.this.setSelectionToViewer(selection);
+ CxGridMementoEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoModelWizard.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoModelWizard.java
new file mode 100644
index 0000000..1e5ad9c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/memento/presentation/CxGridMementoModelWizard.java
@@ -0,0 +1,648 @@
+/**
+ *
+ * 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.ecview.extension.grid.memento.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoFactory;
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoPackage;
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridMementoModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridMementoPackage cxGridMementoPackage = CxGridMementoPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridMementoFactory cxGridMementoFactory = cxGridMementoPackage.getCxGridMementoFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridMementoModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridMementoModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(cxecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewCxGridMemento")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : cxGridMementoPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)cxGridMementoPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = cxGridMementoFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), cxecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridMementoModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridMementoModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridMementoModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridMementoModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return CxGridEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ cxecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new CxGridMementoModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoModelWizard_label"));
+ newFileCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoModelWizard_description"));
+ newFileCreationPage.setFileName(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new CxGridMementoModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridMementoModelWizard_label"));
+ initialObjectCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridActionBarContributor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridActionBarContributor.java
new file mode 100644
index 0000000..5129b9e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridActionBarContributor.java
@@ -0,0 +1,441 @@
+/**
+ *
+ * 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.ecview.extension.grid.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the CxGrid model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("cxgrid-settings"));
+ toolBarManager.add(new Separator("cxgrid-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridEditor_menu"), "org.eclipse.osbp.ecview.extension.gridMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridEditor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridEditor.java
new file mode 100644
index 0000000..4d7d396
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridEditor.java
@@ -0,0 +1,1866 @@
+/**
+ *
+ * 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.ecview.extension.grid.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.memento.provider.CxGridMementoItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.provider.CxGridRendererItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a CxGrid model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(CxGridEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(CxGridEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == CxGridEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(CxGridEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == CxGridEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(CxGridEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridRendererItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridMementoItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ CxGridEditor.this.setSelectionToViewer(selection);
+ CxGridEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridModelWizard.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridModelWizard.java
new file mode 100644
index 0000000..dec5ac5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/CxGridModelWizard.java
@@ -0,0 +1,646 @@
+/**
+ *
+ * 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.ecview.extension.grid.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.grid.CxGridFactory;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridPackage cxGridPackage = CxGridPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridFactory cxGridFactory = cxGridPackage.getCxGridFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(cxecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewCxGrid")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : cxGridPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)cxGridPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = cxGridFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), cxecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return CxGridEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ cxecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new CxGridModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridModelWizard_label"));
+ newFileCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridModelWizard_description"));
+ newFileCreationPage.setFileName(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new CxGridModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridModelWizard_label"));
+ initialObjectCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/cxecviewEditorPlugin.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/cxecviewEditorPlugin.java
new file mode 100644
index 0000000..8799886
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/presentation/cxecviewEditorPlugin.java
@@ -0,0 +1,115 @@
+/**
+ *
+ * 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.ecview.extension.grid.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.ECViewCoreEditPlugin;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtensionEditPlugin;
+
+/**
+ * This is the central singleton for the CxGrid editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class cxecviewEditorPlugin extends EMFPlugin {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final cxecviewEditorPlugin INSTANCE = new cxecviewEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public cxecviewEditorPlugin() {
+ super
+ (new ResourceLocator [] {
+ ECViewCoreEditPlugin.INSTANCE,
+ ExtensionEditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererActionBarContributor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererActionBarContributor.java
new file mode 100644
index 0000000..d13d1e3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererActionBarContributor.java
@@ -0,0 +1,443 @@
+/**
+ *
+ * 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.ecview.extension.grid.renderer.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the CxGridRenderer model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridRendererActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(cxecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridRendererActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("cxgridrenderer-settings"));
+ toolBarManager.add(new Separator("cxgridrenderer-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererEditor_menu"), "org.eclipse.osbp.ecview.extension.grid.rendererMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(cxecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererEditor.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererEditor.java
new file mode 100644
index 0000000..eb842ee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererEditor.java
@@ -0,0 +1,1868 @@
+/**
+ *
+ * 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.ecview.extension.grid.renderer.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.provider.CxGridRendererItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.memento.provider.CxGridMementoItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a CxGridRenderer model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridRendererEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(CxGridRendererEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(CxGridRendererEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == CxGridRendererEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(CxGridRendererEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == CxGridRendererEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(CxGridRendererEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridRendererEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridRendererItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CxGridMementoItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.grid.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), CxGridRendererEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ CxGridRendererEditor.this.setSelectionToViewer(selection);
+ CxGridRendererEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererModelWizard.java b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererModelWizard.java
new file mode 100644
index 0000000..bbcbe7c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.model.editor/src/org/eclipse/osbp/ecview/extension/grid/renderer/presentation/CxGridRendererModelWizard.java
@@ -0,0 +1,648 @@
+/**
+ *
+ * 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.ecview.extension.grid.renderer.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage;
+import org.eclipse.osbp.ecview.extension.grid.provider.CxGridEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.osbp.ecview.extension.grid.presentation.cxecviewEditorPlugin;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CxGridRendererModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridRendererPackage cxGridRendererPackage = CxGridRendererPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridRendererFactory cxGridRendererFactory = cxGridRendererPackage.getCxGridRendererFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridRendererModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CxGridRendererModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(cxecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewCxGridRenderer")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : cxGridRendererPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)cxGridRendererPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = cxGridRendererFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), cxecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ cxecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridRendererModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridRendererModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(cxecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class CxGridRendererModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CxGridRendererModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return CxGridEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ cxecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(cxecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new CxGridRendererModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererModelWizard_label"));
+ newFileCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererModelWizard_description"));
+ newFileCreationPage.setFileName(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new CxGridRendererModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(cxecviewEditorPlugin.INSTANCE.getString("_UI_CxGridRendererModelWizard_label"));
+ initialObjectCreationPage.setDescription(cxecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.project b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.project
new file mode 100644
index 0000000..84f7811
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.presentation.clientside</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/LICENSE.txt b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d11421f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.grid.presentation.clientside
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.presentation.clientside
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.slf4j.api,
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.ibm.icu;bundle-version="50.1.1",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)"
+Import-Package: org.osgi.framework;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0"
+Export-Package: org.eclipse.osbp.ecview.extension.grid.presentation.clientside;x-internal:=true;version="0.9.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/about.html b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/about.ini b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/about.mappings b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/about.properties b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/about.properties
new file mode 100644
index 0000000..397247c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.grid.presentation.clientside
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/build.properties b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/build.properties
new file mode 100644
index 0000000..c8e800d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/build.properties
@@ -0,0 +1,13 @@
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
+source.. = src/
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/epl-v10.html b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/license.html b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/notice.html b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/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.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml
new file mode 100644
index 0000000..127f2bb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom-compileWidgetset.xml
@@ -0,0 +1,208 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation.clientside</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <vaadin.version>7.5.7</vaadin.version>
+ <vaadin.plugin.version>7.5.7</vaadin.plugin.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-server</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiled</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared-deps</artifactId>
+ <scope>provided</scope>
+ <version>1.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiler</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-themes</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <!-- This add sources, .gwt.xml files etc to jar from source directory.
+ Not quite maven convention byt easiest to setup this way. -->
+ <directory>src</directory>
+ </resource>
+ <resource>
+ <directory>src</directory>
+ </resource>
+ </resources>
+ <sourceDirectory>src</sourceDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>0.21.0</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <!-- <includes> -->
+ <!-- <include>org.eclipse.osbp/runtime/web/vaadin/components/widgets/*.java</include> -->
+ <!-- </includes> -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <version>${vaadin.plugin.version}</version>
+ <configuration>
+ <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
+ <!-- <runTarget>mobilemail</runTarget> -->
+ <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
+ way compatible with Vaadin eclipse plugin. -->
+ <webappDirectory>${basedir}/VAADIN/widgetsets
+ </webappDirectory>
+ <hostedWebapp>${basedir}/VAADIN/widgetsets
+ </hostedWebapp>
+ <noServer>true</noServer>
+ <!-- Remove draftCompile when project is ready -->
+ <draftCompile>true</draftCompile>
+ <strict>true</strict>
+ <compileReport>false</compileReport>
+ <style>PRETTY</style>
+ <logLevel>INFO</logLevel>
+ <runTarget>http://localhost:8080/</runTarget>
+
+ <!-- Remove these when going to release dependencies -->
+ <force>true</force>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
+ <!-- directory is cleaned properly -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/VAADIN/widgetsets</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[2.3.0-1,)</versionRange>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[1.0.2,)</versionRange>
+ <goals>
+ <goal>update-widgetset</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml
new file mode 100644
index 0000000..d8e382e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/pom.xml
@@ -0,0 +1,223 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation.clientside</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Clientside Vaadin presentation layer for OSBP ECView extension</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+<!-- <vaadin.version>7.5.7</vaadin.version> -->
+<!-- <vaadin.plugin.version>7.5.7</vaadin.plugin.version> -->
+ </properties>
+
+<!-- no dependencies after o.e.o.dependencies
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-server</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiled</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-themes</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ </dependencies>
+-->
+ <!-- dependencies needed for the widgetset compiler -->
+ <dependencies>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiler</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <resources>
+ <resource>
+ <!-- This add sources, .gwt.xml files etc to jar from source directory.
+ Not quite maven convention byt easiest to setup this way. -->
+ <directory>src</directory>
+ </resource>
+ <resource>
+ <directory>src</directory>
+ </resource>
+ </resources>
+ <sourceDirectory>src</sourceDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>0.21.0</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <!-- <includes> -->
+ <!-- <include>org.eclipse.osbp/runtime/web/vaadin/components/widgets/*.java</include> -->
+ <!-- </includes> -->
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <version>${vaadin.plugin.version}</version>
+ <configuration>
+ <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
+ <!-- <runTarget>mobilemail</runTarget> -->
+ <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
+ way compatible with Vaadin eclipse plugin. -->
+ <webappDirectory>${basedir}/VAADIN/widgetsets
+ </webappDirectory>
+ <hostedWebapp>${basedir}/VAADIN/widgetsets
+ </hostedWebapp>
+ <noServer>true</noServer>
+ <!-- Remove draftCompile when project is ready -->
+ <draftCompile>true</draftCompile>
+ <strict>true</strict>
+ <compileReport>false</compileReport>
+ <style>PRETTY</style>
+ <logLevel>INFO</logLevel>
+ <runTarget>http://localhost:8080/</runTarget>
+
+ <!-- Remove these when going to release dependencies -->
+ <force>true</force>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
+ <!-- directory is cleaned properly -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/VAADIN/widgetsets</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[2.3.0-1,)</versionRange>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[1.0.2,)</versionRange>
+ <goals>
+ <goal>update-widgetset</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetset.gwt.xml b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetset.gwt.xml
new file mode 100644
index 0000000..1ff3789
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetset.gwt.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Vaadin//DTD Vaadin 7//EN" "https://raw.github.com/vaadin/gwt/master/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="com.vaadin.DefaultWidgetSet" />
+ <source path="client" />
+ <source path="shared" />
+ <collapse-all-properties />
+<!-- <set-property name="compiler.useSymbolMaps" value="true" /> -->
+
+</module>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetsetUI.java b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetsetUI.java
new file mode 100644
index 0000000..bfdf35c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/ECViewExtensionsWidgetsetUI.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.grid.presentation.clientside;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * The Class ECViewExtensionsWidgetsetUI.
+ */
+@SuppressWarnings("serial")
+@Theme("clientsidewidget")
+public class ECViewExtensionsWidgetsetUI extends UI {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.UI#init(com.vaadin.server.VaadinRequest)
+ */
+ @Override
+ protected void init(VaadinRequest request) {
+ final VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+ setContent(layout);
+
+ Button button = new Button("Click Me");
+ button.addClickListener(new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new Label("Thank you for clicking"));
+ }
+ });
+ layout.addComponent(button);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRenderer.java b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRenderer.java
new file mode 100644
index 0000000..48f649a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRenderer.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.clientside.client;
+
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.vaadin.client.renderers.Renderer;
+import com.vaadin.client.widget.grid.RendererCellReference;
+
+/**
+ * The Class PriceRenderer.
+ */
+public class PriceRenderer implements Renderer<String> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.client.renderers.Renderer#render(com.vaadin.client.widget.grid.RendererCellReference, java.lang.Object)
+ */
+ @Override
+ public void render(RendererCellReference cell, String htmlString) {
+ cell.getElement().setInnerSafeHtml(
+ SafeHtmlUtils.fromSafeConstant(htmlString));
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRendererConnector.java b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRendererConnector.java
new file mode 100644
index 0000000..858840a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/PriceRendererConnector.java
@@ -0,0 +1,34 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.clientside.client;
+
+import com.vaadin.client.connectors.AbstractRendererConnector;
+import com.vaadin.shared.ui.Connect;
+
+
+/**
+ * The Class PriceRendererConnector.
+ */
+@SuppressWarnings({ "restriction", "serial" })
+@Connect(org.eclipse.osbp.ecview.extension.grid.presentation.renderer.PriceRenderer.class)
+public class PriceRendererConnector extends AbstractRendererConnector<String> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.client.connectors.AbstractRendererConnector#getRenderer()
+ */
+ @Override
+ public PriceRenderer getRenderer() {
+ return (PriceRenderer) super.getRenderer();
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRenderer.java b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRenderer.java
new file mode 100644
index 0000000..a927bf9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRenderer.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.clientside.client;
+
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.vaadin.client.renderers.Renderer;
+import com.vaadin.client.widget.grid.RendererCellReference;
+
+/**
+ * The Class QuantityRenderer.
+ */
+public class QuantityRenderer implements Renderer<String> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.client.renderers.Renderer#render(com.vaadin.client.widget.grid.RendererCellReference, java.lang.Object)
+ */
+ @Override
+ public void render(RendererCellReference cell, String htmlString) {
+ cell.getElement().setInnerSafeHtml(
+ SafeHtmlUtils.fromSafeConstant(htmlString));
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRendererConnector.java b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRendererConnector.java
new file mode 100644
index 0000000..bc29a4c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/client/QuantityRendererConnector.java
@@ -0,0 +1,33 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.clientside.client;
+
+import com.vaadin.client.connectors.AbstractRendererConnector;
+import com.vaadin.shared.ui.Connect;
+
+/**
+ * The Class QuantityRendererConnector.
+ */
+@SuppressWarnings({ "restriction", "serial" })
+@Connect(org.eclipse.osbp.ecview.extension.grid.presentation.renderer.QuantityRenderer.class)
+public class QuantityRendererConnector extends AbstractRendererConnector<String> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.client.connectors.AbstractRendererConnector#getRenderer()
+ */
+ @Override
+ public QuantityRenderer getRenderer() {
+ return (QuantityRenderer) super.getRenderer();
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/styles.css b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/styles.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/styles.css
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_rising.png b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_rising.png
new file mode 100644
index 0000000..5a7686b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_rising.png
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_sloping.png b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_sloping.png
new file mode 100644
index 0000000..b145d9e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_sloping.png
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_stagnating.png b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_stagnating.png
new file mode 100644
index 0000000..0961ff8
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation.clientside/src/org/eclipse/osbp/ecview/extension/grid/presentation/clientside/public/osbee-grid/trend_stagnating.png
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/.project b/org.eclipse.osbp.ecview.extension.grid.presentation/.project
new file mode 100644
index 0000000..0ebd426
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.presentation</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/LICENSE.txt b/org.eclipse.osbp.ecview.extension.grid.presentation/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d539f68
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
@@ -0,0 +1,42 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.grid.presentation
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.presentation
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.slf4j.api,
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.ibm.icu;bundle-version="50.1.1",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;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.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.core.databinding.property,
+ org.vaadin.addons.vaadin-grid-util,
+ org.apache.commons.beanutils;bundle-version="1.9.2",
+ org.jsoup;bundle-version="1.8.3",
+ dragdroplayouts.osgi;bundle-version="1.1.3",
+ org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)"
+Import-Package: org.apache.commons.lang,
+ org.eclipse.core.databinding.property.value,
+ org.eclipse.osbp.vaaclipse.publicapi.authentication;version="0.9.0",
+ org.osgi.framework;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0"
+Export-Package: org.eclipse.osbp.ecview.extension.grid.presentation;x-internal:=true;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.grid.presentation.renderer;x-internal:=true;version="0.9.0"
+Service-Component: OSGI-INF/*.xml
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.PresenterFactory.xml b/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.PresenterFactory.xml
new file mode 100644
index 0000000..45c944e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.PresenterFactory.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.presentation.PresenterFactory">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.presentation.PresenterFactory"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.renderer.RendererFactory.xml b/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.renderer.RendererFactory.xml
new file mode 100644
index 0000000..e77f17f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.presentation.renderer.RendererFactory.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.presentation.renderer.RendererFactory">
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.presentation.renderer.RendererFactory"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererFactory"/>
+ </service>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/about.html b/org.eclipse.osbp.ecview.extension.grid.presentation/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/about.ini b/org.eclipse.osbp.ecview.extension.grid.presentation/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/about.mappings b/org.eclipse.osbp.ecview.extension.grid.presentation/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/about.properties b/org.eclipse.osbp.ecview.extension.grid.presentation/about.properties
new file mode 100644
index 0000000..7e93465
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.grid.presentation
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/build.properties b/org.eclipse.osbp.ecview.extension.grid.presentation/build.properties
new file mode 100644
index 0000000..323bb2e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/build.properties
@@ -0,0 +1,14 @@
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
+source.. = src/
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/epl-v10.html b/org.eclipse.osbp.ecview.extension.grid.presentation/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/license.html b/org.eclipse.osbp.ecview.extension.grid.presentation/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/notice.html b/org.eclipse.osbp.ecview.extension.grid.presentation/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/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.ecview.extension.grid.presentation/pom.xml b/org.eclipse.osbp.ecview.extension.grid.presentation/pom.xml
new file mode 100644
index 0000000..352e0ee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/pom.xml
@@ -0,0 +1,24 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Vaadin presentation layer for OSBP ECView extension</description>
+
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridCellFilter.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridCellFilter.java
new file mode 100644
index 0000000..eee64a2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridCellFilter.java
@@ -0,0 +1,147 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.filter.JoinFilter;
+import org.vaadin.gridutil.cell.CellFilterComponent;
+
+import com.vaadin.data.util.filter.Or;
+import com.vaadin.data.util.filter.SimpleStringFilter;
+import com.vaadin.event.FieldEvents.TextChangeEvent;
+import com.vaadin.event.FieldEvents.TextChangeListener;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.themes.ValoTheme;
+
+/**
+ * The Class GridCellFilter.
+ */
+@SuppressWarnings("serial")
+public class GridCellFilter extends org.vaadin.gridutil.cell.GridCellFilter {
+
+ /** The grid. */
+ private Grid grid;
+
+ /**
+ * Instantiates a new grid cell filter.
+ *
+ * @param grid
+ * the grid
+ */
+ public GridCellFilter(Grid grid) {
+ super(grid);
+ this.grid = grid;
+ }
+
+ /**
+ * Sets the dto filter.
+ *
+ * @param columnId
+ * the column id
+ * @param dtoClass
+ * the dto class
+ * @param inputPrompt
+ * the input prompt
+ * @return the text field
+ */
+ public TextField setDtoFilter(final Object columnId,
+ final Class<?> dtoClass, final String inputPrompt) {
+
+ CellFilterComponent<TextField> filter = new CellFilterComponent<TextField>() {
+
+ private static final long serialVersionUID = 1L;
+ private String domainKeyPropertyId;
+ private String domainDescriptionPropertyId;
+
+ TextField textField = new TextField();
+
+ @Override
+ public TextField layoutComponent() {
+
+ Field domainKeyField = DtoUtils.getDomainKeyField(dtoClass);
+ if (domainKeyField != null) {
+ domainKeyPropertyId = domainKeyField.getName();
+ }
+
+ Field domainDescriptionField = DtoUtils
+ .getDomainDescriptionField(dtoClass);
+ if (domainDescriptionField != null) {
+ domainDescriptionPropertyId = domainDescriptionField
+ .getName();
+ }
+
+ this.textField.setImmediate(true);
+ this.textField.setInputPrompt(inputPrompt);
+ this.textField.addStyleName(ValoTheme.TEXTFIELD_TINY);
+ this.textField.addTextChangeListener(new TextChangeListener() {
+
+ private static final long serialVersionUID = -3567212620627878001L;
+
+ @Override
+ public void textChange(final TextChangeEvent event) {
+ if (event.getText() != null
+ && event.getText().length() > 0) {
+
+ if (isValid(domainKeyPropertyId)
+ && isValid(domainDescriptionPropertyId)) {
+ // filter for key or description
+ SimpleStringFilter numberFilter = new SimpleStringFilter(
+ domainKeyPropertyId, event.getText(),
+ true, false);
+ SimpleStringFilter descriptionFilter = new SimpleStringFilter(
+ domainDescriptionPropertyId, event
+ .getText(), true, false);
+ Or or = new Or(numberFilter, descriptionFilter);
+ replaceFilter(new JoinFilter((String) columnId,
+ or), columnId);
+ } else if (isValid(domainKeyPropertyId)) {
+ // filter for key
+ SimpleStringFilter numberFilter = new SimpleStringFilter(
+ domainKeyPropertyId, event.getText(),
+ true, false);
+ replaceFilter(new JoinFilter((String) columnId,
+ numberFilter), columnId);
+ }
+ } else {
+ removeFilter(columnId);
+ }
+ }
+
+ private boolean isValid(String value) {
+ return value != null && !value.equals("");
+ }
+ });
+ return this.textField;
+ }
+
+ @Override
+ public void clearFilter() {
+ this.textField.clear();
+ }
+ };
+ setCustomFilter(columnId, filter);
+ return filter.getComponent();
+ }
+
+ /**
+ * Destroys the filter.
+ */
+ public void destroy() {
+ grid.removeHeaderRow(getFilterRow());
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java
new file mode 100644
index 0000000..ebd5c77
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/GridPresentation.java
@@ -0,0 +1,1751 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.WritableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.emf.databinding.EMFProperties;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IFieldEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableCollectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableMultiSelectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableSelectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YField;
+import org.eclipse.osbp.ecview.core.databinding.emf.model.ECViewModelBindable;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSelectionType;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ISearchFieldEditpart;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFactory;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridGroupable;
+import org.eclipse.osbp.ecview.extension.grid.CxGridGroupedCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridPackage;
+import org.eclipse.osbp.ecview.extension.grid.CxGridSortable;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridCellStyleGeneratorEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation;
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMemento;
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoColumn;
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoFactory;
+import org.eclipse.osbp.ecview.extension.grid.memento.CxGridMementoSortable;
+import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
+import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.runtime.common.state.ISharedStateContext;
+import org.eclipse.osbp.runtime.designer.api.IDesignerService.IDesignListener;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IBindingManager;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractEmbeddedWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.BeanServiceLazyLoadingContainer;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.DeepResolvingBeanItemContainer;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchService;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.INestedPropertyAble;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.search.ISearchField;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinProperties;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableList;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableValue;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.values.SetToListAdapter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitEvent;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.data.sort.Sort;
+import com.vaadin.data.sort.SortOrder;
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.filter.And;
+import com.vaadin.data.util.filter.Compare;
+import com.vaadin.event.SortEvent;
+import com.vaadin.shared.data.sort.SortDirection;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.ColumnVisibilityChangeEvent;
+import com.vaadin.ui.Grid.FooterRow;
+import com.vaadin.ui.Grid.HeaderRow;
+import com.vaadin.ui.renderers.Renderer;
+
+/**
+ * This presenter is responsible to render a text field on the given layout.
+ */
+public class GridPresentation extends AbstractEmbeddedWidgetPresenter<Grid>
+ implements IGridPresentation<Grid>, IDesignListener{
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(GridPresentation.class);
+
+ /** The grid. */
+ private Grid grid;
+
+ /** The model access. */
+ private ModelAccess modelAccess;
+
+ /** The user changed handler. */
+ private UserChangedHandler userChangedHandler = new UserChangedHandler();
+
+ /** The create columns. */
+ private boolean createColumns;
+
+ /** The columns. */
+ private Set<ColumnWrapper> columns = new HashSet<>();
+
+ /** The grouping headers. */
+ private Map<CxGridHeaderRow, HeaderRow> groupingHeaders = new HashMap<CxGridHeaderRow, HeaderRow>();
+
+ /** The grouping footers. */
+ private Map<CxGridFooterRow, FooterRow> groupingFooters = new HashMap<CxGridFooterRow, FooterRow>();
+
+ /** The filtering header. */
+ private HeaderRow filteringHeader;
+
+ /** The filtering header fields. */
+ private Map<CxGridColumn, ISearchFieldEditpart> filteringHeaderFields = new HashMap<CxGridColumn, ISearchFieldEditpart>();
+
+ /** The selection binding. */
+ private Binding selectionBinding;
+
+ /** The filter changed tracker. */
+ // to handle changed filters
+ private WritableValue filterChangedTracker;
+
+ /** The current memento. */
+ private CxGridMemento currentMemento;
+
+ /** The cell filters. */
+ private GridCellFilter cellFilters;
+
+ /**
+ * The constructor.
+ *
+ * @param editpart
+ * The editpart of that editpart.
+ */
+ public GridPresentation(IElementEditpart editpart) {
+ super((IGridEditpart) editpart);
+ this.modelAccess = new ModelAccess((CxGrid) editpart.getModel());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+
+ // applies the column properties
+ if (createColumns) {
+ createColumns();
+ }
+
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), grid);
+
+ grid.setEditorCancelCaption(Util.getCaption(getI18nService(), "Cancel",
+ modelAccess.yField.getEditorCancelI18nLabelKey(), getLocale()));
+ grid.setEditorSaveCaption(Util.getCaption(getI18nService(), "Save",
+ modelAccess.yField.getEditorSaveI18nLabelKey(), getLocale()));
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#setFilter(java.util.Map)
+ */
+ @Override
+ public void setFilter(Map<String, Object> filter) {
+ List<Container.Filter> filters = new ArrayList<>();
+ for (Map.Entry<String, Object> entry : filter.entrySet()) {
+ filters.add(new Compare.Equal(entry.getKey(), entry.getValue()));
+ }
+
+ Container.Filterable filterable = (Container.Filterable) grid
+ .getContainerDataSource();
+ filterable.removeAllContainerFilters();
+ filterable.addContainerFilter(new And(filters
+ .toArray(new Container.Filter[filters.size()])));
+ }
+
+ /**
+ * Applies the column setting to the grid.
+ */
+ protected void createColumns() {
+
+ resetHeader();
+ resetFooter();
+
+ // reset the column reference in the editparts
+ for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
+ IGridColumnEditpart editpart = ModelUtil.getEditpart(
+ getViewContext(), cxColumn);
+ editpart.setColumnReference(null);
+ }
+
+ // set the visible columns and icons
+ List<String> visibleColumns = new ArrayList<String>();
+ Collection<?> propertyIds = grid.getContainerDataSource()
+ .getContainerPropertyIds();
+ for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
+ if (!cxColumn.isHidden()
+ && (propertyIds.contains(cxColumn.getPropertyPath()) || isNestedColumn(cxColumn))) {
+ visibleColumns.add(cxColumn.getPropertyPath());
+ cxColumn.setLabelI18nKey(cxColumn.getPropertyPath());
+ }
+ }
+
+ if (visibleColumns.size() > 0) {
+ // reset all columns
+ grid.removeAllColumns();
+ }
+
+ // add nested properties
+ if (grid.getContainerDataSource() instanceof INestedPropertyAble) {
+ INestedPropertyAble<?> container = (INestedPropertyAble<?>) grid
+ .getContainerDataSource();
+ for (String property : visibleColumns) {
+ if (property.contains(".")) {
+ container.addNestedContainerProperty(property);
+ }
+ }
+ }
+
+ if (visibleColumns.size() > 0) {
+ // create the columns based on the model
+ //
+ grid.setColumns(visibleColumns.toArray(new Object[visibleColumns
+ .size()]));
+ grid.setColumnOrder(visibleColumns
+ .toArray(new Object[visibleColumns.size()]));
+
+ // traverse the columns again and set other properties
+ for (CxGridColumn cxColumn : modelAccess.yField.getColumns()) {
+ if (!cxColumn.isHidden()
+ && (propertyIds.contains(cxColumn.getPropertyPath()) || isNestedColumn(cxColumn))) {
+ String columnId = cxColumn.getPropertyPath();
+
+ IGridColumnEditpart editpart = ModelUtil.getEditpart(
+ getViewContext(), cxColumn);
+ Grid.Column column = grid.getColumn(columnId);
+
+ editpart.setColumnReference(new ColumnWrapper(cxColumn,
+ column));
+ editpart.initializeColumn();
+ }
+ }
+ }
+
+ updateCellStyleGenerator();
+ createHeaderMetaCells();
+ createFilteringHeader();
+ createFooterMetaCells();
+ createSortOrder();
+ }
+
+ /**
+ * Creates the sort order.
+ */
+ protected void createSortOrder() {
+ CxGrid cxGrid = modelAccess.yField;
+
+ if (cxGrid.getSortOrder().size() > 0) {
+ Sort sort = null;
+ for (CxGridSortable memSort : cxGrid.getSortOrder()) {
+ if (sort == null) {
+ sort = Sort.by(memSort.getColumn().getPropertyId(),
+ toDirection(memSort));
+ } else {
+ sort = sort.then(memSort.getColumn().getPropertyId(),
+ toDirection(memSort));
+ }
+ }
+ grid.sort(sort);
+ }
+ }
+
+ /**
+ * Creates the header meta cells.
+ */
+ protected void createHeaderMetaCells() {
+
+ resetHeader();
+
+ // create the new header
+ CxGrid cxGrid = modelAccess.yField;
+
+ for (CxGridHeaderRow cxHeader : cxGrid.getHeaders()) {
+ HeaderRow headerRow = grid.prependHeaderRow();
+ groupingHeaders.put(cxHeader, headerRow);
+
+ // create the grouping headers
+ //
+ for (CxGridGroupedCell groupingColumn : cxHeader.getGroupings()) {
+ List<Grid.HeaderCell> headerCells = getCells(headerRow,
+ groupingColumn);
+ Grid.HeaderCell cell = headerRow.join(headerCells
+ .toArray(new Grid.HeaderCell[headerCells.size()]));
+
+ // apply the caption of the cell
+ String caption = Util.getCaption(getI18nService(),
+ groupingColumn.getLabel(),
+ groupingColumn.getLabelI18nKey(), getLocale());
+
+ if (groupingColumn.isUseHTML()) {
+ cell.setHtml(caption);
+ } else {
+ cell.setText(caption);
+ }
+ }
+
+ // create the custom cells
+ //
+ for (CxGridMetaCell cxCell : cxHeader.getCustomCells()) {
+ Grid.HeaderCell cell = headerRow.getCell(cxCell.getTarget()
+ .getPropertyId());
+ if (cell == null) {
+ continue;
+ }
+
+ if (cxCell.getElement() != null) {
+ IEmbeddableEditpart ep = ModelUtil.getEditpart(
+ getViewContext(), cxCell.getElement());
+ if (ep != null) {
+ Component component = (Component) ep.render(null);
+ cell.setComponent(component);
+ }
+ } else {
+ String caption = Util.getCaption(getI18nService(),
+ cxCell.getLabel(), cxCell.getLabelI18nKey(),
+ getLocale());
+ if (cxCell.isUseHTML()) {
+ cell.setHtml(caption);
+ } else {
+ cell.setText(caption);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Reset header.
+ */
+ protected void resetHeader() {
+ // reset the old header
+ for (HeaderRow header : groupingHeaders.values()) {
+ grid.removeHeaderRow(header);
+ }
+ groupingHeaders.clear();
+
+ // dispose the cell component field
+ //
+ for (CxGridHeaderRow cxHeader : modelAccess.yField.getHeaders()) {
+ for (CxGridMetaCell cxCell : cxHeader.getCustomCells()) {
+ if (cxCell.getElement() != null) {
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell
+ .getElement());
+ if (ep != null && !ep.isDisposed()) {
+ ep.requestDispose();
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Reset filter.
+ */
+ protected void resetFilter() {
+ // dispose all the rendered search fields
+ for (ISearchFieldEditpart ep : filteringHeaderFields.values()) {
+ ep.dispose();
+ }
+ filteringHeaderFields.clear();
+
+ if (cellFilters != null) {
+ cellFilters.destroy();
+ cellFilters = null;
+ } else {
+ // reset the old header
+ if (filteringHeader != null) {
+ grid.removeHeaderRow(filteringHeader);
+ }
+ }
+
+ filteringHeader = null;
+ }
+
+ /**
+ * Creates the filtering header.
+ */
+ protected void createFilteringHeader() {
+
+ resetFilter();
+
+ CxGrid cxGrid = modelAccess.yField;
+ if (!cxGrid.isFilteringVisible()) {
+ return;
+ }
+
+ if (cxGrid.isCustomFilters()) {
+ createCustomFilters(cxGrid);
+ } else {
+ createAutoFilters();
+ }
+ }
+
+ /**
+ * Creates the auto filters.
+ */
+ protected void createAutoFilters() {
+ cellFilters = new GridCellFilter(grid);
+ Container.Filterable container = (Container.Filterable) grid
+ .getContainerDataSource();
+ for (Grid.Column column : grid.getColumns()) {
+ Class<?> propertyType = container.getType(column.getPropertyId());
+ if (Number.class.isAssignableFrom(propertyType)
+ || isPrimitiveNumber(propertyType)) {
+ cellFilters.setNumberFilter(column.getPropertyId());
+ } else if (propertyType == String.class) {
+ cellFilters.setTextFilter(column.getPropertyId(), true, false);
+ } else if (propertyType == Date.class) {
+ cellFilters.setDateFilter(column.getPropertyId());
+ } else if (propertyType == Boolean.class
+ || propertyType == Boolean.TYPE) {
+ cellFilters.setBooleanFilter(column.getPropertyId());
+ } else if (propertyType.isEnum()) {
+ cellFilters.setComboBoxFilter(column.getPropertyId(),
+ Arrays.asList(propertyType.getEnumConstants()));
+ } else if (DtoUtils.getDomainKeyField(propertyType) != null) {
+ cellFilters.setDtoFilter(column.getPropertyId(), propertyType,
+ "");
+ }
+ }
+ }
+
+ /**
+ * Checks if is primitive number.
+ *
+ * @param propertyType
+ * the property type
+ * @return true, if is primitive number
+ */
+ private boolean isPrimitiveNumber(Class<?> propertyType) {
+ return propertyType == Byte.TYPE || propertyType == Double.TYPE
+ || propertyType == Float.TYPE || propertyType == Integer.TYPE
+ || propertyType == Long.TYPE || propertyType == Short.TYPE;
+ }
+
+ /**
+ * Creates the custom filters.
+ *
+ * @param cxGrid
+ * the cx grid
+ */
+ protected void createCustomFilters(CxGrid cxGrid) {
+ filteringHeader = grid.appendHeaderRow();
+ for (CxGridColumn cxColumn : cxGrid.getColumns()) {
+ Grid.HeaderCell cell = filteringHeader.getCell(cxColumn
+ .getPropertyId());
+ if (cell == null) {
+ continue;
+ }
+
+ // render the search field
+ YSearchField cxSearchField = cxColumn.getSearchField();
+ if (cxSearchField != null) {
+ ISearchFieldEditpart editpart = ModelUtil.getEditpart(
+ getViewContext(), cxSearchField);
+ filteringHeaderFields.put(cxColumn, editpart);
+ ISearchField component = (ISearchField) editpart.render(null);
+ component.bindFilterChanged(filterChangedTracker);
+
+ cell.setComponent((Component) component);
+ }
+ }
+ }
+
+ /**
+ * Refresh filter.
+ *
+ * @return the object
+ */
+ private Object refreshFilter() {
+ Set<Container.Filter> filters = new HashSet<Container.Filter>();
+ for (ISearchFieldEditpart ep : filteringHeaderFields.values()) {
+ Container.Filter f = (Container.Filter) ep.getFilter();
+ if (f != null) {
+ filters.add(f);
+ }
+ }
+
+ try {
+ Container.Filterable filterable = (Container.Filterable) grid
+ .getContainerDataSource();
+ filterable.removeAllContainerFilters();
+ filterable.addContainerFilter(new And(filters
+ .toArray(new Container.Filter[filters.size()])));
+ } catch (Exception e) {
+ LOGGER.error("{}", e);
+ }
+
+ return null;
+ }
+
+ /**
+ * Creates the footer meta cells.
+ */
+ protected void createFooterMetaCells() {
+
+ resetFooter();
+
+ // create the new header
+ CxGrid cxGrid = modelAccess.yField;
+
+ for (CxGridFooterRow cxFooter : cxGrid.getFooters()) {
+ FooterRow footerRow = grid.appendFooterRow();
+ groupingFooters.put(cxFooter, footerRow);
+ for (CxGridGroupedCell groupingColumn : cxFooter.getGroupings()) {
+ List<Grid.FooterCell> footerCells = getCells(footerRow,
+ groupingColumn);
+ Grid.FooterCell cell = footerRow.join(footerCells
+ .toArray(new Grid.FooterCell[footerCells.size()]));
+
+ // apply the caption of the cell
+ String caption = Util.getCaption(getI18nService(),
+ groupingColumn.getLabel(),
+ groupingColumn.getLabelI18nKey(), getLocale());
+
+ if (groupingColumn.isUseHTML()) {
+ cell.setHtml(caption);
+ } else {
+ cell.setText(caption);
+ }
+ }
+
+ // create the custom cells
+ //
+ for (CxGridMetaCell cxCell : cxFooter.getCustomCells()) {
+ Grid.FooterCell cell = footerRow.getCell(cxCell.getTarget()
+ .getPropertyId());
+ if (cell == null) {
+ continue;
+ }
+
+ if (cxCell.getElement() != null) {
+ IEmbeddableEditpart ep = ModelUtil.getEditpart(
+ getViewContext(), cxCell.getElement());
+ if (ep != null) {
+ Component component = (Component) ep.render(null);
+ cell.setComponent(component);
+ }
+ } else {
+ String caption = Util.getCaption(getI18nService(),
+ cxCell.getLabel(), cxCell.getLabelI18nKey(),
+ getLocale());
+ if (cxCell.isUseHTML()) {
+ cell.setHtml(caption);
+ } else {
+ cell.setText(caption);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Reset footer.
+ */
+ protected void resetFooter() {
+ // reset the old header
+ for (FooterRow header : groupingFooters.values()) {
+ grid.removeFooterRow(header);
+ }
+ groupingFooters.clear();
+
+ // dispose the cell component field
+ //
+ for (CxGridFooterRow cxFooter : modelAccess.yField.getFooters()) {
+ for (CxGridMetaCell cxCell : cxFooter.getCustomCells()) {
+ if (cxCell.getElement() != null) {
+ IEmbeddableEditpart ep = ModelUtil.findEditpart(cxCell
+ .getElement());
+ if (ep != null && !ep.isDisposed()) {
+ ep.requestDispose();
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the cells.
+ *
+ * @param row
+ * the row
+ * @param groupingColumn
+ * the grouping column
+ * @return the cells
+ */
+ private List<Grid.HeaderCell> getCells(HeaderRow row,
+ CxGridGroupedCell groupingColumn) {
+ List<Grid.HeaderCell> cells = new ArrayList<Grid.HeaderCell>();
+ for (CxGridGroupable column : groupingColumn.getGroupables()) {
+ if (column instanceof CxGridColumn) {
+ // if it is a column, then use the property id to get the cell
+ //
+ String id = ((CxGridColumn) column).getPropertyId();
+ Grid.HeaderCell cell = row.getCell(id);
+ if (cell != null) {
+ cells.add(cell);
+ }
+ } else if (column instanceof CxGridGroupedCell) {
+ // if it is a grouped cell, then collect all properties of it
+ //
+ cells.addAll(getCells(row, (CxGridGroupedCell) column));
+ }
+ }
+ return cells;
+ }
+
+ /**
+ * Gets the cells.
+ *
+ * @param row
+ * the row
+ * @param groupingColumn
+ * the grouping column
+ * @return the cells
+ */
+ private List<Grid.FooterCell> getCells(FooterRow row,
+ CxGridGroupedCell groupingColumn) {
+ List<Grid.FooterCell> cells = new ArrayList<Grid.FooterCell>();
+ for (CxGridGroupable column : groupingColumn.getGroupables()) {
+ if (column instanceof CxGridColumn) {
+ // if it is a column, then use the property id to get the cell
+ //
+ String id = ((CxGridColumn) column).getPropertyId();
+ Grid.FooterCell cell = row.getCell(id);
+ if (cell != null) {
+ cells.add(cell);
+ }
+ } else if (column instanceof CxGridGroupedCell) {
+ // if it is a grouped cell, then collect all properties of it
+ //
+ cells.addAll(getCells(row, (CxGridGroupedCell) column));
+ }
+ }
+ return cells;
+ }
+
+ /**
+ * Checks if is nested column.
+ *
+ * @param cxColumn
+ * the cx column
+ * @return true, if is nested column
+ */
+ protected boolean isNestedColumn(CxGridColumn cxColumn) {
+ return cxColumn.getPropertyPath() != null
+ && cxColumn.getPropertyPath().contains(".");
+ }
+
+ /**
+ * Returns the column header.
+ *
+ * @param cxColumn
+ * the cx column
+ * @return the column header
+ */
+ private String getColumnHeader(CxGridColumn cxColumn) {
+ String result = null;
+ II18nService service = getI18nService();
+ if (service != null && cxColumn.getLabelI18nKey() != null) {
+ result = service.getValue(cxColumn.getLabelI18nKey(), getLocale());
+ }
+
+ if (result == null || result.equals("")) {
+ result = cxColumn.getLabel();
+ }
+
+ if (result == null || result.equals("")) {
+ result = cxColumn.getPropertyPath();
+ }
+
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doCreateWidget(java.lang.Object)
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes", "serial" })
+ @Override
+ public Grid doCreateWidget(Object parent) {
+ if (grid == null) {
+
+ // tracks changes in the filters
+ filterChangedTracker = new WritableValue();
+ filterChangedTracker.addValueChangeListener(e -> refreshFilter());
+
+ CxGrid cxGrid = modelAccess.yField;
+
+ grid = new Grid();
+ setupComponent(grid, getCastedModel());
+
+ associateWidget(grid, cxGrid);
+
+ if (modelAccess.isCssIdValid()) {
+ grid.setId(modelAccess.getCssID());
+ } else {
+ grid.setId(getEditpart().getId());
+ }
+
+ if (modelAccess.isCssClassValid()) {
+ grid.addStyleName(modelAccess.getCssClass());
+ } else {
+ grid.addStyleName(CSS_CLASS_CONTROL);
+ }
+
+ createColumns = false;
+ if (cxGrid.getType() == String.class) {
+ IndexedContainer datasource = new IndexedContainer();
+ grid.setContainerDataSource(datasource);
+ } else {
+ if (cxGrid.getType() != null) {
+ IBeanSearchService<?> service = null;
+ IBeanSearchServiceFactory factory = getViewContext()
+ .getService(
+ IBeanSearchServiceFactory.class.getName());
+ if (factory != null) {
+ service = factory.createService(cxGrid.getType());
+ }
+ if (cxGrid.isUseBeanService() && service != null) {
+ ISharedStateContext sharedState = getViewContext()
+ .getService(ISharedStateContext.class.getName());
+ BeanServiceLazyLoadingContainer<?> datasource = new BeanServiceLazyLoadingContainer(
+ service, cxGrid.getType(), sharedState);
+
+ // Filter filter = createFilter();
+ // if (filter != null) {
+ // datasource.addContainerFilter(filter);
+ // }
+
+ grid.setContainerDataSource(datasource);
+ } else {
+ DeepResolvingBeanItemContainer datasource = new DeepResolvingBeanItemContainer(
+ cxGrid.getType());
+ grid.setContainerDataSource(datasource);
+ }
+ createColumns = true;
+ } else {
+ IndexedContainer container = new IndexedContainer();
+ container.addContainerProperty("for", String.class, null);
+ container.addContainerProperty("preview", String.class,
+ null);
+ container.addItem(new String[] { "Some value", "other" });
+ grid.setContainerDataSource(container);
+ }
+ }
+
+ // updates the selection type
+ updateSelectionType();
+
+ // creates the binding for the field
+ createBindings(cxGrid, grid);
+
+ if (modelAccess.isCssClassValid()) {
+ grid.addStyleName(modelAccess.getCssClass());
+ }
+
+ // notify field about save
+ grid.getEditorFieldGroup().addCommitHandler(
+ new FieldGroup.CommitHandler() {
+ @Override
+ public void preCommit(CommitEvent commitEvent)
+ throws CommitException {
+
+ }
+
+ @Override
+ public void postCommit(CommitEvent commitEvent)
+ throws CommitException {
+ Object itemId = grid.getEditedItemId();
+ modelAccess.yField.setEditorSaved(itemId);
+ }
+ });
+
+ applyCaptions();
+
+ setupUserCallbacks(cxGrid);
+
+ }
+
+ return grid;
+ }
+
+/**
+ // * Creates a predefined filter for the grid.
+ // *
+ // * @return
+ // */
+ // private Filter createFilter() {
+ // CxGrid grid = modelAccess.yField;
+ // if (grid.getFilters().isEmpty()) {
+ // return null;
+ // }
+ //
+ // List<Filter> filters = new ArrayList<>();
+ // for (YFilter yFilter : grid.getFilters()) {
+ // Filter filter = new Compare.Equal(yFilter.getPropertyPath(),
+ // yFilter.getFilterValue());
+ // filters.add(filter);
+ // }
+ // return new And(filters.toArray(new Filter[filters.size()]));
+ // }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#castEObject(java.lang.Object)
+ */
+ @Override
+ protected CxGrid castEObject(Object model) {
+ return (CxGrid) super.castEObject(model);
+ }
+
+ /**
+ * Creates the bindings.
+ *
+ * @param yGrid
+ * the y grid
+ * @param widget
+ * the widget
+ */
+ protected void createBindings(CxGrid yGrid, Grid widget) {
+ super.createBindings(yGrid, widget, null);
+
+ // bind the editorEnabled property
+ IVaadinObservableValue editorEnabledUiObservable = VaadinProperties
+ .accessor(Grid.class, "editorEnabled").observe(widget);
+ IObservableValue editorEnabledModelObservable = EMFObservables
+ .observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_EditorEnabled());
+ registerBinding(createBindings(editorEnabledUiObservable,
+ editorEnabledModelObservable));
+
+ // bind the footerVisible property
+ IVaadinObservableValue footerVisibleUiObservable = VaadinProperties
+ .accessor(Grid.class, "footerVisible").observe(widget);
+ IObservableValue footerVisibleModelObservable = EMFObservables
+ .observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_FooterVisible());
+ registerBinding(createBindings(footerVisibleUiObservable,
+ footerVisibleModelObservable));
+ // add a value change listener to update the memento
+ footerVisibleModelObservable.addValueChangeListener(e -> {
+ if (currentMemento == null
+ || currentMemento.isFooterVisible() != grid
+ .isFooterVisible()) {
+ updateMemento();
+ }
+ });
+
+ // bind the headerVisible property
+ IVaadinObservableValue headerVisibleUiObservable = VaadinProperties
+ .accessor(Grid.class, "headerVisible").observe(widget);
+ IObservableValue headerVisibleModelObservable = EMFObservables
+ .observeValue(castEObject(yGrid),
+ CxGridPackage.eINSTANCE.getCxGrid_HeaderVisible());
+ registerBinding(createBindings(headerVisibleUiObservable,
+ headerVisibleModelObservable));
+ // add a value change listener to update the memento
+ headerVisibleModelObservable.addValueChangeListener(e -> {
+ if (currentMemento == null
+ || currentMemento.isHeaderVisible() != grid
+ .isHeaderVisible()) {
+ updateMemento();
+ }
+ });
+
+ // bind the columnReorderingAllowed property
+ IVaadinObservableValue columnReorderingAllowedUiObservable = VaadinProperties
+ .accessor(Grid.class, "columnReorderingAllowed")
+ .observe(widget);
+ IObservableValue columnReorderingAllowedModelObservable = EMFObservables
+ .observeValue(castEObject(yGrid), CxGridPackage.eINSTANCE
+ .getCxGrid_ColumnReorderingAllowed());
+ registerBinding(createBindings(columnReorderingAllowedUiObservable,
+ columnReorderingAllowedModelObservable));
+
+ if (!modelAccess.yField.isUseBeanService()) {
+ // if use bean service, the container is responsible to collect
+ // data. So we must not have a binding from the container to the
+ // YGrid#collection attribute.
+ Container.Indexed container = grid.getContainerDataSource();
+ // bind the rows
+ registerBinding(createBindings_ContainerContents(
+ castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__COLLECTION,
+ (Container.ItemSetChangeNotifier) container,
+ yGrid.getType()));
+ }
+ // update the selection binding
+ updateSelectionBinding();
+ }
+
+ /**
+ * Updates the selection binding for the grid.
+ */
+ protected void updateSelectionBinding() {
+
+ CxGrid yGrid = modelAccess.yField;
+
+ if (selectionBinding != null) {
+ unregisterBinding(selectionBinding);
+ selectionBinding = null;
+ }
+
+ // create the model binding from widget to ECView-model
+ if (yGrid.getSelectionType() == YSelectionType.MULTI) {
+ selectionBinding = createBindingsMultiSelection(
+ castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__MULTI_SELECTION, grid,
+ yGrid.getType());
+ // create the model binding from widget to ECView-model
+ registerBinding(selectionBinding);
+ } else {
+ // create the model binding from widget to ECView-model
+ selectionBinding = createBindingsSingleSelection(
+ castEObject(getModel()),
+ CxGridPackage.Literals.CX_GRID__SELECTION, grid,
+ yGrid.getType());
+ registerBinding(selectionBinding);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateSelectionType()
+ */
+ @Override
+ public void updateSelectionType() {
+ grid.setSelectionMode(modelAccess.yField.getSelectionType() == YSelectionType.MULTI ? Grid.SelectionMode.MULTI
+ : Grid.SelectionMode.SINGLE);
+ updateSelectionBinding();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ */
+ @Override
+ public Grid getWidget() {
+ return grid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return grid != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUnrender()
+ */
+ @Override
+ public void doUnrender() {
+ if (grid != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ // remove assocations
+ unassociateWidget(grid);
+
+ resetFooter();
+ resetHeader();
+ resetFilter();
+
+ currentMemento = null;
+ grid = null;
+ }
+ }
+
+ /**
+ * Creates the bindings single selection.
+ *
+ * @param model
+ * the model
+ * @param modelFeature
+ * the model feature
+ * @param field
+ * the field
+ * @param collectionType
+ * the collection type
+ * @return the binding
+ */
+ protected Binding createBindingsSingleSelection(CxGrid model,
+ EStructuralFeature modelFeature, final Grid field,
+ Class<?> collectionType) {
+ IBindingManager bindingManager = getViewContext()
+ .getService(
+ org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
+ .getName());
+ if (bindingManager != null) {
+ // bind the value of yText to textRidget
+ IObservableValue modelObservable = EMFProperties
+ .value(modelFeature).observe(model);
+ IVaadinObservableValue uiObservable = VaadinProperties
+ .propertyGridSelectionValueProperty(collectionType)
+ .observe(field);
+ final Binding binding = bindingManager.bindValue(uiObservable,
+ modelObservable, null, null);
+
+ return binding;
+ }
+ return null;
+ }
+
+ /**
+ * Creates the bindings multi selection.
+ *
+ * @param model
+ * the model
+ * @param modelFeature
+ * the model feature
+ * @param field
+ * the field
+ * @param collectionType
+ * the collection type
+ * @return the binding
+ */
+ protected Binding createBindingsMultiSelection(CxGrid model,
+ EStructuralFeature modelFeature, final Grid field,
+ Class<?> collectionType) {
+ IBindingManager bindingManager = getViewContext()
+ .getService(
+ org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
+ .getName());
+ if (bindingManager != null) {
+ // bind the value of yText to textRidget
+ IObservableList modelObservable = EMFProperties.list(modelFeature)
+ .observe(model);
+ IVaadinObservableList uiObservable = new SetToListAdapter(
+ VaadinProperties.propertyGridSelectionSetPropertyAsSet(
+ collectionType).observe(field), field);
+
+ final Binding binding = bindingManager.bindList(uiObservable,
+ modelObservable, null, null);
+
+ return binding;
+ }
+ return null;
+ }
+
+ /**
+ * Is used by the editpart to update the header.
+ */
+ public void updateHeader() {
+ createHeaderMetaCells();
+ updateMemento();
+ }
+
+ /**
+ * Is used by the editpart to update the footer.
+ */
+ public void updateFooter() {
+ createFooterMetaCells();
+ updateMemento();
+ }
+
+ /**
+ * Is used by the editpart to update the columns.
+ */
+ public void updateColumns() {
+ createColumns();
+ updateMemento();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateFilter()
+ */
+ @Override
+ public void updateFilter() {
+ createFilteringHeader();
+ updateMemento();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridPresentation#updateCellStyleGenerator()
+ */
+ @Override
+ public void updateCellStyleGenerator() {
+ CxGridCellStyleGenerator cxGenerator = modelAccess.yField
+ .getCellStyleGenerator();
+ if (cxGenerator != null) {
+ IGridCellStyleGeneratorEditpart ep = ModelUtil.getEditpart(
+ getViewContext(), cxGenerator);
+ Grid.CellStyleGenerator generator = (Grid.CellStyleGenerator) ep
+ .getDelegate();
+ grid.setCellStyleGenerator(generator);
+ } else {
+ grid.setCellStyleGenerator(null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.common.memento.IMementoHandler#applyMemento(java.lang.Object)
+ */
+ @Override
+ public void applyMemento(Object value) {
+ boolean isRendered = isRendered();
+ try {
+ if (isRendered) {
+ // unrender the grid to increase performance
+ getEditpart().requestUnrender();
+ }
+
+ doApplyMemento(value);
+ } finally {
+ if (isRendered) {
+ // render the grid again
+ getEditpart().requestRender();
+ }
+ }
+ }
+
+ /**
+ * Do apply memento.
+ *
+ * @param value
+ * the value
+ */
+ protected void doApplyMemento(Object value) {
+ CxGrid cxGrid = modelAccess.yField;
+
+ CxGridMemento cxMemento = (CxGridMemento) value;
+ currentMemento = cxMemento;
+
+ // apply the grid properties
+ //
+ cxGrid.setEditorEnabled(cxMemento.isEditorEnabled());
+ cxGrid.setFilteringVisible(cxMemento.isFilterVisible());
+ cxGrid.setHeaderVisible(cxMemento.isHeaderVisible());
+ cxGrid.setFooterVisible(cxMemento.isFooterVisible());
+
+ // apply the columns to the grid and the setting to each column
+ //
+ List<CxGridColumn> tempColumns = new ArrayList<>(cxGrid.getColumns());
+ List<CxGridColumn> cxOrderedColumns = new ArrayList<>(cxGrid
+ .getColumns().size());
+ for (CxGridMementoColumn memColumn : cxMemento.getColumns()) {
+ CxGridColumn cxColumn = findCxColumn(memColumn.getPropertyId());
+ if (cxColumn != null) {
+ // add the columns in the order of the memento
+ cxOrderedColumns.add(cxColumn);
+ tempColumns.remove(cxColumn);
+
+ cxColumn.setEditable(memColumn.isEditable());
+ cxColumn.setHidden(memColumn.isHidden());
+ cxColumn.setHideable(memColumn.isHideable());
+ cxColumn.setSortable(memColumn.isSortable());
+ cxColumn.setExpandRatio(memColumn.getExpandRatio());
+ if (memColumn.getWidth() > 0) {
+ cxColumn.setWidth(memColumn.getWidth());
+ }
+ }
+ }
+
+ // set all columns that are not in the memento as hidden
+ //
+ for (CxGridColumn cxColumn : tempColumns) {
+ cxColumn.setHideable(true);
+ cxColumn.setHidden(true);
+ }
+
+ // set the new columns to the grid
+ cxGrid.getColumns().clear();
+ cxGrid.getColumns().addAll(cxOrderedColumns);
+
+ // update the sortorder
+ //
+ List<CxGridSortable> cxSortables = new ArrayList<>(cxMemento
+ .getSortOrders().size());
+ if (cxMemento.getSortOrders().size() > 0) {
+ for (CxGridMementoSortable memSort : cxMemento.getSortOrders()) {
+
+ CxGridColumn cxColumn = findCxColumn(memSort.getColumn()
+ .getPropertyId());
+ if (cxColumn != null) {
+ CxGridSortable cxSortable = CxGridFactory.eINSTANCE
+ .createCxGridSortable();
+ cxSortable.setColumn(cxColumn);
+ cxSortable.setDescending(memSort.isDescending());
+ cxSortables.add(cxSortable);
+ }
+ }
+ cxGrid.getSortOrder().addAll(cxSortables);
+ }
+ }
+
+ /**
+ * To direction.
+ *
+ * @param cxSortable
+ * the cx sortable
+ * @return the sort direction
+ */
+ private SortDirection toDirection(CxGridSortable cxSortable) {
+ return cxSortable.isDescending() ? SortDirection.DESCENDING
+ : SortDirection.ASCENDING;
+ }
+
+ /**
+ * Gets the memento.
+ *
+ * @return the memento
+ */
+ private Object getMemento() {
+ CxGridMemento cxMemento = CxGridMementoFactory.eINSTANCE
+ .createCxGridMemento();
+
+ currentMemento = cxMemento;
+
+ cxMemento.setId(getMementoId());
+ cxMemento.setGridId(getCastedModel().getId());
+ cxMemento.setEditorEnabled(grid.isEditorEnabled());
+ cxMemento.setHeaderVisible(grid.isHeaderVisible());
+ cxMemento.setFooterVisible(grid.isFooterVisible());
+ cxMemento.setFilterVisible(filteringHeader != null);
+
+ Map<Object, CxGridMementoColumn> tempColumns = new HashMap<>();
+ for (Grid.Column column : grid.getColumns()) {
+ CxGridMementoColumn cxColumn = CxGridMementoFactory.eINSTANCE
+ .createCxGridMementoColumn();
+ cxColumn.setEditable(column.isEditable());
+ cxColumn.setExpandRatio(column.getExpandRatio());
+ cxColumn.setHideable(column.isHidable());
+ cxColumn.setHidden(column.isHidden());
+ cxColumn.setSortable(column.isSortable());
+ cxColumn.setWidth((int) column.getWidth());
+ cxColumn.setPropertyId((String) column.getPropertyId());
+ cxMemento.getColumns().add(cxColumn);
+
+ tempColumns.put(cxColumn.getPropertyId(), cxColumn);
+ }
+
+ for (SortOrder sortOrder : grid.getSortOrder()) {
+ CxGridMementoSortable cxSortable = CxGridMementoFactory.eINSTANCE
+ .createCxGridMementoSortable();
+ CxGridMementoColumn cxColumn = tempColumns.get(sortOrder
+ .getPropertyId());
+ if (cxColumn == null) {
+ LOGGER.warn("Column is not available :"
+ + sortOrder.getPropertyId());
+ continue;
+ }
+
+ cxSortable.setColumn(cxColumn);
+ cxSortable
+ .setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
+
+ cxMemento.getSortOrders().add(cxSortable);
+ }
+
+ return cxMemento;
+ }
+
+ /**
+ * Gets the memento id.
+ *
+ * @return the memento id
+ */
+ protected String getMementoId() {
+ return castEObject(getCastedModel()).getMementoId();
+ }
+
+ /**
+ * Handles the memento, if it is enabled by the grid.
+ *
+ * @param cxGrid
+ * the new up user callbacks
+ */
+ protected void setupUserCallbacks(CxGrid cxGrid) {
+ // then add listeners to the grid
+ //
+ grid.addColumnReorderListener(e -> {
+ if (e.isUserOriginated()) {
+ userChangedHandler.userChangedColumnOrder();
+ updateMemento();
+ }
+ });
+
+ grid.addColumnVisibilityChangeListener(e -> {
+ if (e.isUserOriginated()) {
+ userChangedHandler.userChangedColumnVisibility(e);
+ updateMemento();
+ }
+ });
+
+ grid.addSortListener(e -> {
+ if (e.isUserOriginated()) {
+ userChangedHandler.userChangedSortOrder(e);
+ updateMemento();
+ }
+ });
+
+ }
+
+ /**
+ * Find column wrapper.
+ *
+ * @param column
+ * the column
+ * @return the column wrapper
+ */
+ private ColumnWrapper findColumnWrapper(Grid.Column column) {
+ return columns.stream().filter(e -> e.column == column).findFirst()
+ .orElse(null);
+ }
+
+ /**
+ * Find column wrapper.
+ *
+ * @param propertyId
+ * the property id
+ * @return the column wrapper
+ */
+ private ColumnWrapper findColumnWrapper(String propertyId) {
+ return columns.stream()
+ .filter(e -> e.column.getPropertyId().equals(propertyId))
+ .findFirst().orElse(null);
+ }
+
+ /**
+ * Find cx column.
+ *
+ * @param propertyId
+ * the property id
+ * @return the cx grid column
+ */
+ private CxGridColumn findCxColumn(String propertyId) {
+ CxGrid cxGrid = modelAccess.yField;
+ return cxGrid.getColumns().stream()
+ .filter(e -> e.getPropertyId().equals(propertyId)).findFirst()
+ .orElse(null);
+ }
+
+ /**
+ * Updates the memento.
+ */
+ protected void updateMemento() {
+ if (modelAccess.yField.isMementoEnabled()) {
+ IGridEditpart ep = (IGridEditpart) getEditpart();
+ ep.saveMemento(getMemento());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableCollectionEndpoint) {
+ return internalGetCollectionEndpoint();
+ } else if (bindableValue instanceof YEmbeddableSelectionEndpoint) {
+ return internalGetSelectionEndpoint((YEmbeddableSelectionEndpoint) bindableValue);
+ } else if (bindableValue instanceof YEmbeddableMultiSelectionEndpoint) {
+ return internalGetMultiSelectionEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe the collection.
+ *
+ * @return the i observable list
+ */
+ protected IObservableList internalGetCollectionEndpoint() {
+ // return the observable value for text
+ return EMFProperties.list(CxGridPackage.Literals.CX_GRID__COLLECTION)
+ .observe(getModel());
+ }
+
+ /**
+ * Returns the observable to observe the selection.
+ *
+ * @param yEndpoint
+ * the y endpoint
+ * @return the i observable value
+ */
+ @SuppressWarnings("restriction")
+ protected IObservableValue internalGetSelectionEndpoint(
+ YEmbeddableSelectionEndpoint yEndpoint) {
+
+ String attributePath = ECViewModelBindable.getAttributePath(
+ CxGridPackage.Literals.CX_GRID__SELECTION,
+ yEndpoint.getAttributePath());
+
+ // return the observable value
+ return ECViewModelBindable.observeValue(castEObject(getModel()),
+ attributePath, modelAccess.yField.getType(),
+ modelAccess.yField.getEmfNsURI());
+ }
+
+ /**
+ * Returns the observable to observe the selection.
+ *
+ * @return the i observable list
+ */
+ protected IObservableList internalGetMultiSelectionEndpoint() {
+ // return the observable value for text
+ return EMFProperties.list(CxGridPackage.Literals.CX_GRID__SELECTION)
+ .observe(getModel());
+ }
+
+ /**
+ * An internal helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final CxGrid yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yLayout
+ * the y layout
+ */
+ public ModelAccess(CxGrid yLayout) {
+ super();
+ this.yField = yLayout;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getLabel();
+ }
+
+ /**
+ * Returns the label I18n key.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getLabelI18nKey();
+ }
+ }
+
+ /**
+ * The Class ColumnWrapper.
+ */
+ private class ColumnWrapper extends AbstractDisposable implements
+ IGridColumnEditpart.ColumnReference {
+
+ /** The cx column. */
+ private CxGridColumn cxColumn;
+
+ /** The column. */
+ private Grid.Column column;
+
+ /**
+ * Instantiates a new column wrapper.
+ *
+ * @param cxColumn
+ * the cx column
+ * @param column
+ * the column
+ */
+ public ColumnWrapper(CxGridColumn cxColumn, Grid.Column column) {
+ super();
+ this.cxColumn = cxColumn;
+ this.column = column;
+
+ columns.add(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object converter) {
+ if (converter != null && converter instanceof Converter) {
+ column.setConverter((Converter<?, ?>) converter);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#setRenderer(java.lang.Object, java.lang.Object)
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void setRenderer(Object renderer, Object converter) {
+ if (renderer == null) {
+ LOGGER.debug("Null renderer not allowed");
+ return;
+ }
+ if (converter == null) {
+ column.setRenderer((Renderer) renderer);
+ } else {
+ column.setRenderer((Renderer) renderer, (Converter) converter);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#updateProperties()
+ */
+ @Override
+ public void updateProperties() {
+ column.setHeaderCaption(getColumnHeader(cxColumn));
+ column.setHidden(cxColumn.isHidden());
+ column.setHidable(cxColumn.isHideable());
+ column.setEditable(cxColumn.isEditable());
+ if (cxColumn.getMinWidthPixels() > -1) {
+ column.setMinimumWidth(cxColumn.getMinWidthPixels());
+ }
+ if (cxColumn.getMaxWidthPixels() > 0) {
+ column.setMaximumWidth(cxColumn.getMaxWidthPixels());
+ }
+ if (cxColumn.getWidth() > -1) {
+ column.setWidth(cxColumn.getWidth());
+ } else {
+ column.setWidthUndefined();
+ }
+ column.setSortable(cxColumn.isSortable());
+ if (cxColumn.getExpandRatio() > -1) {
+ column.setExpandRatio(cxColumn.getExpandRatio());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart.ColumnReference#updateEditorField()
+ */
+ @Override
+ public void updateEditorField() {
+ if (!cxColumn.isEditable()) {
+ column.setEditorField(null);
+ } else {
+ YField cxField = cxColumn.getEditorField();
+ Field<?> field = null;
+ if (cxField != null) {
+ IFieldEditpart editpart = ModelUtil.getEditpart(
+ getViewContext(), cxField);
+ field = (Field<?>) editpart.render(null);
+ field.setSizeFull();
+ }
+ column.setEditorField(field);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.common.dispose.AbstractDisposable#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+
+ // remove this column from the cached columns
+ columns.remove(this);
+
+ YField cxField = cxColumn.getEditorField();
+ if (cxField != null) {
+ IFieldEditpart editpart = ModelUtil.findEditpart(cxField);
+ if (editpart != null) {
+ editpart.dispose();
+ }
+ }
+ }
+ }
+
+ /**
+ * The Class UserChangedHandler.
+ */
+ private class UserChangedHandler {
+
+ /**
+ * User changed sort order.
+ *
+ * @param e
+ * the e
+ */
+ private void userChangedSortOrder(SortEvent e) {
+ List<CxGridSortable> cxSortOrder = new ArrayList<>();
+ for (SortOrder sortOrder : e.getSortOrder()) {
+ ColumnWrapper wrapper = findColumnWrapper((String) sortOrder
+ .getPropertyId());
+
+ CxGridSortable cxSortable = CxGridFactory.eINSTANCE
+ .createCxGridSortable();
+ cxSortOrder.add(cxSortable);
+ if (wrapper != null) {
+ cxSortable.setColumn(wrapper.cxColumn);
+ }
+ cxSortable
+ .setDescending(sortOrder.getDirection() == SortDirection.DESCENDING);
+ }
+
+ CxGrid cxGrid = modelAccess.yField;
+ try {
+ cxGrid.eSetDeliver(false);
+ modelAccess.yField.getSortOrder().clear();
+ modelAccess.yField.getSortOrder().addAll(cxSortOrder);
+ } finally {
+ cxGrid.eSetDeliver(true);
+ }
+
+ }
+
+ /**
+ * User changed column visibility.
+ *
+ * @param e
+ * the e
+ */
+ private void userChangedColumnVisibility(ColumnVisibilityChangeEvent e) {
+ Grid.Column affected = e.getColumn();
+ ColumnWrapper wrapper = findColumnWrapper(affected);
+ if (wrapper == null) {
+ LOGGER.warn("No column available for "
+ + affected.getHeaderCaption());
+ return;
+ }
+
+ CxGrid cxGrid = modelAccess.yField;
+ try {
+ cxGrid.eSetDeliver(false);
+ // update the column in the model
+ CxGridColumn cxColumn = wrapper.cxColumn;
+ cxColumn.setHidden(e.isHidden());
+ } finally {
+ cxGrid.eSetDeliver(true);
+ }
+ }
+
+ /**
+ * User changed column order.
+ */
+ private void userChangedColumnOrder() {
+ List<CxGridColumn> cxColumns = new ArrayList<>();
+ for (Grid.Column column : grid.getColumns()) {
+ ColumnWrapper wrapper = findColumnWrapper(column);
+ cxColumns.add(wrapper.cxColumn);
+ }
+
+ CxGrid cxGrid = modelAccess.yField;
+ try {
+ cxGrid.eSetDeliver(false);
+ cxGrid.getColumns().clear();
+ cxGrid.getColumns().addAll(cxColumns);
+ } finally {
+ cxGrid.eSetDeliver(true);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/PresenterFactory.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/PresenterFactory.java
new file mode 100644
index 0000000..f342e72
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/PresenterFactory.java
@@ -0,0 +1,64 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+
+/**
+ * The presenter factory.
+ */
+@Component(immediate = true, service = { IPresentationFactory.class })
+public class PresenterFactory implements IPresentationFactory {
+
+ /**
+ * Instantiates a new presenter factory.
+ */
+ public PresenterFactory() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory#isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext, IElementEditpart editpart) {
+ String presentationURI = uiContext.getPresentationURI();
+ return presentationURI != null
+ && presentationURI.equals(VaadinRenderer.UI_KIT_URI);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory#createPresentation(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends IWidgetPresentation<?>> A createPresentation(
+ IViewContext uiContext, IElementEditpart editpart)
+ throws IllegalArgumentException {
+ if (editpart instanceof IGridEditpart) {
+ return (A) new GridPresentation(editpart);
+ }
+
+ throw new IllegalArgumentException(String.format(
+ "No presenter available for editpart %s[%s]", editpart
+ .getClass().getName(), editpart.getId()));
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/PriceRenderer.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/PriceRenderer.java
new file mode 100644
index 0000000..83daae1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/PriceRenderer.java
@@ -0,0 +1,170 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.renderer;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+
+import org.apache.commons.beanutils.NestedNullException;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.ui.Grid.AbstractRenderer;
+import com.vaadin.data.util.converter.Converter.ConversionException;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridPriceRenderer;
+
+import elemental.json.JsonValue;
+
+/**
+ * The Class PriceRenderer.
+ */
+@SuppressWarnings("serial")
+public class PriceRenderer extends AbstractRenderer<Object> {
+
+ /** The Constant HTML_PATTERN. */
+ private static final String HTML_PATTERN = "<b>{@value}</b> <i>{@currency}</i>";
+
+ /** The Constant NUMBER_FORMAT. */
+ private static final String NUMBER_FORMAT = "#,##0.00";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(PriceRenderer.class);
+
+ /** The locale. */
+ private final Locale locale;
+
+ /** The cx renderer. */
+ private CxGridPriceRenderer cxRenderer;
+
+ /**
+ * Instantiates a new price renderer.
+ *
+ * @param cxRenderer
+ * the cx renderer
+ * @param locale
+ * the locale
+ */
+ public PriceRenderer(CxGridPriceRenderer cxRenderer, Locale locale) {
+ super(Object.class, cxRenderer.getNullRepresentation());
+ this.cxRenderer = cxRenderer;
+ this.locale = locale;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.Grid.AbstractRenderer#encode(java.lang.Object)
+ */
+ @Override
+ public JsonValue encode(Object value) {
+ String stringValue = "error";
+ if (value == null) {
+ stringValue = getNullRepresentation();
+ } else {
+ String valueString = getValueString(value);
+ Object currencyString = getCurrencyString(value);
+ stringValue = toHtmlPattern().replaceAll("\\{@value}", valueString);
+ stringValue = stringValue.replaceAll("\\{@currency}",
+ currencyString.toString());
+ }
+ return encode(stringValue, String.class);
+ }
+
+ /**
+ * To html pattern.
+ *
+ * @return the string
+ */
+ protected String toHtmlPattern() {
+ return cxRenderer.getHtmlPattern() == null
+ || cxRenderer.getHtmlPattern().equals("") ? HTML_PATTERN
+ : cxRenderer.getHtmlPattern();
+ }
+
+ /**
+ * Gets the currency string.
+ *
+ * @param value
+ * the value
+ * @return the currency string
+ */
+ protected Object getCurrencyString(Object value) {
+ Object currencyProp;
+ try {
+ if (value == null) {
+ return "";
+ }
+ currencyProp = PropertyUtils.getProperty(value,
+ cxRenderer.getCurrencyPropertyPath());
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ currencyProp = "";
+ LOGGER.error("{}", e);
+ } catch (NestedNullException e) {
+ // nothing to do -> value is null
+ currencyProp = "";
+ }
+ return currencyProp;
+ }
+
+ /**
+ * Gets the value string.
+ *
+ * @param value
+ * the value
+ * @return the value string
+ */
+ protected String getValueString(Object value) {
+ String valueString = "undef";
+ Object valueProp;
+ try {
+ valueProp = PropertyUtils.getProperty(value,
+ cxRenderer.getValuePropertyPath());
+ if (valueProp instanceof String) {
+ valueString = (String) valueProp;
+ } else {
+ DecimalFormat df = new DecimalFormat(
+ StringEscapeUtils.unescapeHtml(getNumberFormat()),
+ DecimalFormatSymbols.getInstance(locale));
+ valueString = df.format(valueProp);
+ }
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ getNumberFormat(), e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ }
+ return valueString;
+ }
+
+ /**
+ * Gets the number format.
+ *
+ * @return the number format
+ */
+ private String getNumberFormat() {
+ return cxRenderer.getNumberFormat() != null
+ && !cxRenderer.getNumberFormat().trim().isEmpty() ? cxRenderer
+ .getNumberFormat() : NUMBER_FORMAT;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/QuantityRenderer.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/QuantityRenderer.java
new file mode 100644
index 0000000..5945aaf
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/QuantityRenderer.java
@@ -0,0 +1,167 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.renderer;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+
+import org.apache.commons.beanutils.NestedNullException;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.ui.Grid.AbstractRenderer;
+
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridQuantityRenderer;
+
+import elemental.json.JsonValue;
+
+/**
+ * The Class QuantityRenderer.
+ */
+@SuppressWarnings("serial")
+public class QuantityRenderer extends AbstractRenderer<Object> {
+
+ /** The Constant HTML_PATTERN. */
+ private static final String HTML_PATTERN = "<b>{@value}</b> <i>{@uom}</i>";
+
+ /** The Constant NUMBER_FORMAT. */
+ private static final String NUMBER_FORMAT = "#,##0.00";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(QuantityRenderer.class);
+
+ /** The locale. */
+ private final Locale locale;
+
+ /** The cx renderer. */
+ private CxGridQuantityRenderer cxRenderer;
+
+ /**
+ * Instantiates a new quantity renderer.
+ *
+ * @param cxRenderer
+ * the cx renderer
+ * @param locale
+ * the locale
+ */
+ public QuantityRenderer(CxGridQuantityRenderer cxRenderer, Locale locale) {
+ super(Object.class, cxRenderer.getNullRepresentation());
+ this.cxRenderer = cxRenderer;
+ this.locale = locale;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.Grid.AbstractRenderer#encode(java.lang.Object)
+ */
+ @Override
+ public JsonValue encode(Object value) {
+ String stringValue;
+ if (value == null) {
+ stringValue = getNullRepresentation();
+ } else {
+ String valueString = getValueString(value);
+ Object uomString = getUomString(value);
+ stringValue = toHtmlPattern().replaceAll("\\{@value}", valueString);
+ stringValue = stringValue.replaceAll("\\{@uom}",
+ uomString.toString());
+ }
+ return encode(stringValue, String.class);
+ }
+
+ /**
+ * Gets the uom string.
+ *
+ * @param value
+ * the value
+ * @return the uom string
+ */
+ protected Object getUomString(Object value) {
+ Object uomProp;
+ try {
+ uomProp = PropertyUtils.getProperty(value,
+ cxRenderer.getUomPropertyPath());
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ uomProp = "";
+ LOGGER.error("{}", e);
+ } catch (NestedNullException e) {
+ // nothing to do -> value is null
+ uomProp = "";
+ }
+ return uomProp;
+ }
+
+ /**
+ * Gets the value string.
+ *
+ * @param value
+ * the value
+ * @return the value string
+ */
+ protected String getValueString(Object value) {
+ String valueString = "undef";
+ Object valueProp;
+ try {
+ valueProp = PropertyUtils.getProperty(value,
+ cxRenderer.getValuePropertyPath());
+ if (valueProp instanceof String) {
+ valueString = (String) valueProp;
+ } else {
+ DecimalFormat df = new DecimalFormat(
+ StringEscapeUtils.unescapeHtml(getNumberFormat()),
+ DecimalFormatSymbols.getInstance(locale));
+ valueString = df.format(valueProp);
+ }
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ getNumberFormat(), e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ }
+ return valueString;
+ }
+
+ /**
+ * To html pattern.
+ *
+ * @return the string
+ */
+ protected String toHtmlPattern() {
+ return cxRenderer.getHtmlPattern() == null
+ || cxRenderer.getHtmlPattern().equals("") ? HTML_PATTERN
+ : cxRenderer.getHtmlPattern();
+ }
+
+ /**
+ * Gets the number format.
+ *
+ * @return the number format
+ */
+ private String getNumberFormat() {
+ return cxRenderer.getNumberFormat() != null
+ && !cxRenderer.getNumberFormat().trim().isEmpty() ? cxRenderer
+ .getNumberFormat() : NUMBER_FORMAT;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java
new file mode 100644
index 0000000..d2a20e4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java
@@ -0,0 +1,178 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.grid.presentation.renderer;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.osgi.service.component.annotations.Component;
+import org.vaadin.gridutil.renderer.BooleanRenderer;
+import org.vaadin.gridutil.renderer.IndicatorRenderer;
+
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.ui.renderers.ButtonRenderer;
+import com.vaadin.ui.renderers.DateRenderer;
+import com.vaadin.ui.renderers.HtmlRenderer;
+import com.vaadin.ui.renderers.ImageRenderer;
+import com.vaadin.ui.renderers.NumberRenderer;
+import com.vaadin.ui.renderers.ProgressBarRenderer;
+import com.vaadin.ui.renderers.TextRenderer;
+
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridBooleanRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridButtonRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridHtmlRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridImageRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridIndicatorRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridNumberRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridPriceRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridProgressBarRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridQuantityRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererClickEvent;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridTextRenderer;
+
+import elemental.json.JsonValue;
+
+/**
+ * A factory for creating Renderer objects.
+ */
+@Component(immediate = true)
+public class RendererFactory implements IGridRendererFactory {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.renderer.
+ * IGridRendererFactory
+ * #isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext,
+ * org.eclipse
+ * .osbp.ecview.extension.grid.editparts.renderer.IGridRendererEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext, IGridRendererEditpart editpart) {
+ String presentationURI = uiContext.getPresentationURI();
+ return presentationURI != null
+ && presentationURI.equals(VaadinRenderer.UI_KIT_URI);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.renderer.
+ * IGridRendererFactory
+ * #createRenderer(org.eclipse.osbp.ecview.core.common.context.IViewContext,
+ * org
+ * .eclipse.osbp.ecview.extension.grid.editparts.renderer.IGridRendererEditpart
+ * )
+ */
+ @SuppressWarnings("serial")
+ @Override
+ public Object createRenderer(IViewContext uiContext,
+ IGridRendererEditpart editpart) throws IllegalArgumentException {
+
+ CxGridRenderer cxRenderer = (CxGridRenderer) editpart.getModel();
+ if (cxRenderer instanceof CxGridDateRenderer) {
+ CxGridDateRenderer cxCasted = (CxGridDateRenderer) cxRenderer;
+ String dateFormat = cxCasted.getDateFormat();
+ if (dateFormat != null && !dateFormat.equals("")) {
+ return new DateRenderer(new SimpleDateFormat(dateFormat,
+ uiContext.getLocale()));
+ } else {
+ return new DateRenderer(uiContext.getLocale());
+ }
+ } else if (cxRenderer instanceof CxGridNumberRenderer) {
+ CxGridNumberRenderer cxCasted = (CxGridNumberRenderer) cxRenderer;
+ String numberFormat = cxCasted.getNumberFormat();
+ if (numberFormat != null && !numberFormat.equals("")) {
+ try {
+ return new NumberRenderer(new DecimalFormat(
+ StringEscapeUtils.unescapeHtml(numberFormat),
+ DecimalFormatSymbols.getInstance(uiContext
+ .getLocale())),
+ cxCasted.getNullRepresentation());
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ numberFormat, e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+ } else {
+ return new NumberRenderer(uiContext.getLocale());
+ }
+ } else if (cxRenderer instanceof CxGridTextRenderer) {
+ CxGridTextRenderer cxCasted = (CxGridTextRenderer) cxRenderer;
+ return new TextRenderer(cxCasted.getNullRepresentation());
+ } else if (cxRenderer instanceof CxGridImageRenderer) {
+ CxGridImageRenderer cxCasted = (CxGridImageRenderer) cxRenderer;
+ ImageRenderer renderer = new ImageRenderer();
+ renderer.addClickListener(e -> {
+ CxGridRendererClickEvent cxEvent = CxGridRendererFactory.eINSTANCE
+ .createCxGridRendererClickEvent();
+ cxEvent.setRenderer(cxRenderer);
+ cxEvent.setLastClickTime(new Date().getTime());
+ cxCasted.setLastClickEvent(cxEvent);
+ });
+ return renderer;
+ } else if (cxRenderer instanceof CxGridButtonRenderer) {
+ CxGridButtonRenderer cxCasted = (CxGridButtonRenderer) cxRenderer;
+ ButtonRenderer renderer = new ButtonRenderer(
+ cxCasted.getNullRepresentation());
+ renderer.addClickListener(e -> {
+ CxGridRendererClickEvent cxEvent = CxGridRendererFactory.eINSTANCE
+ .createCxGridRendererClickEvent();
+ cxEvent.setRenderer(cxRenderer);
+ cxEvent.setLastClickTime(new Date().getTime());
+ cxCasted.setLastClickEvent(cxEvent);
+ });
+ return renderer;
+ } else if (cxRenderer instanceof CxGridHtmlRenderer) {
+ CxGridHtmlRenderer cxCasted = (CxGridHtmlRenderer) cxRenderer;
+ return new HtmlRenderer(cxCasted.getNullRepresentation());
+ } else if (cxRenderer instanceof CxGridProgressBarRenderer) {
+ final CxGridProgressBarRenderer cxCasted = (CxGridProgressBarRenderer) cxRenderer;
+ return new ProgressBarRenderer() {
+ @Override
+ public JsonValue encode(Double value) {
+ if (value != null) {
+ value = value / cxCasted.getMaxValue();
+ }
+ return super.encode(value);
+ }
+ };
+ } else if (cxRenderer instanceof CxGridBooleanRenderer) {
+ return new BooleanRenderer();
+ } else if (cxRenderer instanceof CxGridQuantityRenderer) {
+ return new QuantityRenderer((CxGridQuantityRenderer) cxRenderer,
+ uiContext.getLocale());
+ } else if (cxRenderer instanceof CxGridPriceRenderer) {
+ return new PriceRenderer((CxGridPriceRenderer) cxRenderer,
+ uiContext.getLocale());
+ } else if (cxRenderer instanceof CxGridIndicatorRenderer) {
+ CxGridIndicatorRenderer temp = (CxGridIndicatorRenderer) cxRenderer;
+ return new IndicatorRenderer(temp.getGreenStarts(),
+ temp.getRedEnds());
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/.project b/org.eclipse.osbp.ecview.extension.grid.sample/.project
new file mode 100644
index 0000000..e725c8c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.sample</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/LICENSE.txt b/org.eclipse.osbp.ecview.extension.grid.sample/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..20f766b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/META-INF/MANIFEST.MF
@@ -0,0 +1,43 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.grid.sample
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.sample;singleton:=true
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.ibm.icu;bundle-version="50.1.1",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;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.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ javax.servlet;bundle-version="3.0.0",
+ org.eclipse.equinox.event;bundle-version="1.3.100",
+ org.eclipse.osbp.runtime.event;bundle-version="[0.9.0,0.10.0)",
+ javax.persistence;bundle-version="2.1.0",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
+ com.vaadin.client-compiled;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.themes;bundle-version="[7.5.7,7.7.0)",
+ org.vaadin.addons.vaadin-grid-util;bundle-version="1.0.7",
+ org.eclipse.osbp.runtime.memento;bundle-version="[0.9.0,0.10.0)"
+Import-Package: org.osgi.framework;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.http;version="1.2.1",
+ org.slf4j;version="1.6.4"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Activator: org.eclipse.osbp.ecview.extension.sample.Activator
+Export-Package: org.eclipse.osbp.ecview.extension.sample;x-internal:=true;version="0.9.0"
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.sample.ConverterFactorty.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty.xml
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty.xml b/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty.xml
new file mode 100644
index 0000000..9add7b6
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.sample.CellStyleGeneratorFactorty"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.ConverterFactorty.xml b/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.ConverterFactorty.xml
new file mode 100644
index 0000000..d761ff1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/OSGI-INF/org.eclipse.osbp.ecview.extension.sample.ConverterFactorty.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.sample.ConverterFactorty">
+ <implementation class="org.eclipse.osbp.ecview.extension.sample.ConverterFactorty"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory"/>
+ </service>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/female.gif b/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/female.gif
new file mode 100644
index 0000000..1bd1155
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/female.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/male.gif b/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/male.gif
new file mode 100644
index 0000000..af2f47b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/VAADIN/themes/valo/gridsample/male.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/about.html b/org.eclipse.osbp.ecview.extension.grid.sample/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/about.ini b/org.eclipse.osbp.ecview.extension.grid.sample/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/about.mappings b/org.eclipse.osbp.ecview.extension.grid.sample/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/about.properties b/org.eclipse.osbp.ecview.extension.grid.sample/about.properties
new file mode 100644
index 0000000..cd4678e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.grid.sample
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/build.properties b/org.eclipse.osbp.ecview.extension.grid.sample/build.properties
new file mode 100644
index 0000000..50e4e03
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/build.properties
@@ -0,0 +1,15 @@
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
+source.. = src/,\
+ src-gen/
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/epl-v10.html b/org.eclipse.osbp.ecview.extension.grid.sample/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/license.html b/org.eclipse.osbp.ecview.extension.grid.sample/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/notice.html b/org.eclipse.osbp.ecview.extension.grid.sample/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/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.ecview.extension.grid.sample/pom.xml b/org.eclipse.osbp.ecview.extension.grid.sample/pom.xml
new file mode 100644
index 0000000..0424a51
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/pom.xml
@@ -0,0 +1,23 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.sample</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Sample for OSBP ECView Grid extensions</description>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Activator.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Activator.java
new file mode 100644
index 0000000..a315c72
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Activator.java
@@ -0,0 +1,232 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import javax.servlet.ServletException;
+
+import org.eclipse.osbp.runtime.common.event.IEventBroker;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.http.NamespaceException;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * Activator is used by OSGi framework to notify about the start and stop of the
+ * bundle. The activator will look for the HttpService and registers the vaadin
+ * servlet at it.
+ */
+public class Activator implements BundleActivator,
+ ServiceTrackerCustomizer<HttpService, HttpService>, BundleListener {
+
+ /** The context. */
+ private static BundleContext context;
+
+ /** The instance. */
+ private static Activator INSTANCE;
+
+ /**
+ * Gets the context.
+ *
+ * @return the context
+ */
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Gets the single instance of Activator.
+ *
+ * @return the instance
+ */
+ public static Activator getInstance() {
+ return INSTANCE;
+ }
+
+ /** The tracker. */
+ // used to track the HttpService
+ private ServiceTracker<HttpService, HttpService> tracker;
+
+ /** The http service. */
+ // used to register servlets
+ private HttpService httpService;
+
+ /** The resource provider. */
+ private ResourceProvider resourceProvider;
+
+ /** The event broker. */
+ private IEventBroker eventBroker;
+
+ /**
+ * Gets the event broker.
+ *
+ * @return the eventBroker
+ */
+ public IEventBroker getEventBroker() {
+ return eventBroker;
+ }
+
+ //
+ // Helper methods to get an instance of the http service
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
+ */
+ //
+ @Override
+ public HttpService addingService(ServiceReference<HttpService> reference) {
+ httpService = context.getService(reference);
+
+ try {
+ // register the servlet at the http service
+ httpService.registerServlet("/", new SimpleVaadinServlet(), null,
+ resourceProvider);
+ } catch (ServletException e) {
+ e.printStackTrace();
+ } catch (NamespaceException e) {
+ e.printStackTrace();
+ }
+
+ return httpService;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference, java.lang.Object)
+ */
+ @Override
+ public void removedService(ServiceReference<HttpService> reference,
+ HttpService service) {
+ // unregister the servlet from the http service
+ httpService.unregister("/");
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.ServiceTrackerCustomizer#modifiedService(org.osgi.framework.ServiceReference, java.lang.Object)
+ */
+ @Override
+ public void modifiedService(ServiceReference<HttpService> reference,
+ HttpService service) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ INSTANCE = this;
+ startBundle(bundleContext, "org.eclipse.osbp.runtime.event");
+
+ ServiceReference<IEventBroker> eventBrokerRef = bundleContext
+ .getServiceReference(IEventBroker.class);
+ if (eventBrokerRef != null) {
+ eventBroker = bundleContext.getService(eventBrokerRef);
+ } else {
+ throw new RuntimeException("Can not run Bundle properly!");
+ }
+
+ resourceProvider = new ResourceProvider();
+
+ handleStartedBundles(context);
+
+ // register this instance as a bundle listener to an reference to all
+ // vaadin bundles. Used to find the static resources.
+ bundleContext.addBundleListener(this);
+
+ // Start a HttpService-Tracker to get an instance of HttpService
+ tracker = new ServiceTracker<>(bundleContext, HttpService.class, this);
+ tracker.open();
+ }
+
+ /**
+ * Start bundle.
+ *
+ * @param bundleContext
+ * the bundle context
+ * @param bundleSymbolicName
+ * the bundle symbolic name
+ * @throws BundleException
+ * the bundle exception
+ */
+ protected void startBundle(BundleContext bundleContext,
+ String bundleSymbolicName) throws BundleException {
+ for (Bundle bundle : bundleContext.getBundles()) {
+ if (bundle.getSymbolicName().equals(bundleSymbolicName)) {
+ if (bundle.getState() != Bundle.ACTIVE) {
+ bundle.start();
+ return;
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ // close the HttpService-tracker
+ tracker.close();
+ tracker = null;
+
+ resourceProvider = null;
+
+ bundleContext.removeBundleListener(this);
+
+ INSTANCE = null;
+ Activator.context = null;
+ }
+
+ /**
+ * Tries to find proper started bundles and adds them to resource provider.
+ * Since bundle changed listener will not find them.
+ *
+ * @param context
+ * the context
+ */
+ protected void handleStartedBundles(BundleContext context) {
+ for (Bundle bundle : context.getBundles()) {
+ String name = bundle.getSymbolicName();
+ if (name.startsWith("com.vaadin")
+ || name.equals("org.eclipse.osbp.ecview.extension.grid.sample")
+ || name.equals("org.eclipse.osbp.ecview.extension.widgetset")) {
+ resourceProvider.add(bundle);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent)
+ */
+ @Override
+ public void bundleChanged(BundleEvent event) {
+ // tracks the starting and stopping of vaadin bundles. If a bundle is a
+ // vaadin bundle it will be added to the resource provider for lookups.
+ String name = event.getBundle().getSymbolicName();
+ if (name.startsWith("com.vaadin")
+ || name.equals("org.eclipse.osbp.ecview.extension.grid.sample")
+ || name.equals("org.eclipse.osbp.ecview.extension.widgetset")) {
+ if (event.getType() == BundleEvent.STARTED) {
+ resourceProvider.add(event.getBundle());
+ } else if (event.getType() == BundleEvent.STOPPED) {
+ resourceProvider.remove(event.getBundle());
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/CellStyleGeneratorFactorty.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/CellStyleGeneratorFactorty.java
new file mode 100644
index 0000000..cb1e9d7
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/CellStyleGeneratorFactorty.java
@@ -0,0 +1,78 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.osgi.service.component.annotations.Component;
+
+import com.vaadin.ui.Grid.CellReference;
+import com.vaadin.ui.Grid.CellStyleGenerator;
+
+import org.eclipse.osbp.ecview.extension.grid.CxGridDelegateCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridCellStyleGeneratorEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory;
+
+/**
+ * The Class CellStyleGeneratorFactorty.
+ */
+@Component(immediate = true)
+public class CellStyleGeneratorFactorty implements
+ IGridCellStyleGeneratorFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory#isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.extension.grid.editparts.IGridCellStyleGeneratorEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext,
+ IGridCellStyleGeneratorEditpart editpart) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory#createCellStyleGenerator(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.extension.grid.editparts.IGridCellStyleGeneratorEditpart)
+ */
+ @Override
+ public Object createCellStyleGenerator(IViewContext uiContext,
+ IGridCellStyleGeneratorEditpart editpart)
+ throws IllegalArgumentException {
+
+ CxGridDelegateCellStyleGenerator yGenerator = (CxGridDelegateCellStyleGenerator) editpart
+ .getModel();
+ if (yGenerator.getDelegateId().equals("sampleGrid")) {
+ return new Generator();
+ }
+
+ return null;
+
+ }
+
+ /**
+ * The Class Generator.
+ */
+ @SuppressWarnings("serial")
+ private static class Generator implements CellStyleGenerator {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.Grid.CellStyleGenerator#getStyle(com.vaadin.ui.Grid.CellReference)
+ */
+ @Override
+ public String getStyle(CellReference cellReference) {
+ if (cellReference.getPropertyId().equals("name")) {
+ return "osbee-bold";
+ }
+ return null;
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ConverterFactorty.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ConverterFactorty.java
new file mode 100644
index 0000000..a1daeab
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ConverterFactorty.java
@@ -0,0 +1,111 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import java.io.InputStream;
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.osgi.service.component.annotations.Component;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+import com.vaadin.server.StreamResource;
+import com.vaadin.server.ThemeResource;
+
+/**
+ * The Class ConverterFactorty.
+ */
+@Component(immediate = true)
+public class ConverterFactorty implements IConverterFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory#isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory#createConverter(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart)
+ */
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+ YDelegateConverter yConverter = (YDelegateConverter) editpart
+ .getModel();
+ if (yConverter.getConverterId().equals("genderToImageConverter")) {
+ return new GenderToImageConverter();
+ }
+
+ return null;
+ }
+
+ /**
+ * The Class GenderToImageConverter.
+ */
+ @SuppressWarnings("serial")
+ private static class GenderToImageConverter implements
+ Converter<Resource, Gender> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Gender convertToModel(Resource value,
+ Class<? extends Gender> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Resource convertToPresentation(Gender value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ switch (value) {
+ case FEMALE:
+ return new ThemeResource("gridsample/female.gif");
+ case MALE:
+ return new ThemeResource("gridsample/male.gif");
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<Gender> getModelType() {
+ return Gender.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ECViewGridSampleUI.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ECViewGridSampleUI.java
new file mode 100644
index 0000000..7da337e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ECViewGridSampleUI.java
@@ -0,0 +1,821 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.osbp.ecview.core.common.context.ContextException;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.binding.IBindableValueEndpointEditpart;
+import org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager;
+import org.eclipse.osbp.ecview.core.common.model.binding.YECViewModelValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YAlignment;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YBooleanSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YCheckBox;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDateTime;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSelectionType;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSlider;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayoutCellStyle;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridDelegateCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFactory;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridGroupedCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridButtonRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridProgressBarRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererClickEvent;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererFactory;
+import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.runtime.common.memento.IMementoManager;
+import org.eclipse.osbp.runtime.common.validation.IStatus;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+
+import com.vaadin.annotations.Push;
+import com.vaadin.annotations.Theme;
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+import com.vaadin.ui.themes.ValoTheme;
+
+/**
+ * The Class ECViewGridSampleUI.
+ */
+@SuppressWarnings("serial")
+@Theme(ValoTheme.THEME_NAME)
+@Widgetset("org.eclipse.osbp.ecview.extension.widgetset.CxECViewWidgetset")
+@Push
+public class ECViewGridSampleUI extends UI {
+
+ /** The view context. */
+ @SuppressWarnings("unused")
+ private IViewContext viewContext;
+
+ /** The result layout. */
+ private VerticalLayout resultLayout;
+
+ /** The cx grid. */
+ private CxGrid cxGrid;
+
+ /** The col name. */
+ private CxGridColumn colName;
+
+ /** The col name2. */
+ private CxGridColumn colName2;
+
+ /** The col age. */
+ private CxGridColumn colAge;
+
+ /** The col birthday. */
+ private CxGridColumn colBirthday;
+
+ /** The names group cell. */
+ private CxGridGroupedCell namesGroupCell;
+
+ /** The header row1. */
+ private CxGridHeaderRow headerRow1;
+
+ /** The custom cell age. */
+ private CxGridMetaCell customCellAge;
+
+ /** The person group cell. */
+ private CxGridGroupedCell personGroupCell;
+
+ /** The header row2. */
+ private CxGridHeaderRow headerRow2;
+
+ /** The custom cell birthday. */
+ private CxGridMetaCell customCellBirthday;
+
+ /** The fgroup1. */
+ private CxGridGroupedCell fgroup1;
+
+ /** The footer row. */
+ private CxGridFooterRow footerRow;
+
+ /** The fgroup2. */
+ private CxGridGroupedCell fgroup2;
+
+ /** The footer row person info. */
+ private CxGridFooterRow footerRowPersonInfo;
+
+ /** The custom cell birthday footer. */
+ private CxGridMetaCell customCellBirthdayFooter;
+
+ /** The single selection. */
+ private CheckBox singleSelection;
+
+ /** The birthday renderer. */
+ private CxGridDateRenderer birthdayRenderer;
+
+ /** The age renderer. */
+ private CxGridButtonRenderer ageRenderer;
+
+ /** The col vit. */
+ private CxGridColumn colVit;
+
+ /** The vit renderer. */
+ private CxGridProgressBarRenderer vitRenderer;
+
+ /** The age renderer click endpoint. */
+ private YECViewModelValueBindingEndpoint ageRendererClickEndpoint;
+
+ /** The col native german. */
+ private CxGridColumn colNativeGerman;
+
+ /** The col gender. */
+ private CxGridColumn colGender;
+
+ /** The y vl. */
+ private YVerticalLayout yVl;
+
+ /** The button layout. */
+ private GridLayout buttonLayout;
+
+ /** The delegating memento manager. */
+ private IMementoManager delegatingMementoManager;
+
+ /** The memento manager. */
+ private SampleMementoManager mementoManager;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.UI#init(com.vaadin.server.VaadinRequest)
+ */
+ @Override
+ protected void init(VaadinRequest request) {
+
+ BundleContext context = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+ ServiceReference<IMementoManager> ref = context
+ .getServiceReference(IMementoManager.class);
+ delegatingMementoManager = context.getService(ref);
+
+ mementoManager = new SampleMementoManager();
+
+ VerticalLayout layout = new VerticalLayout();
+ layout.setSizeFull();
+ setContent(layout);
+ layout.setStyleName(Reindeer.LAYOUT_BLUE);
+ layout.setMargin(true);
+ layout.setSpacing(true);
+
+ createResultArea(layout);
+
+ VerticalLayout filler = new VerticalLayout();
+ layout.addComponent(filler);
+ layout.setExpandRatio(filler, 1.0f);
+ filler.setSizeFull();
+ filler.setMargin(true);
+ filler.setStyleName(Reindeer.LAYOUT_WHITE);
+
+ Label description = new Label();
+ filler.addComponent(description);
+ filler.setComponentAlignment(description, Alignment.BOTTOM_LEFT);
+ description.setContentMode(ContentMode.HTML);
+
+ }
+
+ /**
+ * Creates the result area.
+ *
+ * @param layout
+ * the layout
+ */
+ private void createResultArea(VerticalLayout layout) {
+
+ // VaadinObservables.activateRealm(this);
+
+ resultLayout = new VerticalLayout();
+ layout.addComponent(resultLayout);
+ YView yView = createViewModel();
+
+ VaadinRenderer renderer = new VaadinRenderer();
+ try {
+ viewContext = renderer.render(resultLayout, yView,
+ createRenderingParams());
+ } catch (ContextException e) {
+ e.printStackTrace();
+ }
+
+ createPersons();
+
+ buttonLayout = new GridLayout();
+ buttonLayout.setColumns(2);
+ buttonLayout.setSizeFull();
+ resultLayout.addComponent(buttonLayout);
+
+ Button b = new Button("show/hide Names-Group");
+ b.setDescription("Shows or hides the Names-Group-HeaderRow");
+ b.setWidth("250px");
+ b.addClickListener(e -> enableHeaderAndFooter());
+ buttonLayout.addComponent(b);
+
+ Button b2 = new Button("add/remove columns");
+ b2.setWidth("250px");
+ b2.addClickListener(e -> addAndRemoveColumns());
+ buttonLayout.addComponent(b2);
+
+ Button b3 = new Button("add/remove MetaCells");
+ b3.setWidth("250px");
+ b3.addClickListener(e -> enableCustomCells());
+ buttonLayout.addComponent(b3);
+
+ Button b4 = new Button("editor enabled");
+ b4.setWidth("250px");
+ b4.addClickListener(e -> enableEditor());
+ HorizontalLayout b4Layout = new HorizontalLayout(b4);
+ buttonLayout.addComponent(b4Layout);
+
+ Button b5 = new Button("select something");
+ b5.setWidth("250px");
+ singleSelection = new CheckBox("singleSelection");
+ singleSelection.setValue(true);
+ singleSelection
+ .addValueChangeListener(e -> {
+ cxGrid.setSelectionType(singleSelection.getValue() ? YSelectionType.SINGLE
+ : YSelectionType.MULTI);
+ });
+
+ HorizontalLayout b5Layout = new HorizontalLayout(b5, singleSelection);
+ b5Layout.setComponentAlignment(singleSelection, Alignment.MIDDLE_LEFT);
+ b5Layout.setSpacing(true);
+ b5.addClickListener(e -> switchSelectionMode());
+ buttonLayout.addComponent(b5Layout);
+
+ TextField birthdayFormat = new TextField("format of birthday");
+ birthdayFormat.setValue("%1$tB %1$te, %1$tY");
+ birthdayFormat.addValueChangeListener(e -> {
+ birthdayRenderer.setDateFormat(birthdayFormat.getValue());
+ });
+ buttonLayout.addComponent(birthdayFormat);
+
+ IBindableValueEndpointEditpart ep = ModelUtil.getEditpart(viewContext,
+ ageRendererClickEndpoint);
+ ep.getObservable()
+ .addValueChangeListener(
+ e -> {
+ CxGridRendererClickEvent cxEvent = (CxGridRendererClickEvent) e
+ .getObservableValue().getValue();
+ Notification.show("Age renderer clicked: "
+ + cxEvent.getRenderer().getId());
+ });
+
+ Button b6 = new Button("filter visible");
+ b6.setWidth("250px");
+ b6.addClickListener(e -> enableFilter());
+ buttonLayout.addComponent(b6);
+
+ Button b7 = new Button("header visible");
+ b7.setWidth("250px");
+ b7.addClickListener(e -> enableHeader());
+ buttonLayout.addComponent(b7);
+
+ Button b8 = new Button("footer visible");
+ b8.setWidth("250px");
+ b8.addClickListener(e -> enableFooter());
+ buttonLayout.addComponent(b8);
+
+ Button b9 = new Button("rerender");
+ b9.setWidth("250px");
+ b9.addClickListener(e -> rerender());
+ buttonLayout.addComponent(b9);
+
+ Button b10 = new Button("new model and memento");
+ b10.setDescription("Creates a new CxGrid-Model and renders it. If a memento was already created by reordering columns,... then the memento will become applied before rendering.");
+ b10.setWidth("250px");
+ b10.addClickListener(e -> {
+ if (mementoManager.loadMemento(cxGrid.getMementoId()) == null) {
+ Notification.show(
+ "No memento available yet. Change something.",
+ Notification.Type.ERROR_MESSAGE);
+ return;
+ }
+ newModelAndMemento();
+
+ });
+ buttonLayout.addComponent(b10);
+ }
+
+ /**
+ * Creates the datamodel.
+ */
+ private void createPersons() {
+ Person person1 = new Person();
+ person1.setName("My first name");
+ person1.setName2("<b><i>Another</i></b> name");
+ person1.setAge(43);
+ person1.setVitality(142);
+ person1.setBirthday(new Date());
+ person1.setNativeGerman(true);
+ person1.setGender(Gender.MALE);
+ cxGrid.getCollection().add(person1);
+
+ Person person2 = new Person();
+ person2.setName("Other name");
+ person2.setName2("<b><i>Foo</i></b> Baa");
+ person2.setAge(26);
+ person2.setVitality(220);
+ person2.setBirthday(new Date());
+ person2.setGender(Gender.FEMALE);
+ cxGrid.getCollection().add(person2);
+
+ Person person3 = new Person();
+ person3.setName("Some value");
+ person3.setName2("<b><i>Mustermann</i></b> Peter");
+ person3.setAge(33);
+ person3.setVitality(85);
+ person3.setBirthday(new Date());
+ person3.setGender(Gender.FEMALE);
+ cxGrid.getCollection().add(person3);
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableHeaderAndFooter() {
+ if (cxGrid.getHeaders().contains(headerRow1)) {
+ cxGrid.getHeaders().remove(headerRow1);
+ } else {
+ cxGrid.getHeaders().add(headerRow1);
+ }
+
+ if (cxGrid.getFooters().contains(footerRowPersonInfo)) {
+ cxGrid.getFooters().remove(footerRowPersonInfo);
+ } else {
+ cxGrid.getFooters().add(footerRowPersonInfo);
+ }
+
+ return null;
+ }
+
+ /**
+ * Adds and removes defined columns.
+ *
+ * @return the object
+ */
+ private Object addAndRemoveColumns() {
+ if (cxGrid.getColumns().contains(colAge)) {
+ cxGrid.getColumns().remove(colAge);
+ cxGrid.getColumns().remove(colBirthday);
+ } else {
+ int idx = cxGrid.getColumns().indexOf(colName2);
+ cxGrid.getColumns().add(idx + 1, colAge);
+ cxGrid.getColumns().add(colBirthday);
+ }
+
+ return null;
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableCustomCells() {
+ if (!headerRow2.getCustomCells().isEmpty()) {
+ headerRow1.getCustomCells().clear();
+ headerRow2.getCustomCells().clear();
+ } else {
+ headerRow1.getCustomCells().add(customCellAge);
+ headerRow2.getCustomCells().add(customCellBirthday);
+ }
+
+ return null;
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableEditor() {
+ cxGrid.setEditorEnabled(!cxGrid.isEditorEnabled());
+ return null;
+ }
+
+ /**
+ * Switches the selection mode.
+ *
+ * @return the object
+ */
+ private Object switchSelectionMode() {
+ if (cxGrid.getSelectionType() == YSelectionType.SINGLE) {
+ cxGrid.setSelection(cxGrid.getCollection().get(0));
+ } else {
+ cxGrid.getMultiSelection().addAll(cxGrid.getCollection());
+ }
+ return null;
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableFilter() {
+ cxGrid.setFilteringVisible(!cxGrid.isFilteringVisible());
+ return null;
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableHeader() {
+ cxGrid.setHeaderVisible(!cxGrid.isHeaderVisible());
+ return null;
+ }
+
+ /**
+ * /**
+ *
+ * @return the object
+ */
+ private Object enableFooter() {
+ cxGrid.setFooterVisible(!cxGrid.isFooterVisible());
+ return null;
+ }
+
+ /**
+ * Rerender the model.
+ *
+ * @return the object
+ */
+ private Object rerender() {
+
+ IGridEditpart gEp = ModelUtil.findEditpart(cxGrid);
+ gEp.requestUnrender();
+ gEp.requestRender();
+
+ return null;
+ }
+
+ /**
+ * Creates a new model and applies the memento if available.
+ */
+ private void newModelAndMemento() {
+ yVl.getElements().clear();
+
+ yVl.getElements().add(createCxGrid());
+ createPersons();
+ }
+
+ /**
+ * Creates the rendering parameters.
+ *
+ * @return the map
+ */
+ private Map<String, Object> createRenderingParams() {
+ Map<String, Object> params = new HashMap<String, Object>();
+ Map<String, Object> services = new HashMap<String, Object>();
+ params.put(IViewContext.PARAM_SERVICES, services);
+ services.put(II18nService.class.getName(), new I18nService());
+ services.put(IECViewMementoManager.class.getName(), mementoManager);
+
+ return params;
+ }
+
+ /**
+ * Creates the view model.
+ *
+ * @return the y view
+ */
+ private YView createViewModel() {
+ YView yView = CoreModelFactory.eINSTANCE.createYView();
+
+ yVl = ExtensionModelFactory.eINSTANCE.createYVerticalLayout();
+ yView.setContent(yVl);
+
+ // creates the cxGrid
+ createCxGrid();
+
+ // add the grid
+ yVl.addElement(cxGrid);
+
+ return yView;
+ }
+
+ /**
+ * Creates the cx grid.
+ *
+ * @return the cx grid
+ */
+ protected CxGrid createCxGrid() {
+ CxGridFactory fact = CxGridFactory.eINSTANCE;
+ cxGrid = fact.createCxGrid();
+ cxGrid.setId("sample.grid");
+ cxGrid.setMementoEnabled(true);
+ cxGrid.setFooterVisible(true);
+ cxGrid.setEditorEnabled(true);
+ cxGrid.setType(Person.class);
+ cxGrid.setFilteringVisible(true);
+ cxGrid.setSelectionType(YSelectionType.SINGLE);
+ cxGrid.setTypeQualifiedName(Person.class.getName());
+
+ CxGridDelegateCellStyleGenerator cxGenerator = CxGridFactory.eINSTANCE
+ .createCxGridDelegateCellStyleGenerator();
+ cxGenerator.setDelegateId("sampleGrid");
+ cxGrid.setCellStyleGenerator(cxGenerator);
+
+ YVerticalLayoutCellStyle cellStyle = yVl.addCellStyle(cxGrid);
+ cellStyle.setAlignment(YAlignment.TOP_FILL);
+
+ colName = fact.createCxGridColumn();
+ colName.setPropertyId("name");
+ colName.setPropertyPath("name");
+ colName.setEditable(true);
+ cxGrid.getColumns().add(colName);
+
+ colName2 = fact.createCxGridColumn();
+ colName2.setPropertyId("name2");
+ colName2.setPropertyPath("name2");
+ colName2.setEditable(true);
+ colName2.setRenderer(CxGridRendererFactory.eINSTANCE
+ .createCxGridHtmlRenderer());
+
+ YTextSearchField name2SF = ExtensionModelFactory.eINSTANCE
+ .createYTextSearchField();
+ name2SF.setPropertyPath("name2");
+ colName2.setSearchField(name2SF);
+ cxGrid.getColumns().add(colName2);
+
+ colAge = fact.createCxGridColumn();
+ colAge.setPropertyId("age");
+ colAge.setPropertyPath("age");
+ colAge.setEditable(true);
+ ageRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridButtonRenderer();
+ ageRendererClickEndpoint = ageRenderer.createLastClickEventEndpoint();
+ colAge.setRenderer(ageRenderer);
+ YNumericSearchField ageSF = ExtensionModelFactory.eINSTANCE
+ .createYNumericSearchField();
+ ageSF.setPropertyPath("age");
+ ageSF.setType(Integer.class);
+ colAge.setSearchField(ageSF);
+ cxGrid.getColumns().add(colAge);
+
+ colNativeGerman = fact.createCxGridColumn();
+ colNativeGerman.setPropertyId("nativeGerman");
+ colNativeGerman.setPropertyPath("nativeGerman");
+ colNativeGerman.setEditable(true);
+ YBooleanSearchField nativeGermanSF = ExtensionModelFactory.eINSTANCE
+ .createYBooleanSearchField();
+ nativeGermanSF.setPropertyPath("nativeGerman");
+ colNativeGerman.setSearchField(nativeGermanSF);
+ colNativeGerman.setRenderer(CxGridRendererFactory.eINSTANCE
+ .createCxGridBooleanRenderer());
+ cxGrid.getColumns().add(colNativeGerman);
+
+ colGender = fact.createCxGridColumn();
+ colGender.setPropertyId("gender");
+ colGender.setPropertyPath("gender");
+ colGender.setEditable(true);
+ colGender.setRenderer(CxGridRendererFactory.eINSTANCE
+ .createCxGridImageRenderer());
+ YDelegateConverter yGenderConverter = CoreModelFactory.eINSTANCE
+ .createYDelegateConverter();
+ yGenderConverter.setConverterId("genderToImageConverter");
+ colGender.setConverter(yGenderConverter);
+ cxGrid.getColumns().add(colGender);
+
+ colVit = fact.createCxGridColumn();
+ colVit.setPropertyId("vitality");
+ colVit.setPropertyPath("vitality");
+ colVit.setEditable(true);
+ vitRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridProgressBarRenderer();
+ vitRenderer.setMaxValue(250);
+ colVit.setRenderer(vitRenderer);
+
+ YSlider vitEditor = ExtensionModelFactory.eINSTANCE.createYSlider();
+ vitEditor.setMaxValue(250);
+ vitEditor.setMinValue(0);
+ vitEditor.setResolution(0);
+ colVit.setEditorField(vitEditor);
+
+ cxGrid.getColumns().add(colVit);
+
+ colBirthday = fact.createCxGridColumn();
+ colBirthday.setPropertyId("birthday");
+ colBirthday.setPropertyPath("birthday");
+ colBirthday.setEditable(true);
+ YDateTime birthdayEditor = ExtensionModelFactory.eINSTANCE
+ .createYDateTime();
+ colBirthday.setEditorField(birthdayEditor);
+ birthdayRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridDateRenderer();
+ birthdayRenderer.setDateFormat("%1$tB %1$te, %1$tY");
+ colBirthday.setRenderer(birthdayRenderer);
+ cxGrid.getColumns().add(colBirthday);
+
+ //
+ // create grouped header
+ //
+
+ // group name and name2 in header "Names Group"
+ //
+ namesGroupCell = fact.createCxGridGroupedCell();
+ namesGroupCell.setLabel("Names Group");
+ namesGroupCell.getGroupables().add(colName);
+ namesGroupCell.getGroupables().add(colName2);
+
+ headerRow1 = fact.createCxGridHeaderRow();
+ headerRow1.getGroupings().add(namesGroupCell);
+ cxGrid.getHeaders().add(headerRow1);
+
+ customCellAge = fact.createCxGridMetaCell();
+ YCheckBox cellAgeCheckbox = ExtensionModelFactory.eINSTANCE
+ .createYCheckBox();
+ cellAgeCheckbox.setLabel("checkbox in header");
+ customCellAge.setElement(cellAgeCheckbox);
+ customCellAge.setTarget(colAge);
+ headerRow1.getCustomCells().add(customCellAge);
+
+ // group "Names Group" and age in "Person Group"
+ //
+ personGroupCell = fact.createCxGridGroupedCell();
+ personGroupCell.setLabel("Person Group");
+ personGroupCell.getGroupables().add(namesGroupCell);
+ personGroupCell.getGroupables().add(colAge);
+
+ headerRow2 = fact.createCxGridHeaderRow();
+ headerRow2.getGroupings().add(personGroupCell);
+ cxGrid.getHeaders().add(headerRow2);
+
+ customCellBirthday = fact.createCxGridMetaCell();
+ YNumericField cellBirthdayField = ExtensionModelFactory.eINSTANCE
+ .createYNumericField();
+ cellBirthdayField.setLabel("NumericField in header");
+ customCellBirthday.setElement(cellBirthdayField);
+ customCellBirthday.setTarget(colBirthday);
+ headerRow2.getCustomCells().add(customCellBirthday);
+
+ //
+ // create grouped footer
+ //
+
+ // group name and name2 in header "Names Group"
+ //
+ fgroup1 = fact.createCxGridGroupedCell();
+ fgroup1.setLabel("Names Group");
+ fgroup1.getGroupables().add(colName);
+ fgroup1.getGroupables().add(colName2);
+
+ footerRow = fact.createCxGridFooterRow();
+ footerRow.getGroupings().add(fgroup1);
+ cxGrid.getFooters().add(footerRow);
+
+ // group "Names Group" and age in "Person Group"
+ //
+ fgroup2 = fact.createCxGridGroupedCell();
+ fgroup2.setLabel("Person Group");
+ fgroup2.getGroupables().add(fgroup1);
+ fgroup2.getGroupables().add(colAge);
+
+ footerRowPersonInfo = fact.createCxGridFooterRow();
+ footerRowPersonInfo.getGroupings().add(fgroup2);
+ cxGrid.getFooters().add(footerRowPersonInfo);
+
+ customCellBirthdayFooter = fact.createCxGridMetaCell();
+ customCellBirthdayFooter.setElement(ExtensionModelFactory.eINSTANCE
+ .createYNumericField());
+ customCellBirthdayFooter.setTarget(colBirthday);
+ footerRowPersonInfo.getCustomCells().add(customCellBirthdayFooter);
+
+ return cxGrid;
+ }
+
+ /**
+ * A simple I18n service implementation.
+ */
+ private static class I18nService extends AbstractDisposable implements
+ II18nService {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.common.i18n.II18nService#getValue(java.lang
+ * .String, java.util.Locale)
+ */
+ @Override
+ public String getValue(String i18nKey, Locale locale) {
+ if (i18nKey.equals("save.i18n")) {
+ return "do save";
+ } else if (i18nKey.equals("cancel.i18n")) {
+ return "do cancel";
+ } else if (i18nKey
+ .equals("org.eclipse.osbp.ecview.core.common.i18n.TextSearchFieldTooltip")) {
+ return "Searchfield accepting wildcards like *, >, <,...";
+ } else if (i18nKey
+ .equals("org.eclipse.osbp.ecview.core.common.i18n.NumberSearchFieldTooltip")) {
+ return "Searchfield accepting wildcards like >, <,...";
+ } else if (i18nKey
+ .equals("org.eclipse.osbp.ecview.core.common.i18n.BooleanSearchFieldTooltip")) {
+ return "Search for Boolean values";
+ }
+ return i18nKey;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.common.dispose.AbstractDisposable#
+ * internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ // nothing to do
+ }
+ }
+
+ /**
+ * A singleton sample memento manager which provides the same memento to all
+ * instances of ECViewGridSampleUI.
+ */
+ public class SampleMementoManager implements IECViewMementoManager {
+
+ /** The Constant USER_ID. */
+ private static final String USER_ID = "Admin1";
+
+ /**
+ * Instantiates a new sample memento manager.
+ */
+ private SampleMementoManager() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager
+ * #loadMemento(java.lang.String)
+ */
+ @Override
+ public Object loadMemento(String mementoId) {
+ return delegatingMementoManager.loadMemento(USER_ID, mementoId);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager
+ * #saveMemento(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public IStatus saveMemento(String mementoId, Object memento) {
+ return delegatingMementoManager.saveMemento(USER_ID, mementoId,
+ memento);
+ }
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Gender.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Gender.java
new file mode 100644
index 0000000..65d7b46
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Gender.java
@@ -0,0 +1,27 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+/**
+ * The Enum Gender.
+ */
+public enum Gender {
+
+ /** The male. */
+ MALE,
+
+ /** The female. */
+ FEMALE
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Person.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Person.java
new file mode 100644
index 0000000..1af68f4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/Person.java
@@ -0,0 +1,370 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+import java.util.Date;
+
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+/**
+ * The Class Person.
+ */
+@SuppressWarnings("all")
+public class Person implements Serializable {
+
+ /** The property change support. */
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ /** The disposed. */
+ @Dispose
+ private boolean disposed;
+
+ /** The id. */
+ private String id = java.util.UUID.randomUUID().toString();
+
+ /** The name. */
+ private String name;
+
+ /** The name2. */
+ private String name2;
+
+ /** The age. */
+ private int age;
+
+ /** The vitality. */
+ private double vitality;
+
+ /** The birthday. */
+ private Date birthday;
+
+ /** The native german. */
+ private boolean nativeGerman;
+
+ /** The gender. */
+ private Gender gender;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ *
+ * @return true, if is disposed
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * Adds the property change listener.
+ *
+ * @param listener
+ * the listener
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * Adds the property change listener.
+ *
+ * @param propertyName
+ * the property name
+ * @param listener
+ * the listener
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * Removes the property change listener.
+ *
+ * @param listener
+ * the listener
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * Removes the property change listener.
+ *
+ * @param propertyName
+ * the property name
+ * @param listener
+ * the listener
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * Fire property change.
+ *
+ * @param propertyName
+ * the property name
+ * @param oldValue
+ * the old value
+ * @param newValue
+ * the new value
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the id property or <code>null</code> if not present.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * Sets the <code>id</code> property to this instance.
+ *
+ * @param id
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setId(final String id) {
+ firePropertyChange("id", this.id, this.id = id);
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name);
+ }
+
+ /**
+ * Returns the name2 property or <code>null</code> if not present.
+ *
+ * @return the name2
+ */
+ public String getName2() {
+ return this.name2;
+ }
+
+ /**
+ * Sets the <code>name2</code> property to this instance.
+ *
+ * @param name2
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName2(final String name2) {
+ firePropertyChange("name2", this.name2, this.name2 = name2);
+ }
+
+ /**
+ * Returns the age property or <code>null</code> if not present.
+ *
+ * @return the age
+ */
+ public int getAge() {
+ return this.age;
+ }
+
+ /**
+ * Sets the <code>age</code> property to this instance.
+ *
+ * @param age
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setAge(final int age) {
+ firePropertyChange("age", this.age, this.age = age);
+ }
+
+ /**
+ * Gets the vitality.
+ *
+ * @return the vitality
+ */
+ public double getVitality() {
+ return vitality;
+ }
+
+ /**
+ * Sets the vitality.
+ *
+ * @param vitality
+ * the new vitality
+ */
+ public void setVitality(double vitality) {
+ firePropertyChange("vitality", this.vitality, this.vitality = vitality);
+ }
+
+ /**
+ * Returns the birthday property or <code>null</code> if not present.
+ *
+ * @return the birthday
+ */
+ public Date getBirthday() {
+ return this.birthday;
+ }
+
+ /**
+ * Checks if is native german.
+ *
+ * @return true, if is native german
+ */
+ public boolean isNativeGerman() {
+ return nativeGerman;
+ }
+
+ /**
+ * Sets the native german.
+ *
+ * @param nativeGerman
+ * the new native german
+ */
+ public void setNativeGerman(boolean nativeGerman) {
+ firePropertyChange("nativeGerman", this.nativeGerman,
+ this.nativeGerman = nativeGerman);
+ }
+
+ /**
+ * Gets the gender.
+ *
+ * @return the gender
+ */
+ public Gender getGender() {
+ return gender;
+ }
+
+ /**
+ * Sets the gender.
+ *
+ * @param gender
+ * the new gender
+ */
+ public void setGender(Gender gender) {
+ firePropertyChange("gender", this.gender, this.gender = gender);
+ }
+
+ /**
+ * Sets the <code>birthday</code> property to this instance.
+ *
+ * @param birthday
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setBirthday(final Date birthday) {
+ firePropertyChange("birthday", this.birthday, this.birthday = birthday);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Person other = (Person) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ResourceProvider.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ResourceProvider.java
new file mode 100644
index 0000000..ae0e0eb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ResourceProvider.java
@@ -0,0 +1,91 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.osgi.framework.Bundle;
+import org.osgi.service.http.HttpContext;
+
+/**
+ * Resource provider is responsible to look for resources requested by the
+ * HttpService. Therefore it uses the classpath of registered bundles.
+ */
+public class ResourceProvider implements HttpContext {
+
+ /** The resources. */
+ private List<Bundle> resources = new ArrayList<Bundle>();
+
+ /* (non-Javadoc)
+ * @see org.osgi.service.http.HttpContext#getResource(java.lang.String)
+ */
+ @Override
+ public URL getResource(String uri) {
+ URL resource = null;
+ // iterate over the vaadin bundles and try to find the requested
+ // resource
+ for (Bundle bundle : resources) {
+ resource = bundle.getResource(uri);
+ if (resource != null) {
+ break;
+ }
+ }
+ return resource;
+ }
+
+ /**
+ * Adds a bundle that may potentially contain a requested resource.
+ *
+ * @param bundle
+ * the bundle
+ */
+ public void add(Bundle bundle) {
+ if(!resources.contains(bundle)){
+ resources.add(bundle);
+ }
+ }
+
+ /**
+ * Removes a bundle that may potentially contain a requested resource.
+ *
+ * @param bundle
+ * the bundle
+ */
+ public void remove(Bundle bundle) {
+ resources.remove(bundle);
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.service.http.HttpContext#getMimeType(java.lang.String)
+ */
+ @Override
+ public String getMimeType(String arg0) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.service.http.HttpContext#handleSecurity(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
+ */
+ @Override
+ public boolean handleSecurity(HttpServletRequest request,
+ HttpServletResponse response) throws IOException {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SampleMementoManager.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SampleMementoManager.java
new file mode 100644
index 0000000..82ff0db
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SampleMementoManager.java
@@ -0,0 +1,59 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager;
+import org.eclipse.osbp.ecview.core.common.model.core.YMemento;
+import org.eclipse.osbp.runtime.common.validation.IStatus;
+
+/**
+ * A singleton sample memento manager which provides the same memento to all
+ * instances of ECViewGridSampleUI.
+ */
+public class SampleMementoManager implements IECViewMementoManager {
+
+ /** The instance. */
+ public static SampleMementoManager INSTANCE = new SampleMementoManager();
+
+ /** The mementos. */
+ private Map<String, YMemento> mementos = new HashMap<String, YMemento>();
+
+ /**
+ * Instantiates a new sample memento manager.
+ */
+ private SampleMementoManager() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager#loadMemento(java.lang.String)
+ */
+ @Override
+ public Object loadMemento(String mementoId) {
+ return mementos.get(mementoId);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.memento.IECViewMementoManager#saveMemento(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public IStatus saveMemento(String mementoId, Object memento) {
+ mementos.put(mementoId, (YMemento) memento);
+ return IStatus.OK;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ServletService.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ServletService.java
new file mode 100644
index 0000000..e598765
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/ServletService.java
@@ -0,0 +1,69 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.ServiceException;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.server.VaadinServlet;
+import com.vaadin.server.VaadinServletService;
+import com.vaadin.ui.UI;
+
+/**
+ * The Class ServletService.
+ */
+@SuppressWarnings("serial")
+public class ServletService extends VaadinServletService {
+
+ /**
+ * Instantiates a new servlet service.
+ *
+ * @param servlet
+ * the servlet
+ * @param deploymentConfiguration
+ * the deployment configuration
+ * @throws ServiceException
+ * the service exception
+ */
+ public ServletService(VaadinServlet servlet,
+ DeploymentConfiguration deploymentConfiguration)
+ throws ServiceException {
+ super(servlet, deploymentConfiguration);
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.server.VaadinService#getClassLoader()
+ */
+ @Override
+ public ClassLoader getClassLoader() {
+ // return the bundle classloader
+ // see http://dev.vaadin.com/ticket/15516
+ return ServletService.class.getClassLoader();
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.server.VaadinService#findUI(com.vaadin.server.VaadinRequest)
+ */
+ public UI findUI(VaadinRequest request) {
+ UI instance = super.findUI(request);
+
+ // activate the realm for the current ui and thread
+ VaadinObservables.activateRealm(instance);
+
+ return instance;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SimpleVaadinServlet.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SimpleVaadinServlet.java
new file mode 100644
index 0000000..c409d69
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/SimpleVaadinServlet.java
@@ -0,0 +1,43 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+import com.vaadin.annotations.VaadinServletConfiguration;
+import com.vaadin.server.DeploymentConfiguration;
+import com.vaadin.server.ServiceException;
+import com.vaadin.server.VaadinServlet;
+import com.vaadin.server.VaadinServletService;
+
+/**
+ * An implementation of VaadinServlet that uses SimpleUI as its base UI.
+ */
+@SuppressWarnings("serial")
+@VaadinServletConfiguration(ui = ECViewGridSampleUI.class, productionMode = false)
+public class SimpleVaadinServlet extends VaadinServlet {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.server.VaadinServlet#createServletService(com.vaadin.server.DeploymentConfiguration)
+ */
+ @Override
+ protected VaadinServletService createServletService(
+ DeploymentConfiguration deploymentConfiguration)
+ throws ServiceException {
+ // see http://dev.vaadin.com/ticket/15516
+ ServletService service = new ServletService(this,
+ deploymentConfiguration);
+ service.init();
+ return service;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/VitalityLevel.java b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/VitalityLevel.java
new file mode 100644
index 0000000..4af1ad2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.sample/src/org/eclipse/osbp/ecview/extension/sample/VitalityLevel.java
@@ -0,0 +1,24 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.sample;
+
+/**
+ * The Enum VitalityLevel.
+ */
+public enum VitalityLevel {
+
+ A,
+ B,
+ C
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.DS_Store b/org.eclipse.osbp.ecview.extension.grid.tests/.DS_Store
new file mode 100644
index 0000000..9354267
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.DS_Store
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/.project b/org.eclipse.osbp.ecview.extension.grid.tests/.project
new file mode 100644
index 0000000..98fd204
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/.project
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.grid.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</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.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/LICENSE.txt b/org.eclipse.osbp.ecview.extension.grid.tests/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/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.ecview.extension.grid.tests/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..fe82590
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,51 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.grid.tests
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.grid.tests
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-Vendor: Eclipse OSBP
+Bundle-Localization: plugin
+Import-Package: javax.servlet;version="2.6.0",
+ javax.servlet.http;version="2.6.0",
+ org.osgi.framework;version="1.7.0",
+ org.osgi.service.cm;version="1.4.0",
+ org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.http;version="1.2.1",
+ org.slf4j;version="1.6.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.osbp.ecview.extension.grid.tests.Activator
+Require-Bundle: org.junit;bundle-version="4.10.0",
+ org.knowhowlab.osgi.testing.assertions;bundle-version="[1.3.0,1.3.1)",
+ org.knowhowlab.osgi.testing.utils;bundle-version="[1.2.2,1.2.3)",
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.core.runtime,
+ org.eclipse.emf.ecore,
+ org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.equinox.ds;bundle-version="1.4.200",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.osbp.ecview.core.util.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.beans;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.ui.presentation.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.event;bundle-version="[0.9.0,0.10.0)",
+ org.apache.commons.lang;bundle-version="2.6.0",
+ org.eclipse.osbp.ecview.extension.grid.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.designer.api;bundle-version="0.9.0"
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService.xml
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty.xml b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty.xml
new file mode 100644
index 0000000..aa22399
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.tests.presentation.CellStyleGeneratorFactorty"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty.xml b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty.xml
new file mode 100644
index 0000000..91c0478
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.tests.presentation.ConverterFactorty"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService.xml b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService.xml
new file mode 100644
index 0000000..0546598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/OSGI-INF/org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService">
+ <service>
+ <provide interface="org.eclipse.osbp.runtime.common.i18n.II18nService"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.grid.tests.presentation.GridTests$I18nService"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/about.html b/org.eclipse.osbp.ecview.extension.grid.tests/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/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.ecview.extension.grid.tests/build.properties b/org.eclipse.osbp.ecview.extension.grid.tests/build.properties
new file mode 100644
index 0000000..3291600
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/build.properties
@@ -0,0 +1,19 @@
+output.. = target/classes/
+bin.includes = .,\
+ META-INF/,\
+ plugin.properties,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ dto/,\
+ modelsbin/,\
+ OSGI-INF/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+jars.compile.order = .
+source.. = src/,\
+ src-gen/
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/epl-v10.html b/org.eclipse.osbp.ecview.extension.grid.tests/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/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.ecview.extension.grid.tests/license.html b/org.eclipse.osbp.ecview.extension.grid.tests/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/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.ecview.extension.grid.tests/notice.html b/org.eclipse.osbp.ecview.extension.grid.tests/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/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.ecview.extension.grid.tests/plugin.properties b/org.eclipse.osbp.ecview.extension.grid.tests/plugin.properties
new file mode 100644
index 0000000..24680b9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = Model Model
+providerName = www.example.org
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/pom.xml b/org.eclipse.osbp.ecview.extension.grid.tests/pom.xml
new file mode 100644
index 0000000..901d6b3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/pom.xml
@@ -0,0 +1,23 @@
+<?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: -->
+<!--# Florian Pirchner - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.tests</artifactId>
+ <packaging>eclipse-test-plugin</packaging>
+
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/Activator.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/Activator.java
new file mode 100644
index 0000000..a357eac
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/Activator.java
@@ -0,0 +1,63 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests;
+
+import org.knowhowlab.osgi.testing.assertions.BundleAssert;
+import org.knowhowlab.osgi.testing.assertions.ServiceAssert;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private static Activator instance;
+ public static BundleContext context;
+
+ /**
+ * @return the instance
+ */
+ public static Activator getInstance() {
+ return instance;
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ Activator.context = context;
+ instance = this;
+
+ BundleAssert.setDefaultBundleContext(context);
+ ServiceAssert.setDefaultBundleContext(context);
+ }
+
+ /**
+ * Returns the bundle with the given id.
+ *
+ * @param id
+ * @return
+ */
+ public static Bundle findBundle(String id) {
+ for (Bundle bundle : context.getBundles()) {
+ if (bundle.getSymbolicName().equals(id)) {
+ return bundle;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ Activator.context = null;
+ instance = null;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/BundleHelper.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/BundleHelper.java
new file mode 100644
index 0000000..c015397
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/BundleHelper.java
@@ -0,0 +1,81 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import static org.knowhowlab.osgi.testing.assertions.BundleAssert.assertBundleAvailable;
+import static org.knowhowlab.osgi.testing.assertions.ServiceAssert.assertServiceAvailable;
+
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+import org.eclipse.osbp.ecview.extension.grid.tests.Activator;
+
+/**
+ * Helps checking required bundles
+ *
+ * @author admin
+ *
+ */
+public class BundleHelper {
+
+ public static void ensureSetup() throws BundleException {
+ ensureNeededBundlesAvailable();
+ ensureNeededServicesAvailable();
+ }
+
+ public static void ensureNeededBundlesAvailable() throws BundleException {
+
+ // check bundles available
+ assertBundleAvailable("org.eclipse.osbp.runtime.web.http");
+ assertBundleAvailable("org.eclipse.osbp.runtime.web.jetty");
+ assertBundleAvailable("org.eclipse.equinox.ds");
+ assertBundleAvailable("org.eclipse.equinox.util");
+ assertBundleAvailable("org.eclipse.equinox.cm");
+
+ // stop jetty
+ Bundle jetty = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.equinox.http.jetty");
+ if (jetty != null) {
+ jetty.stop();
+ }
+
+ // start ds
+ Bundle ds = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.equinox.ds");
+ if (ds == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.equinox.ds is missing!");
+ }
+ if (ds.getState() != Bundle.STARTING && ds.getState() != Bundle.ACTIVE) {
+ ds.start();
+ }
+
+ // start cm
+ Bundle cm = BundleUtils.findBundle(Activator.context,
+ "org.eclipse.equinox.cm");
+ if (cm == null) {
+ throw new IllegalStateException(
+ "Bundle org.eclipse.equinox.cm is missing!");
+ }
+ if (cm.getState() != Bundle.STARTING && cm.getState() != Bundle.ACTIVE) {
+ cm.start();
+ }
+ }
+
+ public static void ensureNeededServicesAvailable() throws BundleException {
+ assertServiceAvailable("org.osgi.service.cm.ConfigurationAdmin");
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/CellStyleGeneratorFactorty.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/CellStyleGeneratorFactorty.java
new file mode 100644
index 0000000..6c2b9d2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/CellStyleGeneratorFactorty.java
@@ -0,0 +1,63 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.osgi.service.component.annotations.Component;
+
+import com.vaadin.ui.Grid.CellReference;
+import com.vaadin.ui.Grid.CellStyleGenerator;
+
+import org.eclipse.osbp.ecview.extension.grid.CxGridDelegateCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridCellStyleGeneratorEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.presentation.IGridCellStyleGeneratorFactory;
+
+@Component(immediate = true)
+public class CellStyleGeneratorFactorty implements
+ IGridCellStyleGeneratorFactory {
+
+ @Override
+ public boolean isFor(IViewContext uiContext,
+ IGridCellStyleGeneratorEditpart editpart) {
+ return true;
+ }
+
+ @Override
+ public Object createCellStyleGenerator(IViewContext uiContext,
+ IGridCellStyleGeneratorEditpart editpart)
+ throws IllegalArgumentException {
+
+ CxGridDelegateCellStyleGenerator yGenerator = (CxGridDelegateCellStyleGenerator) editpart
+ .getModel();
+ if (yGenerator.getDelegateId().equals("sampleGrid")) {
+ return new Generator();
+ }
+
+ return null;
+
+ }
+
+ @SuppressWarnings("serial")
+ private static class Generator implements CellStyleGenerator {
+
+ @Override
+ public String getStyle(CellReference cellReference) {
+ if (cellReference.getPropertyId().equals("name")) {
+ return "osbee-bold";
+ }
+ return null;
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/ConverterFactorty.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/ConverterFactorty.java
new file mode 100644
index 0000000..dae6f44
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/ConverterFactorty.java
@@ -0,0 +1,85 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.osgi.service.component.annotations.Component;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
+
+@Component(immediate = true)
+public class ConverterFactorty implements IConverterFactory {
+
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ return true;
+ }
+
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+ YDelegateConverter yConverter = (YDelegateConverter) editpart
+ .getModel();
+ if (yConverter.getConverterId().equals("genderToImageConverter")) {
+ return new GenderToImageConverter();
+ }
+
+ return null;
+ }
+
+ @SuppressWarnings("serial")
+ public static class GenderToImageConverter implements
+ Converter<Resource, Gender> {
+
+ @Override
+ public Gender convertToModel(Resource value,
+ Class<? extends Gender> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return null;
+ }
+
+ @Override
+ public Resource convertToPresentation(Gender value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ switch (value) {
+ case FEMALE:
+ return new ThemeResource("gridsample/female.gif");
+ case MALE:
+ return new ThemeResource("gridsample/male.gif");
+ }
+ return null;
+ }
+
+ @Override
+ public Class<Gender> getModelType() {
+ return Gender.class;
+ }
+
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultUI.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultUI.java
new file mode 100644
index 0000000..517e68d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultUI.java
@@ -0,0 +1,74 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.UIDetachedException;
+
+@SuppressWarnings("serial")
+public class DefaultUI extends UI {
+
+ @Override
+ protected void init(VaadinRequest request) {
+
+ }
+
+ @Override
+ public void accessSynchronously(Runnable runnable)
+ throws UIDetachedException {
+ runnable.run();
+ }
+
+ @Override
+ public Future<Void> access(Runnable runnable) {
+ runnable.run();
+ return new InternalFuture();
+ }
+
+ private static class InternalFuture implements Future<Void> {
+
+ @Override
+ public boolean cancel(boolean mayInterruptIfRunning) {
+ return false;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return false;
+ }
+
+ @Override
+ public boolean isDone() {
+ return true;
+ }
+
+ @Override
+ public Void get() throws InterruptedException, ExecutionException {
+ return null;
+ }
+
+ @Override
+ public Void get(long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException,
+ TimeoutException {
+ return null;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultViewContext.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultViewContext.java
new file mode 100644
index 0000000..9e84c6e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/DefaultViewContext.java
@@ -0,0 +1,23 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import org.eclipse.osbp.ecview.core.common.context.ViewContext;
+
+public class DefaultViewContext extends ViewContext {
+
+ public DefaultViewContext(){
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Gender.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Gender.java
new file mode 100644
index 0000000..751e559
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Gender.java
@@ -0,0 +1,20 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+public enum Gender {
+
+ MALE, FEMALE
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/GridTests.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/GridTests.java
new file mode 100644
index 0000000..a6efeb8
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/GridTests.java
@@ -0,0 +1,735 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Locale;
+
+import javax.naming.ConfigurationException;
+
+import org.eclipse.osbp.ecview.core.common.context.ContextException;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.model.binding.YECViewModelValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YDelegateConverter;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YBooleanSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDateTime;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSelectionType;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextSearchField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.util.SimpleExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.IDateTimeEditpart;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridDelegateCellStyleGenerator;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFactory;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFooterRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridGroupedCell;
+import org.eclipse.osbp.ecview.extension.grid.CxGridHeaderRow;
+import org.eclipse.osbp.ecview.extension.grid.CxGridMetaCell;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridColumnEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridFooterRowEditpart;
+import org.eclipse.osbp.ecview.extension.grid.editparts.IGridHeaderRowEditpart;
+import org.eclipse.osbp.ecview.extension.grid.presentation.GridPresentation;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridButtonRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridProgressBarRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererFactory;
+import org.eclipse.osbp.runtime.common.dispose.AbstractDisposable;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.NumericField;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.search.TextSearchField;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.service.component.annotations.Component;
+
+import com.vaadin.data.util.converter.StringToBooleanConverter;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
+import com.vaadin.server.VaadinSession;
+import com.vaadin.shared.ui.grid.GridStaticCellType;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.Column;
+import com.vaadin.ui.Grid.FooterCell;
+import com.vaadin.ui.Grid.FooterRow;
+import com.vaadin.ui.Grid.HeaderCell;
+import com.vaadin.ui.Grid.HeaderRow;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.renderers.ButtonRenderer;
+import com.vaadin.ui.renderers.DateRenderer;
+import com.vaadin.ui.renderers.HtmlRenderer;
+import com.vaadin.ui.renderers.ImageRenderer;
+import com.vaadin.ui.renderers.ProgressBarRenderer;
+import com.vaadin.ui.renderers.TextRenderer;
+
+/**
+ * Tests the {@link GridPresentation}.
+ */
+@SuppressWarnings("restriction")
+public class GridTests {
+
+ private static final String P_BIRTHDAY = "birthday";
+ private static final String P_VITALITY = "vitality";
+ private static final String P_GENDER = "gender";
+ private static final String P_NATIVE_GERMAN = "nativeGerman";
+ private static final String P_AGE = "age";
+ private static final String P_NAME2 = "name2";
+ private static final String P_NAME = "name";
+ private SimpleExtensionModelFactory factory = new SimpleExtensionModelFactory();
+ private CxGridFactory cxFactory = CxGridFactory.eINSTANCE;
+ private CssLayout rootLayout = new CssLayout();
+ private CxGridColumn cxColName;
+ private CxGridColumn cxColName2;
+ private CxGridColumn cxColAge;
+ private CxGridButtonRenderer cxAgeRenderer;
+ private YECViewModelValueBindingEndpoint cxAgeRendererClickEndpoint;
+ private CxGridColumn cxColNativeGerman;
+ private CxGridColumn cxColGender;
+ private CxGridColumn cxColVit;
+ private CxGridProgressBarRenderer cxVitRenderer;
+ private CxGridColumn cxColBirthday;
+ private CxGridDateRenderer cxBirthdayRenderer;
+ private YView yView;
+ private CxGrid cxGrid;
+ private CxGridGroupedCell cxNamesGroupCell;
+ private CxGridHeaderRow cxHeaderRow1;
+ private CxGridMetaCell cxCustomCellAge;
+ private CxGridGroupedCell cxPersonGroupCell;
+ private CxGridHeaderRow cxHeaderRow2;
+ private CxGridMetaCell cxCustomCellBirthday;
+ private CxGridGroupedCell cxFooterGroup1;
+ private CxGridFooterRow cxFooterRow;
+ private CxGridGroupedCell cxFooterGroup2;
+ private CxGridFooterRow cxFooterRowPersonInfo;
+ private CxGridMetaCell cxCustomCellBirthdayFooter;
+
+ @SuppressWarnings("unchecked")
+ private static <A> A findEditpart(YElement yElement) {
+ return (A) DelegatingEditPartManager.getInstance().findEditpart(
+ yElement);
+ }
+
+ /**
+ * Setup tests.
+ *
+ * @throws ConfigurationException
+ * @throws BundleException
+ */
+ @Before
+ public void setup() throws BundleException {
+ BundleUtils.startBundleAsync(getBundleContext(),
+ "org.eclipse.osbp.runtime.event");
+
+ VaadinSession.setCurrent(new VaadinSession(null));
+ UI ui = new DefaultUI();
+ ui.setSession(VaadinSession.getCurrent());
+ UI.setCurrent(ui);
+ UI.getCurrent().setContent(rootLayout);
+ VaadinObservables.activateRealm(UI.getCurrent());
+ }
+
+ private BundleContext getBundleContext() {
+ return FrameworkUtil.getBundle(getClass()).getBundleContext();
+ }
+
+ /**
+ * A very simple render.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_SimpleRender() throws ContextException {
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the grid --------------------------
+ // ----------------------------------------------------------
+ YView yView = factory.createView();
+ CxGrid cxGrid = cxFactory.createCxGrid();
+ yView.setContent(cxGrid);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ assertTrue(gridPres.isRendered());
+ assertFalse(gridPres.isDisposed());
+ assertTrue(gridEP.isRendered());
+ assertFalse(gridEP.isDisposed());
+
+ gridEP.requestDispose();
+ assertFalse(gridPres.isRendered());
+ assertTrue(gridPres.isDisposed());
+ assertFalse(gridEP.isRendered());
+ assertTrue(gridEP.isDisposed());
+ }
+
+ /**
+ * A very simple header row.
+ *
+ * @throws ContextException
+ */
+ @Test
+ public void test_Columns() throws ContextException {
+
+ assertNotNull(VaadinSession.getCurrent());
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ createDefaultModel();
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ Grid grid = gridPres.getWidget();
+ assertTrue(gridPres.isRendered());
+ assertFalse(gridPres.isDisposed());
+ assertTrue(gridEP.isRendered());
+ assertFalse(gridEP.isDisposed());
+
+ assertEquals(1, grid.getHeaderRowCount());
+ assertEquals(7, grid.getColumns().size());
+
+ Column col = grid.getColumn(P_NAME);
+ assertNotNull(col);
+ assertNull(col.getConverter());
+ assertTrue(col.getRenderer() instanceof TextRenderer);
+
+ col = grid.getColumn(P_NAME2);
+ assertNotNull(col);
+ assertNull(col.getConverter());
+ assertTrue(col.getRenderer() instanceof HtmlRenderer);
+
+ col = grid.getColumn(P_AGE);
+ assertNotNull(col);
+ assertTrue(col.getConverter() instanceof StringToIntegerConverter);
+ assertTrue(col.getRenderer() instanceof ButtonRenderer);
+
+ col = grid.getColumn(P_BIRTHDAY);
+ assertNotNull(col);
+ assertNull(col.getConverter());
+ assertTrue(col.getRenderer() instanceof DateRenderer);
+
+ col = grid.getColumn(P_GENDER);
+ assertNotNull(col);
+ assertTrue(col.getConverter() instanceof ConverterFactorty.GenderToImageConverter);
+ assertTrue(col.getRenderer() instanceof ImageRenderer);
+
+ col = grid.getColumn(P_NATIVE_GERMAN);
+ assertNotNull(col);
+ assertTrue(col.getConverter() instanceof StringToBooleanConverter);
+ assertTrue(col.getRenderer() instanceof TextRenderer);
+
+ col = grid.getColumn(P_VITALITY);
+ assertNotNull(col);
+ assertNull(col.getConverter());
+ assertTrue(col.getRenderer() instanceof ProgressBarRenderer);
+
+ // test editparts
+ assertFalse(ModelUtil.getEditpart(context, cxColAge).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColBirthday).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColGender).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColName).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColName2).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColNativeGerman).isDisposed());
+ assertFalse(ModelUtil.getEditpart(context, cxColVit).isDisposed());
+
+ gridEP.requestDispose();
+ assertFalse(gridPres.isRendered());
+ assertTrue(gridPres.isDisposed());
+ assertFalse(gridEP.isRendered());
+ assertTrue(gridEP.isDisposed());
+
+ assertNull(ModelUtil.findEditpart(cxColAge));
+ assertNull(ModelUtil.findEditpart(cxColBirthday));
+ assertNull(ModelUtil.findEditpart(cxColGender));
+ assertNull(ModelUtil.findEditpart(cxColName));
+ assertNull(ModelUtil.findEditpart(cxColName2));
+ assertNull(ModelUtil.findEditpart(cxColNativeGerman));
+ assertNull(ModelUtil.findEditpart(cxColVit));
+
+ }
+
+ @Test
+ public void test_RemoveAddColumns() throws ContextException {
+
+ assertNotNull(VaadinSession.getCurrent());
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ createDefaultModel();
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ Grid grid = gridPres.getWidget();
+
+ Column col = grid.getColumn(P_BIRTHDAY);
+ assertNotNull(col);
+
+ // test editor field
+ IDateTimeEditpart editorEP = ModelUtil.getEditpart(context, cxColBirthday
+ .getEditorField());
+ assertFalse(editorEP.isDisposed());
+ assertNotNull(editorEP.getWidget());
+
+ // remove column
+ IGridColumnEditpart birthdayEP = ModelUtil.getEditpart(context, cxColBirthday);
+ cxGrid.getColumns().remove(cxColBirthday);
+ assertTrue(birthdayEP.isDisposed());
+ assertNull(grid.getColumn(P_BIRTHDAY));
+
+ // test editor
+ editorEP = ModelUtil.findEditpart(cxColBirthday.getEditorField());
+ assertNull(editorEP);
+
+ // add column
+ cxGrid.getColumns().add(2, cxColBirthday);
+ birthdayEP = ModelUtil.getEditpart(context, cxColBirthday);
+ assertFalse(birthdayEP.isDisposed());
+ assertNotNull(grid.getColumn(P_BIRTHDAY));
+
+ gridEP.requestDispose();
+ }
+
+ @Test
+ public void test_HeaderRows() throws ContextException {
+
+ assertNotNull(VaadinSession.getCurrent());
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ createExtendedModel();
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ Grid grid = gridPres.getWidget();
+
+ assertEquals(3, grid.getHeaderRowCount());
+
+ // remove the header
+ IGridHeaderRowEditpart headerRow1EP = ModelUtil
+ .getEditpart(context, cxHeaderRow1);
+ cxGrid.getHeaders().remove(cxHeaderRow1);
+ assertEquals(2, grid.getHeaderRowCount());
+ assertTrue(headerRow1EP.isDisposed());
+
+ // add it again
+ cxGrid.getHeaders().add(0, cxHeaderRow1);
+ headerRow1EP = ModelUtil.findEditpart(cxHeaderRow1);
+ assertFalse(headerRow1EP.isDisposed());
+ assertEquals(3, grid.getHeaderRowCount());
+
+ // test the meta cell
+ HeaderRow headerRow1 = grid.getHeaderRow(1);
+ HeaderCell ageCell = headerRow1.getCell(P_AGE);
+ assertEquals(GridStaticCellType.WIDGET, ageCell.getCellType());
+ CheckBox ageMetaCellComp = (CheckBox) ageCell.getComponent();
+ assertNotNull(ageMetaCellComp);
+
+ assertNotNull(ModelUtil.findEditpart(cxCustomCellAge));
+ // remove the meta cell
+ cxHeaderRow1.getCustomCells().remove(cxCustomCellAge);
+ assertNull(ModelUtil.findEditpart(cxCustomCellAge));
+ headerRow1 = grid.getHeaderRow(1);
+ ageCell = headerRow1.getCell(P_AGE);
+ assertEquals(GridStaticCellType.TEXT, ageCell.getCellType());
+
+ // add the meta cell again
+ cxHeaderRow1.getCustomCells().add(cxCustomCellAge);
+ assertNotNull(ModelUtil.findEditpart(cxCustomCellAge));
+ headerRow1 = grid.getHeaderRow(1);
+ ageCell = headerRow1.getCell(P_AGE);
+ assertEquals(GridStaticCellType.WIDGET, ageCell.getCellType());
+ ageMetaCellComp = (CheckBox) ageCell.getComponent();
+ assertNotNull(ageMetaCellComp);
+
+ gridEP.requestDispose();
+ }
+
+ @Test
+ public void test_FooterRows() throws ContextException {
+
+ assertNotNull(VaadinSession.getCurrent());
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ createExtendedModel();
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ Grid grid = gridPres.getWidget();
+
+ assertEquals(2, grid.getFooterRowCount());
+
+ // remove the header
+ IGridFooterRowEditpart footerRow1EP = ModelUtil
+ .getEditpart(context, cxFooterRowPersonInfo);
+ cxGrid.getFooters().remove(cxFooterRowPersonInfo);
+ assertEquals(1, grid.getFooterRowCount());
+ assertTrue(footerRow1EP.isDisposed());
+
+ // add it again
+ cxGrid.getFooters().add(0, cxFooterRowPersonInfo);
+ footerRow1EP = ModelUtil.findEditpart(cxFooterRowPersonInfo);
+ assertFalse(footerRow1EP.isDisposed());
+ assertEquals(2, grid.getFooterRowCount());
+
+ // test the meta cell
+ FooterRow footerRow1 = grid.getFooterRow(0);
+ FooterCell ageCell = footerRow1.getCell(P_BIRTHDAY);
+ assertEquals(GridStaticCellType.WIDGET, ageCell.getCellType());
+ NumericField ageMetaCellComp = (NumericField) ageCell.getComponent();
+ assertNotNull(ageMetaCellComp);
+
+ assertNotNull(ModelUtil.findEditpart(cxCustomCellBirthdayFooter));
+ // remove the meta cell
+ cxFooterRowPersonInfo.getCustomCells().remove(
+ cxCustomCellBirthdayFooter);
+ assertNull(ModelUtil.findEditpart(cxCustomCellBirthdayFooter));
+ footerRow1 = grid.getFooterRow(0);
+ ageCell = footerRow1.getCell(P_BIRTHDAY);
+ assertEquals(GridStaticCellType.TEXT, ageCell.getCellType());
+
+ // add the meta cell again
+ cxFooterRowPersonInfo.getCustomCells().add(cxCustomCellBirthdayFooter);
+ assertNotNull(ModelUtil.findEditpart(cxCustomCellBirthdayFooter));
+ footerRow1 = grid.getFooterRow(0);
+ ageCell = footerRow1.getCell(P_BIRTHDAY);
+ assertEquals(GridStaticCellType.WIDGET, ageCell.getCellType());
+ ageMetaCellComp = (NumericField) ageCell.getComponent();
+ assertNotNull(ageMetaCellComp);
+
+ gridEP.requestDispose();
+ }
+
+ @Test
+ public void test_FilterRow() throws ContextException {
+
+ assertNotNull(VaadinSession.getCurrent());
+
+ // switch the global locale to german
+ Locale.setDefault(Locale.GERMAN);
+
+ // ----------------------------------------------------------
+ // ------------- Create the layout --------------------------
+ // ----------------------------------------------------------
+ createExtendedModel();
+ cxGrid.setFilteringVisible(true);
+
+ // ----------------------------------------------------------
+ // ----------------- Render the UI --------------------------
+ // ----------------------------------------------------------
+ VaadinRenderer renderer = new VaadinRenderer();
+ IViewContext context = renderer.render(rootLayout, yView, null);
+ IGridEditpart gridEP = DelegatingEditPartManager.getInstance()
+ .getEditpart(context, cxGrid);
+ GridPresentation gridPres = gridEP.getPresentation();
+
+ Grid grid = gridPres.getWidget();
+
+ assertEquals(4, grid.getHeaderRowCount());
+
+ HeaderRow filterRow = grid.getHeaderRow(3);
+ HeaderCell cell = filterRow.getCell(P_NAME2);
+ assertNotNull(cell.getComponent());
+ assertTrue(cell.getComponent() instanceof TextSearchField);
+
+ YSearchField cxSearchField = cxColName2.getSearchField();
+ assertNotNull(ModelUtil.findEditpart(cxSearchField));
+
+ // remove the header
+ cxGrid.setFilteringVisible(false);
+ assertEquals(3, grid.getHeaderRowCount());
+ assertNull(ModelUtil.findEditpart(cxSearchField));
+
+ // add it again
+ cxGrid.setFilteringVisible(true);
+ assertEquals(4, grid.getHeaderRowCount());
+ assertNotNull(ModelUtil.findEditpart(cxSearchField));
+
+ filterRow = grid.getHeaderRow(3);
+ cell = filterRow.getCell(P_NAME2);
+ assertNotNull(cell.getComponent());
+ assertTrue(cell.getComponent() instanceof TextSearchField);
+
+ // change the search field -> current is disposed
+ cxColName2.setSearchField(null);
+ assertNull(ModelUtil.findEditpart(cxSearchField));
+
+ // type of cell changed to TEXT
+ filterRow = grid.getHeaderRow(3);
+ cell = filterRow.getCell(P_NAME2);
+ assertEquals(GridStaticCellType.TEXT, cell.getCellType());
+
+ gridEP.requestDispose();
+ }
+
+ protected void createDefaultModel() {
+ yView = factory.createView();
+ cxGrid = cxFactory.createCxGrid();
+ yView.setContent(cxGrid);
+
+ cxGrid.setFooterVisible(true);
+ cxGrid.setType(Person.class);
+ cxGrid.setFilteringVisible(false);
+ cxGrid.setSelectionType(YSelectionType.SINGLE);
+ cxGrid.setTypeQualifiedName(Person.class.getName());
+
+ CxGridDelegateCellStyleGenerator cxGenerator = CxGridFactory.eINSTANCE
+ .createCxGridDelegateCellStyleGenerator();
+ cxGenerator.setDelegateId("sampleGrid");
+ cxGrid.setCellStyleGenerator(cxGenerator);
+
+ cxColName = cxFactory.createCxGridColumn();
+ cxColName.setPropertyId(P_NAME);
+ cxColName.setPropertyPath(P_NAME);
+ cxColName.setEditable(true);
+ cxGrid.getColumns().add(cxColName);
+
+ cxColName2 = cxFactory.createCxGridColumn();
+ cxColName2.setPropertyId(P_NAME2);
+ cxColName2.setPropertyPath(P_NAME2);
+ cxColName2.setEditable(true);
+ cxColName2.setRenderer(CxGridRendererFactory.eINSTANCE
+ .createCxGridHtmlRenderer());
+
+ YTextSearchField name2SF = ExtensionModelFactory.eINSTANCE
+ .createYTextSearchField();
+ name2SF.setPropertyPath(P_NAME2);
+ cxColName2.setSearchField(name2SF);
+ cxGrid.getColumns().add(cxColName2);
+
+ cxColAge = cxFactory.createCxGridColumn();
+ cxColAge.setPropertyId(P_AGE);
+ cxColAge.setPropertyPath(P_AGE);
+ cxColAge.setEditable(true);
+ cxAgeRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridButtonRenderer();
+ cxAgeRendererClickEndpoint = cxAgeRenderer
+ .createLastClickEventEndpoint();
+ cxColAge.setRenderer(cxAgeRenderer);
+ YNumericSearchField cxAgeSF = ExtensionModelFactory.eINSTANCE
+ .createYNumericSearchField();
+ cxAgeSF.setPropertyPath(P_AGE);
+ cxAgeSF.setType(Integer.class);
+ cxColAge.setSearchField(cxAgeSF);
+ cxGrid.getColumns().add(cxColAge);
+
+ cxColNativeGerman = cxFactory.createCxGridColumn();
+ cxColNativeGerman.setPropertyId(P_NATIVE_GERMAN);
+ cxColNativeGerman.setPropertyPath(P_NATIVE_GERMAN);
+ cxColNativeGerman.setEditable(true);
+ YBooleanSearchField cxNativeGermanSF = ExtensionModelFactory.eINSTANCE
+ .createYBooleanSearchField();
+ cxNativeGermanSF.setPropertyPath(P_NATIVE_GERMAN);
+ cxColNativeGerman.setSearchField(cxNativeGermanSF);
+ cxGrid.getColumns().add(cxColNativeGerman);
+
+ cxColGender = cxFactory.createCxGridColumn();
+ cxColGender.setPropertyId(P_GENDER);
+ cxColGender.setPropertyPath(P_GENDER);
+ cxColGender.setEditable(true);
+ cxColGender.setRenderer(CxGridRendererFactory.eINSTANCE
+ .createCxGridImageRenderer());
+ YDelegateConverter yGenderConverter = CoreModelFactory.eINSTANCE
+ .createYDelegateConverter();
+ yGenderConverter.setConverterId("genderToImageConverter");
+ cxColGender.setConverter(yGenderConverter);
+ cxGrid.getColumns().add(cxColGender);
+
+ cxColVit = cxFactory.createCxGridColumn();
+ cxColVit.setPropertyId(P_VITALITY);
+ cxColVit.setPropertyPath(P_VITALITY);
+ cxColVit.setEditable(true);
+ cxVitRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridProgressBarRenderer();
+ cxVitRenderer.setMaxValue(250);
+ cxColVit.setRenderer(cxVitRenderer);
+ cxGrid.getColumns().add(cxColVit);
+
+ cxColBirthday = cxFactory.createCxGridColumn();
+ cxColBirthday.setPropertyId(P_BIRTHDAY);
+ cxColBirthday.setPropertyPath(P_BIRTHDAY);
+ cxColBirthday.setEditable(true);
+ YDateTime cxBirthdayEditor = ExtensionModelFactory.eINSTANCE
+ .createYDateTime();
+ cxColBirthday.setEditorField(cxBirthdayEditor);
+ cxBirthdayRenderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridDateRenderer();
+ cxBirthdayRenderer.setDateFormat("yyyy-MM-dd");
+ cxColBirthday.setRenderer(cxBirthdayRenderer);
+ cxGrid.getColumns().add(cxColBirthday);
+ }
+
+ protected void createExtendedModel() {
+ createDefaultModel();
+
+ cxGrid.setCustomFilters(true);
+
+ // group name and name2 in header "Names Group"
+ //
+ cxNamesGroupCell = cxFactory.createCxGridGroupedCell();
+ cxNamesGroupCell.setLabel("Names Group");
+ cxNamesGroupCell.getGroupables().add(cxColName);
+ cxNamesGroupCell.getGroupables().add(cxColName2);
+
+ cxHeaderRow1 = cxFactory.createCxGridHeaderRow();
+ cxHeaderRow1.getGroupings().add(cxNamesGroupCell);
+ cxGrid.getHeaders().add(cxHeaderRow1);
+
+ cxCustomCellAge = cxFactory.createCxGridMetaCell();
+ cxCustomCellAge.setElement(ExtensionModelFactory.eINSTANCE
+ .createYCheckBox());
+ cxCustomCellAge.setTarget(cxColAge);
+ cxHeaderRow1.getCustomCells().add(cxCustomCellAge);
+
+ // group "Names Group" and age in "Person Group"
+ //
+ cxPersonGroupCell = cxFactory.createCxGridGroupedCell();
+ cxPersonGroupCell.setLabel("Person Group");
+ cxPersonGroupCell.getGroupables().add(cxNamesGroupCell);
+ cxPersonGroupCell.getGroupables().add(cxColAge);
+
+ cxHeaderRow2 = cxFactory.createCxGridHeaderRow();
+ cxHeaderRow2.getGroupings().add(cxPersonGroupCell);
+ cxGrid.getHeaders().add(cxHeaderRow2);
+
+ cxCustomCellBirthday = cxFactory.createCxGridMetaCell();
+ cxCustomCellBirthday.setElement(ExtensionModelFactory.eINSTANCE
+ .createYNumericField());
+ cxCustomCellBirthday.setTarget(cxColBirthday);
+ cxHeaderRow2.getCustomCells().add(cxCustomCellBirthday);
+
+ //
+ // footer
+ //
+
+ // group name and name2 in header "Names Group"
+ //
+ cxFooterGroup1 = cxFactory.createCxGridGroupedCell();
+ cxFooterGroup1.setLabel("Names Group");
+ cxFooterGroup1.getGroupables().add(cxColName);
+ cxFooterGroup1.getGroupables().add(cxColName2);
+
+ cxFooterRow = cxFactory.createCxGridFooterRow();
+ cxFooterRow.getGroupings().add(cxFooterGroup1);
+ cxGrid.getFooters().add(cxFooterRow);
+
+ // group "Names Group" and age in "Person Group"
+ //
+ cxFooterGroup2 = cxFactory.createCxGridGroupedCell();
+ cxFooterGroup2.setLabel("Person Group");
+ cxFooterGroup2.getGroupables().add(cxFooterGroup1);
+ cxFooterGroup2.getGroupables().add(cxColAge);
+
+ cxFooterRowPersonInfo = cxFactory.createCxGridFooterRow();
+ cxFooterRowPersonInfo.getGroupings().add(cxFooterGroup2);
+ cxGrid.getFooters().add(cxFooterRowPersonInfo);
+
+ cxCustomCellBirthdayFooter = cxFactory.createCxGridMetaCell();
+ cxCustomCellBirthdayFooter.setElement(ExtensionModelFactory.eINSTANCE
+ .createYNumericField());
+ cxCustomCellBirthdayFooter.setTarget(cxColBirthday);
+ cxFooterRowPersonInfo.getCustomCells().add(cxCustomCellBirthdayFooter);
+ }
+
+ /**
+ * A simple I18n service implementation.
+ */
+ @Component(immediate = true, service = { II18nService.class })
+ public static class I18nService extends AbstractDisposable implements
+ II18nService {
+
+ @Override
+ public String getValue(String i18nKey, Locale locale) {
+ return i18nKey;
+ }
+
+ @Override
+ protected void internalDispose() {
+ // nothing to do
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Person.java b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Person.java
new file mode 100644
index 0000000..f88d72c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.grid.tests/src/org/eclipse/osbp/ecview/extension/grid/tests/presentation/Person.java
@@ -0,0 +1,277 @@
+/**
+ *
+ * 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.ecview.extension.grid.tests.presentation;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+import java.util.Date;
+
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class Person implements Serializable {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ @Dispose
+ private boolean disposed;
+
+ private String id = java.util.UUID.randomUUID().toString();
+
+ private String name;
+
+ private String name2;
+
+ private int age;
+
+ private double vitality;
+
+ private Date birthday;
+
+ private boolean nativeGerman;
+
+ private Gender gender;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the id property or <code>null</code> if not present.
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * Sets the <code>id</code> property to this instance.
+ *
+ * @param id
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setId(final String id) {
+ firePropertyChange("id", this.id, this.id = id);
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name);
+ }
+
+ /**
+ * Returns the name2 property or <code>null</code> if not present.
+ */
+ public String getName2() {
+ return this.name2;
+ }
+
+ /**
+ * Sets the <code>name2</code> property to this instance.
+ *
+ * @param name2
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setName2(final String name2) {
+ firePropertyChange("name2", this.name2, this.name2 = name2);
+ }
+
+ /**
+ * Returns the age property or <code>null</code> if not present.
+ */
+ public int getAge() {
+ return this.age;
+ }
+
+ /**
+ * Sets the <code>age</code> property to this instance.
+ *
+ * @param age
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setAge(final int age) {
+ firePropertyChange("age", this.age, this.age = age);
+ }
+
+ public double getVitality() {
+ return vitality;
+ }
+
+ public void setVitality(double vitality) {
+ firePropertyChange("vitality", this.vitality, this.vitality = vitality);
+ }
+
+ /**
+ * Returns the birthday property or <code>null</code> if not present.
+ */
+ public Date getBirthday() {
+ return this.birthday;
+ }
+
+ public boolean isNativeGerman() {
+ return nativeGerman;
+ }
+
+ public void setNativeGerman(boolean nativeGerman) {
+ firePropertyChange("nativeGerman", this.nativeGerman,
+ this.nativeGerman = nativeGerman);
+ }
+
+ public Gender getGender() {
+ return gender;
+ }
+
+ public void setGender(Gender gender) {
+ firePropertyChange("gender", this.gender, this.gender = gender);
+ }
+
+ /**
+ * Sets the <code>birthday</code> property to this instance.
+ *
+ * @param birthday
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setBirthday(final Date birthday) {
+ firePropertyChange("birthday", this.birthday, this.birthday = birthday);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Person other = (Person) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/.project b/org.eclipse.osbp.ecview.extension.model.editor/.project
new file mode 100644
index 0000000..4b86a0e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.model.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1a42c14
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.model.editor;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin$Implementation
+Bundle-Vendor: Eclipse OSBP
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.osbp.ecview.extension.model.converter.presentation,
+ org.eclipse.osbp.ecview.extension.model.presentation,
+ org.eclipse.osbp.ecview.extension.model.visibility.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.osbp.ecview.extension.model.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport,
+ org.eclipse.osbp.ecview.core.common.model.edit;visibility:=reexport,
+ org.eclipse.osbp.ecview.core.extension.model.edit;visibility:=reexport,
+ org.eclipse.xtext.common.types.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/about.html b/org.eclipse.osbp.ecview.extension.model.editor/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/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.ecview.extension.model.editor/build.properties b/org.eclipse.osbp.ecview.extension.model.editor/build.properties
new file mode 100644
index 0000000..95711fa
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/build.properties
@@ -0,0 +1,13 @@
+# All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.
+#
+# Contributors:
+# Florian Pirchner - initial API and implementation
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YConverterModelFile.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YConverterModelFile.gif
new file mode 100644
index 0000000..e33a305
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YConverterModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YECviewModelFile.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YECviewModelFile.gif
new file mode 100644
index 0000000..26ea942
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YECviewModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YVisibilityModelFile.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YVisibilityModelFile.gif
new file mode 100644
index 0000000..102f65e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/obj16/YVisibilityModelFile.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYConverter.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYConverter.gif
new file mode 100644
index 0000000..a1aafe6
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYConverter.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYECview.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYECview.gif
new file mode 100644
index 0000000..023a6d4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYECview.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYVisibility.gif b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYVisibility.gif
new file mode 100644
index 0000000..568874a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/icons/full/wizban/NewYVisibility.gif
Binary files differ
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/notice.html b/org.eclipse.osbp.ecview.extension.model.editor/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/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.ecview.extension.model.editor/plugin.properties b/org.eclipse.osbp.ecview.extension.model.editor/plugin.properties
new file mode 100644
index 0000000..d25cbe9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/plugin.properties
@@ -0,0 +1,81 @@
+#
+# 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:
+# Florian Pirchner - Initial implementation
+#
+
+pluginName = ecview Editor
+providerName = www.example.org
+
+_UI_YECviewEditor_menu = &YECview Editor
+_UI_YConverterEditor_menu = &YConverter Editor
+_UI_YVisibilityEditor_menu = &YVisibility Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_Wizard_category = Example EMF Model Creation Wizards
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_YECviewModelWizard_label = YECview Model
+_UI_YECviewModelWizard_description = Create a new YECview model
+
+_UI_YECviewEditor_label = YECview Model Editor
+
+_UI_YECviewEditorFilenameDefaultBase = My
+_UI_YECviewEditorFilenameExtensions = yecview
+
+_UI_YConverterModelWizard_label = YConverter Model
+_UI_YConverterModelWizard_description = Create a new YConverter model
+
+_UI_YConverterEditor_label = YConverter Model Editor
+
+_UI_YConverterEditorFilenameDefaultBase = My
+_UI_YConverterEditorFilenameExtensions = yconverter
+
+_UI_YVisibilityModelWizard_label = YVisibility Model
+_UI_YVisibilityModelWizard_description = Create a new YVisibility model
+
+_UI_YVisibilityEditor_label = YVisibility Model Editor
+
+_UI_YVisibilityEditorFilenameDefaultBase = My
+_UI_YVisibilityEditorFilenameExtensions = yvisibility
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/plugin.xml b/org.eclipse.osbp.ecview.extension.model.editor/plugin.xml
new file mode 100644
index 0000000..b8132de
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/plugin.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+#
+# 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:
+# Florian Pirchner - Initial implementation
+#
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated ecview -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.model.presentation.YECviewModelWizardID"
+ name="%_UI_YECviewModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.model.presentation.YECviewModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/YECviewModelFile.gif">
+ <description>%_UI_YECviewModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated ecview -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.model.presentation.YECviewEditorID"
+ name="%_UI_YECviewEditor_label"
+ icon="icons/full/obj16/YECviewModelFile.gif"
+ extensions="yecview"
+ class="org.eclipse.osbp.ecview.extension.model.presentation.YECviewEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.model.presentation.YECviewActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated ecview -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.model.converter.presentation.YConverterModelWizardID"
+ name="%_UI_YConverterModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.model.converter.presentation.YConverterModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/YConverterModelFile.gif">
+ <description>%_UI_YConverterModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated ecview -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.model.converter.presentation.YConverterEditorID"
+ name="%_UI_YConverterEditor_label"
+ icon="icons/full/obj16/YConverterModelFile.gif"
+ extensions="yconverter"
+ class="org.eclipse.osbp.ecview.extension.model.converter.presentation.YConverterEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.model.converter.presentation.YConverterActionBarContributor">
+ </editor>
+ </extension>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated ecview -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.osbp.ecview.extension.model.visibility.presentation.YVisibilityModelWizardID"
+ name="%_UI_YVisibilityModelWizard_label"
+ class="org.eclipse.osbp.ecview.extension.model.visibility.presentation.YVisibilityModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/YVisibilityModelFile.gif">
+ <description>%_UI_YVisibilityModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated ecview -->
+ <editor
+ id="org.eclipse.osbp.ecview.extension.model.visibility.presentation.YVisibilityEditorID"
+ name="%_UI_YVisibilityEditor_label"
+ icon="icons/full/obj16/YVisibilityModelFile.gif"
+ extensions="yvisibility"
+ class="org.eclipse.osbp.ecview.extension.model.visibility.presentation.YVisibilityEditor"
+ contributorClass="org.eclipse.osbp.ecview.extension.model.visibility.presentation.YVisibilityActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java
new file mode 100644
index 0000000..4c16bbf
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterActionBarContributor.java
@@ -0,0 +1,443 @@
+/**
+ *
+ * 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.ecview.extension.model.converter.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the YConverter model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YConverterActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YConverterActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("yconverter-settings"));
+ toolBarManager.add(new Separator("yconverter-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterEditor_menu"), "org.eclipse.osbp.ecview.extension.model.converterMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java
new file mode 100644
index 0000000..9b30c50
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterEditor.java
@@ -0,0 +1,1871 @@
+/**
+ *
+ * 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.ecview.extension.model.converter.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.model.converter.provider.YConverterItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.osbp.ecview.extension.model.provider.YECviewItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.visibility.provider.YVisibilityItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.xtext.common.types.provider.TypesItemProviderAdapterFactory;
+
+
+/**
+ * This is an example of a YConverter model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YConverterEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(YConverterEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(YConverterEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == YConverterEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(YConverterEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == YConverterEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(YConverterEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YConverterEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YECviewItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YConverterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YVisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new TypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YConverterEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ YConverterEditor.this.setSelectionToViewer(selection);
+ YConverterEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return ecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java
new file mode 100644
index 0000000..dd12677
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/converter/presentation/YConverterModelWizard.java
@@ -0,0 +1,648 @@
+/**
+ *
+ * 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.ecview.extension.model.converter.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterFactory;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterPackage;
+import org.eclipse.osbp.ecview.extension.model.provider.ecviewEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YConverterModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YConverterPackage yConverterPackage = YConverterPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YConverterFactory yConverterFactory = yConverterPackage.getYConverterFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YConverterModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YConverterModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewYConverter")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : yConverterPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)yConverterPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = yConverterFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), ecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YConverterModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YConverterModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YConverterModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YConverterModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return ecviewEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ ecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new YConverterModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterModelWizard_label"));
+ newFileCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterModelWizard_description"));
+ newFileCreationPage.setFileName(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new YConverterModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YConverterModelWizard_label"));
+ initialObjectCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java
new file mode 100644
index 0000000..ee41b39
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewActionBarContributor.java
@@ -0,0 +1,441 @@
+/**
+ *
+ * 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.ecview.extension.model.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the YECview model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YECviewActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YECviewActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("yecview-settings"));
+ toolBarManager.add(new Separator("yecview-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewEditor_menu"), "org.eclipse.osbp.ecview.extension.modelMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java
new file mode 100644
index 0000000..1d12182
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewEditor.java
@@ -0,0 +1,1869 @@
+/**
+ *
+ * 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.ecview.extension.model.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.model.provider.YECviewItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.converter.provider.YConverterItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.visibility.provider.YVisibilityItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.xtext.common.types.provider.TypesItemProviderAdapterFactory;
+
+
+/**
+ * This is an example of a YECview model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YECviewEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(YECviewEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(YECviewEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == YECviewEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(YECviewEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == YECviewEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(YECviewEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YECviewEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YECviewItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YConverterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YVisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new TypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YECviewEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ YECviewEditor.this.setSelectionToViewer(selection);
+ YECviewEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return ecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java
new file mode 100644
index 0000000..0c45464
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/YECviewModelWizard.java
@@ -0,0 +1,646 @@
+/**
+ *
+ * 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.ecview.extension.model.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.provider.ecviewEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YECviewModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YECviewPackage yeCviewPackage = YECviewPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YECviewFactory yeCviewFactory = yeCviewPackage.getYECviewFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YECviewModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YECviewModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewYECview")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : yeCviewPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)yeCviewPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = yeCviewFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), ecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YECviewModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YECviewModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YECviewModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YECviewModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return ecviewEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ ecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new YECviewModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewModelWizard_label"));
+ newFileCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewModelWizard_description"));
+ newFileCreationPage.setFileName(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new YECviewModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YECviewModelWizard_label"));
+ initialObjectCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java
new file mode 100644
index 0000000..12842a3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/presentation/ecviewEditorPlugin.java
@@ -0,0 +1,118 @@
+/**
+ *
+ * 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.ecview.extension.model.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.ECViewCoreEditPlugin;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtensionEditPlugin;
+
+import org.eclipse.xtext.common.types.provider.TypesEditPlugin;
+
+/**
+ * This is the central singleton for the ecview editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class ecviewEditorPlugin extends EMFPlugin {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final ecviewEditorPlugin INSTANCE = new ecviewEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ecviewEditorPlugin() {
+ super
+ (new ResourceLocator [] {
+ ECViewCoreEditPlugin.INSTANCE,
+ ExtensionEditPlugin.INSTANCE,
+ TypesEditPlugin.INSTANCE,
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java
new file mode 100644
index 0000000..31f1852
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityActionBarContributor.java
@@ -0,0 +1,443 @@
+/**
+ *
+ * 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.ecview.extension.model.visibility.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the YVisibility model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YVisibilityActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(ecviewEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YVisibilityActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("yvisibility-settings"));
+ toolBarManager.add(new Separator("yvisibility-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityEditor_menu"), "org.eclipse.osbp.ecview.extension.model.visibilityMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(ecviewEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java
new file mode 100644
index 0000000..9e5e18b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityEditor.java
@@ -0,0 +1,1871 @@
+/**
+ *
+ * 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.ecview.extension.model.visibility.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.util.LocalSelectionTransfer;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.osbp.ecview.extension.model.visibility.provider.YVisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.binding.provider.BindingItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.authorization.provider.AuthorizationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.core.provider.CoreModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.datatypes.provider.DatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.validation.provider.ValidationItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.common.model.visibility.provider.VisibilityItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.provider.ExtDatatypesItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.core.extension.model.extension.provider.ExtensionModelItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.converter.provider.YConverterItemProviderAdapterFactory;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.osbp.ecview.extension.model.provider.YECviewItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.xtext.common.types.provider.TypesItemProviderAdapterFactory;
+
+
+/**
+ * This is an example of a YVisibility model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YVisibilityEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(YVisibilityEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(YVisibilityEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == YVisibilityEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ if (updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(YVisibilityEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == YVisibilityEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(YVisibilityEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YVisibilityEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YECviewItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YConverterItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new YVisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new BindingItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new CoreModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new AuthorizationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new DatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new VisibilityItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtDatatypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ExtensionModelItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new TypesItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.osbp.ecview.extension.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), YVisibilityEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ YVisibilityEditor.this.setSelectionToViewer(selection);
+ YVisibilityEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for (Resource resource : editingDomain.getResourceSet().getResources()) {
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return ecviewEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java
new file mode 100644
index 0000000..d091a49
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.model.editor/src/org/eclipse/osbp/ecview/extension/model/visibility/presentation/YVisibilityModelWizard.java
@@ -0,0 +1,648 @@
+/**
+ *
+ * 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.ecview.extension.model.visibility.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityFactory;
+import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityPackage;
+import org.eclipse.osbp.ecview.extension.model.provider.ecviewEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.osbp.ecview.extension.model.presentation.ecviewEditorPlugin;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class YVisibilityModelWizard extends Wizard implements INewWizard {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String copyright = "All rights reserved by Loetz GmbH&Co.KG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation";
+
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YVisibilityPackage yVisibilityPackage = YVisibilityPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YVisibilityFactory yVisibilityFactory = yVisibilityPackage.getYVisibilityFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YVisibilityModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected YVisibilityModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ecviewEditorPlugin.INSTANCE.getImage("full/wizban/NewYVisibility")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : yVisibilityPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)yVisibilityPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = yVisibilityFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), ecviewEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ ecviewEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YVisibilityModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YVisibilityModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(ecviewEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class YVisibilityModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public YVisibilityModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return ecviewEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ ecviewEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(ecviewEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new YVisibilityModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityModelWizard_label"));
+ newFileCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityModelWizard_description"));
+ newFileCreationPage.setFileName(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new YVisibilityModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(ecviewEditorPlugin.INSTANCE.getString("_UI_YVisibilityModelWizard_label"));
+ initialObjectCreationPage.setDescription(ecviewEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/.project b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.project
new file mode 100644
index 0000000..1b5307f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.presentation.vaadin</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/LICENSE.txt b/org.eclipse.osbp.ecview.extension.presentation.vaadin/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3e75676
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/META-INF/MANIFEST.MF
@@ -0,0 +1,64 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.presentation.vaadin
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.presentation.vaadin
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.slf4j.api,
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.ibm.icu;bundle-version="50.1.1",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;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.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.designer.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.e4.core.contexts,
+ org.eclipse.osbp.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.apache.commons.beanutils;bundle-version="1.9.2",
+ org.eclipse.core.databinding.beans,
+ org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.xtext.functionlibrary.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.uomo.units;bundle-version="0.6.0",
+ org.unitsofmeasurement.unit-api;bundle-version="0.6.1",
+ org.eclipse.osbp.vaadin.addons.designer.overlay;bundle-version="0.9.0",
+ dragdroplayouts.osgi;bundle-version="1.1.3",
+ org.eclipse.osbp.fork.vaadin.addon.maskedtextfield;bundle-version="0.1.10",
+ org.eclipse.osbp.runtime.web.vaadin.components.widget,
+ org.eclipse.xtext.util,
+ org.eclipse.core.databinding.property;bundle-version="1.4.200"
+Import-Package: org.apache.commons.lang,
+ org.eclipse.core.databinding.property.value,
+ org.eclipse.e4.core.services.events,
+ org.eclipse.osbp.ui.api.customfields;version="0.9.0",
+ org.eclipse.osbp.ui.api.functionlibrary;version="0.9.0",
+ org.eclipse.osbp.ui.api.themes;version="0.9.0",
+ org.eclipse.osbp.utils.blob.component;version="0.9.0",
+ org.eclipse.osbp.utils.functionnormalizer.api;version="0.9.0",
+ org.eclipse.osbp.utils.vaadin;version="0.9.0",
+ org.osgi.framework;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0"
+Export-Package: org.eclipse.osbp.ecview.extension.presentation.vaadin;version="0.9.0";x-internal:=true,
+ org.eclipse.osbp.ecview.extension.presentation.vaadin.components.common;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy,
+ org.eclipse.osbp.ecview.extension.presentation.vaadin.utils;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.vaadin.components;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.vaadin.components.utils;version="0.9.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Service-Component: OSGI-INF/*.xml
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory.xml b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory.xml
new file mode 100644
index 0000000..eb30f62
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.ConverterFactory"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml
new file mode 100644
index 0000000..54c0a9f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/OSGI-INF/presentationFactory.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.presentation.vaadin.factory">
+ <implementation class="org.eclipse.osbp.ecview.extension.presentation.vaadin.PresenterFactory"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory"/>
+ </service>
+</scr:component>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/about.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/about.ini b/org.eclipse.osbp.ecview.extension.presentation.vaadin/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/about.mappings b/org.eclipse.osbp.ecview.extension.presentation.vaadin/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/about.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin/about.properties
new file mode 100644
index 0000000..2476c57
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.presentation.vaadin
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/build.properties b/org.eclipse.osbp.ecview.extension.presentation.vaadin/build.properties
new file mode 100644
index 0000000..9c93700
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/build.properties
@@ -0,0 +1,12 @@
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ LICENSE.txt,\
+ license.html
+output.. = target/classes
+source.. = src/
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/epl-v10.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/license.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/notice.html b/org.eclipse.osbp.ecview.extension.presentation.vaadin/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/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.ecview.extension.presentation.vaadin/pom.xml b/org.eclipse.osbp.ecview.extension.presentation.vaadin/pom.xml
new file mode 100644
index 0000000..d5f2c30
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/pom.xml
@@ -0,0 +1,23 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.presentation.vaadin</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Vaadin presentation layer for OSBP ECView extension</description>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java
new file mode 100644
index 0000000..faca014
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/PresenterFactory.java
@@ -0,0 +1,114 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory;
+import org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation;
+import org.eclipse.osbp.ecview.extension.editparts.IContentSensitiveLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedNumericFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IPrefixedMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IRichTextAreaEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IBlobUploadComponentEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.ICustomDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IIconComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.components.IPairComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.BlobUploadComponentPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.ContentSensitiveLayoutPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.CustomDecimalFieldPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.IconComboBoxPresentation;
+//lunifera@80.156.28.28/osbpgit/org.eclipse.osbp.ecview.extension.git
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.MaskedDecimalFieldPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.MaskedNumericFieldPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.MaskedTextFieldPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.PairComboBoxPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.PrefixedMaskedTextFieldPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.components.RichTextAreaPresentation;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy.StrategyLayoutPresentation;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+
+/**
+ * The presenter factory.
+ */
+public class PresenterFactory implements IPresentationFactory {
+
+ /**
+ * Instantiates a new presenter factory.
+ */
+ public PresenterFactory() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory
+ * #isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext,
+ * org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext, IElementEditpart editpart) {
+ String presentationURI = uiContext.getPresentationURI();
+ return presentationURI != null
+ && presentationURI.equals(VaadinRenderer.UI_KIT_URI);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IPresentationFactory
+ * #createPresentation
+ * (org.eclipse.osbp.ecview.core.common.context.IViewContext,
+ * org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends IWidgetPresentation<?>> A createPresentation(
+ IViewContext uiContext, IElementEditpart editpart)
+ throws IllegalArgumentException {
+ if (editpart instanceof IStrategyLayoutEditpart) {
+ return (A) new StrategyLayoutPresentation(editpart);
+ } else if (editpart instanceof IBlobUploadComponentEditpart) {
+ return (A) new BlobUploadComponentPresentation(editpart);
+ } else if (editpart instanceof ICustomDecimalFieldEditpart) {
+ return (A) new CustomDecimalFieldPresentation(editpart);
+ } else if (editpart instanceof IIconComboBoxEditpart) {
+ return (A) new IconComboBoxPresentation(editpart);
+ } else if (editpart instanceof IPairComboBoxEditpart) {
+ return (A) new PairComboBoxPresentation(editpart);
+ } else if (editpart instanceof IContentSensitiveLayoutEditpart) {
+ return (A) new ContentSensitiveLayoutPresentation(editpart);
+ } else if (editpart instanceof IRichTextAreaEditpart) {
+ return (A) new RichTextAreaPresentation(editpart);
+ } else if (editpart instanceof IMaskedTextFieldEditpart) {
+ return (A) new MaskedTextFieldPresentation(editpart);
+ } else if (editpart instanceof IPrefixedMaskedTextFieldEditpart) {
+ return (A) new PrefixedMaskedTextFieldPresentation(editpart);
+ } else if (editpart instanceof IMaskedDecimalFieldEditpart) {
+ return (A) new MaskedDecimalFieldPresentation(editpart);
+ } else if (editpart instanceof IMaskedNumericFieldEditpart) {
+ return (A) new MaskedNumericFieldPresentation(editpart);
+ }
+
+ throw new IllegalArgumentException(String.format(
+ "No presenter available for editpart %s[%s]", editpart
+ .getClass().getName(), editpart.getId()));
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java
new file mode 100644
index 0000000..b00374c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/BlobUploadComponentPresentation.java
@@ -0,0 +1,398 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.components.IBlobUploadComponentEditpart;
+import org.eclipse.osbp.ecview.extension.model.YBlobUploadComponent;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinProperties;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableValue;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService.ThemeResourceType;
+import org.eclipse.osbp.utils.blob.component.BlobUploadComponent;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Label;
+
+/**
+ * This presenter is responsible to render a text field on the given layout.
+ */
+public class BlobUploadComponentPresentation extends AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The blob upload comp. */
+ private BlobUploadComponent blobUploadComp;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public BlobUploadComponentPresentation(IElementEditpart editpart) {
+ super((IBlobUploadComponentEditpart) editpart);
+ this.modelAccess = new ModelAccess((YBlobUploadComponent) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (blobUploadComp == null) {
+
+ IThemeResourceService themeResourceService = getViewContext().getService(IThemeResourceService.class.getName());
+ blobUploadComp = new BlobUploadComponent();
+ blobUploadComp.setDisplayResolutionId(modelAccess.yblobUploadComp.getDisplayResolutionId());
+ blobUploadComp.enableUploadButton(true);
+ blobUploadComp.setFirmlyLinked(modelAccess.isFirmlyLinked());
+ blobUploadComp.setUniqueNameEnabled(modelAccess.isUniqueNameEnabled());
+ blobUploadComp.setBlobUploadCompLabel(new Label(modelAccess.yblobUploadComp.getLabel()));
+ blobUploadComp.setUploadIcon(themeResourceService.getThemeResource("upload", ThemeResourceType.ICON));
+ blobUploadComp.setDownloadIcon(themeResourceService.getThemeResource("download", ThemeResourceType.ICON));
+ blobUploadComp.addStyleName(CSS_CLASS_CONTROL);
+ blobUploadComp.setImmediate(true);
+ setupComponent(blobUploadComp, getCastedModel());
+
+ associateWidget(blobUploadComp, modelAccess.yblobUploadComp);
+ if (modelAccess.isCssIdValid()) {
+ blobUploadComp.setId(modelAccess.getCssID());
+ } else {
+ blobUploadComp.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<String>("", String.class);
+ blobUploadComp.setPropertyDataSource(property);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yblobUploadComp, blobUploadComp);
+
+ if (modelAccess.isCssClassValid()) {
+ blobUploadComp.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ }
+ return blobUploadComp;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(), modelAccess.getLabelI18nKey(), getLocale(), blobUploadComp);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException("BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: " + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()), YECviewPackage.Literals.YBLOB_UPLOAD_COMPONENT__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yblobUploadComp
+ * the yblob upload comp
+ * @param blobUploadComp
+ * the blob upload comp
+ */
+ protected void createBindings(YBlobUploadComponent yblobUploadComp, BlobUploadComponent blobUploadComp) {
+ // create the model binding from widget to ECView-model
+
+ IObservableValue modelOV = EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YBLOB_UPLOAD_COMPONENT__VALUE);
+
+ IVaadinObservableValue targetOV = observeUploadedBlobUuid(blobUploadComp);
+
+ Binding b = createBindings(targetOV, modelOV);
+ registerBinding(b);
+
+ super.createBindings(yblobUploadComp, blobUploadComp, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return blobUploadComp;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return blobUploadComp != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (blobUploadComp != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ ComponentContainer parent = ((ComponentContainer) blobUploadComp.getParent());
+ if (parent != null) {
+ parent.removeComponent(blobUploadComp);
+ }
+
+ // remove assocations
+ unassociateWidget(blobUploadComp);
+
+ blobUploadComp = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The yblob upload comp. */
+ private final YBlobUploadComponent yblobUploadComp;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YBlobUploadComponent yField) {
+ super();
+ this.yblobUploadComp = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yblobUploadComp.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yblobUploadComp.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the boolean value of uniqueNameEnabled.
+ *
+ * @return uniqueNameEnabled
+ */
+ public boolean isUniqueNameEnabled() {
+ return yblobUploadComp.isUniqueNameEnabled();
+ }
+
+ /**
+ * Returns the boolean value of firmlyLinked.
+ *
+ * @return firmlyLinked
+ */
+ public boolean isFirmlyLinked() {
+ return yblobUploadComp.isFirmlyLinked();
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ // return yblobUploadComp.getDatadescription() != null ?
+ // yblobUploadComp
+ // .getDatadescription().getLabel() : null;
+ return yblobUploadComp.getLabel();
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ // return yblobUploadComp.getDatadescription() != null ?
+ // yblobUploadComp
+ // .getDatadescription().getLabelI18nKey() : null;
+ return yblobUploadComp.getLabelI18nKey();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return blobUploadComp;
+ }
+
+ /**
+ * Observe uploaded blob uuid.
+ *
+ * @param component
+ * the component
+ * @return the i vaadin observable value
+ */
+ public static IVaadinObservableValue observeUploadedBlobUuid(BlobUploadComponent component) {
+ return VaadinProperties.value().observeVaadinProperty(component);
+ }
+
+ /**
+ * Switch it.
+ */
+ public void switchIt() {
+ IEmbeddableEditpart ep = getEditpart();
+ ep.requestUnrender();
+ ep.requestRender();
+ }
+
+ /**
+ * The Class Adapter.
+ */
+ private class Adapter extends AdapterImpl {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.
+ * eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ public void notifyChanged(Notification msg) {
+ if (msg.getFeature() == CoreModelPackage.Literals.YENABLE__ENABLED) {
+ switchIt();
+ }
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/ContentSensitiveLayoutPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/ContentSensitiveLayoutPresentation.java
new file mode 100644
index 0000000..d240f35
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/ContentSensitiveLayoutPresentation.java
@@ -0,0 +1,371 @@
+/**
+ *
+ * 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.ecview.extension.presentation.vaadin.components;
+
+import java.util.ArrayList;
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.ILayoutEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.extension.model.YContentSensitiveLayout;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IConstants;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractLayoutPresenter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+
+import fi.jasoft.dragdroplayouts.DDVerticalLayout;
+
+public class ContentSensitiveLayoutPresentation extends
+ AbstractLayoutPresenter<ComponentContainer> {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ContentSensitiveLayoutPresentation.class);
+
+ /** The vertical layout. */
+ private DDVerticalLayout verticalLayout;
+
+ /** The model access. */
+ private ModelAccess modelAccess;
+
+ /**
+ * The constructor.
+ *
+ * @param editpart
+ * The editpart of that presentation.
+ */
+ public ContentSensitiveLayoutPresentation(IElementEditpart editpart) {
+ super((ILayoutEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YContentSensitiveLayout) editpart.getModel());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractLayoutPresenter
+ * #updateCellStyle(org.eclipse.osbp.ecview.core.common
+ * .model.core.YEmbeddable)
+ */
+ public void updateCellStyle(YEmbeddable child) {
+ // refresh the whole ui
+ refreshUI();
+ }
+
+ /**
+ * Is called to refresh the UI. The element will be removed from the grid
+ * layout and added to it again afterwards.
+ */
+ protected void refreshUI() {
+ verticalLayout.removeAllComponents();
+
+ for (IEmbeddableEditpart child : getChildren()) {
+ Component childComponent = (Component) child.render(verticalLayout);
+ childComponent.setSizeFull();
+ verticalLayout.addComponent(childComponent);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doCreateWidget(java.lang.Object)
+ */
+ @Override
+ public ComponentContainer doCreateWidget(Object parent) {
+ if (verticalLayout == null) {
+ verticalLayout = new DDVerticalLayout();
+ setupComponent(verticalLayout, getCastedModel());
+
+ associateWidget(verticalLayout, modelAccess.yLayout);
+
+ if (modelAccess.isCssIdValid()) {
+ verticalLayout.setId(modelAccess.getCssID());
+ } else {
+ verticalLayout.setId(getEditpart().getId());
+ }
+
+ if (modelAccess.isMargin()) {
+ verticalLayout.addStyleName(IConstants.CSS_CLASS_MARGIN);
+ verticalLayout.setMargin(true);
+ }
+
+ if (!modelAccess.isSpacing()) {
+ verticalLayout.setSpacing(false);
+ } else {
+ verticalLayout.addStyleName(IConstants.CSS_CLASS_SPACING);
+ verticalLayout.setSpacing(true);
+ }
+
+ if (modelAccess.isCssClassValid()) {
+ verticalLayout.addStyleName(modelAccess.getCssClass());
+ } else {
+ verticalLayout.addStyleName(CSS_CLASS_CONTROL);
+ }
+ verticalLayout.addStyleName(IConstants.CSS_CLASS_VERTICALLAYOUT);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yLayout, verticalLayout, null);
+
+ // initialize all children
+ initializeChildren();
+
+ // and now render children
+ renderChildren(false);
+ }
+
+ return verticalLayout;
+ }
+
+ /**
+ * Adds the children to the superclass and prevents rendering.
+ */
+ private void initializeChildren() {
+ setRenderLock(true);
+ try {
+ for (IEmbeddableEditpart editPart : getEditpart().getElements()) {
+ super.add(editPart);
+ }
+ } finally {
+ setRenderLock(false);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public ComponentContainer getWidget() {
+ return verticalLayout;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return verticalLayout != null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractLayoutPresenter#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ for (IEmbeddableEditpart child : new ArrayList<IEmbeddableEditpart>(
+ getChildren())) {
+ child.dispose();
+ }
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUnrender()
+ */
+ @Override
+ public void doUnrender() {
+ if (verticalLayout != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ // remove assocations
+ unassociateWidget(verticalLayout);
+
+ // unrender the children
+ unrenderChildren();
+
+ verticalLayout.removeAllComponents();
+ verticalLayout = null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractLayoutPresenter
+ * #internalAdd(org.eclipse.osbp.ecview.core.common.editpart
+ * .IEmbeddableEditpart)
+ */
+ @Override
+ protected void internalAdd(IEmbeddableEditpart editpart) {
+ refreshUI();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractLayoutPresenter
+ * #internalRemove(org.eclipse.osbp.ecview.core.common
+ * .editpart.IEmbeddableEditpart)
+ */
+ @Override
+ protected void internalRemove(IEmbeddableEditpart child) {
+ child.unrender();
+ refreshUI();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.ILayoutPresentation#
+ * renderChildren(boolean)
+ */
+ @Override
+ public void renderChildren(boolean force) {
+ if (force) {
+ unrenderChildren();
+ }
+
+ refreshUI();
+ }
+
+ /**
+ * Will unrender all children.
+ */
+ protected void unrenderChildren() {
+ for (IEmbeddableEditpart editpart : getChildren()) {
+ if (editpart.isRendered()) {
+ editpart.unrender();
+ }
+ }
+ }
+
+ /**
+ * An internal helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y layout. */
+ private final YContentSensitiveLayout yLayout;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yLayout
+ * the y layout
+ */
+ public ModelAccess(YContentSensitiveLayout yLayout) {
+ super();
+ this.yLayout = yLayout;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yLayout.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Checks if is spacing.
+ *
+ * @return true, if is spacing
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.extension.YContentSensitiveLayout#isSpacing()
+ */
+ public boolean isSpacing() {
+ return yLayout.isSpacing();
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yLayout.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Checks if is margin.
+ *
+ * @return true, if is margin
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.extension.YContentSensitiveLayout#isMargin()
+ */
+ public boolean isMargin() {
+ return yLayout.isMargin();
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/CustomDecimalFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/CustomDecimalFieldPresentation.java
new file mode 100644
index 0000000..f193130
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/CustomDecimalFieldPresentation.java
@@ -0,0 +1,481 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YValueBindable;
+import org.eclipse.osbp.ecview.core.common.model.datatypes.YDatatype;
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDecimalDatatype;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.editparts.components.ICustomDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YCustomDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.CustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.vaadin.components.CustomDecimalField;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IBindingManager;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text area on the given layout.
+ */
+public class CustomDecimalFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The custom decimal field. */
+ private CustomField customDecimalField;
+
+ /** The binding_value to ui. */
+ private Binding binding_valueToUI;
+
+ /** The property. */
+ private ObjectProperty<Double> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public CustomDecimalFieldPresentation(IElementEditpart editpart) {
+ super((ICustomDecimalFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YCustomDecimalField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings({ "serial", "unchecked" })
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (customDecimalField == null) {
+
+ customDecimalField = new CustomField(
+ (CustomDecimalConverter) getConverter());
+ customDecimalField.addStyleName(CSS_CLASS_CONTROL);
+ customDecimalField.setImmediate(true);
+ setupComponent(customDecimalField, getCastedModel());
+
+ associateWidget(customDecimalField, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ customDecimalField.setId(modelAccess.getCssID());
+ } else {
+ customDecimalField.setId(getEditpart().getId());
+ }
+
+ IViewContext context = getViewContext();
+ customDecimalField.setLocale(context.getLocale());
+ property = new ObjectProperty<Double>(0d, Double.class);
+ customDecimalField.setPropertyDataSource(property);
+
+ customDecimalField
+ .addValueChangeListener(new Property.ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (binding_valueToUI != null) {
+ updateUiToECViewModel();
+ }
+ }
+ });
+
+ if (modelAccess.isCssClassValid()) {
+ customDecimalField.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+ doApplyDatatype(modelAccess.yField.getDatatype());
+
+ initializeField(customDecimalField);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, customDecimalField);
+
+ // send an event, that the content was rendered again
+ sendRenderedLifecycleEvent();
+ }
+ return customDecimalField;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#getDefaultConverter()
+ */
+ @Override
+ protected Converter<?, ?> getDefaultConverter() {
+ return new DecimalConverter();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#doUpdateConverter(com.vaadin.data.util.converter.Converter)
+ */
+ @SuppressWarnings("rawtypes")
+ protected void doUpdateConverter(Converter converter) {
+ super.doUpdateConverter(converter);
+
+ // if converter changes, then apply the settings from datatype to it
+ doApplyDatatype(modelAccess.yField.getDatatype());
+ }
+
+ /**
+ * Applies the datatype options to the field.
+ *
+ * @param yDt
+ * the y dt
+ */
+ protected void doApplyDatatype(YDatatype yDt) {
+ if (customDecimalField == null) {
+ return;
+ }
+
+ int oldPrecision = customDecimalField.getPrecision();
+ if (yDt == null) {
+ customDecimalField.setPrecision(2);
+ customDecimalField.setUseGrouping(true);
+ customDecimalField.setMarkNegative(true);
+ } else {
+ YDecimalDatatype yCasted = (YDecimalDatatype) yDt;
+ customDecimalField.setPrecision(yCasted.getPrecision());
+ customDecimalField.setUseGrouping(yCasted.isGrouping());
+ customDecimalField.setMarkNegative(yCasted.isMarkNegative());
+ }
+
+ if (isRendered()) {
+ // if the precision changed, then update the value from the ui field
+ // to the ECViewModel
+ if (oldPrecision != customDecimalField.getPrecision()) {
+ updateUiToECViewModel();
+ }
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // update the captions
+ applyCaptions();
+
+ // tell the number field about the locale change
+ customDecimalField.setLocale(locale);
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), customDecimalField);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return customDecimalField;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YCUSTOM_DECIMAL_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YCustomDecimalField yField,
+ CustomDecimalField field) {
+ // create the model binding from ridget to ECView-model
+
+ binding_valueToUI = createModelBinding(castEObject(getModel()),
+ YECviewPackage.Literals.YCUSTOM_DECIMAL_FIELD__VALUE, field,
+ null, null);
+
+ registerBinding(binding_valueToUI);
+
+ super.createBindings(yField, field, null);
+ }
+
+ /**
+ * Creates the model binding.
+ *
+ * @param model
+ * the model
+ * @param modelFeature
+ * the model feature
+ * @param field
+ * the field
+ * @param targetToModel
+ * the target to model
+ * @param modelToTarget
+ * the model to target
+ * @return the binding
+ */
+ protected Binding createModelBinding(EObject model,
+ EStructuralFeature modelFeature, AbstractField<?> field,
+ UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget) {
+ IBindingManager bindingManager = getViewContext()
+ .getService(
+ org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
+ .getName());
+ if (bindingManager != null) {
+ // bind the value of yText to textRidget
+ IObservableValue modelObservable = EMFObservables.observeValue(
+ model, modelFeature);
+ IObservableValue uiObservable = VaadinObservables
+ .observeConvertedValue(field);
+ return bindingManager.bindValue(uiObservable, modelObservable,
+ targetToModel, modelToTarget);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return customDecimalField;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return customDecimalField != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (customDecimalField != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) customDecimalField.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent)
+ .removeComponent(customDecimalField);
+ }
+
+ // remove assocations
+ unassociateWidget(customDecimalField);
+
+ customDecimalField = null;
+
+ sendUnrenderedLifecycleEvent();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ binding_valueToUI = null;
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * Update ui to ec view model.
+ */
+ protected void updateUiToECViewModel() {
+ if (binding_valueToUI != null) {
+ binding_valueToUI.updateTargetToModel();
+ }
+
+ Binding domainToEObjectBinding = ModelUtil
+ .getValueBinding((YValueBindable) getModel());
+ if (domainToEObjectBinding != null) {
+ domainToEObjectBinding.updateTargetToModel();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YCustomDecimalField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YCustomDecimalField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /**
+ * The Class CustomField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomField extends CustomDecimalField {
+
+ /**
+ * Instantiates a new custom field.
+ *
+ * @param converter
+ * the converter
+ */
+ public CustomField(CustomDecimalConverter converter) {
+ super("", getViewContext());
+ setConverter(converter);
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java
new file mode 100644
index 0000000..39de45e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/IconComboBoxPresentation.java
@@ -0,0 +1,400 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.LinkedHashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableSelectionEndpoint;
+import org.eclipse.osbp.ecview.core.databinding.emf.model.ECViewModelBindable;
+import org.eclipse.osbp.ecview.extension.editparts.components.IIconComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YIconComboBox;
+import org.eclipse.osbp.ecview.extension.vaadin.components.utils.FunctionWrapper;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService;
+import org.eclipse.osbp.ui.api.themes.IThemeResourceService.ThemeResourceType;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.Resource;
+import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text field on the given layout.
+ */
+public class IconComboBoxPresentation extends AbstractFieldWidgetPresenter<Component> {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory.getLogger(IconComboBoxPresentation.class);
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The combo. */
+ private ComboBox combo;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public IconComboBoxPresentation(IElementEditpart editpart) {
+ super((IIconComboBoxEditpart) editpart);
+ this.modelAccess = new ModelAccess((YIconComboBox) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (combo == null) {
+ // Get Map from FunctionLibraryDSL
+ Map<String, String> comboBoxContent = getComboBoxContent();
+ IThemeResourceService themeResourceService = getViewContext().getService(IThemeResourceService.class.getName());
+ combo = new ComboBox();
+ combo.addStyleName(CSS_CLASS_CONTROL);
+ combo.setImmediate(true);
+ setupComponent(combo, getCastedModel());
+
+ associateWidget(combo, modelAccess.yIconComboBox);
+ if (modelAccess.isCssIdValid()) {
+ combo.setId(modelAccess.getCssID());
+ } else {
+ combo.setId(getEditpart().getId());
+ }
+
+ Set<String> iconKeys = comboBoxContent.keySet();
+ // Datasource
+ combo.setContainerDataSource(new IndexedContainer(iconKeys));
+ property = new ObjectProperty<String>("", String.class);
+ combo.setPropertyDataSource(property);
+
+ // Image
+ for (Entry<String, String> entry : comboBoxContent.entrySet()) {
+ Resource icon = themeResourceService.getThemeResource(entry.getValue(), ThemeResourceType.ICON);
+ combo.setItemIcon(entry.getKey(), icon);
+ }
+
+ combo.setItemCaptionMode(ItemCaptionMode.ICON_ONLY);
+ combo.setTextInputAllowed(false);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yIconComboBox, combo);
+
+ if (modelAccess.isCssClassValid()) {
+ combo.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(combo);
+
+ }
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(), modelAccess.getLabelI18nKey(), getLocale(), combo);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.osbp.ecview.core.common.model.core
+ * .YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException("BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableSelectionEndpoint) {
+ return internalGetSelectionEndpoint((YEmbeddableSelectionEndpoint) bindableValue);
+ }
+ throw new IllegalArgumentException("Not a valid input: " + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe the selection.
+ *
+ * @param yEndpoint
+ * the y endpoint
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetSelectionEndpoint(YEmbeddableSelectionEndpoint yEndpoint) {
+
+ String attributePath = ECViewModelBindable.getAttributePath(YECviewPackage.Literals.YICON_COMBO_BOX__SELECTION, yEndpoint.getAttributePath());
+
+ // return the observable value for text
+ return ECViewModelBindable.observeValue(castEObject(getModel()), attributePath, modelAccess.yIconComboBox.getType(), modelAccess.yIconComboBox.getEmfNsURI());
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yCombo
+ * the y combo
+ * @param combo
+ * the combo
+ */
+ protected void createBindings(YIconComboBox yCombo, ComboBox combo) {
+ // ATTENTION!!!!
+ // The creation of the model container binding from widget to
+ // ECView-model as in the ComboBoxPresentation
+ // (registerBinding(createBindings_ContainerContents...)) is in
+ // this case not required due to the existing fixed content collection
+ // on the creation of the icon comboBox.
+
+ // create the model binding from widget to ECView-model
+ registerBinding(createBindingsSelection(castEObject(getModel()), YECviewPackage.Literals.YICON_COMBO_BOX__SELECTION, combo, yCombo.getType()));
+
+ super.createBindings(yCombo, combo, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return combo != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (combo != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) combo.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(combo);
+ }
+
+ // remove assocations
+ unassociateWidget(combo);
+
+ combo = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y icon combo box. */
+ private final YIconComboBox yIconComboBox;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yIconComboBox
+ * the y icon combo box
+ */
+ public ModelAccess(YIconComboBox yIconComboBox) {
+ super();
+ this.yIconComboBox = yIconComboBox;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yIconComboBox.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yIconComboBox.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yIconComboBox.getDatadescription() != null ? yIconComboBox.getDatadescription().getLabel() : null;
+ // return yIconComboBox.getLabel();
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yIconComboBox.getDatadescription() != null ? yIconComboBox.getDatadescription().getLabelI18nKey() : null;
+ // return yIconComboBox.getLabelI18nKey();
+ }
+ }
+
+ // ++++++++++++++ FunctionLibraryHelperMethods +++++++++++++++
+
+ /**
+ * Gets the combo box content.
+ *
+ * @return the combo box content
+ */
+ private Map<String, String> getComboBoxContent() {
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+ LinkedHashMap<String, String> value = new LinkedHashMap<>();
+ for (Entry<String, String> entry : getProperties()) {
+ if (functionTypingAPI.getFunctionImagePickerTypeName().equalsIgnoreCase(entry.getKey())) {
+
+ String functionFqn = entry.getValue();
+ FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+ try {
+ IFunctionLibraryService service = getViewContext().getService(IFunctionLibraryService.class.getName());
+ if (service == null) {
+ LOGGER.error("No IFunctionLibraryService available");
+ return value;
+ }
+ @SuppressWarnings("unchecked")
+ Map<String, String> callResult = (Map<String, String>) service.callFunctionLibrary(wrapper.getClassName(), wrapper.getMethodName());
+ if (callResult != null) {
+ return callResult;
+ } else {
+ LOGGER.error("Incorrect function class or method name.");
+ return value;
+ }
+ } catch (ClassCastException ex) {
+ // TODO (JCD): Translation
+ LOGGER.error("Return type of the function call '" + functionFqn + "' is not a " + Double.class.getSimpleName() + "!");
+ }
+ }
+ }
+ return value;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public EMap<String, String> getProperties() {
+ if (modelAccess.yIconComboBox != null) {
+ return modelAccess.yIconComboBox.getProperties();
+ }
+ return new BasicEMap<String, String>();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedDecimalFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedDecimalFieldPresentation.java
new file mode 100644
index 0000000..8941df4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedDecimalFieldPresentation.java
@@ -0,0 +1,375 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.text.DecimalFormatSymbols;
+import java.util.Locale;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedDecimalFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YMaskedDecimalField;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.vaadin.addons.maskedtextfield.DecimalField;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class MaskedDecimalFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomMaskedDecimalField text;
+
+ /** The property. */
+ private ObjectProperty<Number> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public MaskedDecimalFieldPresentation(IElementEditpart editpart) {
+ super((IMaskedDecimalFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YMaskedDecimalField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomMaskedDecimalField();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<Number>(null, Number.class);
+ text.setPropertyDataSource(property);
+
+ if(modelAccess.yField.getMask() != null && !modelAccess.yField.getMask().isEmpty()) {
+ text.setMask(modelAccess.yField.getMask());
+ } else {
+ text.setMask("#,##0.00");
+ }
+
+ applyDecimals();
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ protected void applyDecimals() {
+ DecimalFormatSymbols symbols = DecimalFormatSymbols
+ .getInstance(getLocale());
+ text.setGroupingSeparator(symbols.getGroupingSeparator());
+ text.setDecimalSeparator(symbols.getDecimalSeparator());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+
+ applyDecimals();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_DECIMAL_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YMaskedDecimalField yField, DecimalField field) {
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_DECIMAL_FIELD__VALUE, text));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YMaskedDecimalField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YMaskedDecimalField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomMaskedDecimalField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomMaskedDecimalField extends DecimalField {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedNumericFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedNumericFieldPresentation.java
new file mode 100644
index 0000000..c98d0d4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedNumericFieldPresentation.java
@@ -0,0 +1,357 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedNumericFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YMaskedNumericField;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.vaadin.addons.maskedtextfield.NumericField;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class MaskedNumericFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomMaskedNumericField text;
+
+ /** The property. */
+ private ObjectProperty<Number> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public MaskedNumericFieldPresentation(IElementEditpart editpart) {
+ super((IMaskedNumericFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YMaskedNumericField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomMaskedNumericField();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<Number>(null, Number.class);
+ text.setPropertyDataSource(property);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_NUMERIC_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YMaskedNumericField yField, NumericField field) {
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_NUMERIC_FIELD__VALUE, text));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YMaskedNumericField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YMaskedNumericField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomMaskedNumericField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomMaskedNumericField extends NumericField {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedTextFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedTextFieldPresentation.java
new file mode 100644
index 0000000..e43e041
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/MaskedTextFieldPresentation.java
@@ -0,0 +1,359 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.IMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YMaskedTextField;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.vaadin.addons.maskedtextfield.MaskedTextField;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class MaskedTextFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomMaskedTextField text;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public MaskedTextFieldPresentation(IElementEditpart editpart) {
+ super((IMaskedTextFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YMaskedTextField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomMaskedTextField();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<String>(null, String.class);
+ text.setPropertyDataSource(property);
+
+ text.setMask(modelAccess.yField.getMask());
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_TEXT_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YMaskedTextField yField, MaskedTextField field) {
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ YECviewPackage.Literals.YMASKED_TEXT_FIELD__VALUE, text));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YMaskedTextField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YMaskedTextField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomMaskedTextField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomMaskedTextField extends MaskedTextField {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PairComboBoxPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PairComboBoxPresentation.java
new file mode 100644
index 0000000..3f38199
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PairComboBoxPresentation.java
@@ -0,0 +1,562 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+ package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.emf.databinding.EMFProperties;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableCollectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableSelectionEndpoint;
+import org.eclipse.osbp.ecview.core.databinding.emf.model.ECViewModelBindable;
+import org.eclipse.osbp.ecview.extension.editparts.components.IPairComboBoxEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YPairComboBox;
+import org.eclipse.osbp.runtime.common.state.ISharedStateContext;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IBindingManager;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.BeanServiceLazyLoadingContainer;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.DeepResolvingBeanItemContainer;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory;
+import org.eclipse.osbp.runtime.web.vaadin.components.widget.LazyLoadingComboBox;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+import org.eclipse.xtext.util.Pair;
+import org.eclipse.xtext.util.Tuples;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Container.Sortable;
+import com.vaadin.data.Property;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.Resource;
+import com.vaadin.server.ThemeResource;
+import com.vaadin.ui.AbstractSelect.ItemCaptionMode;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+@SuppressWarnings("restriction")
+public class PairComboBoxPresentation extends AbstractFieldWidgetPresenter<Component> {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory.getLogger(PairComboBoxPresentation.class);
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The combo. */
+ private LazyLoadingComboBox combo;
+
+ /** The property. */
+ @SuppressWarnings("rawtypes")
+ private ObjectProperty property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public PairComboBoxPresentation(IElementEditpart editpart) {
+ super((IPairComboBoxEditpart) editpart);
+ this.modelAccess = new ModelAccess((YPairComboBox) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (combo == null) {
+
+ combo = new CustomComboBox();
+ combo.addStyleName(CSS_CLASS_CONTROL);
+ combo.setImmediate(true);
+ setupComponent(combo, getCastedModel());
+
+ associateWidget(combo, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ combo.setId(modelAccess.getCssID());
+ } else {
+ combo.setId(getEditpart().getId());
+ }
+
+ if (modelAccess.isCssClassValid()) {
+ combo.addStyleName(modelAccess.getCssClass());
+ }
+
+ try {
+ property = new ObjectProperty(null, modelAccess.yField.getType());
+ combo.setPropertyDataSource(property);
+
+ if (modelAccess.yField.getType() != null) {
+ if (!modelAccess.yField.isUseBeanService()) {
+ DeepResolvingBeanItemContainer datasource = new DeepResolvingBeanItemContainer(modelAccess.yField.getType());
+ combo.setContainerDataSource(datasource);
+ } else {
+ IBeanSearchServiceFactory factory = getViewContext().getService(IBeanSearchServiceFactory.class.getName());
+ if (factory != null) {
+ ISharedStateContext sharedState = getViewContext().getService(ISharedStateContext.class.getName());
+ BeanServiceLazyLoadingContainer<?> datasource = new BeanServiceLazyLoadingContainer(
+ factory.createService(modelAccess.yField.getType()), modelAccess.yField.getType(), sharedState);
+ combo.setContainerDataSource(datasource);
+ }
+ }
+ }
+
+ String itemCaptionProperty = modelAccess.yField.getCaptionProperty();
+ if (itemCaptionProperty != null && !itemCaptionProperty.equals("")) {
+ combo.setItemCaptionPropertyId(itemCaptionProperty);
+ combo.setItemCaptionMode(ItemCaptionMode.PROPERTY);
+
+ Container container = combo.getContainerDataSource();
+ if (container instanceof Container.Sortable) {
+ Container.Sortable sortable = (Sortable) container;
+ sortable.sort(new Object[] { itemCaptionProperty }, new boolean[] { true });
+ }
+ } else {
+ combo.setItemCaptionMode(ItemCaptionMode.ID);
+ }
+
+ String itemImageProperty = modelAccess.yField.getImageProperty();
+ if (itemImageProperty != null && !itemImageProperty.equals("")) {
+ combo.setItemIconPropertyId(itemImageProperty);
+ }
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, combo);
+
+ if (modelAccess.isCssClassValid()) {
+ combo.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(combo);
+ } catch (Exception e) {
+ LOGGER.error("{}", e);
+ }
+ }
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(), modelAccess.getLabelI18nKey(), getLocale(), combo);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException("BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableCollectionEndpoint) {
+ return internalGetCollectionEndpoint();
+ } else if (bindableValue instanceof YEmbeddableSelectionEndpoint) {
+ return internalGetSelectionEndpoint((YEmbeddableSelectionEndpoint) bindableValue);
+ }
+ throw new IllegalArgumentException("Not a valid input: " + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe the collection.
+ *
+ * @return the i observable list
+ */
+ protected IObservableList internalGetCollectionEndpoint() {
+ // return the observable value for text
+ return EMFProperties.list(YECviewPackage.Literals.YPAIR_COMBO_BOX__COLLECTION).observe(getModel());
+ }
+
+ /**
+ * Returns the observable to observe the selection.
+ *
+ * @param yEndpoint
+ * the y endpoint
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetSelectionEndpoint(YEmbeddableSelectionEndpoint yEndpoint) {
+
+ String attributePath = ECViewModelBindable.getAttributePath(YECviewPackage.Literals.YPAIR_COMBO_BOX__SELECTION,
+ yEndpoint.getAttributePath());
+
+ // return the observable value for text
+ return ECViewModelBindable.observeValue(castEObject(getModel()), attributePath, modelAccess.yField.getType(),
+ modelAccess.yField.getEmfNsURI());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return combo;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return combo != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (combo != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) combo.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(combo);
+ }
+
+ // remove assocations
+ unassociateWidget(combo);
+
+ combo = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YPairComboBox yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YPairComboBox yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField.getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField.getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /**
+ * Converts the string value of the item icon property to
+ * {@link ThemeResource}.
+ */
+ @SuppressWarnings("serial")
+ private static class CustomComboBox extends LazyLoadingComboBox {
+
+ /** The item icon property id. */
+ private Object itemIconPropertyId;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.ui.AbstractSelect#setItemIconPropertyId(java.lang.Object)
+ */
+ @Override
+ public void setItemIconPropertyId(Object propertyId) throws IllegalArgumentException {
+ if (propertyId == null) {
+ super.setItemIconPropertyId(propertyId);
+ } else if (!getContainerPropertyIds().contains(propertyId)) {
+ super.setItemIconPropertyId(propertyId);
+ } else if (String.class.isAssignableFrom(getType(propertyId))) {
+ itemIconPropertyId = propertyId;
+ } else {
+ super.setItemIconPropertyId(propertyId);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractSelect#getItemIconPropertyId()
+ */
+ public Object getItemIconPropertyId() {
+ return itemIconPropertyId != null ? itemIconPropertyId : super.getItemIconPropertyId();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractSelect#getItemIcon(java.lang.Object)
+ */
+ public Resource getItemIcon(Object itemId) {
+ if (itemIconPropertyId == null) {
+ return super.getItemIcon(itemId);
+ } else {
+ final Property<?> ip = getContainerProperty(itemId, getItemIconPropertyId());
+ if (ip == null) {
+ return null;
+ }
+ final Object icon = ip.getValue();
+ try {
+ if (icon instanceof String) {
+ return new ThemeResource((String) icon);
+ }
+ } catch (Exception e) {
+ // nothing to do
+ }
+ }
+ return null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YPairComboBox yField, LazyLoadingComboBox field) {
+ // create the model binding from ridget to ECView-model
+ // registerBinding(createBindings_ContainerContents(castEObject(getModel()),
+ // YECviewPackage.Literals.YPAIR_COMBO_BOX__COLLECTION,
+ // field));
+ // create the model binding from ridget to ECView-model
+ registerBinding(createBindings_ContainerContents(castEObject(getModel()), YECviewPackage.Literals.YPAIR_COMBO_BOX__COLLECTION,
+ field, yField.getType()));
+
+ // create the model binding from ridget to ECView-model
+ // registerBinding(createBindingsPairSelection(castEObject(getModel()),
+ // YECviewPackage.Literals.YPAIR_COMBO_BOX__SELECTION, field,
+ // yField.getType()));
+ registerBinding(createBindingsPairSelection(castEObject(getModel()), YECviewPackage.Literals.YPAIR_COMBO_BOX__SELECTION, field));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /**
+ * Binds the value attribute from the ecview model to the ui element.
+ *
+ * @param model
+ * the model
+ * @param modelFeature
+ * the model feature
+ * @param field
+ * the field
+ * @param targetToModel
+ * the target to model
+ * @param modelToTarget
+ * the model to target
+ * @return Binding - the created binding
+ */
+ protected Binding createBindingsPairSelection(EObject model, EStructuralFeature modelFeature, Field<?> field) {
+ IBindingManager bindingManager = getViewContext().getService(
+ org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class.getName());
+ if (bindingManager != null) {
+
+ UpdateValueStrategy targetToModel = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
+ targetToModel.setConverter(new PairToTextConverter());
+ UpdateValueStrategy modelToTarget = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
+ modelToTarget.setConverter(new TextToPairConverter());
+
+ // bind the value of yText to textRidget
+ IObservableValue modelObservable = EMFObservables.observeValue(model, modelFeature);
+ IObservableValue uiObservable = VaadinObservables.observeValue(field);
+ return bindingManager.bindValue(uiObservable, modelObservable, targetToModel, modelToTarget);
+ }
+ return null;
+ }
+
+ private static class TextToPairConverter extends Converter {
+
+ public TextToPairConverter() {
+ super(String.class, Pair.class);
+ }
+
+ @Override
+ public Object convert(Object fromObject) {
+ if (fromObject == null) {
+ return null;
+ }
+ return Tuples.create(extractSimpleName((String) fromObject), (String) fromObject);
+ // return fromObject;
+ }
+
+ private String extractSimpleName(String fqn) {
+ String[] splittedFqn = fqn.split("\\.");
+ String name = "";
+ int length = splittedFqn.length;
+ if (length > 0) {
+ name = splittedFqn[length - 1];
+ }
+ return name;
+ }
+ }
+
+ private static class PairToTextConverter extends Converter {
+
+ public PairToTextConverter() {
+ super(Pair.class, String.class);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object convert(Object fromObject) {
+ if (fromObject == null) {
+ return "";
+ }
+ return ((Pair<String, String>) fromObject).getSecond();
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PrefixedMaskedTextFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PrefixedMaskedTextFieldPresentation.java
new file mode 100644
index 0000000..9fc4a36
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/PrefixedMaskedTextFieldPresentation.java
@@ -0,0 +1,363 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.IPrefixedMaskedTextFieldEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YPrefixedMaskedTextField;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.vaadin.addons.maskedtextfield.PrefixedMaskedTextField;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class PrefixedMaskedTextFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomPrefixedMaskedTextField text;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public PrefixedMaskedTextFieldPresentation(IElementEditpart editpart) {
+ super((IPrefixedMaskedTextFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YPrefixedMaskedTextField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomPrefixedMaskedTextField();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<String>(null, String.class);
+ text.setPropertyDataSource(property);
+
+ text.setMask(modelAccess.yField.getMask());
+ text.setMasks(modelAccess.yField.getPrefixes().map());
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YPREFIXED_MASKED_TEXT_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YPrefixedMaskedTextField yField,
+ PrefixedMaskedTextField field) {
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ YECviewPackage.Literals.YPREFIXED_MASKED_TEXT_FIELD__VALUE,
+ text));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YPrefixedMaskedTextField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YPrefixedMaskedTextField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomPrefixedMaskedTextField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomPrefixedMaskedTextField extends PrefixedMaskedTextField {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/QuantityTextFieldPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/QuantityTextFieldPresentation.java
new file mode 100644
index 0000000..7421573
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/QuantityTextFieldPresentation.java
@@ -0,0 +1,333 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Locale;
+
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextField;
+import org.eclipse.osbp.ecview.core.ui.core.editparts.extension.ITextFieldEditpart;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.TextField;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class QuantityTextFieldPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomTextField text;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public QuantityTextFieldPresentation(IElementEditpart editpart) {
+ super((ITextFieldEditpart) editpart);
+ this.modelAccess = new ModelAccess((YTextField) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomTextField();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<String>(null, String.class);
+ text.setPropertyDataSource(property);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalGetObservableEndpoint(org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ ExtensionModelPackage.Literals.YTEXT_FIELD__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YTextField yField, TextField field) {
+ // create the model binding from ridget to ECView-model
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ ExtensionModelPackage.Literals.YTEXT_FIELD__VALUE, text));
+
+ super.createBindings(yField, field, null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YTextField yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YTextField yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if(object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomTextField.
+ */
+ @SuppressWarnings("serial")
+ private class CustomTextField extends TextField {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if(isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java
new file mode 100644
index 0000000..52263ce
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/RichTextAreaPresentation.java
@@ -0,0 +1,441 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components;
+
+import java.util.Base64;
+import java.util.Locale;
+
+import org.eclipse.core.databinding.Binding;
+import org.eclipse.core.databinding.UpdateValueStrategy;
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.emf.databinding.EMFObservables;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint;
+import org.eclipse.osbp.ecview.extension.editparts.IRichTextAreaEditpart;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+import org.eclipse.osbp.ecview.extension.model.YRichTextArea;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IBindingManager;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractFieldWidgetPresenter;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.internal.util.Util;
+import org.eclipse.osbp.runtime.web.vaadin.databinding.VaadinObservables;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.ErrorMessage;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.RichTextArea;
+
+/**
+ * This presenter is responsible to render a text field for quantities.
+ */
+public class RichTextAreaPresentation extends
+ AbstractFieldWidgetPresenter<Component> {
+
+ /** The model access. */
+ private final ModelAccess modelAccess;
+
+ /** The text. */
+ private CustomRichTextArea text;
+
+ /** The property. */
+ private ObjectProperty<String> property;
+
+ /**
+ * Constructor.
+ *
+ * @param editpart
+ * The editpart of that presenter
+ */
+ public RichTextAreaPresentation(IElementEditpart editpart) {
+ super((IRichTextAreaEditpart) editpart);
+ this.modelAccess = new ModelAccess((YRichTextArea) editpart.getModel());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Component doCreateWidget(Object parent) {
+ if (text == null) {
+
+ text = new CustomRichTextArea();
+ text.addStyleName(CSS_CLASS_CONTROL);
+ text.setNullRepresentation("");
+ text.setImmediate(true);
+ setupComponent(text, getCastedModel());
+
+ associateWidget(text, modelAccess.yField);
+ if (modelAccess.isCssIdValid()) {
+ text.setId(modelAccess.getCssID());
+ } else {
+ text.setId(getEditpart().getId());
+ }
+
+ property = new ObjectProperty<String>(null, String.class);
+ text.setPropertyDataSource(property);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yField, text);
+
+ if (modelAccess.isCssClassValid()) {
+ text.addStyleName(modelAccess.getCssClass());
+ }
+
+ applyCaptions();
+
+ initializeField(text);
+ }
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ Util.applyCaptions(getI18nService(), modelAccess.getLabel(),
+ modelAccess.getLabelI18nKey(), getLocale(), text);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#doGetField()
+ */
+ @Override
+ protected Field<?> doGetField() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractVaadinWidgetPresenter
+ * #internalGetObservableEndpoint(org.eclipse.osbp
+ * .ecview.core.common.model.core.YEmbeddableBindingEndpoint)
+ */
+ @Override
+ protected IObservable internalGetObservableEndpoint(
+ YEmbeddableBindingEndpoint bindableValue) {
+ if (bindableValue == null) {
+ throw new IllegalArgumentException(
+ "BindableValue must not be null!");
+ }
+
+ if (bindableValue instanceof YEmbeddableValueEndpoint) {
+ return internalGetValueEndpoint();
+ }
+ throw new IllegalArgumentException("Not a valid input: "
+ + bindableValue);
+ }
+
+ /**
+ * Returns the observable to observe value.
+ *
+ * @return the i observable value
+ */
+ protected IObservableValue internalGetValueEndpoint() {
+ // return the observable value for text
+ return EMFObservables.observeValue(castEObject(getModel()),
+ YECviewPackage.Literals.YRICH_TEXT_AREA__VALUE);
+ }
+
+ /**
+ * Creates the bindings for the given values.
+ *
+ * @param yField
+ * the y field
+ * @param field
+ * the field
+ */
+ protected void createBindings(YRichTextArea yField, RichTextArea field) {
+ // create the model binding from ridget to ECView-model
+ if (yField.isUseBlob()) {
+ registerBinding(createBindings_BlobValue(castEObject(getModel()),
+ YECviewPackage.Literals.YRICH_TEXT_AREA__BLOB_VALUE, text));
+ } else {
+ registerBinding(createBindings_Value(castEObject(getModel()),
+ YECviewPackage.Literals.YRICH_TEXT_AREA__VALUE, text));
+ }
+
+ super.createBindings(yField, field, null);
+ }
+
+ /**
+ * Binds the value attribute from the ecview model to the ui element.
+ *
+ * @param model
+ * the model
+ * @param modelFeature
+ * the model feature
+ * @param field
+ * the field
+ * @param targetToModel
+ * the target to model
+ * @param modelToTarget
+ * the model to target
+ * @return Binding - the created binding
+ */
+ protected Binding createBindings_BlobValue(EObject model,
+ EStructuralFeature modelFeature, Field<?> field) {
+ IBindingManager bindingManager = getViewContext()
+ .getService(
+ org.eclipse.osbp.ecview.core.common.binding.IECViewBindingManager.class
+ .getName());
+ if (bindingManager != null) {
+
+ UpdateValueStrategy targetToModel = new UpdateValueStrategy(
+ UpdateValueStrategy.POLICY_UPDATE);
+ targetToModel.setConverter(new TextToBlobConverter());
+ UpdateValueStrategy modelToTarget = new UpdateValueStrategy(
+ UpdateValueStrategy.POLICY_UPDATE);
+ modelToTarget.setConverter(new BlobToTextConverter());
+
+ // bind the value of yText to textRidget
+ IObservableValue modelObservable = EMFObservables.observeValue(
+ model, modelFeature);
+ IObservableValue uiObservable = VaadinObservables
+ .observeValue(field);
+ return bindingManager.bindValue(uiObservable, modelObservable,
+ targetToModel, modelToTarget);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * getWidget()
+ */
+ @Override
+ public Component getWidget() {
+ return text;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#
+ * isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return text != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void doUnrender() {
+ if (text != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ Component parent = ((Component) text.getParent());
+ if (parent != null && parent instanceof ComponentContainer) {
+ ((ComponentContainer) parent).removeComponent(text);
+ }
+
+ // remove assocations
+ unassociateWidget(text);
+
+ text = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /**
+ * A helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y field. */
+ private final YRichTextArea yField;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yField
+ * the y field
+ */
+ public ModelAccess(YRichTextArea yField) {
+ super();
+ this.yField = yField;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yField.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yField.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label
+ */
+ public String getLabel() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabel() : null;
+ }
+
+ /**
+ * Returns the label.
+ *
+ * @return the label i18n key
+ */
+ public String getLabelI18nKey() {
+ return yField.getDatadescription() != null ? yField
+ .getDatadescription().getLabelI18nKey() : null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.
+ * AbstractFieldWidgetPresenter#setConverter(java.lang.Object)
+ */
+ @Override
+ public void setConverter(Object object) {
+ if (object == null) {
+
+ }
+ super.setConverter(object);
+ }
+
+ /**
+ * The Class CustomRichTextArea.
+ */
+ @SuppressWarnings("serial")
+ private class CustomRichTextArea extends RichTextArea {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.ui.AbstractField#getErrorMessage()
+ */
+ @Override
+ public ErrorMessage getErrorMessage() {
+ if (isDisposed()) {
+ // after disposal, Vaadin will call this method once.
+ return null;
+ }
+
+ ErrorMessage message = super.getErrorMessage();
+ reportValidationError(message);
+ return message;
+ }
+ }
+
+ private static class TextToBlobConverter extends Converter {
+
+ public TextToBlobConverter() {
+ super(String.class, byte[].class);
+ }
+
+ @Override
+ public Object convert(Object fromObject) {
+ if (fromObject == null) {
+ return null;
+ }
+ return Base64.getEncoder().encode(((String) fromObject).getBytes());
+ }
+ }
+
+ private static class BlobToTextConverter extends Converter {
+
+ public BlobToTextConverter() {
+ super(byte[].class, String.class);
+ }
+
+ @Override
+ public Object convert(Object fromObject) {
+ if (fromObject == null) {
+ return "";
+ }
+ return new String(Base64.getDecoder().decode((byte[]) fromObject));
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/common/ECViewComponent.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/common/ECViewComponent.java
new file mode 100644
index 0000000..ebdd72c
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/components/common/ECViewComponent.java
@@ -0,0 +1,237 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.components.common;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.osbp.ecview.core.common.context.ContextException;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.VaadinRenderer;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Notification.Type;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * This component shows an rendered ECView component for the given DTO instance.
+ * <p>
+ * Attention: This component needs to be {@link #dispose() disposed} if not used
+ * anymore.
+ */
+@SuppressWarnings("serial")
+public class ECViewComponent extends CustomComponent {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ECViewComponent.class);
+
+ /**
+ * Use this property to pass the beanSlot that should be used for the dto.
+ * See properties map in {@link #render(Object, Map)}
+ */
+ public static final String PROP_SLOT = "beanSlot";
+
+ /** The cache. */
+ private Map<String, IViewContext> cache = new HashMap<>();
+
+ /** The layout. */
+ private VerticalLayout layout;
+
+ /** The current view context. */
+ private IViewContext currentViewContext;
+
+ /** The callback. */
+ private ViewProviderCallback callback;
+
+ /**
+ * Instantiates a new EC view component.
+ */
+ public ECViewComponent() {
+ this(null);
+ }
+
+ /**
+ * Instantiates a new EC view component.
+ *
+ * @param callback
+ * the callback
+ */
+ public ECViewComponent(ViewProviderCallback callback) {
+ this.callback = callback;
+
+ setSizeFull();
+
+ layout = new VerticalLayout();
+ layout.setSizeFull();
+ setCompositionRoot(layout);
+
+ }
+
+ /**
+ * Will render and show a bound view instance for the given dto.
+ *
+ * @param viewId
+ * the id of the view
+ * @param dto
+ * the dto instance to be displayed
+ * @param properties
+ * render properties
+ * @return the rendered view context or <code>null</code>.
+ */
+ public IViewContext setValue(String viewId, Object dto,
+ Map<String, Object> properties) {
+ // if the type of dto did not change, we only need to set the new dto
+ // instance
+ String currentId = null;
+ if (currentViewContext != null) {
+ currentId = currentViewContext.getViewEditpart().getName();
+ }
+
+ if (viewId.equals(currentId)) {
+ currentViewContext.setBean(getBeanSlotName(properties), dto);
+ } else {
+ // remove all components
+ layout.removeAllComponents();
+
+ // determine the resulting ui content
+ IViewContext context = cache.get(viewId);
+ if (context == null) {
+ context = createNewContext(viewId, properties);
+ }
+
+ if (context != null) {
+ if (!context.isRendered()) {
+ try {
+ new VaadinRenderer()
+ .render(context, layout, properties);
+ } catch (ContextException e) {
+ LOGGER.error("{}", e);
+ Notification.show(
+ viewId + " caused " + e.getLocalizedMessage()
+ + "!", Type.ERROR_MESSAGE);
+ }
+ }
+
+ // set data to the view
+ if (dto != null) {
+ context.setBean(getBeanSlotName(properties), dto);
+ }
+ }
+ currentViewContext = context;
+ }
+ return currentViewContext;
+ }
+
+ /**
+ * Gets the bean slot name.
+ *
+ * @param properties
+ * the properties
+ * @return the bean slot name
+ */
+ protected String getBeanSlotName(Map<String, Object> properties) {
+ return (String) properties.get(PROP_SLOT);
+ }
+
+ /**
+ * Creates a new context for the given dto using the properties.
+ *
+ * @param viewId
+ * the view id
+ * @param properties
+ * the properties
+ * @return the i view context
+ */
+ protected IViewContext createNewContext(String viewId,
+ Map<String, Object> properties) {
+
+ IViewContext context = null;
+ BundleContext bc = FrameworkUtil.getBundle(getClass())
+ .getBundleContext();
+ ServiceReference<IECViewProviderService> ref = bc
+ .getServiceReference(IECViewProviderService.class);
+ if (ref != null) {
+ IECViewProviderService service = bc.getService(ref);
+
+ YView yView = null;
+ // check whether the owner wants to contribute a view model
+ if (callback != null) {
+ yView = callback.getView(viewId, properties);
+ }
+
+ if (yView != null) {
+ // create a context for the provided view model
+ context = service.getViewContext(yView);
+ } else {
+ // else check the service for a proper view model
+ context = service.getViewContext(viewId);
+ }
+ if (context != null) {
+ cache.put(viewId, context);
+ }
+
+ bc.ungetService(ref);
+ } else {
+ LOGGER.error("No view available for " + viewId);
+ }
+
+ return context;
+ }
+
+ /**
+ * Disposes the component.
+ */
+ public void dispose() {
+ cache.values().forEach(it -> {
+ try {
+ it.dispose();
+ } catch (Exception e) {
+ LOGGER.error("{}", e);
+ }
+ });
+ cache.clear();
+ cache = null;
+
+ layout = null;
+ currentViewContext = null;
+ }
+
+ /**
+ * A callback class to allow owners of this class to create context specifix
+ * views.
+ */
+ public interface ViewProviderCallback {
+
+ /**
+ * Returns a custom view for the given id and properties. Or
+ * <code>null</code> if a default view should be used.
+ *
+ * @param viewId
+ * the view id
+ * @param properties
+ * the properties
+ * @return the view
+ */
+ YView getView(String viewId, Map<String, Object> properties);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java
new file mode 100644
index 0000000..09b1602
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ConverterFactory.java
@@ -0,0 +1,84 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart;
+import org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory;
+import org.eclipse.osbp.ecview.extension.editparts.converter.ICustomDecimalConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IDecimalToUomoConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.INumericToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.INumericToUomoConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IObjectToStringConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.ISimpleDecimalConverterEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.converter.IStringToResourceConverterEditpart;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterPackage;
+import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YDecimalToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToResourceConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToUomoConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YSimpleDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YStringToResourceConverter;
+import org.osgi.service.component.annotations.Component;
+
+/**
+ * A factory for creating Converter objects.
+ */
+@Component(immediate = true)
+public class ConverterFactory implements IConverterFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory#isFor(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart)
+ */
+ @Override
+ public boolean isFor(IViewContext uiContext, IConverterEditpart editpart) {
+ EObject model = (EObject) editpart.getModel();
+ return model.eClass().getEPackage() == YConverterPackage.eINSTANCE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IConverterFactory#createConverter(org.eclipse.osbp.ecview.core.common.context.IViewContext, org.eclipse.osbp.ecview.core.common.editpart.IConverterEditpart)
+ */
+ @Override
+ public Object createConverter(IViewContext uiContext,
+ IConverterEditpart editpart) throws IllegalArgumentException {
+
+ if (editpart instanceof IObjectToStringConverterEditpart) {
+ return new ObjectToStringConverter();
+ } else if (editpart instanceof IStringToResourceConverterEditpart) {
+ return new StringToResourceConverter(uiContext,
+ (YStringToResourceConverter) editpart.getModel());
+ } else if (editpart instanceof INumericToUomoConverterEditpart) {
+ return new NumericToUomoConverter(uiContext,
+ (YNumericToUomoConverter) editpart.getModel());
+ } else if (editpart instanceof INumericToResourceConverterEditpart) {
+ return new NumericToResourceConverter(uiContext,
+ (YNumericToResourceConverter) editpart.getModel());
+ } else if (editpart instanceof IDecimalToUomoConverterEditpart) {
+ return new DecimalToUomoConverter(uiContext,
+ (YDecimalToUomoConverter) editpart.getModel());
+ } else if (editpart instanceof ICustomDecimalConverterEditpart) {
+ return new CustomDecimalConverter(uiContext,
+ (YCustomDecimalConverter) editpart.getModel());
+ } else if (editpart instanceof ISimpleDecimalConverterEditpart) {
+ return new SimpleDecimalConverter(uiContext,
+ (YSimpleDecimalConverter) editpart.getModel());
+ }
+
+ throw new IllegalArgumentException("Not a valid editpart: "
+ + editpart.getClass().getName());
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java
new file mode 100644
index 0000000..6728deb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/CustomDecimalConverter.java
@@ -0,0 +1,458 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.text.ParseException;
+import java.util.Locale;
+import java.util.Map.Entry;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.vaadin.components.utils.FunctionWrapper;
+import org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter;
+import org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.eclipse.osbp.xtext.functionlibrary.common.uomo.DimensionlessUnit;
+import org.eclipse.uomo.units.impl.BaseAmount;
+import org.eclipse.uomo.units.impl.format.LocalUnitFormatImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.unitsofmeasurement.quantity.Dimensionless;
+
+/**
+ * The Class CustomDecimalConverter.
+ */
+@SuppressWarnings("serial")
+public class CustomDecimalConverter extends DecimalConverter {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(CustomDecimalConverter.class);
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /** The y converter. */
+ private YCustomDecimalConverter yConverter;
+
+ /** The converted decimal format. */
+ private DecimalFormat convertedDecimalFormat;
+// private final DecimalFormat defaultDecimalFormat = new DecimalFormat(
+// "##,##0.00");
+ /** The default decimal format. */
+ private final DecimalFormat defaultDecimalFormat = new DecimalFormat();
+
+ /**
+ * Instantiates a new custom decimal converter.
+ *
+ * @param registry
+ * the registry
+ * @param yConverter
+ * the y converter
+ */
+ public CustomDecimalConverter(IServiceRegistry registry,
+ YCustomDecimalConverter yConverter) {
+ this.registry = registry;
+ this.yConverter = yConverter;
+ }
+
+ /**
+ * Instantiates a new custom decimal converter.
+ */
+ public CustomDecimalConverter() {
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.AbstractStringToNumberConverter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToPresentation(Double value,
+ Class<? extends String> targetType, Locale locale)
+ throws ConversionException {
+ if (value == null) {
+ return null;
+ }
+
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+ for (Entry<String, String> entry : getProperties()) {
+ if (functionTypingAPI.getFunctionConverterTypeName()
+ .equalsIgnoreCase(entry.getKey())) {
+ return handleToPresentationFormat(entry.getValue()+".valueToPresentationConverter", value,
+ locale, yConverter.getBaseUnit());
+ }
+ }
+ return getToPresentationFormat(locale).format(value);
+ }
+
+// @Override
+// public String convertToPresentationOld(Double value,
+// Class<? extends String> targetType, Locale locale)
+// throws ConversionException {
+// if (value == null) {
+// return null;
+// }
+
+// FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+// for (Entry<String, String> entry : getProperties()) {
+// if (functionTypingAPI.getFunctionBaseUnitTypeName().equals(
+// entry.getKey())) {
+// yConverter.setBaseUnit(entry.getValue());
+// }
+// }
+// for (Entry<String, String> entry : getProperties()) {
+// if (functionTypingAPI.getFunctionToPresentationFormatTypeName()
+// .equals(entry.getKey())) {
+// value = handleToPresentationFormatOld(entry.getValue(), value,
+// locale, yConverter.getBaseUnit());
+// }
+// }
+// return getToPresentationFormat(locale).format(value);
+// }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.StringToDoubleConverter#convertToModel(java.lang.String, java.lang.Class, java.util.Locale)
+ */
+@Override
+ public Double convertToModel(String value,
+ Class<? extends Double> targetType, Locale locale)
+ throws ConversionException {
+ Number n = null;
+ String suffix = "";
+ if (value != null){
+ try {
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+ if (locale != null){
+ DecimalFormatSymbols newSymbols = new DecimalFormatSymbols(locale);
+ defaultDecimalFormat.setDecimalFormatSymbols(newSymbols);
+ }
+ MeasurementValue measure = splitValue(value);
+ if(measure != null) {
+ n = defaultDecimalFormat.parse(measure.getValue());
+ suffix = measure.getUnit();
+ } else {
+ n = 0;
+ }
+
+ // Double dbl = new Double(n.doubleValue());
+ // String dblStr = defaultDecimalFormat.format(dbl);
+ // int idx = dblStr.toString().length();
+ // String suffix = value.substring(idx).trim();
+ // for (Entry<String, String> entry : getProperties()) {
+ // if (functionTypingAPI.getFunctionBaseUnitTypeName().equals(
+ // entry.getKey())) {
+ // yConverter.setBaseUnit(entry.getValue());
+ // }
+ // }
+ for (Entry<String, String> entry : getProperties()) {
+ if (functionTypingAPI.getFunctionConverterTypeName()
+ .equalsIgnoreCase(entry.getKey())) {
+ n = handleToModelFormat(entry.getValue()+".valueToModelConverter", n.doubleValue(),
+ locale, yConverter.getBaseUnit(), suffix);
+ }
+ }
+ } catch (ParseException e) {
+ return null;
+ }
+ }
+ return n == null ? null : n.doubleValue();
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public EMap<String, String> getProperties() {
+ if (yConverter != null) {
+ return yConverter.getProperties();
+ }
+ return new BasicEMap<String, String>();
+ }
+
+ /**
+ * Gets the to presentation format.
+ *
+ * @param locale
+ * the locale
+ * @return the to presentation format
+ */
+ // @Override
+ protected NumberFormat getToPresentationFormat(Locale locale) {
+ if (convertedDecimalFormat != null) {
+ return convertedDecimalFormat;
+ } else {
+ return super.getFormat(locale);
+ }
+ }
+
+ /**
+ * Handle to presentation format.
+ *
+ * @param functionFqn
+ * the function fqn
+ * @param value
+ * the value
+ * @param locale
+ * the locale
+ * @param baseUnit
+ * the base unit
+ * @return the string
+ */
+ // Helper Methods
+ private String handleToPresentationFormat(String functionFqn, Double value,
+ Locale locale, String baseUnit) {
+ FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+ try {
+ if (locale != null) {
+ IFunctionLibraryService service = registry
+ .getService(IFunctionLibraryService.class.getName());
+ if (service == null) {
+ LOGGER.error("No IFunctionLibraryService available");
+ return getAmountOutput(new BaseAmount<Dimensionless>(value, DimensionlessUnit.NOSYMBOL), locale);
+ }
+
+ BaseAmount<?> callResult = (BaseAmount<?>) service
+ .callFunctionLibrary(wrapper.getClassName(),
+ wrapper.getMethodName(), value, locale,
+ baseUnit);
+ if (callResult!=null){
+ return getAmountOutput(callResult, locale);
+ } else {
+ // TODO (JCD): Translation
+ LOGGER.error("The called converter function call '" + functionFqn
+ + "' is not defined. Please define the required function in your Functionlibrary DSL instance!");
+ }
+ }
+ } catch (ClassCastException ex) {
+ // TODO (JCD): Translation
+ LOGGER.error("Return type of the function call '" + functionFqn
+ + "' is not a "
+ + BaseAmount.class.getSimpleName() + "!");
+ }
+ return getAmountOutput(new BaseAmount<Dimensionless>(value, DimensionlessUnit.NOSYMBOL), locale);
+ }
+
+ /**
+ * Gets the amount output.
+ *
+ * @param amount
+ * the amount
+ * @param locale
+ * the locale
+ * @return the amount output
+ */
+ private String getAmountOutput(BaseAmount<?> amount, Locale locale) {
+ LocalUnitFormatImpl localUnitFormat = LocalUnitFormatImpl.getInstance();
+ if (locale!=null){
+ localUnitFormat = LocalUnitFormatImpl.getInstance(locale);
+ }
+ // as you can't use icu for compatibilty reasons, this functions are used - instead of getUnit()
+ String convertedUnit = localUnitFormat.format(amount.unit());
+ // as you can't use icu for compatibilty reasons, this functions are used - instead of getNumber()
+ String convertedNumber = getToPresentationFormat(locale).format(amount.value());
+ StringBuffer strBuf = new StringBuffer(convertedNumber).append(" ").append(convertedUnit);
+ return strBuf.toString();
+ }
+
+// /**
+// * Handle to presentation format old.
+// *
+// * @param functionFqn
+// * the function fqn
+// * @param value
+// * the value
+// * @param locale
+// * the locale
+// * @param baseUnit
+// * the base unit
+// * @return the double
+// */
+// private Double handleToPresentationFormatOld(String functionFqn, Double value,
+// Locale locale, String baseUnit) {
+// FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+// try {
+// if (locale != null) {
+// IFunctionLibraryService service = registry
+// .getService(IFunctionLibraryService.class.getName());
+// if (service == null) {
+// LOGGER.error("No IFunctionLibraryService available");
+// // TODO
+// return value;
+// }
+//
+// TempDecimalFormatWrapper callResult = (TempDecimalFormatWrapper) service
+// .callFunctionLibrary(wrapper.getClassName(),
+// wrapper.getMethodName(), value, locale,
+// baseUnit);
+// if (callResult!=null){
+// setConvertedDecimalFormat(callResult.getFormat());
+// return callResult.getValue();
+// } else {
+// // TODO (JCD): Translation
+// LOGGER.error("The called converter function call '" + functionFqn
+// + "' is not defined. Please define the required function in your Functionlibrary DSL instance!");
+// }
+// }
+// } catch (ClassCastException ex) {
+// // TODO (JCD): Translation
+// LOGGER.error("Return type of the function call '" + functionFqn
+// + "' is not a "
+// + TempDecimalFormatWrapper.class.getSimpleName() + "!");
+// }
+// return value;
+// }
+
+ /**
+ * Handle to model format.
+ *
+ * @param functionFqn
+ * the function fqn
+ * @param value
+ * the value
+ * @param locale
+ * the locale
+ * @param baseSuffix
+ * the base suffix
+ * @param suffix
+ * the suffix
+ * @return the double
+ */
+ private Double handleToModelFormat(String functionFqn, Double value,
+ Locale locale, String baseSuffix, String suffix) {
+ FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+ try {
+ if (locale != null) {
+ IFunctionLibraryService service = registry
+ .getService(IFunctionLibraryService.class.getName());
+ if (service == null) {
+ LOGGER.error("No IFunctionLibraryService available");
+ // TODO
+ return value;
+ }
+ Double callResult = (Double) service.callFunctionLibrary(
+ wrapper.getClassName(), wrapper.getMethodName(), value,
+ locale, baseSuffix, suffix);
+ return callResult;
+ }
+ } catch (ClassCastException ex) {
+ // TODO (JCD): Translation
+ LOGGER.error("Return type of the function call '" + functionFqn
+ + "' is not a " + Double.class.getSimpleName() + "!");
+ }
+ return value;
+ }
+
+ /**
+ * Split value.
+ *
+ * @param value
+ * the value
+ * @return the measurement value
+ */
+ private MeasurementValue splitValue(String value){
+ Pattern p = Pattern.compile("\\d+([.,]\\d+)?");
+ char groupSeparator = defaultDecimalFormat.getDecimalFormatSymbols().getGroupingSeparator();
+ value = value.replace(String.valueOf(groupSeparator), "");
+ Matcher m = p.matcher(value);
+ if (m.find()) {
+ String unit = value.replace(value.substring(m.start(), m.end()),"").trim();
+ MeasurementValue measure = new MeasurementValue(m.group(), unit);
+ return measure;
+ }
+ return null;
+ }
+
+ /**
+ * Sets the converted decimal format.
+ *
+ * @param decimalFormat
+ * the new converted decimal format
+ */
+ public void setConvertedDecimalFormat(DecimalFormat decimalFormat) {
+ this.convertedDecimalFormat = decimalFormat;
+ }
+
+ /**
+ * The Class MeasurementValue.
+ */
+ // Helper Inner Class
+ class MeasurementValue {
+
+ /** The value. */
+ String value;
+
+ /** The unit. */
+ String unit;
+
+ /**
+ * Instantiates a new measurement value.
+ *
+ * @param value
+ * the value
+ * @param unit
+ * the unit
+ */
+ public MeasurementValue(String value, String unit) {
+ super();
+ this.value = value;
+ this.unit = unit;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the unit.
+ *
+ * @return the unit
+ */
+ public String getUnit() {
+ return unit;
+ }
+
+ /**
+ * Sets the unit.
+ *
+ * @param unit
+ * the new unit
+ */
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalFloatConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalFloatConverter.java
new file mode 100644
index 0000000..98221ce
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalFloatConverter.java
@@ -0,0 +1,257 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+import com.vaadin.data.util.converter.StringToFloatConverter;
+
+/**
+ * A converter used to format and parse Decimal values.
+ */
+@SuppressWarnings("serial")
+public class DecimalFloatConverter extends StringToFloatConverter {
+
+ /** The integer instance. */
+ private boolean integerInstance;
+
+ /** The number format pattern. */
+ private String numberFormatPattern;
+
+ /** The use grouping. */
+ private boolean useGrouping;
+
+ /** The decimal format symbols. */
+ private DecimalFormatSymbols decimalFormatSymbols;
+
+ /** The custom format symbols. */
+ private boolean customFormatSymbols;
+
+ /** The precision. */
+ private int precision;
+
+ /**
+ * Instantiates a new decimal float converter.
+ */
+ public DecimalFloatConverter() {
+ this(false);
+ }
+
+ /**
+ * Instantiates a new decimal float converter.
+ *
+ * @param integerInstance
+ * the integer instance
+ */
+ public DecimalFloatConverter(boolean integerInstance) {
+ this.integerInstance = integerInstance;
+ this.numberFormatPattern = getDefaultFormat();
+ this.decimalFormatSymbols = getDefaultFormatSymbols();
+ this.precision = getDefaultPrecision();
+ this.useGrouping = getDefaultUseGrouping();
+ }
+
+ /**
+ * Returns the default value for use grouping.
+ *
+ * @return the default use grouping
+ */
+ protected boolean getDefaultUseGrouping() {
+ return true;
+ }
+
+ /**
+ * Returns the default value for precision.
+ *
+ * @return the default precision
+ */
+ protected int getDefaultPrecision() {
+ return 2;
+ }
+
+ /**
+ * Returns the default value for format symbols.
+ *
+ * @return the default format symbols
+ */
+ protected DecimalFormatSymbols getDefaultFormatSymbols() {
+ return new DecimalFormatSymbols();
+ }
+
+ /**
+ * Returns the default value for default format.
+ *
+ * @return the default format
+ */
+ protected String getDefaultFormat() {
+ return "##,##0.00";
+ }
+
+ /**
+ * Sets the number format pattern that should be used to format the number.
+ *
+ * @param numberFormatPattern
+ * the numberFormatPattern to set
+ */
+ protected void setNumberFormatPattern(String numberFormatPattern) {
+ this.numberFormatPattern = numberFormatPattern;
+ }
+
+ /**
+ * Sets the {@link DecimalFormatSymbols} that should be used by the
+ * formatter.
+ *
+ * @param decimalFormatSymbols
+ * the decimalFormatSymbols to set
+ */
+ public void setDecimalFormatSymbols(
+ DecimalFormatSymbols decimalFormatSymbols) {
+ this.decimalFormatSymbols = decimalFormatSymbols;
+
+ if (decimalFormatSymbols != null) {
+ customFormatSymbols = true;
+ } else {
+ customFormatSymbols = false;
+ }
+ }
+
+ /**
+ * Returns the currently used number format pattern.
+ *
+ * @return the number format pattern
+ */
+ public String getNumberFormatPattern() {
+ return numberFormatPattern;
+ }
+
+ /**
+ * Returns the currently used format symbols.
+ *
+ * @return the decimal format symbols
+ */
+ public DecimalFormatSymbols getDecimalFormatSymbols() {
+ return decimalFormatSymbols;
+ }
+
+ /**
+ * If true, then grouping should be used. False otherwise. Default is true.
+ *
+ * @return true, if is use grouping
+ */
+ public boolean isUseGrouping() {
+ return useGrouping;
+ }
+
+ /**
+ * If true, then grouping should be used. False otherwise. Default is true.
+ *
+ * @param useGrouping
+ * the new use grouping
+ */
+ public void setUseGrouping(boolean useGrouping) {
+ this.useGrouping = useGrouping;
+ }
+
+ /**
+ * Returns the precision of that decimal field.
+ *
+ * @return the precision
+ */
+ public int getPrecision() {
+ return precision;
+ }
+
+ /**
+ * Sets the precision of that decimal field.
+ *
+ * @param precision
+ * the new precision
+ */
+ public void setPrecision(int precision) {
+ this.precision = precision;
+
+ updateNumberFormat();
+ }
+
+ /**
+ * Sets the number format pattern to be used for formatting.
+ */
+ protected void updateNumberFormat() {
+ String format = "##,##0";
+
+ if (precision > 0) {
+ format = format.concat(".");
+ }
+ for (int i = 0; i < precision; i++) {
+ format = format.concat("0");
+ }
+
+ setNumberFormatPattern(format);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.data.util.converter.AbstractStringToNumberConverter#getFormat
+ * (java.util.Locale)
+ */
+ protected NumberFormat getFormat(Locale locale) {
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+
+ NumberFormat result = null;
+ if (numberFormatPattern != null && !numberFormatPattern.equals("")) {
+ try {
+ if (decimalFormatSymbols != null && customFormatSymbols) {
+ result = new DecimalFormat(
+ StringEscapeUtils.unescapeHtml(numberFormatPattern),
+ decimalFormatSymbols);
+ } else {
+ result = new DecimalFormat(
+ StringEscapeUtils.unescapeHtml(numberFormatPattern),
+ DecimalFormatSymbols.getInstance(locale));
+ }
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ numberFormatPattern, e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+
+ if (integerInstance) {
+ result.setParseIntegerOnly(true);
+ result.setRoundingMode(RoundingMode.HALF_EVEN);
+ }
+ } else {
+ if (integerInstance) {
+ result = NumberFormat.getIntegerInstance(locale);
+ } else {
+ result = NumberFormat.getNumberInstance(locale);
+ }
+ }
+
+ result.setGroupingUsed(useGrouping);
+
+ return result;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalToUomoConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalToUomoConverter.java
new file mode 100644
index 0000000..174cf94
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/DecimalToUomoConverter.java
@@ -0,0 +1,119 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YDecimalToUomoConverter;
+import org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter;
+
+//import org.eclipse.osbp.runtime.web.vaadin.components.converter.NumbericConverter;
+
+/**
+ * The Class DecimalToUomoConverter.
+ */
+@SuppressWarnings("serial")
+public class DecimalToUomoConverter extends DecimalConverter {
+ // public class NumericToUomoConverter implements Converter<String, Number>
+ // {
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /** The cx converter. */
+ private YDecimalToUomoConverter cxConverter;
+
+ /**
+ * Instantiates a new decimal to uomo converter.
+ *
+ * @param registry
+ * the registry
+ * @param cxConverter
+ * the cx converter
+ */
+ public DecimalToUomoConverter(IServiceRegistry registry,
+ YDecimalToUomoConverter cxConverter) {
+ this.registry = registry;
+ this.cxConverter = cxConverter;
+ }
+
+ // @Override
+ // public Double convertToModel(String value,
+ // Class<? extends Double> targetType, Locale locale)
+ // throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // return super.convertToModel(value.replace(" cm", ""), targetType,
+ // locale);
+ // }
+ //
+ // @Override
+ // public String convertToPresentation(Double value,
+ // Class<? extends String> targetType, Locale locale)
+ // throws com.vaadin.data.util.converter.Converter.ConversionException {
+ //
+ // // for (YStringToResourceConfig config : cxConverter.getConfigs()) {
+ // // if (isMatch(value, config)) {
+ // // IResourceProvider provider = registry
+ // // .getService(IResourceProvider.class.getName());
+ // // return provider.getResource(config.getResourceURL());
+ // // }
+ // // }
+ //
+ // return super.convertToPresentation(value, targetType, locale) + " cm";
+ //
+ // }
+
+ // /**
+ // * Returns the default value for default format.
+ // *
+ // * @return
+ // */
+ // protected String getDefaultFormat() {
+ // return "##,## cm";
+ // }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter
+ * #getFormat(java.util.Locale)
+ */
+ //
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ DecimalFormat result;
+ try {
+ if (Locale.GERMANY.equals(locale)) {
+ result = new DecimalFormat(StringEscapeUtils.unescapeHtml(super.getNumberFormatPattern()
+ + " cm"),
+ DecimalFormatSymbols.getInstance(Locale.GERMAN));
+ } else {
+ result = new DecimalFormat(StringEscapeUtils.unescapeHtml(super.getNumberFormatPattern()
+ + " ft"), DecimalFormatSymbols.getInstance(Locale.US));
+ }
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ super.getNumberFormatPattern(), e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+
+ return result;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToResourceConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToResourceConverter.java
new file mode 100644
index 0000000..37a7fd7
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToResourceConverter.java
@@ -0,0 +1,148 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToResourceConfig;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToResourceConverter;
+import org.eclipse.osbp.runtime.web.vaadin.common.resource.IResourceProvider;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+
+/**
+ * The Class NumericToResourceConverter.
+ */
+@SuppressWarnings("serial")
+public class NumericToResourceConverter implements Converter<Resource, Number> {
+
+ /** The cx converter. */
+ private YNumericToResourceConverter cxConverter;
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /**
+ * Instantiates a new numeric to resource converter.
+ *
+ * @param registry
+ * the registry
+ * @param cxConverter
+ * the cx converter
+ */
+ public NumericToResourceConverter(IServiceRegistry registry,
+ YNumericToResourceConverter cxConverter) {
+ this.registry = registry;
+ this.cxConverter = cxConverter;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Number convertToModel(Resource value,
+ Class<? extends Number> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ throw new com.vaadin.data.util.converter.Converter.ConversionException(
+ "NumericToResourceConverter is readonly!");
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Resource convertToPresentation(Number value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ IResourceProvider provider = registry
+ .getService(IResourceProvider.class.getName());
+
+ for (YNumericToResourceConfig config : cxConverter.getConfigs()) {
+ if (isMatch(value, config)) {
+ if (isValid(config.getResourceThemePath())) {
+ if (provider != null) {
+ return provider.getResource(config
+ .getResourceThemePath());
+ }
+ }
+
+ throw new IllegalStateException("No image defined for "
+ + config);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks if is valid.
+ *
+ * @param iconKey
+ * the icon key
+ * @return true, if is valid
+ */
+ private boolean isValid(String iconKey) {
+ return iconKey != null && !iconKey.equals("");
+ }
+
+ /**
+ * Checks if is match.
+ *
+ * @param value
+ * the value
+ * @param config
+ * the config
+ * @return true, if is match
+ */
+ protected boolean isMatch(Number value, YNumericToResourceConfig config) {
+ double ref = config.getValue();
+ double val = value.doubleValue();
+
+ switch (config.getCompare()) {
+ case EQUAL:
+ return val == ref;
+ case GREATER_EQUAL:
+ return val >= ref;
+ case GREATER_THAN:
+ return val > ref;
+ case LOWER_EQUAL:
+ return val <= ref;
+ case LOWER_THAN:
+ return val < ref;
+ case NOT_EQUAL:
+ return val != ref;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<Number> getModelType() {
+ return Number.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToUomoConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToUomoConverter.java
new file mode 100644
index 0000000..671a279
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/NumericToUomoConverter.java
@@ -0,0 +1,119 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YNumericToUomoConverter;
+import org.eclipse.osbp.runtime.web.vaadin.components.converter.NumberConverter;
+
+//import org.eclipse.osbp.runtime.web.vaadin.components.converter.NumbericConverter;
+
+/**
+ * The Class NumericToUomoConverter.
+ */
+@SuppressWarnings("serial")
+public class NumericToUomoConverter extends NumberConverter {
+ // public class NumericToUomoConverter implements Converter<String, Number>
+ // {
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /** The y converter. */
+ private YNumericToUomoConverter yConverter;
+
+ /**
+ * Instantiates a new numeric to uomo converter.
+ *
+ * @param registry
+ * the registry
+ * @param yConverter
+ * the y converter
+ */
+ public NumericToUomoConverter(IServiceRegistry registry,
+ YNumericToUomoConverter yConverter) {
+ this.registry = registry;
+ this.yConverter = yConverter;
+ }
+
+ // // @Override
+ // // public Double convertToModel(String value,
+ // // Class<? extends Double> targetType, Locale locale)
+ // // throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // // return super.convertToModel(value.replace(" cm", ""), targetType,
+ // locale);
+ // // }
+ // //
+ // @Override
+ // public String convertToPresentation(Double value,
+ // Class<? extends String> targetType, Locale locale)
+ // throws com.vaadin.data.util.converter.Converter.ConversionException {
+ //
+ // // for (YStringToResourceConfig config : yConverter.getConfigs()) {
+ // // if (isMatch(value, config)) {
+ // // IResourceProvider provider = registry
+ // // .getService(IResourceProvider.class.getName());
+ // // return provider.getResource(config.getResourceURL());
+ // // }
+ // // }
+ //
+ // return super.convertToPresentation(value, targetType, locale) + " cm";
+ //
+ // }
+
+ // /**
+ // * Returns the default value for default format.
+ // *
+ // * @return
+ // */
+ // protected String getDefaultFormat() {
+ // return "##,## cm";
+ // }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.web.vaadin.components.converter.NumberConverter
+ * #getFormat(java.util.Locale)
+ */
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ DecimalFormat result;
+ try {
+ if (Locale.GERMANY.equals(locale)) {
+ result = new DecimalFormat(StringEscapeUtils.unescapeHtml(super.getNumberFormatPattern()
+ + " cm"),
+ DecimalFormatSymbols.getInstance(Locale.GERMAN));
+ } else {
+ result = new DecimalFormat(StringEscapeUtils.unescapeHtml(super.getNumberFormatPattern()
+ + " ft"), DecimalFormatSymbols.getInstance(Locale.US));
+ }
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ super.getNumberFormatPattern(), e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+
+ return result;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ObjectToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ObjectToStringConverter.java
new file mode 100644
index 0000000..24b9b8d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/ObjectToStringConverter.java
@@ -0,0 +1,62 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+
+/**
+ * The Class ObjectToStringConverter.
+ */
+@SuppressWarnings("serial")
+public class ObjectToStringConverter implements Converter<String, Object> {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Object convertToModel(String value,
+ Class<? extends Object> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToPresentation(Object value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return (value!=null)?value.toString():"";
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<Object> getModelType() {
+ return Object.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/PriceToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/PriceToStringConverter.java
new file mode 100644
index 0000000..a3c7881
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/PriceToStringConverter.java
@@ -0,0 +1,68 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.extension.model.converter.YPriceToStringConverter;
+
+import com.vaadin.data.util.converter.Converter;
+
+/**
+ * The Class PriceToStringConverter.
+ */
+// TODO DOM --> See QuantityToStringConverter
+@SuppressWarnings("serial")
+public class PriceToStringConverter implements Converter<String, Object> {
+
+ /** The cx converter. */
+ private YPriceToStringConverter cxConverter;
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Object convertToModel(String value,
+ Class<? extends Object> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToPresentation(Object value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<Object> getModelType() {
+ return Object.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/QuantityToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/QuantityToStringConverter.java
new file mode 100644
index 0000000..4e259ee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/QuantityToStringConverter.java
@@ -0,0 +1,362 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.ParseException;
+import java.util.Collections;
+import java.util.Locale;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.beans.IBeanValueProperty;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.extension.model.converter.YQuantityToStringConverter;
+import org.eclipse.osbp.runtime.common.types.ITypeProviderService;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchService;
+import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.Container.Filter;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.filter.Compare;
+
+/**
+ * This converter converters values from a "quantity object" (model) to a String
+ * (presentation) and back to a quantity object.
+ * <p>
+ * Therefore it uses following logic:<br>
+ * The <code>model value</code> is an object containing the value as a numeric
+ * value and the uom (UnitOfMeasure). Value and uom may be nested properties.
+ * <h3>Access path</h3>
+ * The YQuantityToStringConverter contains three "access path". An "access path"
+ * is a property path with dot-notation like "uom.isoCode". To access the values
+ * inside the given object, reflection needs to be used.
+ * <p>
+ * Sample with mappings to the YQuantityToStringConverter:
+ *
+ * <pre>
+ * /**
+ * /**
+ * /**
+ * }
+ *
+ * class Uom {
+ * /**
+ * String name;
+ * ...
+ * }
+ * </pre>
+ *
+ * The Quantity bean is the model value. To access the values following
+ * accessPath in the YQuantityToStringConverter needs to be used:<br>
+ * -> for value: <code>value</code> --> converter#amountPropertyPath<br>
+ * -> for uom-Object: <code>uom</code> --> converter#uomPropertyPath<br>
+ * -> for uomCode: <code>uom.iso3Code</code> --> converter#uomPropertyPath + "."
+ * + converter#uomCodeRelativePropertyPath<br>
+ * By reflection the values can become accessed.
+ *
+ * <h3>Convert To Presentation</h3> For the convert to presentation
+ * implementation, a number format pattern is used. The uom-String-value is
+ * added to the number format pattern as a constant. <br>
+ * <br>
+ * The result may look like: <code>1.200,23 kg</code>
+ *
+ * <h3>Convert To Model</h3> For the convert to model implementation, the given
+ * presentation-String needs to become parsed. And a new Object of type
+ * "model value" needs to be created. The type of the instance, is also
+ * contained in the YQuantityToStringConverter object. See
+ * {@link YQuantityToStringConverter#getQuantityTypeQualifiedName()}. To get a
+ * class based on the FQN use the {@link ITypeProviderService}.<br>
+ * The UOM needs to be converted to a valid UOM-object. Therefore use the
+ * {@link IBeanSearchService}.
+ *
+ * <h3>Unsupported UOMs</h3> To ensure, that only valid UOMs are being entered
+ * in the UI, an additional Validator needs to be implemented. It validates,
+ * that the entered UOM is valid. To query about valid UOMs, the
+ * BeanSearchService is available. See {@link IBeanSearchService}.
+ *
+ * <h3>Usage</h3> You may use this converter, to bind a Quantity-Dto to a
+ * TextField.
+ *
+ */
+@SuppressWarnings("serial")
+public class QuantityToStringConverter implements Converter<String, Object> {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(QuantityToStringConverter.class);
+
+ /** The Constant NUMBER_FORMAT_PATTERN. */
+ private static final String NUMBER_FORMAT_PATTERN = "##,##0.00 {$uom}";
+
+ /** The cx converter. */
+ private final YQuantityToStringConverter cxConverter;
+
+ /** The bean search service. */
+ private IBeanSearchService<Object> beanSearchService;
+
+ /** The quantity type. */
+ private final Class<?> quantityType;
+
+ /**
+ * Instantiates a new quantity to string converter.
+ *
+ * @param context
+ * the context
+ * @param cxConverter
+ * the cx converter
+ */
+ @SuppressWarnings("unchecked")
+ public QuantityToStringConverter(IViewContext context,
+ YQuantityToStringConverter cxConverter) {
+ super();
+ this.cxConverter = cxConverter;
+
+ ITypeProviderService typeService = context
+ .getService(ITypeProviderService.class.getName());
+ quantityType = typeService.forName(null,
+ cxConverter.getQuantityTypeQualifiedName());
+
+ // use the BeanProperties to find the UnitOfMeasure by its code
+ IBeanValueProperty prop = BeanProperties.value(quantityType,
+ cxConverter.getUomPropertyPath());
+ IBeanSearchServiceFactory factory = context
+ .getService(IBeanSearchServiceFactory.class.getName());
+ if (factory != null) {
+ beanSearchService = factory.createService((Class<Object>) prop
+ .getValueType());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object,
+ * java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Object convertToModel(String valueString,
+ Class<? extends Object> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ try {
+ // parse amount and uom from the given user input
+ Number amount = parseAmount(valueString);
+ Object uom = parseUom(valueString);
+
+ // set amount and uom to the new quantity object
+ Object quantity = quantityType.newInstance();
+ applyAmount(quantity, amount);
+ applyUom(quantity, uom);
+
+ return quantity;
+ } catch (InstantiationException | IllegalAccessException
+ | InvocationTargetException | ParseException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ return null;
+ }
+ }
+
+ /**
+ * Sets the uom into the quantity object.
+ *
+ * @param quantity
+ * the quantity
+ * @param uom
+ * the uom
+ * @throws IllegalAccessException
+ * the illegal access exception
+ * @throws InvocationTargetException
+ * the invocation target exception
+ * @throws NoSuchMethodException
+ * the no such method exception
+ */
+ private void applyUom(Object quantity, Object uom)
+ throws IllegalAccessException, InvocationTargetException,
+ NoSuchMethodException {
+ PropertyUtils.setNestedProperty(quantity,
+ cxConverter.getUomPropertyPath(), uom);
+ }
+
+ /**
+ * Sets the amount into the quantity object.
+ *
+ * @param quantity
+ * the quantity
+ * @param amount
+ * the amount
+ * @throws IllegalAccessException
+ * the illegal access exception
+ * @throws InvocationTargetException
+ * the invocation target exception
+ * @throws NoSuchMethodException
+ * the no such method exception
+ */
+ private void applyAmount(Object quantity, Number amount)
+ throws IllegalAccessException, InvocationTargetException,
+ NoSuchMethodException {
+ PropertyUtils.setNestedProperty(quantity,
+ cxConverter.getAmountPropertyPath(), amount);
+ }
+
+ /**
+ * Parses the amount part from the given value String.<br>
+ * "1200.98 kg" -> "1200.98"
+ *
+ * @param valueString
+ * the value string
+ * @return the number
+ * @throws ParseException
+ * the parse exception
+ */
+ private Number parseAmount(String valueString) throws ParseException {
+ // TODO DOM - enhance with a better split criteria
+ String[] tokens = valueString.trim().split(" ");
+ String amountString = tokens.length == 2 ? tokens[0] : "";
+ return new DecimalFormat().parse(amountString);
+ }
+
+ /**
+ * Parses the uom part from the given value String and creates a UOM Object.<br>
+ * "1200.98 kg" -> "kg" -> Object{kg}
+ *
+ * @param valueString
+ * the value string
+ * @return the object
+ */
+ private Object parseUom(String valueString) {
+ // TODO DOM - enhance with a better split criteria
+ String[] tokens = valueString.trim().split(" ");
+ String uomCode = tokens.length == 2 ? tokens[1] : "";
+ return getUOMForCode(uomCode);
+ }
+
+ /**
+ * Returns the unit of measure for the given uomCode or <code>null</code> if
+ * no uom could be found.
+ *
+ * @param uomCode
+ * the uom code
+ * @return the UOM for code
+ */
+ private Object getUOMForCode(String uomCode) {
+ // create a filter based on the relative property path that should be
+ // used to show the value
+ Filter filter = new Compare.Equal(
+ cxConverter.getUomCodeRelativePropertyPath(), uomCode);
+ return beanSearchService.getFirstBean(
+ Collections.singletonList(filter), null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang
+ * .Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToPresentation(Object value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ try {
+ String pattern = NUMBER_FORMAT_PATTERN;
+ pattern = pattern.replace("{$uom}", getUomCode(value));
+ try {
+ DecimalFormat format = new DecimalFormat(StringEscapeUtils.unescapeHtml(pattern), new DecimalFormatSymbols(locale));
+ return format.format(getAmount(value));
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ pattern, e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ return "Error";
+ }
+ }
+
+ /**
+ * Returns the amount value based on the AmountPropertyPath.
+ *
+ * @param value
+ * the value
+ * @return the amount
+ * @throws IllegalAccessException
+ * the illegal access exception
+ * @throws InvocationTargetException
+ * the invocation target exception
+ * @throws NoSuchMethodException
+ * the no such method exception
+ */
+ private Object getAmount(Object value) throws IllegalAccessException,
+ InvocationTargetException, NoSuchMethodException {
+ return PropertyUtils.getNestedProperty(value,
+ cxConverter.getAmountPropertyPath());
+ }
+
+ /**
+ * Returns the amount value based on the UomPropertyPath.
+ *
+ * @param value
+ * the value
+ * @return the uom code
+ * @throws IllegalAccessException
+ * the illegal access exception
+ * @throws InvocationTargetException
+ * the invocation target exception
+ * @throws NoSuchMethodException
+ * the no such method exception
+ */
+ private String getUomCode(Object value) throws IllegalAccessException,
+ InvocationTargetException, NoSuchMethodException {
+ // concat the uomPath and the uomCodePath to directly access the uom
+ // code.
+ return (String) PropertyUtils.getNestedProperty(
+ value,
+ cxConverter.getUomPropertyPath() + "."
+ + cxConverter.getUomCodeRelativePropertyPath());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<Object> getModelType() {
+ return Object.class;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/SimpleDecimalConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/SimpleDecimalConverter.java
new file mode 100644
index 0000000..355f1ea
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/SimpleDecimalConverter.java
@@ -0,0 +1,88 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YSimpleDecimalConverter;
+import org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class SimpleDecimalConverter.
+ */
+@SuppressWarnings("serial")
+public class SimpleDecimalConverter extends DecimalConverter {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(SimpleDecimalConverter.class);
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /** The y converter. */
+ private YSimpleDecimalConverter yConverter;
+
+ /**
+ * Instantiates a new simple decimal converter.
+ *
+ * @param registry
+ * the registry
+ * @param yConverter
+ * the y converter
+ */
+ public SimpleDecimalConverter(IServiceRegistry registry,
+ YSimpleDecimalConverter yConverter) {
+ this.registry = registry;
+ this.yConverter = yConverter;
+ }
+
+ /**
+ * Instantiates a new simple decimal converter.
+ */
+ public SimpleDecimalConverter() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.osbp.runtime.web.vaadin.components.converter.DecimalConverter
+ * #getFormat(java.util.Locale)
+ */
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ DecimalFormat result;
+ try {
+ result = new DecimalFormat(StringEscapeUtils.unescapeHtml(yConverter.getNumberFormatPattern()),
+ DecimalFormatSymbols.getInstance(locale));
+ } catch (IllegalArgumentException e) {
+ String msg = String.format(
+ "formatter %s is invalid for decimal numbers: %s",
+ yConverter.getNumberFormatPattern(), e.getLocalizedMessage());
+ throw new ConversionException(msg);
+ }
+ return result;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/StringToResourceConverter.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/StringToResourceConverter.java
new file mode 100644
index 0000000..d26c762
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/converter/StringToResourceConverter.java
@@ -0,0 +1,148 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.ecview.extension.model.converter.YStringToResourceConfig;
+import org.eclipse.osbp.ecview.extension.model.converter.YStringToResourceConverter;
+import org.eclipse.osbp.runtime.web.vaadin.common.resource.IResourceProvider;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+
+/**
+ * The Class StringToResourceConverter.
+ */
+@SuppressWarnings("serial")
+public class StringToResourceConverter implements Converter<Resource, String> {
+
+ /** The registry. */
+ private IServiceRegistry registry;
+
+ /** The cx converter. */
+ private YStringToResourceConverter cxConverter;
+
+ /**
+ * Instantiates a new string to resource converter.
+ *
+ * @param registry
+ * the registry
+ * @param cxConverter
+ * the cx converter
+ */
+ public StringToResourceConverter(IServiceRegistry registry,
+ YStringToResourceConverter cxConverter) {
+ this.registry = registry;
+ this.cxConverter = cxConverter;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public String convertToModel(Resource value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ throw new com.vaadin.data.util.converter.Converter.ConversionException(
+ "StringToResourceConverter is readonly!");
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale)
+ */
+ @Override
+ public Resource convertToPresentation(String value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ IResourceProvider provider = registry
+ .getService(IResourceProvider.class.getName());
+
+ for (YStringToResourceConfig config : cxConverter.getConfigs()) {
+ if (isMatch(value, config)) {
+
+ if (isValid(config.getResourceThemePath())) {
+ if (provider != null) {
+ return provider.getResource(config
+ .getResourceThemePath());
+ }
+ }
+
+ throw new IllegalStateException("No image defined for "
+ + config);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Checks if is valid.
+ *
+ * @param iconKey
+ * the icon key
+ * @return true, if is valid
+ */
+ private boolean isValid(String iconKey) {
+ return iconKey != null && !iconKey.equals("");
+ }
+
+ /**
+ * Checks if is match.
+ *
+ * @param value
+ * the value
+ * @param config
+ * the config
+ * @return true, if is match
+ */
+ protected boolean isMatch(String value, YStringToResourceConfig config) {
+ String ref = config.getValue();
+
+ switch (config.getCompare()) {
+ case EQUAL:
+ return ref.equals(value);
+ case GREATER_EQUAL:
+ return ref.compareTo(value) >= 0;
+ case GREATER_THAN:
+ return ref.compareTo(value) > 0;
+ case LOWER_EQUAL:
+ return ref.compareTo(value) <= 0;
+ case LOWER_THAN:
+ return ref.compareTo(value) < 0;
+ case NOT_EQUAL:
+ return ref.compareTo(value) != 0;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getModelType()
+ */
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.data.util.converter.Converter#getPresentationType()
+ */
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/strategy/StrategyLayoutPresentation.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/strategy/StrategyLayoutPresentation.java
new file mode 100644
index 0000000..f93372b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/strategy/StrategyLayoutPresentation.java
@@ -0,0 +1,510 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.strategy;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.eclipse.osbp.ecview.core.common.editpart.IElementEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart;
+import org.eclipse.osbp.ecview.core.common.editpart.IKeyStrokeDefinitionEditpart;
+import org.eclipse.osbp.ecview.core.common.model.core.YAlignment;
+import org.eclipse.osbp.ecview.extension.editparts.IStrategyLayoutEditpart;
+import org.eclipse.osbp.ecview.extension.editparts.presentation.IStrategyLayoutPresentation;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeCallback;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.IConstants;
+import org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractEmbeddedWidgetPresenter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.event.ActionManager;
+import com.vaadin.event.ShortcutListener;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * This presenter is responsible to render a text field on the given layout.
+ */
+public class StrategyLayoutPresentation extends
+ AbstractEmbeddedWidgetPresenter<Panel> implements
+ IStrategyLayoutPresentation<Panel> {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(StrategyLayoutPresentation.class);
+
+ /** The root panel. */
+ private Panel rootPanel;
+
+ /** The root layout. */
+ private VerticalLayout rootLayout;
+
+ /** The model access. */
+ private ModelAccess modelAccess;
+
+ /** The content editpart. */
+ private IEmbeddableEditpart contentEditpart;
+
+ /** The callbacks. */
+ private Map<KeyStrokeCallback, ShortcutListener> callbacks;
+
+ /**
+ * The constructor.
+ *
+ * @param editpart
+ * The editpart of that editpart.
+ */
+ public StrategyLayoutPresentation(IElementEditpart editpart) {
+ super((IStrategyLayoutEditpart) editpart);
+ this.modelAccess = new ModelAccess(
+ (YStrategyLayout) editpart.getModel());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUpdateLocale(java.util.Locale)
+ */
+ @Override
+ protected void doUpdateLocale(Locale locale) {
+ // no need to set the locale to the ui elements. Is handled by vaadin
+ // internally.
+
+ // update the captions
+ applyCaptions();
+ }
+
+ /**
+ * Applies the labels to the widgets.
+ */
+ protected void applyCaptions() {
+ }
+
+ /**
+ * Is called to refresh the UI. The element will be removed from the layout
+ * and added to it again afterwards.
+ */
+ protected void refreshUI() {
+ rootLayout.removeAllComponents();
+
+ if (contentEditpart != null) {
+ Component contentComp = (Component) contentEditpart
+ .render(rootLayout);
+ rootLayout.addComponent(contentComp);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.presentation.IStrategyLayoutPresentation#registerKeyStroke(org.eclipse.osbp.ecview.core.common.editpart.IKeyStrokeDefinitionEditpart, org.eclipse.osbp.runtime.common.keystroke.KeyStrokeCallback)
+ */
+ @SuppressWarnings("serial")
+ @Override
+ public void registerKeyStroke(
+ IKeyStrokeDefinitionEditpart keyStrokeDefEditpart,
+ final KeyStrokeCallback callback) {
+
+ if (callbacks != null && callbacks.containsKey(callback)) {
+ return;
+ }
+
+ KeyStrokeDefinition def = keyStrokeDefEditpart.getDefinition();
+ ShortcutListener listener = new ShortcutListener(def.getCaption(),
+ def.getKeyCode(), def.getModifierKeys()) {
+ @Override
+ public void handleAction(Object sender, Object target) {
+ callback.callback(sender, target);
+ }
+ };
+
+ if (callbacks == null) {
+ callbacks = new HashMap<KeyStrokeCallback, ShortcutListener>();
+ }
+ callbacks.put(callback, listener);
+
+ if (isRendered()) {
+ // TODO change me later when bug is fixed
+ // visibility bug in Vaadin. 2 actionManager instances available
+ // for add and remove.
+ ActionManager manager = getActionManager();
+ manager.addAction(listener);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.presentation.IStrategyLayoutPresentation#unregisterKeyStroke(org.eclipse.osbp.runtime.common.keystroke.KeyStrokeCallback)
+ */
+ @Override
+ public void unregisterKeyStroke(KeyStrokeCallback callback) {
+ ShortcutListener listener = callbacks.remove(callback);
+ if (listener != null) {
+ if (callbacks != null) {
+ callbacks.remove(callback);
+ }
+ if (isRendered()) {
+ // TODO change me later when bug is fixed
+ // visibility bug in Vaadin. 2 actionManager instances available
+ // for add and remove.
+ ActionManager manager = getActionManager();
+ manager.removeAction(listener);
+ }
+ }
+ }
+
+ /**
+ * Temporary for Vaadin bug.
+ *
+ * @return the action manager
+ */
+ protected ActionManager getActionManager() {
+ ActionManager actionManager = null;
+ try {
+ Method m = AbstractComponent.class.getDeclaredMethod(
+ "getActionManager", new Class[0]);
+ if (!m.isAccessible()) {
+ m.setAccessible(true);
+ }
+ actionManager = (ActionManager) m.invoke(rootPanel, new Object[0]);
+ } catch (NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ } catch (IllegalAccessException e) {
+ LOGGER.error("{}", e);
+ } catch (InvocationTargetException e) {
+ LOGGER.error("{}", e); }
+ return actionManager;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doCreateWidget(java.lang.Object)
+ */
+ @Override
+ public Panel doCreateWidget(Object parent) {
+ if (rootPanel == null) {
+ rootPanel = new Panel();
+ rootLayout = new VerticalLayout();
+ rootPanel.setContent(rootLayout);
+ rootPanel.setSizeFull();
+ rootLayout.setSizeFull();
+ setupComponent(rootLayout, getCastedModel());
+
+ associateWidget(rootLayout, modelAccess.yLayout);
+
+ if (modelAccess.isCssIdValid()) {
+ rootLayout.setId(modelAccess.getCssID());
+ } else {
+ rootLayout.setId(getEditpart().getId());
+ }
+
+ if (modelAccess.isMargin()) {
+ rootLayout.addStyleName(IConstants.CSS_CLASS_MARGIN);
+ rootLayout.setMargin(true);
+ }
+
+ if (!modelAccess.isSpacing()) {
+ rootLayout.setSpacing(false);
+ } else {
+ rootLayout.addStyleName(IConstants.CSS_CLASS_SPACING);
+ rootLayout.setSpacing(true);
+ }
+
+ if (modelAccess.isCssClassValid()) {
+ rootLayout.addStyleName(modelAccess.getCssClass());
+ } else {
+ rootLayout.addStyleName(CSS_CLASS_CONTROL);
+ }
+ rootLayout.addStyleName(IConstants.CSS_CLASS_HORIZONTALLAYOUT);
+
+ // creates the binding for the field
+ createBindings(modelAccess.yLayout, rootLayout, null);
+
+ // activate callbacks
+ if (callbacks != null) {
+ ActionManager manager = getActionManager();
+ for (ShortcutListener listener : callbacks.values()) {
+ manager.addAction(listener);
+ }
+ }
+
+ // and now render children
+ renderChildren(false);
+ }
+
+ return rootPanel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.editparts.presentation.IStrategyLayoutPresentation#setContent(org.eclipse.osbp.ecview.core.common.editpart.IEmbeddableEditpart)
+ */
+ @Override
+ public void setContent(IEmbeddableEditpart contentEditpart) {
+ if (this.contentEditpart == contentEditpart) {
+ return;
+ }
+
+ if (this.contentEditpart != null) {
+ this.contentEditpart.requestUnrender();
+ }
+
+ this.contentEditpart = contentEditpart;
+
+ if (isRendered() && this.contentEditpart != null) {
+ refreshUI();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#getWidget()
+ */
+ @Override
+ public Panel getWidget() {
+ return rootPanel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.presentation.IWidgetPresentation#isRendered()
+ */
+ @Override
+ public boolean isRendered() {
+ return rootPanel != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#internalDispose()
+ */
+ @Override
+ protected void internalDispose() {
+ try {
+ unrender();
+
+ if (callbacks != null) {
+ callbacks.clear();
+ callbacks = null;
+ }
+ } finally {
+ super.internalDispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.ecview.presentation.vaadin.common.AbstractVaadinWidgetPresenter#doUnrender()
+ */
+ @Override
+ public void doUnrender() {
+ if (rootPanel != null) {
+
+ // unbind all active bindings
+ unbind();
+
+ // remove assocations
+ unassociateWidget(rootPanel);
+
+ // unrender the children
+ unrenderContent();
+
+ if (callbacks != null) {
+ ActionManager manager = getActionManager();
+ for (ShortcutListener listener : callbacks.values()) {
+ manager.removeAction(listener);
+ }
+ }
+
+ rootLayout.removeAllComponents();
+ rootPanel = null;
+ rootLayout = null;
+ }
+ }
+
+ /**
+ * Render children.
+ *
+ * @param force
+ * the force
+ */
+ public void renderChildren(boolean force) {
+ if (force) {
+ unrenderContent();
+ }
+
+ refreshUI();
+ }
+
+ /**
+ * Will unrender the content.
+ */
+ protected void unrenderContent() {
+ if (contentEditpart != null && contentEditpart.isRendered()) {
+ contentEditpart.requestUnrender();
+ }
+ }
+
+ /**
+ * An internal helper class.
+ */
+ private static class ModelAccess {
+
+ /** The y layout. */
+ private final YStrategyLayout yLayout;
+
+ /**
+ * Instantiates a new model access.
+ *
+ * @param yLayout
+ * the y layout
+ */
+ public ModelAccess(YStrategyLayout yLayout) {
+ super();
+ this.yLayout = yLayout;
+ }
+
+ /**
+ * Gets the css class.
+ *
+ * @return the css class
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssClass()
+ */
+ public String getCssClass() {
+ return yLayout.getCssClass();
+ }
+
+ /**
+ * Returns true, if the css class is not null and not empty.
+ *
+ * @return true, if is css class valid
+ */
+ public boolean isCssClassValid() {
+ return getCssClass() != null && !getCssClass().equals("");
+ }
+
+ /**
+ * Checks if is spacing.
+ *
+ * @return true, if is spacing
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.extension.YStrategyLayout#isSpacing()
+ */
+ public boolean isSpacing() {
+ return false;
+ }
+
+ /**
+ * Gets the css id.
+ *
+ * @return the css id
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.core.YCssAble#getCssID()
+ */
+ public String getCssID() {
+ return yLayout.getCssID();
+ }
+
+ /**
+ * Returns true, if the css id is not null and not empty.
+ *
+ * @return true, if is css id valid
+ */
+ public boolean isCssIdValid() {
+ return getCssID() != null && !getCssID().equals("");
+ }
+
+ /**
+ * Checks if is margin.
+ *
+ * @return true, if is margin
+ * @see org.eclipse.osbp.ecview.core.ui.core.model.extension.YStrategyLayout#isMargin()
+ */
+ public boolean isMargin() {
+ return false;
+ }
+ }
+
+ /**
+ * The Class Cell.
+ */
+ public static class Cell {
+
+ /** The component. */
+ private final Component component;
+
+ /** The alignment. */
+ private final YAlignment alignment;
+
+ /**
+ * Instantiates a new cell.
+ *
+ * @param component
+ * the component
+ * @param alignment
+ * the alignment
+ */
+ public Cell(Component component, YAlignment alignment) {
+ super();
+ this.component = component;
+ this.alignment = alignment;
+ }
+
+ /**
+ * Gets the component.
+ *
+ * @return the component
+ */
+ protected Component getComponent() {
+ return component;
+ }
+
+ /**
+ * Gets the alignment.
+ *
+ * @return the alignment
+ */
+ protected YAlignment getAlignment() {
+ return alignment;
+ }
+
+ /**
+ * Checks if is expand vertical.
+ *
+ * @return true, if is expand vertical
+ */
+ protected boolean isExpandVertical() {
+ switch (alignment) {
+ case FILL_CENTER:
+ case FILL_FILL:
+ case FILL_LEFT:
+ case FILL_RIGHT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Checks if is expand horizontal.
+ *
+ * @return true, if is expand horizontal
+ */
+ protected boolean isExpandHorizontal() {
+ switch (alignment) {
+ case BOTTOM_FILL:
+ case FILL_FILL:
+ case MIDDLE_FILL:
+ case TOP_FILL:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/utils/TempDecimalFormatWrapper.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/utils/TempDecimalFormatWrapper.java
new file mode 100644
index 0000000..06c6d89
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/presentation/vaadin/utils/TempDecimalFormatWrapper.java
@@ -0,0 +1,81 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.presentation.vaadin.utils;
+
+import java.text.DecimalFormat;
+
+/**
+ * The Class TempDecimalFormatWrapper.
+ */
+public class TempDecimalFormatWrapper {
+
+ /** The value. */
+ private Double value;
+
+ /** The format. */
+ private DecimalFormat format;
+
+ /**
+ * Instantiates a new temp decimal format wrapper.
+ *
+ * @param value
+ * the value
+ * @param format
+ * the format
+ */
+ public TempDecimalFormatWrapper(Double value, DecimalFormat format) {
+ super();
+ this.value = value;
+ this.format = format;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public Double getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value.
+ *
+ * @param value
+ * the new value
+ */
+ public void setValue(Double value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the format.
+ *
+ * @return the format
+ */
+ public DecimalFormat getFormat() {
+ return format;
+ }
+
+ /**
+ * Sets the format.
+ *
+ * @param format
+ * the new format
+ */
+ public void setFormat(DecimalFormat format) {
+ this.format = format;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java
new file mode 100644
index 0000000..1620cff
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/CustomDecimalField.java
@@ -0,0 +1,224 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.vaadin.components;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.inject.Inject;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.extension.presentation.vaadin.converter.CustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.vaadin.components.utils.FunctionWrapper;
+import org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField;
+import org.eclipse.osbp.ui.api.functionlibrary.IFunctionLibraryService;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A decimalfield specific price styling.
+ */
+@SuppressWarnings("serial")
+public class CustomDecimalField extends DecimalField {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(CustomDecimalField.class);
+
+ /** The view context. */
+ private final IViewContext viewContext;
+
+ /** The converter. */
+ private CustomDecimalConverter converter;
+
+ /** The context. */
+ @Inject
+ IEclipseContext context;
+
+ /**
+ * Instantiates a new custom decimal field.
+ */
+ public CustomDecimalField() {
+ this(null, null);
+ }
+
+ /**
+ * Instantiates a new custom decimal field.
+ *
+ * @param caption
+ * the caption
+ * @param viewContext
+ * the view context
+ */
+ public CustomDecimalField(String caption, IViewContext viewContext) {
+ this(caption, null, viewContext);
+ }
+
+ /**
+ * Instantiates a new custom decimal field.
+ *
+ * @param caption
+ * the caption
+ * @param converter
+ * the converter
+ * @param viewContext
+ * the view context
+ */
+ public CustomDecimalField(String caption, CustomDecimalConverter converter,
+ IViewContext viewContext) {
+ super(caption, converter);
+
+ this.viewContext = viewContext;
+
+ setNullRepresentation("");
+ setNullSettingAllowed(false);
+ }
+
+ /**
+ * Sets the converter.
+ *
+ * @param converter
+ * the new converter
+ */
+ public void setConverter(CustomDecimalConverter converter) {
+ this.converter = converter != null ? converter
+ : new CustomDecimalConverter();
+ super.setConverter(this.converter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.runtime.web.vaadin.components.fields.DecimalField#setInternalValue(java.lang.String)
+ */
+ protected void setInternalValue(String newValue) {
+ super.setInternalValue(newValue);
+ // TODO (JCD): Only temporary till Mr. Pirchner fixes the isModified
+ // bug.
+ getState().modified = true;
+ // --------
+
+ if (converter != null) {
+ callFunctions(converter.getProperties());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.AbstractField#setConvertedValue(java.lang.Object)
+ */
+ public void setConvertedValue(Object value) {
+ if (converter != null) {
+ converter.setConvertedDecimalFormat(null);
+ }
+ super.setConvertedValue(value);
+ }
+
+ /**
+ * Call functions.
+ *
+ * @param properties
+ * the properties
+ */
+ // ++++++++++++++++ Helper Methods ++++++++++++++++++++
+ private void callFunctions(EMap<String, String> properties) {
+ FunctionTypingAPI functionTypingAPI = new FunctionTypingAPI();
+ for (Entry<String, String> entry : properties) {
+ if (functionTypingAPI.getFunctionCssTypeName().equalsIgnoreCase(
+ entry.getKey())) {
+ handleCss(entry.getValue());
+ }
+ LOGGER.debug("entry.getKey(): " + entry.getKey());
+ LOGGER.debug("entry.getValue(): " + entry.getValue());
+ }
+
+ }
+
+ /**
+ * Handle css.
+ *
+ * @param functionFqn
+ * the function fqn
+ */
+ @SuppressWarnings("unchecked")
+ private void handleCss(String functionFqn) {
+ FunctionWrapper wrapper = new FunctionWrapper(functionFqn);
+ Object result = null;
+ try {
+ if (getPropertyDataSource() == null || isBuffered() || isModified()) {
+ String value = getInternalValue();
+ try {
+ result = converter.convertToModel(value, Double.class,
+ getLocale());
+ } catch (Exception e) {
+ // nothing to do
+ }
+ } else {
+ Object value = getPropertyDataSource().getValue();
+ if (value != null) {
+ result = (Double) value;
+ }
+ }
+
+ if (result != null) {
+ IFunctionLibraryService functionService = viewContext
+ .getService(IFunctionLibraryService.class.getName());
+ if (functionService == null) {
+ LOGGER.error("No implementation of IFunctionLibraryService available.");
+ return;
+ }
+
+ Map<String, Boolean> callResult = (Map<String, Boolean>) functionService
+ .callFunctionLibrary(wrapper.getClassName(),
+ wrapper.getMethodName(), result);
+ if (callResult!=null){
+ removeStyleNames(callResult);
+ addStyleNames(callResult);
+ }
+ }
+ } catch (ClassCastException ex) {
+ // TODO (JCD): Translation
+ LOGGER.error("Return type of the function call '" + functionFqn
+ + "' is not a Map!");
+ }
+ }
+
+ /**
+ * Removes the style names.
+ *
+ * @param styleNames
+ * the style names
+ */
+ private void removeStyleNames(Map<String, Boolean> styleNames) {
+ for (Entry<String, Boolean> entry : styleNames.entrySet()) {
+ removeStyleName(entry.getKey());
+ }
+ }
+
+ /**
+ * Adds the style names.
+ *
+ * @param styleNames
+ * the style names
+ */
+ private void addStyleNames(Map<String, Boolean> styleNames) {
+ for (Entry<String, Boolean> entry : styleNames.entrySet()) {
+ if (entry.getValue()) {
+ addStyleName(entry.getKey());
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/utils/FunctionWrapper.java b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/utils/FunctionWrapper.java
new file mode 100644
index 0000000..3267c5f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation.vaadin/src/org/eclipse/osbp/ecview/extension/vaadin/components/utils/FunctionWrapper.java
@@ -0,0 +1,56 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.vaadin.components.utils;
+
+/**
+ * The Class FunctionWrapper.
+ */
+public class FunctionWrapper {
+
+ /** The class name. */
+ private String className;
+
+ /** The method name. */
+ private String methodName;
+
+ /**
+ * Instantiates a new function wrapper.
+ *
+ * @param fqn
+ * the fqn
+ */
+ public FunctionWrapper(String fqn) {
+ int lastDot = fqn.lastIndexOf('.');
+ className = fqn.substring(0, lastDot);
+ methodName = fqn.substring(lastDot + 1);
+ }
+
+ /**
+ * Gets the class name.
+ *
+ * @return the class name
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Gets the method name.
+ *
+ * @return the method name
+ */
+ public String getMethodName() {
+ return methodName;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation/LICENSE.txt b/org.eclipse.osbp.ecview.extension.presentation/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/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.ecview.extension.presentation/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..1a94746
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/META-INF/MANIFEST.MF
@@ -0,0 +1,37 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.presentation
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.presentation
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.slf4j.api,
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.ibm.icu;bundle-version="50.1.1",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.editparts.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.databinding.emf;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.extension.model;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.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.ecview.presentation.vaadin;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.components;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.editparts;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.emf.databinding;bundle-version="1.3.0",
+ org.eclipse.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.apache.commons.beanutils;bundle-version="1.9.2"
+Import-Package: org.eclipse.osbp.utils.blob.component;version="0.9.0",
+ org.eclipse.core.databinding.property.value,
+ org.eclipse.e4.core.services.events,
+ org.osgi.framework;version="1.7.0",
+ org.osgi.service.component.annotations;version="1.2.0"
+Export-Package: org.eclipse.osbp.ecview.extension.presentation;x-internal:=true;version="0.9.0"
+Service-Component: OSGI-INF/*.xml
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.osbp.ecview.extension.presentation/about.html b/org.eclipse.osbp.ecview.extension.presentation/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/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.ecview.extension.presentation/epl-v10.html b/org.eclipse.osbp.ecview.extension.presentation/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/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.ecview.extension.presentation/license.html b/org.eclipse.osbp.ecview.extension.presentation/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/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.ecview.extension.presentation/notice.html b/org.eclipse.osbp.ecview.extension.presentation/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/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.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/NumericToResourceConverter.java b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/NumericToResourceConverter.java
new file mode 100644
index 0000000..665bfed
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/NumericToResourceConverter.java
@@ -0,0 +1,110 @@
+/**
+ *
+ * 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.ecview.extension.presentation.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.runtime.common.i18n.I18nUtil;
+import org.eclipse.osbp.runtime.web.vaadin.common.resource.IResourceProvider;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+
+import org.eclipse.osbp.ecview.extension.model.converter.CxNumericToResourceConfig;
+import org.eclipse.osbp.ecview.extension.model.converter.CxNumericToResourceConverter;
+
+@SuppressWarnings("serial")
+public class NumericToResourceConverter implements Converter<Resource, Number> {
+
+ private CxNumericToResourceConverter cxConverter;
+ private IServiceRegistry registry;
+
+ public NumericToResourceConverter(IServiceRegistry registry,
+ CxNumericToResourceConverter cxConverter) {
+ this.registry = registry;
+ this.cxConverter = cxConverter;
+ }
+
+ @Override
+ public Number convertToModel(Resource value,
+ Class<? extends Number> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ throw new com.vaadin.data.util.converter.Converter.ConversionException(
+ "NumericToResourceConverter is readonly!");
+ }
+
+ @Override
+ public Resource convertToPresentation(Number value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ IResourceProvider provider = registry
+ .getService(IResourceProvider.class.getName());
+
+ for (CxNumericToResourceConfig config : cxConverter.getConfigs()) {
+ if (isMatch(value, config)) {
+
+ String iconKey = I18nUtil.getImageKey(config
+ .getResourceThemePath());
+ if (isValid(iconKey)) {
+ if (provider != null) {
+ return provider.getResource(iconKey);
+ }
+ }
+
+ throw new IllegalStateException("No image defined for "
+ + config);
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isValid(String iconKey) {
+ return iconKey != null && !iconKey.equals("");
+ }
+
+ protected boolean isMatch(Number value, CxNumericToResourceConfig config) {
+ double ref = config.getValue();
+ double val = value.doubleValue();
+
+ switch (config.getCompare()) {
+ case EQUAL:
+ return val == ref;
+ case GREATER_EQUAL:
+ return val >= ref;
+ case GREATER_THAN:
+ return val > ref;
+ case LOWER_EQUAL:
+ return val <= ref;
+ case LOWER_THAN:
+ return val < ref;
+ case NOT_EQUAL:
+ return val != ref;
+ }
+ return false;
+ }
+
+ @Override
+ public Class<Number> getModelType() {
+ return Number.class;
+ }
+
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/PriceToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/PriceToStringConverter.java
new file mode 100644
index 0000000..e5007e9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/PriceToStringConverter.java
@@ -0,0 +1,52 @@
+/**
+ *
+ * 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.ecview.extension.presentation.converter;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+
+import org.eclipse.osbp.ecview.extension.model.converter.CxPriceToStringConverter;
+
+// TODO DOM --> See QuantityToStringConverter
+@SuppressWarnings("serial")
+public class PriceToStringConverter implements Converter<String, Object> {
+
+ private CxPriceToStringConverter cxConverter;
+
+ @Override
+ public Object convertToModel(String value,
+ Class<? extends Object> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value;
+ }
+
+ @Override
+ public String convertToPresentation(Object value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ return value.toString();
+ }
+
+ @Override
+ public Class<Object> getModelType() {
+ return Object.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/QuantityToStringConverter.java b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/QuantityToStringConverter.java
new file mode 100644
index 0000000..62fbabc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/QuantityToStringConverter.java
@@ -0,0 +1,229 @@
+/**
+ *
+ * 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.ecview.extension.presentation.converter;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.DecimalFormat;
+import java.text.ParseException;
+import java.util.Locale;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.runtime.common.types.ITypeProviderService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.vaadin.data.util.converter.Converter;
+
+import org.eclipse.osbp.ecview.extension.api.IUomService;
+import org.eclipse.osbp.ecview.extension.model.converter.CxQuantityToStringConverter;
+
+/**
+ * This converter converters values from a "quantity object" (model) to a String
+ * (presentation) and back to a quantity object.
+ * <p>
+ * Therefore it uses following logic:<br>
+ * The <code>model value</code> is an object containing the value as a numeric
+ * value and the uom (UnitOfMeasure). Value and uom may be nested properties.
+ * <h3>Access path</h3>
+ * The CxQuantityToStringConverter contains two "access path". An "access path"
+ * is a property path with dot-notation like "uom.isoCode". To access the values
+ * inside the given object, reflection needs to be used.
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * class Quantity {
+ * double value;
+ * Uom uom;
+ * }
+ *
+ * class Uom {
+ * String iso3Code;
+ * String name;
+ * ...
+ * }
+ * </pre>
+ *
+ * The Quantity bean is the model value. To access the values following
+ * accessPath in the CxQuantityToStringConverter needs to be used:<br>
+ * -> for value: <code>value</code><br>
+ * -> for currency: <code>uom.iso3Code</code><br>
+ * By reflection the values can become accessed.
+ *
+ * <h3>Convert To Presentation</h3> For the convert to presentation
+ * implementation, a number format pattern is used. The uom-String-value is
+ * added to the number format pattern as a constant. <br>
+ * <br>
+ * The result may look like: <code>1.200,23 kg</code>
+ *
+ * <h3>Convert To Model</h3> For the convert to model implementation, the given
+ * presentation-String needs to become parsed. And a new Object of type
+ * "model value" needs to be created. The type of the instance, is also
+ * contained in the CxQuantityToStringConverter object. See
+ * {@link CxQuantityToStringConverter#getTypeQualifiedName()}. To get a class
+ * based on the FQN use the {@link ITypeProviderService}.<br>
+ * The UOM needs to be converted to a valid UOM-object. Therefore use the
+ * {@link IUomService}.
+ *
+ * <h3>Unsupported UOMs</h3> To ensure, that only valid UOMs are being entered
+ * in the UI, an additional Validator needs to be implemented. It validates,
+ * that the entered UOM is valid. To query about valid UOMs, the UOM-Service is
+ * available. See {@link IUomService}.
+ */
+@SuppressWarnings("serial")
+public class QuantityToStringConverter implements Converter<String, Object> {
+
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(QuantityToStringConverter.class);
+
+ private static final String NUMBER_FORMAT_PATTERN = "#,###,###,##0.00 {$uom}";
+
+ private final CxQuantityToStringConverter cxConverter;
+ private final IUomService uomService;
+ private final Class<?> quantityType;
+
+ public QuantityToStringConverter(IViewContext context,
+ CxQuantityToStringConverter cxConverter) {
+ super();
+ this.cxConverter = cxConverter;
+
+ ITypeProviderService typeService = context
+ .getService(ITypeProviderService.class.getName());
+ quantityType = typeService.forName(null,
+ cxConverter.getTypeQualifiedName());
+ uomService = context.getService(IUomService.class.getName());
+ }
+
+ @Override
+ public Object convertToModel(String valueString,
+ Class<? extends Object> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ try {
+ Object quantity = quantityType.newInstance();
+ Number amount = parseAmount(valueString);
+ Object uom = parseUom(valueString);
+
+ applyAmount(quantity, amount);
+ applyUom(quantity, uom);
+
+ return quantity;
+ } catch (InstantiationException | IllegalAccessException
+ | InvocationTargetException | ParseException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ return null;
+ }
+ }
+
+ private void applyUom(Object quantity, Object uom)
+ throws IllegalAccessException, InvocationTargetException,
+ NoSuchMethodException {
+ PropertyUtils.setNestedProperty(quantity,
+ cxConverter.getUomPropertyPath(), uom);
+ }
+
+ private void applyAmount(Object quantity, Number amount)
+ throws IllegalAccessException, InvocationTargetException,
+ NoSuchMethodException {
+ PropertyUtils.setNestedProperty(quantity,
+ cxConverter.getAmountPropertyPath(), amount);
+ }
+
+ /**
+ * Parses the amount part from the given value String.<br>
+ * "1200.98 kg" -> "1200.98"
+ *
+ * @param valueString
+ * @return
+ * @throws ParseException
+ */
+ private Number parseAmount(String valueString) throws ParseException {
+ String[] tokens = valueString.trim().split(" ");
+ String amountString = tokens.length == 2 ? tokens[0] : "";
+ return new DecimalFormat().parse(amountString);
+ }
+
+ /**
+ * Parses the uom part from the given value String and creates a UOM Object.<br>
+ * "1200.98 kg" -> "kg" -> Object{kg}
+ *
+ * @param valueString
+ * @return
+ */
+ private Object parseUom(String valueString) {
+ String[] tokens = valueString.trim().split(" ");
+ String uomCode = tokens.length == 2 ? tokens[1] : "";
+ return uomService.getUOMForCode(uomCode);
+ }
+
+ @Override
+ public String convertToPresentation(Object value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ try {
+ String pattern = NUMBER_FORMAT_PATTERN;
+ pattern = pattern.replace("{$uom}", getUomCode(value));
+ DecimalFormat format = new DecimalFormat(pattern);
+ return format.format(getAmount(value));
+ } catch (IllegalAccessException | InvocationTargetException
+ | NoSuchMethodException e) {
+ LOGGER.error("{}", e);
+ return "Error";
+ }
+ }
+
+ /**
+ * Returns the amount value based on the AmountPropertyPath.
+ *
+ * @param value
+ * @return
+ * @throws IllegalAccessException
+ * @throws InvocationTargetException
+ * @throws NoSuchMethodException
+ */
+ private Object getAmount(Object value) throws IllegalAccessException,
+ InvocationTargetException, NoSuchMethodException {
+ return PropertyUtils.getNestedProperty(value,
+ cxConverter.getAmountPropertyPath());
+ }
+
+ /**
+ * Returns the amount value based on the UomPropertyPath.
+ *
+ * @param value
+ * @return
+ * @throws IllegalAccessException
+ * @throws InvocationTargetException
+ * @throws NoSuchMethodException
+ */
+ private String getUomCode(Object value) throws IllegalAccessException,
+ InvocationTargetException, NoSuchMethodException {
+ return (String) PropertyUtils.getNestedProperty(value,
+ cxConverter.getUomPropertyPath());
+ }
+
+ @Override
+ public Class<Object> getModelType() {
+ return Object.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/StringToResourceConverter.java b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/StringToResourceConverter.java
new file mode 100644
index 0000000..feb1311
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.presentation/src/org/eclipse/osbp/ecview/extension/presentation/converter/StringToResourceConverter.java
@@ -0,0 +1,111 @@
+/**
+ *
+ * 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.ecview.extension.presentation.converter;
+
+import java.util.Locale;
+
+import org.eclipse.osbp.ecview.core.common.services.IServiceRegistry;
+import org.eclipse.osbp.runtime.common.i18n.I18nUtil;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.runtime.web.vaadin.common.resource.IResourceProvider;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.server.Resource;
+
+import org.eclipse.osbp.ecview.extension.model.converter.CxStringToResourceConfig;
+import org.eclipse.osbp.ecview.extension.model.converter.CxStringToResourceConverter;
+
+@SuppressWarnings("serial")
+public class StringToResourceConverter implements Converter<Resource, String> {
+
+ private IServiceRegistry registry;
+ private CxStringToResourceConverter cxConverter;
+
+ public StringToResourceConverter(IServiceRegistry registry,
+ CxStringToResourceConverter cxConverter) {
+ this.registry = registry;
+ this.cxConverter = cxConverter;
+ }
+
+ @Override
+ public String convertToModel(Resource value,
+ Class<? extends String> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ throw new com.vaadin.data.util.converter.Converter.ConversionException(
+ "StringToResourceConverter is readonly!");
+ }
+
+ @Override
+ public Resource convertToPresentation(String value,
+ Class<? extends Resource> targetType, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+
+ IResourceProvider provider = registry
+ .getService(IResourceProvider.class.getName());
+
+ for (CxStringToResourceConfig config : cxConverter.getConfigs()) {
+ if (isMatch(value, config)) {
+
+ String iconKey = I18nUtil.getImageKey(config
+ .getResourceThemePath());
+
+ if (isValid(iconKey)) {
+ if (provider != null) {
+ return provider.getResource(iconKey);
+ }
+ }
+
+ throw new IllegalStateException("No image defined for "
+ + config);
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isValid(String iconKey) {
+ return iconKey != null && !iconKey.equals("");
+ }
+
+ protected boolean isMatch(String value, CxStringToResourceConfig config) {
+ String ref = config.getValue();
+
+ switch (config.getCompare()) {
+ case EQUAL:
+ return ref.equals(value);
+ case GREATER_EQUAL:
+ return ref.compareTo(value) >= 0;
+ case GREATER_THAN:
+ return ref.compareTo(value) > 0;
+ case LOWER_EQUAL:
+ return ref.compareTo(value) <= 0;
+ case LOWER_THAN:
+ return ref.compareTo(value) < 0;
+ case NOT_EQUAL:
+ return ref.compareTo(value) != 0;
+ }
+ return false;
+ }
+
+ @Override
+ public Class<String> getModelType() {
+ return String.class;
+ }
+
+ @Override
+ public Class<Resource> getPresentationType() {
+ return Resource.class;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin b/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin
new file mode 100644
index 0000000..4356555
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.sample/modelsbin/dtos.dtos.dtos_bin
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ASCII"?>
+<dto:LDtoModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dto="http://osbp.eclipse.org/dsl/dto/v1" xmlns:types="http://osbp.eclipse.org/dsl/common/types/v1" xmlns:types_1="http://www.eclipse.org/xtext/common/JavaVMTypes">
+ <packages name="org.eclipse.osbp.ecview.extension.tests.dtos">
+ <types xsi:type="types:LDataType" name="String">
+ <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
+ <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.String#java.lang.String"/>
+ </jvmTypeReference>
+ </types>
+ <types xsi:type="types:LDataType" name="int" asPrimitive="true">
+ <jvmTypeReference xsi:type="types_1:JvmParameterizedTypeReference">
+ <type xsi:type="types_1:JvmGenericType" href="java:/Objects/java.lang.Integer#java.lang.Integer"/>
+ </jvmTypeReference>
+ </types>
+ <types xsi:type="types:LDataType" name="Date" date="true"/>
+ <types xsi:type="dto:LDto" name="Person">
+ <annotationInfo xsi:type="dto:LDto"/>
+ <features xsi:type="dto:LDtoAttribute" name="id" uuid="true" type="//@packages.0/@types.0">
+ <annotationInfo xsi:type="dto:LDtoFeature"/>
+ </features>
+ <features xsi:type="dto:LDtoAttribute" name="name" type="//@packages.0/@types.0">
+ <annotationInfo xsi:type="dto:LDtoFeature"/>
+ </features>
+ <features xsi:type="dto:LDtoAttribute" name="name2" type="//@packages.0/@types.0">
+ <annotationInfo xsi:type="dto:LDtoFeature"/>
+ </features>
+ <features xsi:type="dto:LDtoAttribute" name="age" type="//@packages.0/@types.1">
+ <annotationInfo xsi:type="dto:LDtoFeature"/>
+ </features>
+ <features xsi:type="dto:LDtoAttribute" name="birthday" type="//@packages.0/@types.2">
+ <annotationInfo xsi:type="dto:LDtoFeature"/>
+ </features>
+ </types>
+ </packages>
+</dto:LDtoModel>
diff --git a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java b/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java
new file mode 100644
index 0000000..f924c48
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/Person.java
@@ -0,0 +1,314 @@
+/**
+ * All rights reserved by Loetz KG Heidelberg 2015.
+ *
+ * Contributors:
+ * Florian Pirchner - initial API and implementation
+ */
+package org.eclipse.osbp.ecview.extension.tests.dtos;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+import java.util.Date;
+import javax.validation.Valid;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class Person implements IDto, Serializable, PropertyChangeListener {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
+
+ @Dispose
+ private boolean disposed;
+
+ private String id = java.util.UUID.randomUUID().toString();
+
+ private String name;
+
+ private String name2;
+
+ private int age;
+
+ @Valid
+ private Date birthday;
+
+ /**
+ * @return true, if the object is disposed.
+ * Disposed means, that it is prepared for garbage collection and may not be used anymore.
+ * Accessing objects that are already disposed will cause runtime exceptions.
+ *
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String, PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName, final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String, PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName, final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Installs lazy collection resolving for entity {@link } to the dto {@link Person}.
+ *
+ */
+ protected void installLazyCollections() {
+
+ }
+
+ /**
+ * Returns the id property or <code>null</code> if not present.
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * Sets the <code>id</code> property to this instance.
+ *
+ * @param id - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setId(final String id) {
+ firePropertyChange("id", this.id, this.id = id );
+ installLazyCollections();
+ }
+
+ /**
+ * Returns the name property or <code>null</code> if not present.
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * Sets the <code>name</code> property to this instance.
+ *
+ * @param name - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setName(final String name) {
+ firePropertyChange("name", this.name, this.name = name );
+ }
+
+ /**
+ * Returns the name2 property or <code>null</code> if not present.
+ */
+ public String getName2() {
+ return this.name2;
+ }
+
+ /**
+ * Sets the <code>name2</code> property to this instance.
+ *
+ * @param name2 - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setName2(final String name2) {
+ firePropertyChange("name2", this.name2, this.name2 = name2 );
+ }
+
+ /**
+ * Returns the age property or <code>null</code> if not present.
+ */
+ public int getAge() {
+ return this.age;
+ }
+
+ /**
+ * Sets the <code>age</code> property to this instance.
+ *
+ * @param age - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setAge(final int age) {
+ firePropertyChange("age", this.age, this.age = age );
+ }
+
+ /**
+ * Returns the birthday property or <code>null</code> if not present.
+ */
+ public Date getBirthday() {
+ return this.birthday;
+ }
+
+ /**
+ * Sets the <code>birthday</code> property to this instance.
+ *
+ * @param birthday - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setBirthday(final Date birthday) {
+ firePropertyChange("birthday", this.birthday, this.birthday = birthday );
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Person other = (Person) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id== null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ public Person createDto() {
+ return new Person();
+ }
+
+ public Person copy(final MappingContext context) {
+ checkDisposed();
+
+ if (context == null) {
+ throw new IllegalArgumentException("Context must not be null!");
+ }
+
+ if(context.isMaxLevel()){
+ return null;
+ }
+
+ // if context contains a copied instance of this object
+ // then return it
+ Person newDto = context.get(this);
+ if(newDto != null){
+ return newDto;
+ }
+
+ try{
+ context.increaseLevel();
+
+ newDto = createDto();
+ context.register(this, newDto);
+
+ // first copy the containments and attributes
+ copyContainments(this, newDto, context);
+
+ // then copy cross references to ensure proper
+ // opposite references are copied too.
+ copyCrossReferences(this, newDto, context);
+ } finally {
+ context.decreaseLevel();
+ }
+
+ return newDto;
+ }
+
+ public void copyContainments(final Person dto, final Person newDto, final MappingContext context) {
+ checkDisposed();
+
+ if (context == null) {
+ throw new IllegalArgumentException("Context must not be null!");
+ }
+
+
+ // copy attributes and beans (beans if derived from entity model)
+ // copy id
+ newDto.setId(getId());
+ // copy name
+ newDto.setName(getName());
+ // copy name2
+ newDto.setName2(getName2());
+ // copy age
+ newDto.setAge(getAge());
+ // copy birthday
+ newDto.setBirthday(getBirthday());
+
+ // copy containment references (cascading is true)
+ }
+
+ public void copyCrossReferences(final Person dto, final Person newDto, final org.eclipse.osbp.dsl.dto.lib.MappingContext context) {
+ checkDisposed();
+
+ if (context == null) {
+ throw new IllegalArgumentException("Context must not be null!");
+ }
+
+
+ // copy cross references (cascading is false)
+ }
+
+ public void propertyChange(final java.beans.PropertyChangeEvent event) {
+ Object source = event.getSource();
+
+ // forward the event from embeddable beans to all listeners. So the parent of the embeddable
+ // bean will become notified and its dirty state can be handled properly
+ {
+ // no super class available to forward event
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java b/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java
new file mode 100644
index 0000000..f7a981d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.sample/src-gen/org/eclipse/osbp/ecview/extension/tests/dtos/TestsDtosTranslator.java
@@ -0,0 +1,69 @@
+package org.eclipse.osbp.ecview.extension.tests.dtos;
+
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.HashMap;
+import java.util.Locale;
+import org.eclipse.osbp.runtime.common.i18n.ITranslator;
+import org.slf4j.Logger;
+
+@SuppressWarnings("all")
+public class TestsDtosTranslator implements ITranslator {
+ private static Logger log = org.slf4j.LoggerFactory.getLogger("translations by translator");
+
+ private static TestsDtosTranslator instance = null;
+
+ private static Locale lastLocale = null;
+
+ private PropertyChangeSupport pcs = new java.beans.PropertyChangeSupport(this);
+
+ private HashMap<String, String> translations = new HashMap<String,String>() {{
+ }};
+
+ public static TestsDtosTranslator getInstance(final Locale locale) {
+ if(instance == null) {
+ instance = new org.eclipse.osbp.ecview.extension.tests.dtos.TestsDtosTranslator();
+ if (lastLocale == null) {
+ instance.changeLocale(locale);
+ }
+ }
+ return instance;
+ }
+
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ this.pcs.addPropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(final PropertyChangeListener listener) {
+ this.pcs.removePropertyChangeListener(listener);
+ }
+
+ public void mergeTranslations() {
+
+ }
+
+ public HashMap<String, String> getTranslations() {
+ return translations;
+ }
+
+ public void changeLocale(final Locale locale) {
+ // avoid unnecessary settings
+ if (locale == null) {
+ if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos is null.");
+ return;
+ }
+ if (locale.equals(lastLocale)) {
+ if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos already set to "+locale.getDisplayLanguage());
+ return;
+ }
+ if (log.isDebugEnabled()) log.debug("locale for org.eclipse.osbp.ecview.extension.tests.dtos set to "+locale.getDisplayLanguage());
+ lastLocale = locale;
+ // call the imported translators change locale method
+ try {
+ java.util.ResourceBundle resource = java.util.ResourceBundle.getBundle("i18n.I18N", locale, getClass().getClassLoader());
+ } catch (java.util.MissingResourceException mre) {
+ System.err.println(getClass().getCanonicalName()+" - "+mre.getLocalizedMessage());
+ }
+
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/.project b/org.eclipse.osbp.ecview.extension.services.tests/.project
new file mode 100644
index 0000000..90c9750
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/.project
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.services.tests</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.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/LICENSE.txt b/org.eclipse.osbp.ecview.extension.services.tests/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.services.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..3c48056
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.services.tests
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.services.tests
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore.xmi;bundle-version="2.8.0",
+ org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.common;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.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.knowhowlab.osgi.testing.assertions;bundle-version="[1.3.0,1.3.1)",
+ org.knowhowlab.osgi.testing.utils;bundle-version="[1.2.2,1.2.3)",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.equinox.ds;bundle-version="1.4.200",
+ org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dsl.dto.lib;bundle-version="[0.9.0,0.10.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: javax.validation;version="1.1.0.Final",
+ javax.validation.constraints;version="1.1.0.Final",
+ org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.event;version="1.3.0",
+ org.slf4j;version="1.6.4"
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/about.html b/org.eclipse.osbp.ecview.extension.services.tests/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/about.ini b/org.eclipse.osbp.ecview.extension.services.tests/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/about.mappings b/org.eclipse.osbp.ecview.extension.services.tests/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/about.properties b/org.eclipse.osbp.ecview.extension.services.tests/about.properties
new file mode 100644
index 0000000..0e61ee3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.services.tests
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/build.properties b/org.eclipse.osbp.ecview.extension.services.tests/build.properties
new file mode 100644
index 0000000..5e2c27a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/build.properties
@@ -0,0 +1,14 @@
+source.. = src/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/epl-v10.html b/org.eclipse.osbp.ecview.extension.services.tests/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/license.html b/org.eclipse.osbp.ecview.extension.services.tests/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/models/org.eclipse.osbp.foodmart.uimodels.TV.ecview b/org.eclipse.osbp.ecview.extension.services.tests/models/org.eclipse.osbp.foodmart.uimodels.TV.ecview
new file mode 100644
index 0000000..97f631b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/models/org.eclipse.osbp.foodmart.uimodels.TV.ecview
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ASCII"?>
+<core:YView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:binding="http://lunifera.org/ecview/v1/core/binding" xmlns:core="http://lunifera.org/ecview/v1/core/view" xmlns:extension="http://lunifera.org/ecview/v1/extension/view" xmlns:model="http://compex.de/ecview/v1/extension" name="org.eclipse.osbp.foodmart.uimodels.TV" viewName="org.eclipse.osbp.foodmart.uimodels.TV" contentAlignment="UNDEFINED">
+ <content xsi:type="extension:YHorizontalLayout">
+ <elements xsi:type="model:YStrategyLayout" id="cx-StrategyLayout">
+ <suspects id="org.eclipse.osbp.foodmart.uimodels.TV.org.eclipse.osbp.sample.item.dtos.TelevisionDto.description" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.description" label="description">
+ <tags>text</tags>
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="description" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ </suspects>
+ <suspects id="org.eclipse.osbp.foodmart.uimodels.TV.org.eclipse.osbp.sample.item.dtos.TelevisionDto.number" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.number" label="number">
+ <tags>text</tags>
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="number" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ </suspects>
+ <suspects xsi:type="model:YTypedCompoundSuspect" id="org.eclipse.osbp.foodmart.uimodels.TV.org.eclipse.osbp.sample.item.dtos.TelevisionDto.resolution" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.resolution" label="resolution">
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="resolution" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ <children id=".type" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.type" label="type">
+ <tags>text</tags>
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="type" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ </children>
+ <children xsi:type="model:YTypedCompoundSuspect" id=".pixels" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.pixels" label="pixels">
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="pixels" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ <children id=".pixels_X" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.pixels_X" label="pixels_X">
+ <tags>number</tags>
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="pixels_X" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ </children>
+ <children id=".pixels_Y" labelI18nKey="org.eclipse.osbp.sample.item.dtos.TelevisionDto.pixels_Y" label="pixels_Y">
+ <tags>number</tags>
+ <valueBindingEndpoints xsi:type="binding:YDetailValueBindingEndpoint" propertyPath="pixels_Y" type="org.eclipse.osbp.sample.item.dtos.TelevisionDto">
+ <masterObservable xsi:type="core:YBeanSlotValueBindingEndpoint" attributePath="value" beanSlot="//@beanSlots.0"/>
+ </valueBindingEndpoints>
+ </children>
+ </children>
+ </suspects>
+ </elements>
+ </content>
+ <beanSlots name="dsTV" valueType="org.eclipse.osbp.sample.item.dtos.TelevisionDto" valueTypeQualifiedName="org.eclipse.osbp.sample.item.dtos.TelevisionDto"/>
+</core:YView>
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/notice.html b/org.eclipse.osbp.ecview.extension.services.tests/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/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.ecview.extension.services.tests/pom.xml b/org.eclipse.osbp.ecview.extension.services.tests/pom.xml
new file mode 100644
index 0000000..29eabfd
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/pom.xml
@@ -0,0 +1,37 @@
+<?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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.services.tests</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Services for ECView extensions</description>
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source/>
+ <target/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewCacheBuilderTest.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewCacheBuilderTest.java
new file mode 100644
index 0000000..40a46ca
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewCacheBuilderTest.java
@@ -0,0 +1,68 @@
+/**
+ *
+ * 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.ecview.extension.services.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.List;
+
+import org.eclipse.osbp.ecview.core.common.extender.IECViewCache;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.sample.item.dtos.TelevisionDto;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.knowhowlab.osgi.testing.utils.ServiceUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+
+public class ECViewCacheBuilderTest {
+
+ private BundleContext bc;
+ private IECViewCache cache;
+
+ @Before
+ public void setup() throws Exception {
+ bc = getBundleContext();
+ BundleUtils.startBundleAsync(bc, "org.eclipse.osbp.ecview.extension.services");
+ BundleUtils.startBundleAsync(bc,
+ "org.eclipse.osbp.ecview.extension.editparts.emf");
+ BundleUtils.startBundleAsync(bc,
+ "org.eclipse.osbp.ecview.extension.presentation.vaadin");
+
+ cache = ServiceUtils.getService(getBundleContext(), IECViewCache.class);
+ assertNotNull(cache);
+ }
+
+ private BundleContext getBundleContext() {
+ return FrameworkUtil.getBundle(getClass()).getBundleContext();
+ }
+
+ @Test
+ public void test_getById() {
+
+ YView result = cache.getView("org.my");
+ assertNotNull(result);
+ assertEquals("org.my", result.getId());
+ }
+
+ @Test
+ public void test_getByClass() {
+ List<YView> result = cache.getViews(TelevisionDto.class, "dsTV");
+ assertEquals(1, result.size());
+ assertEquals("org.my", result.get(0).getId());
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewProviderServiceTest.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewProviderServiceTest.java
new file mode 100644
index 0000000..03eecc0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/ecview/extension/services/tests/ECViewProviderServiceTest.java
@@ -0,0 +1,73 @@
+/**
+ *
+ * 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.ecview.extension.services.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService;
+import org.eclipse.osbp.sample.item.dtos.TelevisionDto;
+import org.junit.Before;
+import org.junit.Test;
+import org.knowhowlab.osgi.testing.utils.BundleUtils;
+import org.knowhowlab.osgi.testing.utils.ServiceUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
+
+public class ECViewProviderServiceTest {
+
+ private BundleContext bc;
+ private IECViewProviderService service;
+
+ @Before
+ public void setup() throws Exception {
+ bc = getBundleContext();
+ BundleUtils.startBundleAsync(bc, "org.eclipse.osbp.ecview.extension.services");
+ BundleUtils.startBundleAsync(bc,
+ "org.eclipse.osbp.ecview.extension.editparts.emf");
+ BundleUtils.startBundleAsync(bc,
+ "org.eclipse.osbp.ecview.extension.presentation.vaadin");
+
+ service = ServiceUtils.getService(getBundleContext(),
+ IECViewProviderService.class);
+ assertNotNull(service);
+ }
+
+ private BundleContext getBundleContext() {
+ return FrameworkUtil.getBundle(getClass()).getBundleContext();
+ }
+
+ @Test
+ public void test_getById() {
+ IViewContext result = service.getViewContext(TelevisionDto.class, "dsTV");
+ assertNotNull(result);
+ assertEquals(TelevisionDto.class, result.getBean("dsTV"));
+
+ IViewContext result2 = service.getViewContext(TelevisionDto.class, "dsTV");
+ assertNotSame(result, result2);
+ }
+
+ @Test
+ public void test_getByClass() {
+ IViewContext result = service.getViewContext("org.eclipse.osbp.foodmart.uimodels.TV");
+ assertNotNull(result);
+ assertEquals(TelevisionDto.class, result.getBean("dsTV"));
+
+ IViewContext result2 = service.getViewContext("org.eclipse.osbp.foodmart.uimodels.TV");
+ assertNotSame(result, result2);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseIDDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseIDDto.java
new file mode 100644
index 0000000..ac298da
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseIDDto.java
@@ -0,0 +1,165 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class BaseIDDto implements IDto, Serializable, PropertyChangeListener {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ @Dispose
+ private boolean disposed;
+
+ private int id;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the id property or <code>null</code> if not present.
+ */
+ public int getId() {
+ return this.id;
+ }
+
+ /**
+ * Sets the <code>id</code> property to this instance.
+ *
+ * @param id
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setId(final int id) {
+ firePropertyChange("id", this.id, this.id = id);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BaseIDDto other = (BaseIDDto) obj;
+ if (other.id != this.id)
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = prime * result + this.id;
+ return result;
+ }
+
+ public BaseIDDto createDto() {
+ return new BaseIDDto();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseUUIDDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseUUIDDto.java
new file mode 100644
index 0000000..b22f4d3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/BaseUUIDDto.java
@@ -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:
+ * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
+ *
+ */
+ package org.eclipse.osbp.sample.item.dtos;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class BaseUUIDDto implements IDto, Serializable, PropertyChangeListener {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ @Dispose
+ private boolean disposed;
+
+ private String id = java.util.UUID.randomUUID().toString();
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the id property or <code>null</code> if not present.
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /**
+ * Sets the <code>id</code> property to this instance.
+ *
+ * @param id
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setId(final String id) {
+ firePropertyChange("id", this.id, this.id = id);
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ BaseUUIDDto other = (BaseUUIDDto) obj;
+ if (this.id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!this.id.equals(other.id))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
+ return result;
+ }
+
+ public BaseUUIDDto createDto() {
+ return new BaseUUIDDto();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/DetailsDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/DetailsDto.java
new file mode 100644
index 0000000..5b22c07
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/DetailsDto.java
@@ -0,0 +1,77 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.BaseUUIDDto;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import java.util.Date;
+import javax.validation.Valid;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class DetailsDto extends BaseUUIDDto implements IDto, Serializable, PropertyChangeListener {
+ @Valid
+ private Date guaranteeEnd;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ super.dispose();
+ }
+
+/**
+ * Returns the guaranteeEnd property or <code>null</code> if not present.
+ */
+ public Date getGuaranteeEnd() {
+ return this.guaranteeEnd;
+ }
+
+/**
+ * Sets the <code>guaranteeEnd</code> property to this instance.
+ *
+ * @param guaranteeEnd - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setGuaranteeEnd(final Date guaranteeEnd) {
+ firePropertyChange("guaranteeEnd", this.guaranteeEnd, this.guaranteeEnd = guaranteeEnd );
+ }
+
+ public DetailsDto createDto() {
+ return new DetailsDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ItemDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ItemDto.java
new file mode 100644
index 0000000..5385c0e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ItemDto.java
@@ -0,0 +1,94 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.BaseUUIDDto;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class ItemDto extends BaseUUIDDto implements IDto, Serializable, PropertyChangeListener {
+ private String number;
+
+ private String description;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ super.dispose();
+ }
+
+/**
+ * Returns the number property or <code>null</code> if not present.
+ */
+ public String getNumber() {
+ return this.number;
+ }
+
+/**
+ * Sets the <code>number</code> property to this instance.
+ *
+ * @param number - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setNumber(final String number) {
+ firePropertyChange("number", this.number, this.number = number );
+ }
+
+/**
+ * Returns the description property or <code>null</code> if not present.
+ */
+ public String getDescription() {
+ return this.description;
+ }
+
+/**
+ * Sets the <code>description</code> property to this instance.
+ *
+ * @param description - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setDescription(final String description) {
+ firePropertyChange("description", this.description, this.description = description );
+ }
+
+ public ItemDto createDto() {
+ return new ItemDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/PixelsDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/PixelsDto.java
new file mode 100644
index 0000000..d1ee4a1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/PixelsDto.java
@@ -0,0 +1,166 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class PixelsDto implements IDto, Serializable, PropertyChangeListener {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ @Dispose
+ private boolean disposed;
+
+ private int pixels_X;
+
+ private int pixels_Y;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the pixels_X property or <code>null</code> if not present.
+ */
+ public int getPixels_X() {
+ return this.pixels_X;
+ }
+
+ /**
+ * Sets the <code>pixels_X</code> property to this instance.
+ *
+ * @param pixels_X
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setPixels_X(final int pixels_X) {
+ firePropertyChange("pixels_X", this.pixels_X, this.pixels_X = pixels_X);
+ }
+
+ /**
+ * Returns the pixels_Y property or <code>null</code> if not present.
+ */
+ public int getPixels_Y() {
+ return this.pixels_Y;
+ }
+
+ /**
+ * Sets the <code>pixels_Y</code> property to this instance.
+ *
+ * @param pixels_Y
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setPixels_Y(final int pixels_Y) {
+ firePropertyChange("pixels_Y", this.pixels_Y, this.pixels_Y = pixels_Y);
+ }
+
+ public PixelsDto createDto() {
+ return new PixelsDto();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ResolutionDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ResolutionDto.java
new file mode 100644
index 0000000..ec2b3dc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/ResolutionDto.java
@@ -0,0 +1,181 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.io.Serializable;
+
+import javax.validation.Valid;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class ResolutionDto implements IDto, Serializable,
+ PropertyChangeListener {
+ private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
+ this);
+
+ @Dispose
+ private boolean disposed;
+
+ private String type;
+
+ @Valid
+ private PixelsDto pixels;
+
+ /**
+ * Returns true, if the object is disposed. Disposed means, that it is
+ * prepared for garbage collection and may not be used anymore. Accessing
+ * objects that are already disposed will cause runtime exceptions.
+ */
+ public boolean isDisposed() {
+ return this.disposed;
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#addPropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void addPropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#removePropertyChangeListener(String,
+ * PropertyChangeListener)
+ */
+ public void removePropertyChangeListener(final String propertyName,
+ final PropertyChangeListener listener) {
+ propertyChangeSupport.removePropertyChangeListener(propertyName,
+ listener);
+ }
+
+ /**
+ * @see PropertyChangeSupport#firePropertyChange(String, Object, Object)
+ */
+ public void firePropertyChange(final String propertyName,
+ final Object oldValue, final Object newValue) {
+ propertyChangeSupport.firePropertyChange(propertyName, oldValue,
+ newValue);
+ }
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ firePropertyChange("disposed", this.disposed, this.disposed = true);
+ }
+
+ /**
+ * Returns the type property or <code>null</code> if not present.
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * Sets the <code>type</code> property to this instance.
+ *
+ * @param type
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setType(final String type) {
+ firePropertyChange("type", this.type, this.type = type);
+ }
+
+ /**
+ * Returns the pixels property.
+ */
+ public PixelsDto getPixels() {
+ if (this.pixels == null) {
+ this.pixels = new PixelsDto();
+ }
+ return this.pixels;
+ }
+
+ /**
+ * Sets the <code>pixels</code> property to this instance.
+ *
+ * @param pixels
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setPixels(final PixelsDto pixels) {
+ if (this.pixels != null) {
+ this.pixels.removePropertyChangeListener(this);
+ }
+
+ firePropertyChange("pixels", this.pixels, this.pixels = pixels);
+
+ if (this.pixels != null) {
+ this.pixels.addPropertyChangeListener(this);
+ }
+ }
+
+ public ResolutionDto createDto() {
+ return new ResolutionDto();
+ }
+
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevionType.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevionType.java
new file mode 100644
index 0000000..3032e01
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevionType.java
@@ -0,0 +1,23 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+@SuppressWarnings("all")
+public enum TelevionType {
+ PLASMA,
+
+ THREED,
+
+ TFT;
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetails2Dto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetails2Dto.java
new file mode 100644
index 0000000..d8b4b42
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetails2Dto.java
@@ -0,0 +1,74 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.DetailsDto;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class TelevisionDetails2Dto extends DetailsDto implements IDto, Serializable, PropertyChangeListener {
+ private String madeIn;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ super.dispose();
+ }
+
+/**
+ * Returns the madeIn property or <code>null</code> if not present.
+ */
+ public String getMadeIn() {
+ return this.madeIn;
+ }
+
+/**
+ * Sets the <code>madeIn</code> property to this instance.
+ *
+ * @param madeIn - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setMadeIn(final String madeIn) {
+ firePropertyChange("madeIn", this.madeIn, this.madeIn = madeIn );
+ }
+
+ public TelevisionDetails2Dto createDto() {
+ return new TelevisionDetails2Dto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetailsDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetailsDto.java
new file mode 100644
index 0000000..2318a30
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDetailsDto.java
@@ -0,0 +1,115 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.DetailsDto;
+import org.eclipse.osbp.sample.item.dtos.TelevionType;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class TelevisionDetailsDto extends DetailsDto implements IDto, Serializable, PropertyChangeListener {
+ private int size;
+
+ private boolean threeD;
+
+ private TelevionType type;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ super.dispose();
+ }
+
+/**
+ * Returns the size property or <code>null</code> if not present.
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+/**
+ * Sets the <code>size</code> property to this instance.
+ *
+ * @param size - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setSize(final int size) {
+ firePropertyChange("size", this.size, this.size = size );
+ }
+
+/**
+ * Returns the threeD property or <code>null</code> if not present.
+ */
+ public boolean getThreeD() {
+ return this.threeD;
+ }
+
+/**
+ * Sets the <code>threeD</code> property to this instance.
+ *
+ * @param threeD - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setThreeD(final boolean threeD) {
+ firePropertyChange("threeD", this.threeD, this.threeD = threeD );
+ }
+
+/**
+ * Returns the type property or <code>null</code> if not present.
+ */
+ public TelevionType getType() {
+ return this.type;
+ }
+
+/**
+ * Sets the <code>type</code> property to this instance.
+ *
+ * @param type - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setType(final TelevionType type) {
+ firePropertyChange("type", this.type, this.type = type );
+ }
+
+ public TelevisionDetailsDto createDto() {
+ return new TelevisionDetailsDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDto.java
new file mode 100644
index 0000000..02d4dee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/TelevisionDto.java
@@ -0,0 +1,158 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+
+import javax.validation.Valid;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+import org.eclipse.osbp.runtime.common.annotations.DomainReference;
+
+@SuppressWarnings("all")
+public class TelevisionDto extends ItemDto implements IDto, Serializable,
+ PropertyChangeListener {
+ @Valid
+ private ResolutionDto resolution;
+
+ @DomainReference
+ @Valid
+ private TelevisionDetailsDto details;
+
+ @DomainReference
+ @Valid
+ private TelevisionDetails2Dto details2;
+
+ /**
+ * Checks whether the object is disposed.
+ *
+ * @throws RuntimeException
+ * if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+ /**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed
+ * too. So the whole composition containment tree will be disposed on
+ * calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ try {
+ if (this.details != null) {
+ this.details.dispose();
+ this.details = null;
+ }
+ if (this.details2 != null) {
+ this.details2.dispose();
+ this.details2 = null;
+ }
+
+ } finally {
+ super.dispose();
+ }
+
+ }
+
+ /**
+ * Returns the resolution property.
+ */
+ public ResolutionDto getResolution() {
+ if (this.resolution == null) {
+ this.resolution = new ResolutionDto();
+ }
+ return this.resolution;
+ }
+
+ /**
+ * Sets the <code>resolution</code> property to this instance.
+ *
+ * @param resolution
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setResolution(final ResolutionDto resolution) {
+ if (this.resolution != null) {
+ this.resolution.removePropertyChangeListener(this);
+ }
+
+ firePropertyChange("resolution", this.resolution,
+ this.resolution = resolution);
+
+ if (this.resolution != null) {
+ this.resolution.addPropertyChangeListener(this);
+ }
+ }
+
+ /**
+ * Returns the details property or <code>null</code> if not present.
+ */
+ public TelevisionDetailsDto getDetails() {
+ return this.details;
+ }
+
+ /**
+ * Sets the <code>details</code> property to this instance.
+ *
+ * @param details
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setDetails(final TelevisionDetailsDto details) {
+ checkDisposed();
+ firePropertyChange("details", this.details, this.details = details);
+ }
+
+ /**
+ * Returns the details2 property or <code>null</code> if not present.
+ */
+ public TelevisionDetails2Dto getDetails2() {
+ return this.details2;
+ }
+
+ /**
+ * Sets the <code>details2</code> property to this instance.
+ *
+ * @param details2
+ * - the property
+ * @throws RuntimeException
+ * if instance is <code>disposed</code>
+ *
+ */
+ public void setDetails2(final TelevisionDetails2Dto details2) {
+ checkDisposed();
+ firePropertyChange("details2", this.details2, this.details2 = details2);
+ }
+
+ public TelevisionDto createDto() {
+ return new TelevisionDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDetailsDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDetailsDto.java
new file mode 100644
index 0000000..4f8f8fd
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDetailsDto.java
@@ -0,0 +1,95 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.DetailsDto;
+import org.eclipse.osbp.sample.item.dtos.WasherType;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+
+@SuppressWarnings("all")
+public class WasherDetailsDto extends DetailsDto implements IDto, Serializable, PropertyChangeListener {
+ private int size;
+
+ private WasherType type;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ super.dispose();
+ }
+
+/**
+ * Returns the size property or <code>null</code> if not present.
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+/**
+ * Sets the <code>size</code> property to this instance.
+ *
+ * @param size - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setSize(final int size) {
+ firePropertyChange("size", this.size, this.size = size );
+ }
+
+/**
+ * Returns the type property or <code>null</code> if not present.
+ */
+ public WasherType getType() {
+ return this.type;
+ }
+
+/**
+ * Sets the <code>type</code> property to this instance.
+ *
+ * @param type - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setType(final WasherType type) {
+ firePropertyChange("type", this.type, this.type = type );
+ }
+
+ public WasherDetailsDto createDto() {
+ return new WasherDetailsDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDto.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDto.java
new file mode 100644
index 0000000..a18d99b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherDto.java
@@ -0,0 +1,90 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+import org.eclipse.osbp.sample.item.dtos.ItemDto;
+import org.eclipse.osbp.sample.item.dtos.WasherDetailsDto;
+import java.beans.PropertyChangeListener;
+import java.io.Serializable;
+import javax.validation.Valid;
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.dsl.dto.lib.MappingContext;
+import org.eclipse.osbp.runtime.common.annotations.Dispose;
+import org.eclipse.osbp.runtime.common.annotations.DomainReference;
+
+@SuppressWarnings("all")
+public class WasherDto extends ItemDto implements IDto, Serializable, PropertyChangeListener {
+ @DomainReference
+ @Valid
+ private WasherDetailsDto details;
+
+/**
+ * Checks whether the object is disposed.
+ * @throws RuntimeException if the object is disposed.
+ */
+ private void checkDisposed() {
+ if (isDisposed()) {
+ throw new RuntimeException("Object already disposed: " + this);
+ }
+ }
+
+/**
+ * Calling dispose will destroy that instance. The internal state will be
+ * set to 'disposed' and methods of that object must not be used anymore.
+ * Each call will result in runtime exceptions.<br/>
+ * If this object keeps composition containments, these will be disposed too.
+ * So the whole composition containment tree will be disposed on calling this method.
+ */
+ @Dispose
+ public void dispose() {
+ if (isDisposed()) {
+ return;
+ }
+ try {
+ if (this.details != null) {
+ this.details.dispose();
+ this.details = null;
+ }
+
+ }
+ finally {
+ super.dispose();
+ }
+
+ }
+
+/**
+ * Returns the details property or <code>null</code> if not present.
+ */
+ public WasherDetailsDto getDetails() {
+ return this.details;
+ }
+
+/**
+ * Sets the <code>details</code> property to this instance.
+ *
+ * @param details - the property
+ * @throws RuntimeException if instance is <code>disposed</code>
+ *
+ */
+ public void setDetails(final WasherDetailsDto details) {
+ checkDisposed();
+ firePropertyChange("details", this.details, this.details = details);
+ }
+
+ public WasherDto createDto() {
+ return new WasherDto();
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherType.java b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherType.java
new file mode 100644
index 0000000..c1c6a7d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services.tests/src/org/eclipse/osbp/sample/item/dtos/WasherType.java
@@ -0,0 +1,21 @@
+/**
+ *
+ * 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.sample.item.dtos;
+
+@SuppressWarnings("all")
+public enum WasherType {
+ WASH,
+
+ WASH_AND_DRY;
+}
diff --git a/org.eclipse.osbp.ecview.extension.services/.project b/org.eclipse.osbp.ecview.extension.services/.project
new file mode 100644
index 0000000..156e7c5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.services</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.services/LICENSE.txt b/org.eclipse.osbp.ecview.extension.services/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..088e38a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.services
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.services
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore.xmi;bundle-version="2.8.0",
+ org.eclipse.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.common;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.osbp.ecview.extension.api;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.model;bundle-version="[0.9.0,0.10.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.osgi.service.event;version="1.3.0",
+ org.slf4j;version="1.6.4"
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewProviderService.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCache.xml
+Export-Package: org.eclipse.osbp.ecview.extension.services
diff --git a/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCache.xml b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCache.xml
new file mode 100644
index 0000000..7d46f70
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCache.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="org.eclipse.osbp.ecview.extension.services.ECViewCache">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.extender.IECViewCache"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.services.ECViewCache"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder.xml b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder.xml
new file mode 100644
index 0000000..8919614
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder">
+ <reference bind="bindCache" cardinality="1..1" interface="org.eclipse.osbp.ecview.core.common.extender.IECViewCache" name="Cache" policy="static" unbind="unbindCache"/>
+ <implementation class="org.eclipse.osbp.ecview.extension.services.ECViewCacheBuilder"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewProviderService.xml b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewProviderService.xml
new file mode 100644
index 0000000..290f68a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/OSGI-INF/org.eclipse.osbp.ecview.extension.services.ECViewProviderService.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.services.ECViewProviderService">
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService"/>
+ </service>
+ <reference bind="bindCache" cardinality="1..1" interface="org.eclipse.osbp.ecview.core.common.extender.IECViewCache" name="Cache" policy="static" unbind="unbindCache"/>
+ <implementation class="org.eclipse.osbp.ecview.extension.services.ECViewProviderService"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.services/about.html b/org.eclipse.osbp.ecview.extension.services/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/about.ini b/org.eclipse.osbp.ecview.extension.services/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/about.mappings b/org.eclipse.osbp.ecview.extension.services/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/about.properties b/org.eclipse.osbp.ecview.extension.services/about.properties
new file mode 100644
index 0000000..406ca9d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.services
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.services/build.properties b/org.eclipse.osbp.ecview.extension.services/build.properties
new file mode 100644
index 0000000..5e2c27a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/build.properties
@@ -0,0 +1,14 @@
+source.. = src/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ OSGI-INF/,\
+ .classpath,\
+ .project,\
+ .settings/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+output.. = target/classes
diff --git a/org.eclipse.osbp.ecview.extension.services/epl-v10.html b/org.eclipse.osbp.ecview.extension.services/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/license.html b/org.eclipse.osbp.ecview.extension.services/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/notice.html b/org.eclipse.osbp.ecview.extension.services/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/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.ecview.extension.services/pom.xml b/org.eclipse.osbp.ecview.extension.services/pom.xml
new file mode 100644
index 0000000..5e5bec1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/pom.xml
@@ -0,0 +1,37 @@
+<?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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.services</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>Services for ECView extensions</description>
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source/>
+ <target/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCache.java b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCache.java
new file mode 100644
index 0000000..60ddda2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCache.java
@@ -0,0 +1,196 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.services;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewCache;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.eclipse.osbp.ecview.extension.model.YECviewPackage;
+
+/**
+ * The Class ECViewCache.
+ */
+@Component
+public class ECViewCache implements IECViewCache {
+
+ /** The Constant ECVIEW_XMI. */
+ public static final String ECVIEW_XMI = "ecview";
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(ECViewCache.class);
+
+ /** The resource set. */
+ private ResourceSetImpl resourceSet;
+
+ /**
+ * Activate.
+ *
+ * @param context
+ * the context
+ */
+ @Activate
+ protected void activate(ComponentContext context) {
+ resourceSet = new ResourceSetImpl();
+
+ // do EMF registration
+ EPackage.Registry.INSTANCE.put(CoreModelPackage.eINSTANCE.getNsURI(),
+ CoreModelPackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(
+ ExtensionModelPackage.eINSTANCE.getNsURI(),
+ ExtensionModelPackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(YECviewPackage.eINSTANCE.getNsURI(),
+ YECviewPackage.eINSTANCE);
+ if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap()
+ .containsKey(ECVIEW_XMI)) {
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
+ ECVIEW_XMI, new XMIResourceFactoryImpl());
+ }
+ }
+
+ /**
+ * Deactivate.
+ *
+ * @param context
+ * the context
+ */
+ @Deactivate
+ protected void deactivate(ComponentContext context) {
+ resourceSet.getResources().clear();
+ resourceSet = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewCache#getView(java.lang.String)
+ */
+ @Override
+ public YView getView(String id) {
+ if (id == null) {
+ return null;
+ }
+ YView cxSource = resourceSet.getResources().stream()
+ .filter(r -> r.getContents().size() > 0)
+ .map(r -> (YView) r.getContents().get(0)).filter(g -> {
+// return id.equals(g.getId());
+ return id.equals(g.getViewName());
+ }).findFirst().orElse(null);
+
+ return cxSource != null ? EcoreUtil.copy(cxSource) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewCache#getViews(java.lang.Class, java.lang.String)
+ */
+ @Override
+ public List<YView> getViews(Class<?> inputType, String beanSlot) {
+ if (inputType == null) {
+ return Collections.emptyList();
+ }
+
+ List<YView> result = new ArrayList<>();
+ for (Resource resource : new ArrayList<>(resourceSet.getResources())) {
+ if (resource.getContents().isEmpty()) {
+ continue;
+ }
+ YView source = (YView) resource.getContents().get(0);
+ if (source == null) {
+ continue;
+ }
+
+ if (isFor(source, inputType, beanSlot)) {
+ result.add(EcoreUtil.copy(source));
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Checks if is for.
+ *
+ * @param source
+ * the source
+ * @param inputType
+ * the input type
+ * @param beanSlot
+ * the bean slot
+ * @return true, if is for
+ */
+ private boolean isFor(YView source, Class<?> inputType, String beanSlot) {
+ for (YBeanSlot slot : source.getBeanSlots()) {
+ if(beanSlot != null && !beanSlot.equals(slot.getName())) {
+ // skip the beanSlot with a different name
+ continue;
+ }
+
+ if (slot.getValueType() == inputType
+ && inputType.getCanonicalName().equals(
+ slot.getValueTypeQualifiedName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewCache#registerViews(java.util.List)
+ */
+ @Override
+ public void registerViews(List<URL> urls) {
+ for (URL url : urls) {
+ Resource resource = resourceSet.getResource(
+ URI.createURI(url.toString()), true);
+ try {
+ resource.load(null);
+ } catch (IOException e) {
+ LOGGER.error("{}", e);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewCache#unregisterViews(java.util.List)
+ */
+ @Override
+ public void unregisterViews(List<URL> urls) {
+ for (URL url : urls) {
+ Resource resource = resourceSet.getResource(
+ URI.createURI(url.toString()), false);
+ if (resource != null) {
+ resource.unload();
+ resourceSet.getResources().remove(resource);
+ }
+ }
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCacheBuilder.java b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCacheBuilder.java
new file mode 100644
index 0000000..65871dc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewCacheBuilder.java
@@ -0,0 +1,211 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.services;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.URI;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.wiring.BundleWiring;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.osgi.util.tracker.BundleTracker;
+import org.osgi.util.tracker.BundleTrackerCustomizer;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewCache;
+
+/**
+ * This extender scans all bundles about .ecview_xmi files. Any of them will be
+ * passed to the {@link IECViewCache}. If bundles are being stopped, the
+ * contained .ecview_xmi files will be unregistered from {@link IECViewCache}.
+ */
+@Component
+public class ECViewCacheBuilder {
+
+ /** The Constant FACTORY_MODEL_EXTENDER. */
+ public static final String FACTORY_MODEL_EXTENDER = "Factory-Model";
+
+ /** The context. */
+ @SuppressWarnings("unused")
+ private ComponentContext context;
+
+ /** The tracker. */
+ private BundleTracker<List<URL>> tracker;
+
+ /** The cache. */
+ private IECViewCache cache;
+
+ /**
+ * Instantiates a new EC view cache builder.
+ */
+ public ECViewCacheBuilder() {
+
+ }
+
+ /**
+ * Activate.
+ *
+ * @param context
+ * the context
+ */
+ @Activate
+ protected void activate(ComponentContext context) {
+ this.context = context;
+ tracker = new BundleTracker<>(context.getBundleContext(),
+ stateCriteria(), new Customizer());
+ tracker.open();
+ }
+
+ /**
+ * State criteria.
+ *
+ * @return the int
+ */
+ protected int stateCriteria() {
+ return Bundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE
+ | Bundle.STOPPING;
+ }
+
+ /**
+ * Deactivate.
+ *
+ * @param context
+ * the context
+ */
+ @Deactivate
+ protected void deactivate(ComponentContext context) {
+ tracker.close();
+ this.context = null;
+ }
+
+ /**
+ * Returns true, if the bundle contains the header.
+ *
+ * @param bundle
+ * the bundle
+ * @param header
+ * the header
+ * @return true, if successful
+ */
+ private boolean containsHeader(Bundle bundle, String header) {
+ Dictionary<String, String> headers = bundle.getHeaders();
+ Enumeration<String> keys = headers.keys();
+ while (keys.hasMoreElements()) {
+ String key = keys.nextElement();
+ if (key.equals(header)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Searches for all ECView translations in the given bundle.
+ *
+ * @param bundle
+ * the bundle
+ * @return the list
+ */
+ private List<URL> internalFindURLs(Bundle bundle) {
+ List<URL> results = new ArrayList<URL>();
+ BundleWiring wiring = bundle.adapt(BundleWiring.class);
+ results.addAll(wiring.findEntries("/", "*." + ECViewCache.ECVIEW_XMI,
+ BundleWiring.LISTRESOURCES_RECURSE));
+
+ Set<String> fragments = new HashSet<String>();
+ for (Iterator<URL> iterator = results.iterator(); iterator.hasNext();) {
+ URL url = iterator.next();
+ URI uri = URI.createURI(url.toString());
+ if (fragments.contains(uri.lastSegment())) {
+ iterator.remove();
+ }
+ fragments.add(uri.lastSegment());
+ }
+ return results;
+ }
+
+ /**
+ * Bind cache.
+ *
+ * @param cache
+ * the cache
+ */
+ @Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC, unbind = "unbindCache")
+ protected void bindCache(IECViewCache cache) {
+ this.cache = cache;
+ }
+
+ /**
+ * Unbind cache.
+ *
+ * @param cache
+ * the cache
+ */
+ protected void unbindCache(IECViewCache cache) {
+ tracker.close();
+ tracker = null;
+ this.cache = null;
+ }
+
+ /**
+ * The Class Customizer.
+ */
+ private class Customizer implements BundleTrackerCustomizer<List<URL>> {
+
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.BundleTrackerCustomizer#addingBundle(org.osgi.framework.Bundle, org.osgi.framework.BundleEvent)
+ */
+ @Override
+ public List<URL> addingBundle(Bundle bundle, BundleEvent event) {
+ if (!containsHeader(bundle, FACTORY_MODEL_EXTENDER)) {
+ return null;
+ }
+
+ List<URL> urls = internalFindURLs(bundle);
+ cache.registerViews(urls);
+ return urls;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.BundleTrackerCustomizer#modifiedBundle(org.osgi.framework.Bundle, org.osgi.framework.BundleEvent, java.lang.Object)
+ */
+ @Override
+ public void modifiedBundle(Bundle bundle, BundleEvent event,
+ List<URL> object) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.util.tracker.BundleTrackerCustomizer#removedBundle(org.osgi.framework.Bundle, org.osgi.framework.BundleEvent, java.lang.Object)
+ */
+ @Override
+ public void removedBundle(Bundle bundle, BundleEvent event,
+ List<URL> urls) {
+ cache.unregisterViews(urls);
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewProviderService.java b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewProviderService.java
new file mode 100644
index 0000000..6a62fd1
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.services/src/org/eclipse/osbp/ecview/extension/services/ECViewProviderService.java
@@ -0,0 +1,214 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.services;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.context.ViewContext;
+import org.eclipse.osbp.ecview.core.common.editpart.DelegatingEditPartManager;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewCache;
+import org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService;
+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.YValueBinding;
+import org.eclipse.osbp.ecview.core.common.model.binding.YVisibilityProcessorValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.CoreModelFactory;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotValueBindingEndpoint;
+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.extension.model.visibility.YAuthorizationVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityFactory;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+
+/**
+ * The Class ECViewProviderService.
+ */
+@Component
+public class ECViewProviderService implements IECViewProviderService {
+
+ /** The cache. */
+ private IECViewCache cache;
+ /**
+ * Use this property to pass the beanSlot that should be used for the dto.
+ * See properties map in {@link #render(Object, Map)}
+ */
+ public static final String PROP_SLOT = "beanSlot";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService#getViewContext(java.lang.Class, java.lang.String)
+ */
+ @Override
+ public IViewContext getViewContext(Class<?> dtoClass, String beanSlot) {
+ YView yView = createYView(dtoClass, beanSlot);
+ return createViewContext(yView);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService#getViewContext(java.lang.String)
+ */
+ @Override
+ public IViewContext getViewContext(String viewId) {
+ YView yView = cache.getView(viewId);
+ return createViewContext(yView);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.core.common.extender.IECViewProviderService#getViewContext(org.eclipse.osbp.ecview.core.common.model.core.YView)
+ */
+ @Override
+ public IViewContext getViewContext(YView yView) {
+ return createViewContext(yView);
+ }
+
+ /**
+ * Creates the view context.
+ *
+ * @param yView
+ * the y view
+ * @return the view context
+ */
+ protected ViewContext createViewContext(YView yView) {
+ if (yView != null) {
+ // create a unrendered view context
+ ViewContext viewContext = new ViewContext();
+ DelegatingEditPartManager.getInstance().getEditpart(viewContext,
+ yView);
+ return viewContext;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * This is the main entry point to serve different YViews for the given DTO.
+ *
+ * @param dtoClass
+ * the dto class
+ * @param beanSlot
+ * the bean slot
+ * @return the y view
+ */
+ protected YView createYView(Class<?> dtoClass, String beanSlot) {
+ // default way -> look in the cache for views
+ List<YView> temp = cache.getViews(dtoClass, beanSlot);
+
+ YView yView = temp.size() > 0 ? temp.get(0) : null;
+
+ if (yView != null) {
+ doEnhance(yView);
+ }
+
+ return yView;
+ }
+
+ /**
+ * Do enhance.
+ *
+ * @param yView
+ * the y view
+ */
+ protected void doEnhance(YView yView) {
+ // createVisibilityProcessor(yView, properties);
+ }
+
+ /**
+ * This is the main entry point to serve different YViews for the given DTO.
+ *
+ * @param viewId
+ * the view id
+ * @return the y view
+ */
+ protected YView createYView(String viewId) {
+ return cache.getView(viewId);
+ }
+
+ /**
+ * Bind cache.
+ *
+ * @param cache
+ * the cache
+ */
+ @Reference(cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.STATIC, unbind = "unbindCache")
+ protected void bindCache(IECViewCache cache) {
+ this.cache = cache;
+ }
+
+ /**
+ * Unbind cache.
+ *
+ * @param cache
+ * the cache
+ */
+ protected void unbindCache(IECViewCache cache) {
+ this.cache = null;
+ }
+
+ /**
+ * Creates the visibility processor.
+ *
+ * @param yView
+ * the y view
+ * @param properties
+ * the properties
+ */
+ private void createVisibilityProcessor(YView yView,
+ Map<String, Object> properties) {
+ // create visibilityProcessor
+ YAuthorizationVisibilityProcessor yvp = YVisibilityFactory.eINSTANCE
+ .createYAuthorizationVisibilityProcessor();
+
+ // yvp.setDelegate(visibilityProcessor);
+ // yvp.setDelegateQualifiedName(visibilityProcessor.getCanonicalName());
+
+ // add visibilityProcessor to YView
+ EList<YVisibilityProcessor> visibilityProcessors = yView
+ .getVisibilityProcessors();
+ visibilityProcessors.add(yvp);
+ // create bean slot endpoint
+ YBeanSlot beanSlot = yView.getBeanSlot(getBeanSlotName(properties));
+ YBeanSlotValueBindingEndpoint sourceEP = CoreModelFactory.eINSTANCE
+ .createYBeanSlotValueBindingEndpoint();
+ sourceEP.setBeanSlot(beanSlot);
+
+ YVisibilityProcessorValueBindingEndpoint targetEP = BindingFactory.eINSTANCE
+ .createYVisibilityProcessorValueBindingEndpoint();
+ // targetEP.setProperty(dsDtoName);
+ // create a binding from beanslot to visibilityProcessor
+ YValueBinding binding = BindingFactory.eINSTANCE.createYValueBinding();
+ binding.setTargetEndpoint(targetEP);
+ binding.setModelEndpoint(sourceEP);
+ binding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE);
+ binding.setTargetToModelStrategy(YBindingUpdateStrategy.NEVER);
+ yvp.getTriggersOn().add(binding);
+ }
+
+ /**
+ * Gets the bean slot name.
+ *
+ * @param properties
+ * the properties
+ * @return the bean slot name
+ */
+ protected String getBeanSlotName(Map<String, Object> properties) {
+ return (String) properties.get(PROP_SLOT);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/.project b/org.eclipse.osbp.ecview.extension.strategy/.project
new file mode 100644
index 0000000..ccb6fa2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/.project
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.strategy</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.sonarlint.eclipse.core.sonarlintBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.strategy/LICENSE.txt b/org.eclipse.osbp.ecview.extension.strategy/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..8f2304b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.strategy
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.strategy
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.osbp.ecview.extension.strategy.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.eclipse.osbp.ecview.core.common.editpart.emf;version="0.9.0",
+ org.eclipse.osbp.ecview.extension.api;version="0.9.0",
+ org.osgi.framework;version="1.8.0",
+ org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.slf4j
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.osbp.ecview.extension.strategy;version="0.9.0"
+Require-Bundle: com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ org.eclipse.core.databinding;bundle-version="1.4.1",
+ org.eclipse.osbp.ecview.core.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.core.common.model;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.osbp.ecview.core.extension.model;bundle-version="[0.9.0,0.10.0)",
+ 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.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.gitinfo;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.model;bundle-version="[0.9.0,0.10.0)",
+ org.apache.commons.beanutils,
+ org.eclipse.osbp.dsl.common.xtext;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.dsl.datatype.lib;bundle-version="[0.9.0,0.10.0)",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.osbp.ui.api,
+ org.eclipse.osbp.preferences
+Service-Component: OSGI-INF/*.xml
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider.xml
new file mode 100644
index 0000000..55cd2d5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider">
+ <property name="ecview.focusing.id" value="cx.altenter.forward"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider.xml
new file mode 100644
index 0000000..0338299
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider">
+ <property name="ecview.layouting.id" value="CssLayoutLayoutingStrategy"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider.xml
new file mode 100644
index 0000000..e9920f0
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider">
+ <property name="ecview.focusing.id" value="cx.enter.backward"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider.xml
new file mode 100644
index 0000000..0068102
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider">
+ <property name="ecview.focusing.id" value="cx.enter.forward"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider.xml
new file mode 100644
index 0000000..17d9034
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider">
+ <property name="ecview.layouting.id" value="FormLayoutStrategy"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider.xml
new file mode 100644
index 0000000..ed2d4b4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider">
+ <property name="ecview.layouting.id" value="GridLLayoutLayoutingStrategy"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider.xml
new file mode 100644
index 0000000..1a7dc4a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider">
+ <property name="ecview.layouting.id" value="HorizontalLayoutLayoutingStrategy"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.ServiceListener.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.ServiceListener.xml
new file mode 100644
index 0000000..dcbf1ee
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.ServiceListener.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osbp.ecview.extension.strategy.ServiceListener">
+ <reference bind="bindOrganizationService" cardinality="0..1" interface="org.eclipse.osbp.ui.api.useraccess.IOrganizationService" name="OrganizationService" policy="dynamic" unbind="unbindOrganizationService"/>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.ServiceListener"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider.xml
new file mode 100644
index 0000000..dd0f847
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider">
+ <property name="ecview.focusing.id" value="cx.tab.backward"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider.xml
new file mode 100644
index 0000000..5e43916
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider">
+ <property name="ecview.focusing.id" value="cx.tab.forward"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider.xml b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider.xml
new file mode 100644
index 0000000..beb753e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider">
+ <property name="ecview.layouting.id" value="VerticalLayoutLayoutingStrategy"/>
+ <service>
+ <provide interface="org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider"/>
+ </service>
+ <implementation class="org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider"/>
+</scr:component>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/about.html b/org.eclipse.osbp.ecview.extension.strategy/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/about.ini b/org.eclipse.osbp.ecview.extension.strategy/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/about.mappings b/org.eclipse.osbp.ecview.extension.strategy/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/about.properties b/org.eclipse.osbp.ecview.extension.strategy/about.properties
new file mode 100644
index 0000000..1f22e5e
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.strategy
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.strategy/build.properties b/org.eclipse.osbp.ecview.extension.strategy/build.properties
new file mode 100644
index 0000000..d7586b8
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/build.properties
@@ -0,0 +1,12 @@
+output.. = target/classes/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .,\
+ .settings/,\
+ OSGI-INF/,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+source.. = src/
diff --git a/org.eclipse.osbp.ecview.extension.strategy/epl-v10.html b/org.eclipse.osbp.ecview.extension.strategy/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/license.html b/org.eclipse.osbp.ecview.extension.strategy/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/notice.html b/org.eclipse.osbp.ecview.extension.strategy/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/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.ecview.extension.strategy/pom.xml b/org.eclipse.osbp.ecview.extension.strategy/pom.xml
new file mode 100644
index 0000000..0fbb2fc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/pom.xml
@@ -0,0 +1,23 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.strategy</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <description>OSBP ECView strategy extension </description>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
new file mode 100644
index 0000000..63f5e54
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
@@ -0,0 +1,1134 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Locale;
+import java.util.Map.Entry;
+import java.util.TreeSet;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.binding.BindingFactory;
+import org.eclipse.osbp.ecview.core.common.model.binding.YBindingEndpoint;
+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.YListBinding;
+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.binding.YVisibilityProcessorValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YAlignment;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YBeanSlotValueBindingEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YCollectionBindable;
+import org.eclipse.osbp.ecview.core.common.model.core.YConverter;
+import org.eclipse.osbp.ecview.core.common.model.core.YDetailBeanSlot;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableCollectionEndpoint;
+import org.eclipse.osbp.ecview.core.common.model.core.YField;
+import org.eclipse.osbp.ecview.core.common.model.core.YLayout;
+import org.eclipse.osbp.ecview.core.common.model.core.YSelectionBindable;
+import org.eclipse.osbp.ecview.core.common.model.core.YTaggable;
+import org.eclipse.osbp.ecview.core.common.model.core.YValueBindable;
+import org.eclipse.osbp.ecview.core.common.model.core.YView;
+import org.eclipse.osbp.ecview.core.common.model.datatypes.YDatadescription;
+import org.eclipse.osbp.ecview.core.common.model.datatypes.impl.DatatypesFactoryImpl;
+import org.eclipse.osbp.ecview.core.common.model.validation.ValidationFactory;
+import org.eclipse.osbp.ecview.core.common.model.validation.YBeanValidationValidator;
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.ExtDatatypesFactory;
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDateTimeDatatype;
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDateTimeFormat;
+import org.eclipse.osbp.ecview.core.extension.model.datatypes.YDateTimeResolution;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YBeanReferenceField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YColumn;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YComboBox;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDateTime;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YDecimalField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YEnumComboBox;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YEnumOptionsGroup;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YNumericField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YPasswordField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YSuggestTextField;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTab;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTabSheet;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTable;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YTextArea;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayoutCellStyle;
+import org.eclipse.osbp.ecview.core.extension.model.extension.impl.ExtensionModelFactoryImpl;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.util.CxGridUtil;
+import org.eclipse.osbp.ecview.extension.model.YBlobUploadComponent;
+import org.eclipse.osbp.ecview.extension.model.YCollectionSuspect;
+import org.eclipse.osbp.ecview.extension.model.YColumnInfo;
+import org.eclipse.osbp.ecview.extension.model.YCustomDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YECviewFactory;
+import org.eclipse.osbp.ecview.extension.model.YIconComboBox;
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YMaskedDecimalField;
+import org.eclipse.osbp.ecview.extension.model.YMaskedTextField;
+import org.eclipse.osbp.ecview.extension.model.YPairComboBox;
+import org.eclipse.osbp.ecview.extension.model.YRichTextArea;
+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.YSuspectInfo;
+import org.eclipse.osbp.ecview.extension.model.YTypedSuspect;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterFactory;
+import org.eclipse.osbp.ecview.extension.model.converter.YCustomDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.converter.YSimpleDecimalConverter;
+import org.eclipse.osbp.ecview.extension.model.visibility.YSubTypeVisibilityProcessor;
+import org.eclipse.osbp.ecview.extension.model.visibility.YVisibilityFactory;
+import org.eclipse.osbp.ecview.extension.strategy.util.NamingConventionsUtil;
+import org.eclipse.osbp.preferences.ProductConfiguration;
+import org.eclipse.osbp.runtime.common.i18n.II18nService;
+import org.eclipse.osbp.ui.api.metadata.IDSLMetadataService;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Action;
+import org.eclipse.osbp.ui.api.useraccess.AbstractAuthorization.Permission;
+import org.eclipse.osbp.ui.api.useraccess.AbstractSubOrganization;
+import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
+import org.eclipse.osbp.ui.api.useraccess.IPosition;
+import org.eclipse.osbp.ui.api.useraccess.IUserAccessService;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+import org.eclipse.osbp.utils.functionnormalizer.entities.FunctionType;
+import org.eclipse.osbp.utils.theme.EnumCssClass;
+import org.eclipse.xtext.util.Pair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Class AbstractLayoutingStrategy.
+ */
+public abstract class AbstractLayoutingStrategy implements ILayoutingStrategy {
+
+ /** The filtered category. */
+ private final String filteredCategory;
+
+ /** The function typing api. */
+ private FunctionTypingAPI functionTypingApi;
+
+ /** The i18n service. */
+ private II18nService i18nService;
+
+ /** The user access service. */
+ private IUserAccessService userAccessService;
+
+ /** The view context. */
+ private IViewContext viewContext;
+
+ private YLayoutingInfo layoutingInfo;
+
+ private IDSLMetadataService dslMetadataService;
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractLayoutingStrategy.class);
+
+ /**
+ * Only given category is shown.
+ *
+ * @param filteredCategory
+ * the filtered category
+ */
+ public AbstractLayoutingStrategy(String filteredCategory) {
+ super();
+ this.filteredCategory = filteredCategory;
+ this.functionTypingApi = new FunctionTypingAPI();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy#layout(org.eclipse .osbp.ecview.extension.model.YLayoutingInfo)
+ */
+ @Override
+ public void layout(YLayoutingInfo layoutingInfo) {
+ this.layoutingInfo = layoutingInfo;
+
+ clean();
+
+ YStrategyLayout yLayout = layoutingInfo.getLayout();
+ layoutingInfo.getActiveSuspectInfos().clear();
+ YLayout layout = createContentLayout();
+ YEmbeddable content;
+ YTabSheet tabSheet = null;
+ viewContext = ModelUtil.getViewContext(yLayout);
+ i18nService = viewContext.getService(II18nService.ID);
+ userAccessService = viewContext.getService(IUserAccessService.class.getName());
+ dslMetadataService = viewContext.getService(IDSLMetadataService.class.getName());
+ // Identify if a TabSheet is necessary due to existing table or grid
+ if (isTabSheetNeeded(yLayout.getSuspects())) {
+ tabSheet = ExtensionModelFactory.eINSTANCE.createYTabSheet();
+ YTab tab = ExtensionModelFactory.eINSTANCE.createYTab();
+ tab.setLabelI18nKey(getEntityI18nKey(yLayout.getSuspects()));
+ tab.setEmbeddable(layout);
+ tabSheet.getTabs().add(tab);
+ content = tabSheet;
+ } else {
+ content = layout;
+ }
+ // Creates YEmbeddables from YSuspects
+ for (YSuspect suspect : createSuspectList(yLayout)) {
+ if (filteredCategory != null && !filteredCategory.equals("") && !suspect.getTags().contains(filteredCategory)) {
+ // filter the suspect
+ continue;
+ }
+
+ // Create a new suspect info.
+ YSuspectInfo suspectInfo = layoutingInfo.createSuspectInfo(suspect);
+ // add the suspectInfo as active suspect
+ layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+
+ YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ if (yEmbeddable != null) {
+ addElement(content, yEmbeddable, suspectInfo);
+ }
+ }
+ layoutingInfo.setContent(content);
+
+ }
+
+ /**
+ * Removes elements tagged with #TAG__TO_BE_CLEANED from the view.
+ */
+ private void clean() {
+ YView view = layoutingInfo.getView();
+ TreeIterator<Object> contents = EcoreUtil.getAllContents(view, true);
+ while (contents.hasNext()) {
+ Object element = contents.next();
+ if (element instanceof YTaggable) {
+ YTaggable taggable = (YTaggable) element;
+ if (taggable.getTags().contains(TAG__TO_BE_CLEANED)) {
+ EcoreUtil.remove(taggable);
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates the suspect list.
+ *
+ * @param yLayout
+ * the y layout
+ * @return the array list
+ */
+ private ArrayList<YSuspect> createSuspectList(YStrategyLayout yLayout) {
+ ArrayList<YSuspect> suspectList = new ArrayList<YSuspect>(yLayout.getSuspects().size());
+ ArrayList<YSuspect> suspectCollectionList = new ArrayList<YSuspect>(yLayout.getSuspects().size());
+ for (YSuspect ySuspect : yLayout.getSuspects()) {
+ if (ySuspect.getTags().contains(TAG__TABLE) || ySuspect.getTags().contains(TAG__GRID)) {
+ suspectCollectionList.add(ySuspect);
+ } else {
+ suspectList.add(ySuspect);
+ }
+ }
+ Collections.sort(suspectCollectionList, new SuspectComparator());
+ suspectList.addAll(suspectCollectionList);
+ return suspectList;
+ }
+
+ /**
+ * Adds the element.
+ *
+ * @param content
+ * the content
+ * @param element
+ * the element
+ * @param suspectInfo
+ * the suspect info
+ */
+ private void addElement(YEmbeddable content, YEmbeddable element, YSuspectInfo suspectInfo) {
+ if (content instanceof YTabSheet) {
+ EList<YTab> tabs = ((YTabSheet) content).getTabs();
+ if (suspectInfo.getSuspect().getTags().contains(TAG__TABLE) || suspectInfo.getSuspect().getTags().contains(TAG__GRID)) {
+ YTab tab = ExtensionModelFactory.eINSTANCE.createYTab();
+ tab.setLabelI18nKey(suspectInfo.getSuspect().getLabelI18nKey());
+ // YLayout layout = createContentLayout();
+ YVerticalLayout layout = ExtensionModelFactory.eINSTANCE.createYVerticalLayout();
+ layout.addElement(element);
+ YVerticalLayoutCellStyle cellStyle = layout.addCellStyle(element);
+ cellStyle.setAlignment(YAlignment.FILL_FILL);
+ tab.setEmbeddable(layout);
+ tabs.add(tab);
+ } else {
+ // Gets the YLayout of the first tab to add the element
+ addElement(((YLayout) tabs.get(0).getEmbeddable()), element);
+ }
+ } else {
+ addElement(((YLayout) content), element);
+ }
+ }
+
+ /**
+ * Creates the content layout.
+ *
+ * @return the y layout
+ */
+ protected abstract YLayout createContentLayout();
+
+ /**
+ * Adds the element.
+ *
+ * @param layout
+ * the layout
+ * @param element
+ * the element
+ */
+ protected abstract void addElement(YLayout layout, YEmbeddable element);
+
+ /**
+ * Creates a new element for the given suspect. Handle bindings,...
+ *
+ * @param suspectInfo
+ * the suspect info
+ * @return the y embeddable
+ */
+ protected YEmbeddable prepareElementForSuspect(YSuspectInfo suspectInfo) {
+ // create a new element for the given suspect
+ YEmbeddable yEmbeddable = createElementForSuspect(suspectInfo);
+
+ return yEmbeddable;
+ }
+
+ /**
+ * Create the value or list bindings for the given element.
+ *
+ * @param suspectInfo
+ * the suspect info
+ * @param yEmbeddable
+ * the y embeddable
+ */
+ protected void prepareValueBindings(YSuspectInfo suspectInfo, YEmbeddable yEmbeddable) {
+ YSuspect ySuspect = suspectInfo.getSuspect();
+ // iterate over all elements
+ for (YBindingEndpoint ep : ySuspect.getValueBindingEndpoints()) {
+
+ /*
+ * if yEmbeddable is a value bindable and ep a value binding
+ */
+ if (ep instanceof YValueBindingEndpoint && yEmbeddable instanceof YValueBindable) {
+ YValueBindable yBindable = (YValueBindable) yEmbeddable;
+ // make a copy -> otherwise the suspect will be changed
+ YBindingEndpoint epCopy = EcoreUtil.copy(ep);
+
+ YValueBindingEndpoint yValueEP = null;
+ if (suspectInfo.getTags().contains(ILayoutingStrategy.TAG__RICH_TEXT__BLOB)) {
+ // if we need to bind the blob value, then we need to use a
+ // different endpoint
+ YRichTextArea richtText = (YRichTextArea) yEmbeddable;
+ yValueEP = richtText.createBlobValueEndpoint();
+ } else {
+ yValueEP = yBindable.createValueEndpoint();
+ }
+
+ YValueBinding yBinding = BindingFactory.eINSTANCE.createYValueBinding();
+ yBinding.setModelEndpoint((YValueBindingEndpoint) epCopy);
+ yBinding.setTargetEndpoint(yValueEP);
+
+ // register binding add suspect. Will be handled
+ // automatically.
+ suspectInfo.getBindings().add(yBinding);
+
+ /*
+ * if yEmbeddable is a selection bindable and ep a value binding
+ */
+ } else if (ep instanceof YValueBindingEndpoint && yEmbeddable instanceof YSelectionBindable) {
+ YSelectionBindable yBindable = (YSelectionBindable) yEmbeddable;
+ // make a copy -> otherwise the suspect will be changed
+ YBindingEndpoint epCopy = EcoreUtil.copy(ep);
+
+ YValueBindingEndpoint yValueEP = yBindable.createSelectionEndpoint();
+ YValueBinding yBinding = BindingFactory.eINSTANCE.createYValueBinding();
+ yBinding.setModelEndpoint((YValueBindingEndpoint) epCopy);
+ yBinding.setTargetEndpoint(yValueEP);
+
+ // register binding add suspect. Will be handled
+ // automatically.
+ suspectInfo.getBindings().add(yBinding);
+
+ /*
+ * if yEmbeddable is a collection bindable and ep a list binding
+ */
+ } else if (ep instanceof YListBindingEndpoint && yEmbeddable instanceof YCollectionBindable) {
+ YCollectionBindable yBindable = (YCollectionBindable) yEmbeddable;
+ // make a copy -> otherwise the suspect will be changed
+ YBindingEndpoint epCopy = EcoreUtil.copy(ep);
+
+ YEmbeddableCollectionEndpoint yListEP = yBindable.createCollectionEndpoint();
+ YListBinding yBinding = BindingFactory.eINSTANCE.createYListBinding();
+ yBinding.setModelEndpoint((YListBindingEndpoint) epCopy);
+ yBinding.setTargetEndpoint(yListEP);
+
+ // register binding add suspect. Will be handled
+ // automatically.
+ suspectInfo.getBindings().add(yBinding);
+ }
+ }
+ }
+
+ /**
+ * Creates the element for suspect.
+ *
+ * @param suspectInfo
+ * the suspect info
+ * @return the y embeddable
+ */
+ protected YEmbeddable createElementForSuspect(YSuspectInfo suspectInfo) {
+ YSuspect ySuspect = suspectInfo.getSuspect();
+ YEmbeddable yEmbeddable = null;
+ if (ySuspect.getTags().contains(TAG__DECIMAL)) {
+ if (existFunctionsInProperties(ySuspect)) {
+ yEmbeddable = YECviewFactory.eINSTANCE.createYCustomDecimalField();
+ setCustomDecimalConverter(yEmbeddable, ySuspect);
+ // if (existInProperties(ySuspect, PROPERTY_DECIMALFORMAT)) {
+ } else {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYDecimalField();
+ ((YDecimalField) yEmbeddable).setConverter(getConverter(ySuspect.getProperties()));
+ }
+ } else if (ySuspect.getTags().contains(TAG__TEXT)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTextField();
+ } else if (ySuspect.getTags().contains(TAG__PASSWORD)) {
+ yEmbeddable = createPasswordField(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__SUGGEST_TEXT)) {
+ YTypedSuspect typedSuspect = (YTypedSuspect) ySuspect;
+ YSuggestTextField yField = ExtensionModelFactory.eINSTANCE.createYSuggestTextField();
+ // the type the field will query for matching entries
+ yField.setType(typedSuspect.getType());
+ yField.setTypeQualifiedName(typedSuspect.getTypeQualifiedName());
+ yField.setUseSuggestions(true);
+ // the caption and filter property
+ yField.setItemCaptionProperty(typedSuspect.getProperties().get(PROPERTY__ITEM_CAPTION));
+ yField.setItemFilterProperty(typedSuspect.getProperties().get(PROPERTY__ITEM_FILTER));
+ yField.setItemUUIDProperty(typedSuspect.getProperties().get(PROPERTY__ITEM_UUID));
+ yEmbeddable = yField;
+ } else if (ySuspect.getTags().contains(TAG__TEXTAREA)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTextArea();
+ if (!ySuspect.getProperties().isEmpty()) {
+ try {
+ int rows = new Integer(ySuspect.getProperties().get(PROPERTY_TEXTAREA));
+ ((YTextArea) yEmbeddable).setRows(rows);
+ } catch (NumberFormatException ex) {
+ // Do nothing!!!
+ }
+ }
+ yEmbeddable.getProperties().addAll(ySuspect.getProperties());
+ } else if (ySuspect.getTags().contains(TAG__NUMBER)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYNumericField();
+ } else if (ySuspect.getTags().contains(TAG__DATE)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYDateTime();
+ for (Entry<String, String> prop : ySuspect.getProperties()) {
+ if (YDateTimeFormat.get(prop.getKey().toUpperCase()) != null) {
+ YDateTimeDatatype yDt = ExtDatatypesFactory.eINSTANCE.createYDateTimeDatatype();
+ yDt.setFormat(YDateTimeFormat.get(prop.getKey().toUpperCase()));
+ if (YDateTimeResolution.get(prop.getValue().toUpperCase()) != null) {
+ yDt.setResolution(YDateTimeResolution.get(prop.getValue().toUpperCase()));
+ }
+ ((YDateTime) yEmbeddable).setDatatype(yDt);
+ // we found a format - ignore the rest if any
+ break;
+ }
+ }
+ } else if (ySuspect.getTags().contains(TAG__BOOLEAN)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYCheckBox();
+ } else if (ySuspect.getTags().contains(TAG__BLOB)) {
+ yEmbeddable = createYBlobUploadComponent(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__GRID)) {
+ yEmbeddable = createGrid(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__BEAN_REFERENCE)) {
+ yEmbeddable = createYBeanReference(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__TABLE)) {
+ yEmbeddable = createTable(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__ENUM_OPTIONS)) {
+ yEmbeddable = createEnumOptions(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__ENUM_COMBO)) {
+ yEmbeddable = createEnumCombo(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__RICH_TEXT__STRING)) {
+ yEmbeddable = createRichTextFieldString(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__MASKED_TEXT_FIELD)) {
+ yEmbeddable = createMaskedTextField(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__MASKED_DECIMAL_FIELD)) {
+ yEmbeddable = createMaskedDecimalField(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__RICH_TEXT__BLOB)) {
+ yEmbeddable = createRichTextFieldBlob(ySuspect);
+ suspectInfo.getTags().add(TAG__RICH_TEXT__BLOB);
+ } else if (ySuspect.getTags().contains(TAG__ORGANIZATION_COMBO)) {
+ yEmbeddable = createOrganizationCombo(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__PERSPECTIVE_COMBO)) {
+ yEmbeddable = createPerspectiveCombo(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__IMAGE_PICKER)) {
+ yEmbeddable = createIconComboBox(ySuspect);
+ } else if (ySuspect.getTags().contains(TAG__SUBTYPES_ROOT)) {
+ createSubTypeElements((YSubTypeBaseSuspect) ySuspect);
+ } else {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTextField();
+ }
+ if (yEmbeddable != null) {
+ yEmbeddable.setLabelI18nKey(ySuspect.getLabelI18nKey());
+ yEmbeddable.setLabel(ySuspect.getLabel());
+ yEmbeddable.setId(ySuspect.getId());
+ yEmbeddable.setCssClass(EnumCssClass.BOX.styleName());
+
+ suspectInfo.setTarget(yEmbeddable);
+
+ // --- Required for validation ---
+ if (ySuspect.getTags().contains(TAG__CONSTRAINT)) {
+ if (yEmbeddable instanceof YField) {
+ YBeanValidationValidator validator = ValidationFactory.eINSTANCE.createYBeanValidationValidator();
+ validator.setBvalClassFullyQualifiedName(ySuspect.getProperties().get(PROPERTY_CLASS));
+ validator.setBvalProperty(ySuspect.getProperties().get(PROPERTY_NAME));
+ ((YField) yEmbeddable).getValidators().add(validator);
+
+ }
+ }
+ // ------------------------------
+
+ // Only for Test purposes
+ // Test Converter
+ if (ySuspect.getTags().contains("FloatToUomo")) {
+ ((YNumericField) yEmbeddable).setConverter(YConverterFactory.eINSTANCE.createYNumericToUomoConverter());
+ }
+
+ // prepares the value bindings
+ prepareValueBindings(suspectInfo, yEmbeddable);
+
+ // required step to enable the permissions managed by the visibility
+ // processors
+ yEmbeddable.setAuthorizationGroup(ySuspect.getAuthorizationGroup());
+ yEmbeddable.setAuthorizationId(ySuspect.getAuthorizationId());
+
+ }
+ return yEmbeddable;
+ }
+
+ /**
+ * Helper method to find out if the suspect properties keys contains a function normalizer entry
+ *
+ * @param ySuspect
+ * @return
+ */
+ private boolean existFunctionsInProperties(YSuspect ySuspect) {
+ for (FunctionType functionType : functionTypingApi.getTypes()) {
+ if (existInProperties(ySuspect, functionType.getName().toLowerCase())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Creates the icon combo box.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createIconComboBox(YSuspect ySuspect) {
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ YIconComboBox yIconCombo = YECviewFactory.eINSTANCE.createYIconComboBox();
+ yIconCombo.setType(yTypedSuspect.getType());
+ yIconCombo.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ // AVOID to use the origin properties map into the addAll-Method!!!!!
+ // Afterwards the content of ySuspect.getProperties() is EMPTY!!!!
+ // Don´t think even to clone the properties EMap. Same result.
+ // Preferred way is as follows.
+ EMap<String, String> yEmbeddableProps = yIconCombo.getProperties();
+ for (Entry<String, String> prop : ySuspect.getProperties()) {
+ yEmbeddableProps.put(prop.getKey(), prop.getValue());
+ }
+ return yIconCombo;
+ }
+
+ /**
+ * Creates elements for a dtos subtype.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createSubTypeElements(YSubTypeBaseSuspect ySuspect) {
+
+ for (YSuspect temp : ySuspect.getChildren()) {
+ YSubTypeSuspect childSuspect = (YSubTypeSuspect) temp;
+
+ YDetailBeanSlot beanSlot = (YDetailBeanSlot) childSuspect.getBeanSlot();
+ for (YSuspect suspect : childSuspect.getChildren()) {
+ // Create a new suspect info.
+ YSuspectInfo suspectInfo = layoutingInfo.createSuspectInfo(suspect);
+ // add the suspectInfo as active suspect
+ layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+
+ YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ addElement(null, yEmbeddable, suspectInfo);
+
+ // create VP
+ // we are using the master beanslot for it. The subtypeSlot will
+ // only be invoked, if the type matches the type of the
+ // beanslot.
+ // but for visible=false we also need a not type-matching dto
+ suspectInfo.getVisibilityProcessors().add(createSubTypeVisibilityProcessor(yEmbeddable, childSuspect, beanSlot.getMasterBeanSlot()));
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Create a VP which reacts to the type of the value in the beanslot. And matches it against the type of the child suspect.
+ *
+ * @param yEmbeddable
+ *
+ * @param childSuspect
+ * @param beanSlot
+ *
+ * @return the vp
+ */
+ private YSubTypeVisibilityProcessor createSubTypeVisibilityProcessor(YEmbeddable yEmbeddable, YSubTypeSuspect childSuspect, YBeanSlot beanSlot) {
+ // create a VP which sets the element visible true/false if the
+ // type of the bound dto matches the expected or not
+ YSubTypeVisibilityProcessor yVp = YVisibilityFactory.eINSTANCE.createYSubTypeVisibilityProcessor();
+ yVp.setType(childSuspect.getType());
+ yVp.setTypeQualifiedName(childSuspect.getTypeQualifiedName());
+ yVp.setTarget(yEmbeddable);
+
+ // the binding endpoint for the slot
+ YBeanSlotValueBindingEndpoint slotEP = beanSlot.createBindingEndpoint("");
+
+ // the binding endpoint for the vp
+ YVisibilityProcessorValueBindingEndpoint vbEndpoint = BindingFactory.eINSTANCE.createYVisibilityProcessorValueBindingEndpoint();
+ vbEndpoint.setProperty("input");
+
+ YValueBinding yBinding = BindingFactory.eINSTANCE.createYValueBinding();
+ yBinding.setModelEndpoint(slotEP);
+ yBinding.setTargetEndpoint(vbEndpoint);
+ yBinding.setModelToTargetStrategy(YBindingUpdateStrategy.UPDATE);
+ yBinding.setTargetToModelStrategy(YBindingUpdateStrategy.NEVER);
+ yVp.getDataUsed().add(yBinding);
+
+ return yVp;
+ }
+
+ /**
+ * Creates the y blob upload component.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ // Helper Methods
+ private YEmbeddable createYBlobUploadComponent(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable = YECviewFactory.eINSTANCE.createYBlobUploadComponent();
+ if (existInProperties(ySuspect, PROPERTY_BLOB)) {
+ try {
+ ((YBlobUploadComponent) yEmbeddable).setDisplayResolutionId(Integer.parseInt(ySuspect.getProperties().get(PROPERTY_BLOB)));
+ } catch (NumberFormatException nfe) {
+ // TODO (JCD): ExceptionHandling
+ LOGGER.error("blob property is not from type int!");
+ }
+ if (existInProperties(ySuspect, PROPERTY_BLOB_FIRMLY_LINKED)) {
+ ((YBlobUploadComponent) yEmbeddable).setFirmlyLinked(true);
+ }
+ if (existInProperties(ySuspect, PROPERTY_BLOB_UNIQUE_NAMED)) {
+ ((YBlobUploadComponent) yEmbeddable).setUniqueNameEnabled(true);
+ }
+ }
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates a new {@link YRichTextArea} and configures it to use blob binding. See {@link YRichTextArea#createBlobValueEndpoint()}.
+ *
+ * @param ySuspect
+ * @return
+ */
+ private YEmbeddable createRichTextFieldBlob(YSuspect ySuspect) {
+ YRichTextArea yRichText = YECviewFactory.eINSTANCE.createYRichTextArea();
+ yRichText.setUseBlob(true);
+ return yRichText;
+ }
+
+ /**
+ * Creates a new {@link YRichTextArea} and configures it to use blob binding. See {@link YRichTextArea#createValueEndpoint()}.
+ *
+ * @param ySuspect
+ * @return
+ */
+ private YEmbeddable createRichTextFieldString(YSuspect ySuspect) {
+ YRichTextArea yRichText = YECviewFactory.eINSTANCE.createYRichTextArea();
+ yRichText.setUseBlob(false);
+ return yRichText;
+ }
+
+ /**
+ * Creates a new {@link YMaskedTextField}.
+ *
+ * @param ySuspect
+ * @return
+ */
+ private YEmbeddable createMaskedTextField(YSuspect ySuspect) {
+ YMaskedTextField yRichText = YECviewFactory.eINSTANCE.createYMaskedTextField();
+ yRichText.setMask(ySuspect.getProperties().get(ILayoutingStrategy.PROPERTY_MASK));
+ return yRichText;
+ }
+
+ /**
+ * Creates a new {@link YMaskedDecimalField}.
+ *
+ * @param ySuspect
+ * @return
+ */
+ private YEmbeddable createMaskedDecimalField(YSuspect ySuspect) {
+ YMaskedDecimalField yRichText = YECviewFactory.eINSTANCE.createYMaskedDecimalField();
+ yRichText.setMask(ySuspect.getProperties().get(ILayoutingStrategy.PROPERTY_MASK));
+
+ return yRichText;
+ }
+
+ /**
+ * Creates a new {@link YPasswordField} and configures it to use blob binding. See {@link YPasswordField#createValueEndpoint()}.
+ *
+ * @param ySuspect
+ * @return
+ */
+ private YEmbeddable createPasswordField(YSuspect ySuspect) {
+ YPasswordField yPasswordField = ExtensionModelFactory.eINSTANCE.createYPasswordField();
+ return yPasswordField;
+ }
+
+ /**
+ * Creates the y bean reference.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createYBeanReference(YSuspect ySuspect) {
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ EMap<String, String> suspectProperties = yTypedSuspect.getProperties();
+ YEmbeddable yEmbeddable = null;
+ if (isEditable(ySuspect)) {
+ if (suspectProperties.containsKey(ILayoutingStrategy.PROPERTY__ITEM_CAPTION)) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYBeanReferenceField();
+ YBeanReferenceField beanReferenceField = (YBeanReferenceField) yEmbeddable;
+ beanReferenceField.setType(yTypedSuspect.getType());
+ beanReferenceField.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ beanReferenceField.setCaptionPropertyPath(getCaptionPropertyPath(suspectProperties));
+ }
+ // Alternative for non editable bean references is a non editable
+ // Textfield.
+ } else {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTextField();
+ for (YBindingEndpoint vEndPoint : yTypedSuspect.getValueBindingEndpoints()) {
+ if (vEndPoint instanceof YDetailValueBindingEndpoint) {
+ YDetailValueBindingEndpoint detailedVEndpoint = (YDetailValueBindingEndpoint) vEndPoint;
+ detailedVEndpoint.setPropertyPath(detailedVEndpoint.getPropertyPath().concat(".").concat(getCaptionPropertyPath(suspectProperties)));
+ }
+ }
+ yTypedSuspect.setId(ySuspect.getId().concat(".").concat(yTypedSuspect.getTypeQualifiedName()).concat(".").concat(getCaptionPropertyPath(suspectProperties)));
+ yTypedSuspect.setTypeQualifiedName(String.class.getCanonicalName());
+ yTypedSuspect.setType(String.class);
+ }
+ // TODO: check if yEmbeddable might be set by some other condition.
+ // Otherwise it might be null.
+ return yEmbeddable;
+ }
+
+ private String getCaptionPropertyPath(EMap<String, String> suspectProperties) {
+ String captionPropertyPath = suspectProperties.get(ILayoutingStrategy.PROPERTY__ITEM_CAPTION);
+ if (captionPropertyPath == null || captionPropertyPath.isEmpty()) {
+ captionPropertyPath = suspectProperties.get(ILayoutingStrategy.PROPERTY__ITEM_DESCRIPTION);
+ }
+ return captionPropertyPath;
+ }
+
+ /**
+ * Creates the y combo box.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createSimpleComboBox(YSuspect ySuspect) {
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ EMap<String, String> suspectProperties = yTypedSuspect.getProperties();
+ YComboBox yEmbeddable = null;
+ if (suspectProperties.containsKey("caption")) {
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
+ YComboBox comboBox = (YComboBox) yEmbeddable;
+ comboBox.setType(yTypedSuspect.getType());
+ comboBox.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ comboBox.setCaptionProperty(suspectProperties.get("caption"));
+ }
+ // TODO: check if yEmbeddable might be set by some other condition.
+ // Otherwise it might be null.
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the table.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createTable(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ YCollectionSuspect yCollectionSuspect = (YCollectionSuspect) ySuspect;
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTable();
+
+ YTable table = (YTable) yEmbeddable;
+ table.setType(yCollectionSuspect.getType());
+ table.setTypeQualifiedName(yCollectionSuspect.getTypeQualifiedName());
+ table.setUseBeanService(false);
+ EList<YColumn> columns = table.getColumns();
+ for (YColumnInfo columnInfo : yCollectionSuspect.getColumns()) {
+ YColumn column = ExtensionModelFactoryImpl.eINSTANCE.createYColumn();
+ column.setPropertyPath(columnInfo.getName());
+ column.setLabel(columnInfo.getName());
+ column.setType(columnInfo.getType());
+ column.setTypeQualifiedName(columnInfo.getTypeQualifiedName());
+ column.setConverter(getConverter(columnInfo.getProperties()));
+ YDatadescription datadescription = DatatypesFactoryImpl.eINSTANCE.createYDatadescription();
+ datadescription.setLabelI18nKey(columnInfo.getLabelI18nKey());
+ column.setDatadescription(datadescription);
+ columns.add(column);
+ }
+ for (YColumn yColumn : table.getColumns()) {
+ yColumn.setVisible(true);
+ }
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the grid.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createGrid(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ YCollectionSuspect yTypedSuspect = (YCollectionSuspect) ySuspect;
+ GridFactory gFactory = new GridFactory();
+ CxGrid grid = gFactory.createGrid(yTypedSuspect);
+ grid = CxGridUtil.setPermissions(userAccessService, grid);
+ yEmbeddable = grid;
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the enum options.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createEnumOptions(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYEnumOptionsGroup();
+ YEnumOptionsGroup enumOptionsGroup = (YEnumOptionsGroup) yEmbeddable;
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ enumOptionsGroup.setType(yTypedSuspect.getType());
+ enumOptionsGroup.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the enum combo boxes.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createEnumCombo(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYEnumComboBox();
+ YEnumComboBox yEnumCombo = (YEnumComboBox) yEmbeddable;
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ yEnumCombo.setType(yTypedSuspect.getType());
+ yEnumCombo.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the organization combo box inclosing organization positions.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createOrganizationCombo(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
+ YComboBox yCombo = (YComboBox) yEmbeddable;
+ yCombo.setUseBeanService(false);
+ YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ yCombo.setType(yTypedSuspect.getType());
+ yCombo.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ Collection<String> positionNames = getOrganizationPositionNames(ProductConfiguration.getAuthenticationOrganizationId());
+ if (positionNames.isEmpty()) {
+ yCombo.getCollection().add(IUserAccessService.ADMINISTRATOR);
+ yCombo.setSelection(IUserAccessService.ADMINISTRATOR);
+ yCombo.setEditable(false);
+ } else {
+ yCombo.getCollection().addAll(getOrganizationPositionNames(ProductConfiguration.getAuthenticationOrganizationId()));
+ }
+ return yEmbeddable;
+ }
+
+ /**
+ * Creates the perspective combo box inclosing perspectives.
+ *
+ * @param ySuspect
+ * the y suspect
+ * @return the y embeddable
+ */
+ private YEmbeddable createPerspectiveCombo(YSuspect ySuspect) {
+ YEmbeddable yEmbeddable;
+ yEmbeddable = YECviewFactory.eINSTANCE.createYPairComboBox();
+ YPairComboBox yCombo = (YPairComboBox) yEmbeddable;
+ yCombo.setUseBeanService(false);
+ // YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
+ // yCombo.setType(yTypedSuspect.getType());
+ // yCombo.setTypeQualifiedName(yTypedSuspect.getTypeQualifiedName());
+ yCombo.setType(Pair.class);
+ yCombo.setTypeQualifiedName(Pair.class.getCanonicalName());
+ yCombo.getCollection().addAll(getPerspectiveNames());
+ yCombo.setCaptionProperty("first");
+ return yEmbeddable;
+ }
+
+ private Collection<? extends IPosition> getOrganizationPositions(String organizationName) {
+ IOrganizationService organizationService = ServiceListener.getOrganizationService();
+ // In case of the open source solution a organization service is not available!
+ if (organizationService != null) {
+ AbstractSubOrganization organization = organizationService.getOrganization(organizationName);
+ if (organization != null) {
+ return organization.getPositions();
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ private Collection<String> getOrganizationPositionNames(String organizationName) {
+ IOrganizationService organizationService = ServiceListener.getOrganizationService();
+ // In case of the open source solution a organization service is not available!
+ if (organizationService != null) {
+ AbstractSubOrganization organization = organizationService.getOrganization(organizationName);
+ if (organization != null) {
+ Collection<String> positionNames = new TreeSet<String>();
+ for (IPosition position : organization.getPositions()) {
+ positionNames.add(position.getName().replace("_", " "));
+ }
+ return positionNames;
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ @SuppressWarnings("rawtypes")
+ private Collection<Pair> getPerspectiveNames() {
+ return dslMetadataService.getDslGrammarElementNames(IDSLMetadataService.DSLLiterals.PERSPECTIVES);
+ }
+
+ /**
+ * Sets the custom decimal converter.
+ *
+ * @param yEmbeddable
+ * the y embeddable
+ * @param ySuspect
+ * the y suspect
+ */
+ private void setCustomDecimalConverter(YEmbeddable yEmbeddable, YSuspect ySuspect) {
+ if (existFunctionsInProperties(ySuspect)) {
+ YCustomDecimalConverter converter = YConverterFactory.eINSTANCE.createYCustomDecimalConverter();
+ converter.getProperties().addAll(ySuspect.getProperties());
+ ((YCustomDecimalField) yEmbeddable).setConverter(converter);
+ }
+ }
+
+ /**
+ * Checks if is tab sheet needed.
+ *
+ * @param suspects
+ * the suspects
+ * @return true, if is tab sheet needed
+ */
+ private boolean isTabSheetNeeded(EList<YSuspect> suspects) {
+ for (YSuspect suspect : suspects) {
+ if (suspect.getTags().contains(TAG__TABLE) || suspect.getTags().contains(TAG__GRID)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Checks for existing supect property
+ */
+ private boolean existInProperties(YElement ySuspect, String propConstant) {
+ if (!ySuspect.getProperties().isEmpty()) {
+ String propertyValue = ySuspect.getProperties().get(propConstant);
+ if (propertyValue != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Gets the converter.
+ *
+ * @param properties
+ * the properties
+ * @return the converter
+ */
+ public static YConverter getConverter(EMap<String, String> properties) {
+ String decimalformatPropertyValue = properties.get(PROPERTY_DECIMALFORMAT);
+ if (decimalformatPropertyValue != null) {
+ YSimpleDecimalConverter yConverter = YConverterFactory.eINSTANCE.createYSimpleDecimalConverter();
+ yConverter.setNumberFormatPattern(decimalformatPropertyValue);
+ return yConverter;
+ } else {
+ return null;
+ }
+
+ }
+
+ /**
+ * Helper class to determine if the component is editable due to the existing user permissions
+ */
+ private boolean isEditable(YSuspect ySuspect) {
+ String dtoName = ySuspect.getAuthorizationGroup();
+ String dtoProperty = ySuspect.getAuthorizationId();
+
+ if (userAccessService.isPermitted(Permission.forDto(dtoName, Action.readable)).isPermitted()) {
+ boolean invisible = userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.invisible)).isPermitted();
+ if (!invisible) {
+ boolean enabled = !userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.disabled)).isPermitted();
+ boolean editable = !userAccessService.isPermitted(Permission.forDtoProperty(dtoName, dtoProperty, Action.noneditable)).isPermitted();
+ if (enabled && editable) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Gets the entity i18n key.
+ *
+ * @param suspects
+ * the suspects
+ * @return the entity i18n key
+ */
+ private String getEntityI18nKey(EList<YSuspect> suspects) {
+ for (YSuspect suspect : suspects) {
+ String dto = suspect.getAuthorizationGroup();
+ return NamingConventionsUtil.toFqnEntityName(dto);
+ }
+ return "";
+ }
+
+ /**
+ * Returns true, if the label is valid.
+ *
+ * @param i18nKey
+ * the i18n key
+ * @return true, if is label i18n key valid
+ */
+ private boolean isLabelI18nKeyValid(String i18nKey) {
+ return i18nKey != null;
+ }
+
+ /**
+ * Returns the active locale for the view.
+ *
+ * @return the locale
+ */
+ private Locale getLocale() {
+ return viewContext.getLocale();
+ }
+
+ /**
+ * Helper Comparator to allow to sort a list of suspects due to their table or grid property value. Sort criteria is that the highest value became the first of the list
+ * followed by the suspects with decreasing value. In case of same values the order between the compared suspects will be maintained and in case of no value the suspect gets
+ * the value 0 and became the last elements of the list.
+ *
+ * @author Jose C. Dominguez
+ *
+ */
+ class SuspectComparator implements Comparator<YSuspect> {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(YSuspect suspect1, YSuspect suspect2) {
+ if (suspect1 == null && suspect2 == null) {
+ return 0;
+ } else if (suspect1 == null && suspect2 != null) {
+ return (-1);
+ } else if (suspect1 != null && suspect2 == null) {
+ return 1;
+ } else if (suspect1 != null && suspect2 != null) {
+ boolean _lessThan = (getValue(suspect1).compareTo(getValue(suspect2)) < 0);
+ if (_lessThan) {
+ return 1;
+ } else {
+ boolean _greaterThan = (getValue(suspect1).compareTo(getValue(suspect2)) > 0);
+ if (_greaterThan) {
+ return (-1);
+ } else {
+ return 0;
+ }
+ }
+ }
+ return 0;
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @param suspect
+ * the suspect
+ * @return the value
+ */
+ private Integer getValue(YSuspect suspect) {
+ try {
+ String value = suspect.getProperties().get(PROPERTY_TABLE);
+ if (value == null) {
+ value = suspect.getProperties().get(PROPERTY_GRID);
+ }
+ return Integer.valueOf(value);
+ } catch (NumberFormatException nfe) {
+ return new Integer(0);
+ }
+ }
+
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/Activator.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/Activator.java
new file mode 100644
index 0000000..960b446
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/Activator.java
@@ -0,0 +1,54 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.gitinfo.Loginfo;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The Class Activator.
+ */
+public class Activator implements BundleActivator {
+
+ /** The context. */
+ private static BundleContext context;
+
+ /**
+ * Gets the context.
+ *
+ * @return the context
+ */
+ static BundleContext getContext() {
+ return context;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ Activator.context = bundleContext;
+ (new Loginfo()).print( Activator.class.getCanonicalName(), Activator.class.getClassLoader());
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ Activator.context = null;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java
new file mode 100644
index 0000000..98651d9
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategy.java
@@ -0,0 +1,99 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+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.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+
+import com.vaadin.event.ShortcutAction.KeyCode;
+import com.vaadin.event.ShortcutAction.ModifierKey;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class AltEnterForwardFocusingStrategy.
+ */
+public class AltEnterForwardFocusingStrategy implements IFocusingStrategy {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout yLayout) {
+ YView yView = yLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round robin
+ * approach. If end of elements are reached, we start by index = 0 again.
+ *
+ * @param yElement
+ * the y element
+ * @return the y embeddable
+ */
+ protected YEmbeddable findNextElementToFocus(YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == yParent.getElements().size() - 1) {
+ // element is the last -> Start again
+ index = 0;
+ } else {
+ // use the next element
+ index = index + 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ if (nextFocusElement instanceof YEditable){
+ if (((YEditable)nextFocusElement).isEditable()){
+ return nextFocusElement;
+ } else {
+ return findNextElementToFocus(nextFocusElement);
+ }
+ }
+ return nextFocusElement;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
+ */
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ int[] modifierKeys = new int[1];
+ modifierKeys[0] = ModifierKey.ALT;
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER,
+ modifierKeys);
+ return def;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategyProvider.java
new file mode 100644
index 0000000..474af65
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AltEnterForwardFocusingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+
+/**
+ * The Class AltEnterForwardFocusingStrategyProvider.
+ */
+@Component(immediate=true, service = IFocusingStrategyProvider.class, property = { "ecview.focusing.id=cx.altenter.forward" })
+public class AltEnterForwardFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "cx.altenter.forward";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider#getStrategy()
+ */
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return new AltEnterForwardFocusingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategy.java
new file mode 100644
index 0000000..9226c3f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategy.java
@@ -0,0 +1,85 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+
+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.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YCssLayout;
+
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+
+/**
+ * Vertical layouting.
+ */
+public class CssLayoutLayoutingStrategy extends AbstractLayoutingStrategy {
+
+ /**
+ * Instantiates a new css layout layouting strategy.
+ */
+ public CssLayoutLayoutingStrategy() {
+ super(null);
+ }
+
+// @Override
+// public void layout(YLayoutingInfo layoutingInfo) {
+// YStrategyLayout yLayout = layoutingInfo.getLayout();
+// layoutingInfo.getActiveSuspectInfos().clear();
+//
+// YCssLayout content = (YCssLayout) createContentLayout();
+//
+// for (YSuspect suspect : new ArrayList<YSuspect>(
+// yLayout.getSuspects())) {
+// YSuspectInfo suspectInfo = layoutingInfo
+// .createSuspectInfo(suspect);
+// // add the suspectInfo as active suspect
+// layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+//
+// YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+//
+// // if (ySuspect.getTags().contains(Group.DISCOUNT.groupId)){
+// // cellStyle.addSpanInfo(0,rowId1,0,rowId1);
+// // rowId1++;
+// // } else {
+// // cellStyle.addSpanInfo(1,rowId2,1,rowId2);
+// // rowId2++;
+// // }
+// content.addElement(yEmbeddable);
+// }
+//
+// layoutingInfo.setContent(content);
+// }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#createContentLayout()
+ */
+@Override
+ protected YLayout createContentLayout() {
+ return ExtensionModelFactory.eINSTANCE.createYCssLayout();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#addElement(org.eclipse.osbp.ecview.core.common.model.core.YLayout, org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ protected void addElement(YLayout layout, YEmbeddable element) {
+ layout.addElement(element);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategyProvider.java
new file mode 100644
index 0000000..a1ec762
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/CssLayoutLayoutingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class CssLayoutLayoutingStrategyProvider.
+ */
+@Component(immediate = true, service = ILayoutingStrategyProvider.class, property = { "ecview.layouting.id=CssLayoutLayoutingStrategy" })
+public class CssLayoutLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "CssLayoutLayoutingStrategy";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new CssLayoutLayoutingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/DefaultLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/DefaultLayoutingStrategyProvider.java
new file mode 100644
index 0000000..b733c5a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/DefaultLayoutingStrategyProvider.java
@@ -0,0 +1,45 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class DefaultLayoutingStrategyProvider.
+ */
+public class DefaultLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The strategy. */
+ private final ILayoutingStrategy strategy;
+
+ /**
+ * Instantiates a new default layouting strategy provider.
+ *
+ * @param strategy
+ * the strategy
+ */
+ public DefaultLayoutingStrategyProvider(ILayoutingStrategy strategy) {
+ this.strategy = strategy;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return strategy;
+ }
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java
new file mode 100644
index 0000000..012db1d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategy.java
@@ -0,0 +1,95 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+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.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+
+import com.vaadin.event.ShortcutAction.KeyCode;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class EnterBackwardFocusingStrategy.
+ */
+public class EnterBackwardFocusingStrategy implements IFocusingStrategy {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout yLayout) {
+ YView yView = yLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round robin
+ * approach. If the first element is reached, we start at the end again.
+ *
+ * @param yElement
+ * the y element
+ * @return the y embeddable
+ */
+ protected YEmbeddable findNextElementToFocus(YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == 0) {
+ // element is the first -> Start again
+ index = yParent.getElements().size() - 1;
+ } else {
+ // use the previous element
+ index = index - 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ if (nextFocusElement instanceof YEditable){
+ if (((YEditable)nextFocusElement).isEditable()){
+ return nextFocusElement;
+ } else {
+ return findNextElementToFocus(nextFocusElement);
+ }
+ }
+ return nextFocusElement;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
+ */
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER, new int[0]);
+ return def;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategyProvider.java
new file mode 100644
index 0000000..0c86401
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterBackwardFocusingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+
+/**
+ * The Class EnterBackwardFocusingStrategyProvider.
+ */
+@Component(immediate=true, service = IFocusingStrategyProvider.class, property = { "ecview.focusing.id=cx.enter.backward" })
+public class EnterBackwardFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "cx.enter.backward";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider#getStrategy()
+ */
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return new EnterBackwardFocusingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java
new file mode 100644
index 0000000..fa49b57
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategy.java
@@ -0,0 +1,96 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+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.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+
+import com.vaadin.event.ShortcutAction.KeyCode;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class EnterForwardFocusingStrategy.
+ */
+public class EnterForwardFocusingStrategy implements IFocusingStrategy {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout yLayout) {
+ YView yView = yLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round robin
+ * approach. If end of elements are reached, we start by index = 0 again.
+ *
+ * @param yElement
+ * the y element
+ * @return the y embeddable
+ */
+ protected YEmbeddable findNextElementToFocus(YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == yParent.getElements().size() - 1) {
+ // element is the last -> Start again
+ index = 0;
+ } else {
+ // use the next element
+ index = index + 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ if (nextFocusElement instanceof YEditable){
+ if (((YEditable)nextFocusElement).isEditable()){
+ return nextFocusElement;
+ } else {
+ return findNextElementToFocus(nextFocusElement);
+ }
+ }
+ return nextFocusElement;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
+ */
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.ENTER,
+ new int[0]);
+ return def;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategyProvider.java
new file mode 100644
index 0000000..2d6bdd2
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/EnterForwardFocusingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+
+/**
+ * The Class EnterForwardFocusingStrategyProvider.
+ */
+@Component(immediate=true, service = IFocusingStrategyProvider.class, property = { "ecview.focusing.id=cx.enter.forward" })
+public class EnterForwardFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "cx.enter.forward";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider#getStrategy()
+ */
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return new EnterForwardFocusingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategy.java
new file mode 100644
index 0000000..789fe91
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategy.java
@@ -0,0 +1,130 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+
+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.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YFormLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YHorizontalLayout;
+
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+
+/**
+ * Vertical layouting.
+ */
+public class FormLayoutLayoutingStrategy extends AbstractLayoutingStrategy {
+
+ /** The left. */
+ private YFormLayout left;
+
+ /** The right. */
+ private YFormLayout right;
+
+ /** The index. */
+ private int index;
+
+ /**
+ * The Enum Group.
+ */
+ public enum Group {
+
+ /** The discount. */
+ DISCOUNT("discount"),
+
+ /** The nondiscount. */
+ NONDISCOUNT("non-discount"),
+
+ /** The nothing. */
+ NOTHING("nothing");
+
+ /** The group id. */
+ private final String groupId;
+
+ /**
+ * Instantiates a new group.
+ *
+ * @param groupId
+ * the group id
+ */
+ Group(String groupId) {
+ this.groupId = groupId;
+ }
+ }
+
+ /**
+ * Instantiates a new form layout layouting strategy.
+ */
+ public FormLayoutLayoutingStrategy() {
+ super(null);
+ }
+
+// @Override
+// public void layout(YLayoutingInfo layoutingInfo) {
+// YStrategyLayout yLayout = layoutingInfo.getLayout();
+// layoutingInfo.getActiveSuspectInfos().clear();
+//
+// YHorizontalLayout content = (YHorizontalLayout) createContentLayout();
+//
+// for (YSuspect suspect : new ArrayList<YSuspect>(
+// yLayout.getSuspects())) {
+// YSuspectInfo suspectInfo = layoutingInfo
+// .createSuspectInfo(suspect);
+// // add the suspectInfo as active suspect
+// layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+//
+// YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+//
+// // if (ySuspect.getTags().contains(Group.DISCOUNT.groupId)){
+// // cellStyle.addSpanInfo(0,rowId1,0,rowId1);
+// // rowId1++;
+// // } else {
+// // cellStyle.addSpanInfo(1,rowId2,1,rowId2);
+// // rowId2++;
+// // }
+// addElement(yEmbeddable);
+// }
+//
+// layoutingInfo.setContent(content);
+// }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#createContentLayout()
+ */
+@Override
+ protected YLayout createContentLayout() {
+ YHorizontalLayout layout = ExtensionModelFactory.eINSTANCE.createYHorizontalLayout();
+ left = ExtensionModelFactory.eINSTANCE.createYFormLayout();
+ right = ExtensionModelFactory.eINSTANCE.createYFormLayout();
+
+ layout.addElement(left);
+ layout.addElement(right);
+ return layout;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#addElement(org.eclipse.osbp.ecview.core.common.model.core.YLayout, org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ protected void addElement(YLayout layout, YEmbeddable element) {
+ if(index % 2 == 0) left.addElement(element); else right.addElement(element);
+ index++;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategyProvider.java
new file mode 100644
index 0000000..de03a55
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/FormLayoutLayoutingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class FormLayoutLayoutingStrategyProvider.
+ */
+@Component(immediate = true, service = ILayoutingStrategyProvider.class, property = { "ecview.layouting.id=FormLayoutStrategy" })
+public class FormLayoutLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "FormLayoutStrategy";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new FormLayoutLayoutingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridFactory.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridFactory.java
new file mode 100644
index 0000000..7dbb076
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridFactory.java
@@ -0,0 +1,196 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.lang.reflect.Field;
+import java.util.Date;
+
+import org.eclipse.osbp.dsl.common.datatypes.IDto;
+import org.eclipse.osbp.ecview.core.common.model.core.YConverter;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.runtime.common.annotations.DtoUtils;
+import org.eclipse.osbp.utils.functionnormalizer.entities.FunctionType;
+import org.eclipse.osbp.utils.functionnormalizer.api.FunctionTypingAPI;
+
+import org.eclipse.osbp.ecview.extension.grid.CxGrid;
+import org.eclipse.osbp.ecview.extension.grid.CxGridColumn;
+import org.eclipse.osbp.ecview.extension.grid.CxGridFactory;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridDateRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRenderer;
+import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererFactory;
+import org.eclipse.osbp.ecview.extension.model.YCollectionSuspect;
+import org.eclipse.osbp.ecview.extension.model.YColumnInfo;
+import org.eclipse.osbp.ecview.extension.model.converter.YConverterFactory;
+
+/**
+ * A factory for creating Grid objects.
+ */
+public class GridFactory {
+
+ /** The grid factory. */
+ private CxGridFactory gridFactory = CxGridFactory.eINSTANCE;
+
+ /**
+ * Creates a new Grid object.
+ *
+ * @param suspect
+ * the suspect
+ * @return the cx grid
+ */
+ public CxGrid createGrid(YCollectionSuspect suspect) {
+
+ CxGrid grid = gridFactory.createCxGrid();
+ grid.setId(suspect.getId());
+ grid.setEditorEnabled(true);
+ grid.setHeaderVisible(true);
+ grid.setFilteringVisible(true);
+ grid.setCustomFilters(false);
+ grid.setUseBeanService(false);
+ grid.setColumnReorderingAllowed(true);
+ grid.setType(suspect.getType());
+ grid.setTypeQualifiedName(suspect.getTypeQualifiedName());
+
+ // lets iterate all the columns for the given suspect
+ // and transform them to grid columns
+ for (YColumnInfo info : suspect.getColumns()) {
+ CxGridColumn col = gridFactory.createCxGridColumn();
+ col.setName(info.getName());
+ col.setLabelI18nKey(info.getLabelI18nKey());
+ // We need to handle DTOs
+ // for them we create a nested property eg. "productgroup.name"
+ //
+ Class<?> type = info.getType();
+ if(type == null) {
+ continue;
+ }
+ if (IDto.class.isAssignableFrom(type)) {
+ Field domainKeyField = DtoUtils.getDomainKeyField(type);
+ if (domainKeyField == null) {
+ // we have no idea which field could be shown as a business
+ // key
+ continue;
+ }
+
+ // lets create a nested property path. Eg. "productgroup.name"
+ String propertyPath = info.getName() + "."
+ + domainKeyField.getName();
+ col.setPropertyPath(propertyPath);
+ col.setPropertyId(propertyPath);
+ col.setType(domainKeyField.getType());
+ col.setTypeQualifiedName(domainKeyField.getType().getName());
+ } else {
+ col.setPropertyPath(info.getName());
+ col.setPropertyId(info.getName());
+ col.setType(info.getType());
+ col.setTypeQualifiedName(info.getTypeQualifiedName());
+ }
+
+ col.setHideable(true);
+
+ Pair pair = createRendererPair(info);
+ col.setRenderer(pair.renderer);
+ col.setConverter(pair.converter);
+
+ // create the editor fields
+ if (info.getType() == Boolean.class
+ || info.getType() == Boolean.TYPE) {
+ col.setEditorField(ExtensionModelFactory.eINSTANCE
+ .createYCheckBox());
+ col.setEditable(true);
+ } else if (info.getType() == Date.class) {
+ col.setEditorField(ExtensionModelFactory.eINSTANCE
+ .createYDateTime());
+ col.setEditable(true);
+ // } else if (info.getType() == Float.class
+ // || info.getType() == Boolean.TYPE) {
+ // YSlider pgbar =
+ // ExtensionModelFactory.eINSTANCE.createYSlider();
+ // pgbar.setMaxValue(1000d);
+ // col.setEditorField(pgbar);
+ // col.setEditable(true);
+ } else {
+ col.setEditorField(ExtensionModelFactory.eINSTANCE
+ .createYTextField());
+ col.setEditable(true);
+ }
+
+ grid.getColumns().add(col);
+ }
+
+ return grid;
+ }
+
+ /**
+ * Creates a renderer for the given property.
+ *
+ * @param info
+ * the info
+ * @return the pair
+ */
+ protected Pair createRendererPair(YColumnInfo info) {
+ Pair pair = new Pair();
+ pair.converter = AbstractLayoutingStrategy.getConverter(info.getProperties());
+ FunctionTypingAPI functionTypingApi = new FunctionTypingAPI();
+ for (FunctionType functionType : functionTypingApi.getTypes()) {
+ String functionPropertyValue = info.getProperties().get(
+ functionType.getName());
+ if (functionPropertyValue != null) {
+ pair.converter = YConverterFactory.eINSTANCE
+ .createYCustomDecimalConverter();
+ pair.converter.getProperties().addAll(info.getProperties());
+ }
+ }
+
+ if (info.getType() == Boolean.class || info.getType() == Boolean.TYPE) {
+ pair.renderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridBooleanRenderer();
+ } else if (info.getType() == Date.class) {
+ CxGridDateRenderer renderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridDateRenderer();
+ // TODO set a dateformat here
+ // renderer.setDateFormat(value);
+ pair.renderer = renderer;
+ } else {
+ pair.renderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridTextRenderer();
+ }
+
+ return pair;
+ }
+
+ /**
+ * Creates a new Grid object.
+ *
+ * @return the pair
+ */
+ protected Pair createBadRenderer() {
+ Pair pair = new Pair();
+ pair.renderer = CxGridRendererFactory.eINSTANCE
+ .createCxGridTextRenderer();
+ return pair;
+ }
+
+ /**
+ * The Class Pair.
+ */
+ protected static class Pair {
+
+ /** The renderer. */
+ public CxGridRenderer renderer;
+
+ /** The converter. */
+ public YConverter converter;
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategy.java
new file mode 100644
index 0000000..b184598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategy.java
@@ -0,0 +1,131 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+import org.eclipse.osbp.ecview.core.common.model.core.YLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YGridLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YGridLayoutCellStyle;
+
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+
+/**
+ * Vertical layouting.
+ */
+public class GridLayoutLayoutingStrategy extends AbstractLayoutingStrategy {
+
+ /**
+ * The Enum Group.
+ */
+ public enum Group {
+
+ /** The discount. */
+ DISCOUNT("discount"),
+
+ /** The nondiscount. */
+ NONDISCOUNT("non-discount"),
+
+ /** The nothing. */
+ NOTHING("nothing");
+
+ /** The group id. */
+ private final String groupId;
+
+ /**
+ * Instantiates a new group.
+ *
+ * @param groupId
+ * the group id
+ */
+ Group(String groupId) {
+ this.groupId = groupId;
+ }
+ }
+
+ /**
+ * Instantiates a new grid layout layouting strategy.
+ */
+ public GridLayoutLayoutingStrategy() {
+ super(null);
+ }
+
+// @Override
+// public void layout(YLayoutingInfo layoutingInfo) {
+// YStrategyLayout yLayout = layoutingInfo.getLayout();
+// layoutingInfo.getActiveSuspectInfos().clear();
+//
+// YGridLayout content = (YGridLayout) createContentLayout();
+//
+// content.setColumns(2);
+// int rowId1 = 0, rowId2 = 0;
+// YSuspectInfo lastInfo = null;
+// for (YSuspect suspect : new ArrayList<YSuspect>(
+// yLayout.getSuspects())) {
+// YSuspectInfo currentInfo = layoutingInfo
+// .createSuspectInfo(suspect);
+//
+// // add the suspectInfo as active suspect
+// layoutingInfo.getActiveSuspectInfos().add(currentInfo);
+//
+// YEmbeddable yEmbeddable = prepareElementForSuspect(currentInfo);
+//
+// // A ->next B ->next C
+// if (lastInfo != null) {
+// lastInfo.setNextFocus(currentInfo);
+// } else if (yEmbeddable instanceof YFocusable) {
+// layoutingInfo.setFirstFocus(currentInfo);
+// }
+// lastInfo = currentInfo;
+//
+// YSuspect ySuspect = currentInfo.getSuspect();
+// YGridLayoutCellStyle cellStyle = content
+// .addGridLayoutCellStyle(yEmbeddable);
+//
+// // if (ySuspect.getTags().contains(Group.DISCOUNT.groupId)){
+// // cellStyle.addSpanInfo(0,rowId1,0,rowId1);
+// // rowId1++;
+// // } else {
+// // cellStyle.addSpanInfo(1,rowId2,1,rowId2);
+// // rowId2++;
+// // }
+// content.addElement(yEmbeddable);
+// }
+//
+// layoutingInfo.setContent(content);
+// }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#createContentLayout()
+ */
+@Override
+ protected YLayout createContentLayout() {
+ return ExtensionModelFactory.eINSTANCE.createYGridLayout();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#addElement(org.eclipse.osbp.ecview.core.common.model.core.YLayout, org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ protected void addElement(YLayout layout, YEmbeddable element) {
+ layout.addElement(element);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategyProvider.java
new file mode 100644
index 0000000..3b973eb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/GridLayoutLayoutingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class GridLayoutLayoutingStrategyProvider.
+ */
+@Component(immediate = true, service = ILayoutingStrategyProvider.class, property = { "ecview.layouting.id=GridLLayoutLayoutingStrategy" })
+public class GridLayoutLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "GridLLayoutLayoutingStrategy";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new GridLayoutLayoutingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategy.java
new file mode 100644
index 0000000..8207016
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategy.java
@@ -0,0 +1,85 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+
+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.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YHorizontalLayout;
+
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+
+/**
+ * Vertical layouting.
+ */
+public class HorizontalLayoutLayoutingStrategy extends AbstractLayoutingStrategy {
+
+ /**
+ * Instantiates a new horizontal layout layouting strategy.
+ */
+ public HorizontalLayoutLayoutingStrategy() {
+ super(null);
+ }
+
+// @Override
+// public void layout(YLayoutingInfo layoutingInfo) {
+// YStrategyLayout yLayout = layoutingInfo.getLayout();
+// layoutingInfo.getActiveSuspectInfos().clear();
+//
+// YHorizontalLayout content = (YHorizontalLayout) createContentLayout();
+//
+// for (YSuspect suspect : new ArrayList<YSuspect>(
+// yLayout.getSuspects())) {
+// YSuspectInfo suspectInfo = layoutingInfo
+// .createSuspectInfo(suspect);
+// // add the suspectInfo as active suspect
+// layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+//
+// YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+//
+// // if (ySuspect.getTags().contains(Group.DISCOUNT.groupId)){
+// // cellStyle.addSpanInfo(0,rowId1,0,rowId1);
+// // rowId1++;
+// // } else {
+// // cellStyle.addSpanInfo(1,rowId2,1,rowId2);
+// // rowId2++;
+// // }
+// content.addElement(yEmbeddable);
+// }
+//
+// layoutingInfo.setContent(content);
+// }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#createContentLayout()
+ */
+@Override
+ protected YLayout createContentLayout() {
+ return ExtensionModelFactory.eINSTANCE.createYHorizontalLayout();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#addElement(org.eclipse.osbp.ecview.core.common.model.core.YLayout, org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ protected void addElement(YLayout layout, YEmbeddable element) {
+ layout.addElement(element);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategyProvider.java
new file mode 100644
index 0000000..c50d09a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/HorizontalLayoutLayoutingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class HorizontalLayoutLayoutingStrategyProvider.
+ */
+@Component(immediate = true, service = ILayoutingStrategyProvider.class, property = { "ecview.layouting.id=HorizontalLayoutLayoutingStrategy" })
+public class HorizontalLayoutLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "HorizontalLayoutLayoutingStrategy";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new HorizontalLayoutLayoutingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/ServiceListener.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/ServiceListener.java
new file mode 100644
index 0000000..62263ca
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/ServiceListener.java
@@ -0,0 +1,78 @@
+/**
+ *
+ * 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.ecview.extension.strategy;
+
+import org.eclipse.osbp.ui.api.useraccess.IOrganizationService;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The listener interface for receiving service events. The class that is
+ * interested in processing a service event implements this interface, and the
+ * object created with that class is registered with a component using the
+ * component's <code>addServiceListener</code> method. When the service event
+ * occurs, that object's appropriate method is invoked.
+ *
+ */
+// TODO: check reference
+/*
+ * reference not found
+ *
+ * @see ServiceEvent
+ */
+@Component
+public class ServiceListener {
+
+ /** The Constant LOGGER. */
+ private static final Logger LOGGER = LoggerFactory.getLogger(ServiceListener.class);
+
+ /** The Constant sOrganizationServices. */
+ private static IOrganizationService sOrganizationService;
+
+ /**
+ * Gets the organization services.
+ *
+ * @return the organization services
+ */
+ public static IOrganizationService getOrganizationService() {
+ return sOrganizationService;
+ }
+
+ /**
+ * Bind organization service.
+ *
+ * @param organization
+ * the organization
+ */
+ @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC)
+ public void bindOrganizationService(IOrganizationService organization) {
+ LOGGER.debug(ServiceListener.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " bound");
+ sOrganizationService = organization;
+ }
+
+ /**
+ * Unbind organization service.
+ *
+ * @param organization
+ * the organization
+ */
+ public void unbindOrganizationService(IOrganizationService organization) {
+ LOGGER.debug(ServiceListener.class.getCanonicalName() + ": " + organization.getClass().getCanonicalName() + " unbound");
+ sOrganizationService = null;
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java
new file mode 100644
index 0000000..a5c844b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategy.java
@@ -0,0 +1,112 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+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.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+
+import com.vaadin.event.ShortcutAction.KeyCode;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class TabBackwardFocusingStrategy.
+ */
+public class TabBackwardFocusingStrategy implements IFocusingStrategy {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout yLayout) {
+ YView yView = yLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yLayout, yCurrentFocus);
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round robin
+ * approach. If the first element is reached, we start at the end again.
+ *
+ * @param yLayout
+ * the y layout
+ * @param yElement
+ * the y element
+ * @return the y embeddable
+ */
+ protected YEmbeddable findNextElementToFocus(YStrategyLayout yLayout,
+ YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == 0) {
+ // element is the first -> Start again
+ index = yParent.getElements().size() - 1;
+ } else {
+ // use the previous element
+ index = index - 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ if (nextFocusElement instanceof YEditable){
+ if (((YEditable)nextFocusElement).isEditable()){
+ return nextFocusElement;
+ } else {
+ return findNextElementToFocus(yLayout, nextFocusElement);
+ }
+ }
+ return nextFocusElement;
+
+ // YSuspectInfo info = yLayout.findInfoFor(yElement);
+ // YSuspectInfo previous = info != null ? info.getPreviousFocus() :
+ // null;
+ // YEmbeddable target = previous != null ? previous.getTarget() : null;
+ //
+ // // use the last element
+ // if (target == null && yLayout.getLayoutingInfo() != null
+ // && yLayout.findLastFocus() != null) {
+ // target = yLayout.findLastFocus().getTarget();
+ // }
+ //
+ // return target;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
+ */
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB,
+ new int[0]);
+ return def;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategyProvider.java
new file mode 100644
index 0000000..16bfa85
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabBackwardFocusingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+
+/**
+ * The Class TabBackwardFocusingStrategyProvider.
+ */
+@Component(immediate=true, service = IFocusingStrategyProvider.class, property = { "ecview.focusing.id=cx.tab.backward" })
+public class TabBackwardFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "cx.tab.backward";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider#getStrategy()
+ */
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return new TabBackwardFocusingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java
new file mode 100644
index 0000000..dc8b9cc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategy.java
@@ -0,0 +1,96 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.eclipse.osbp.ecview.core.common.context.IViewContext;
+import org.eclipse.osbp.ecview.core.common.model.core.YEditable;
+import org.eclipse.osbp.ecview.core.common.model.core.YElement;
+import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable;
+import org.eclipse.osbp.ecview.core.common.model.core.YFocusable;
+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.services.IWidgetAssocationsService;
+import org.eclipse.osbp.ecview.core.util.emf.ModelUtil;
+import org.eclipse.osbp.runtime.common.keystroke.KeyStrokeDefinition;
+
+import com.vaadin.event.ShortcutAction.KeyCode;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+
+/**
+ * The Class TabForwardFocusingStrategy.
+ */
+public class TabForwardFocusingStrategy implements IFocusingStrategy {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#focus(java.lang.Object, java.lang.Object, org.eclipse.osbp.ecview.extension.model.YStrategyLayout)
+ */
+ @Override
+ public void focus(Object source, Object target, YStrategyLayout yLayout) {
+ YView yView = yLayout.getView();
+ IViewContext context = ModelUtil.getViewContext(yView);
+ IWidgetAssocationsService<Object, ? extends YElement> service = context
+ .getService(IWidgetAssocationsService.ID);
+
+ YEmbeddable yCurrentFocus = (YEmbeddable) service
+ .getModelElement(target);
+ YEmbeddable yNextFocus = findNextElementToFocus(yCurrentFocus);
+ yView.setCurrentFocus((YFocusable) yNextFocus);
+ }
+
+ /**
+ * Looks for the next element to be focused. Therefore it uses a round robin
+ * approach. If end of elements are reached, we start by index = 0 again.
+ *
+ * @param yElement
+ * the y element
+ * @return the y embeddable
+ */
+ protected YEmbeddable findNextElementToFocus(YEmbeddable yElement) {
+ if (yElement == null) {
+ return null;
+ }
+ YLayout yParent = (YLayout) yElement.eContainer();
+ int index = yParent.getElements().indexOf(yElement);
+ if (index == yParent.getElements().size() - 1) {
+ // element is the last -> Start again
+ index = 0;
+ } else {
+ // use the next element
+ index = index + 1;
+ }
+
+ YEmbeddable nextFocusElement = yParent.getElements().get(index);
+ if (nextFocusElement instanceof YEditable){
+ if (((YEditable)nextFocusElement).isEditable()){
+ return nextFocusElement;
+ } else {
+ return findNextElementToFocus(nextFocusElement);
+ }
+ }
+ return nextFocusElement;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategy#getKeyStrokeDefinition()
+ */
+ @Override
+ public KeyStrokeDefinition getKeyStrokeDefinition() {
+ KeyStrokeDefinition def = new KeyStrokeDefinition("", KeyCode.TAB,
+ new int[0]);
+ return def;
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategyProvider.java
new file mode 100644
index 0000000..476960f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/TabForwardFocusingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategy;
+import org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider;
+
+/**
+ * The Class TabForwardFocusingStrategyProvider.
+ */
+@Component(immediate=true, service = IFocusingStrategyProvider.class, property = { "ecview.focusing.id=cx.tab.forward" })
+public class TabForwardFocusingStrategyProvider implements
+ IFocusingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "cx.tab.forward";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.IFocusingStrategyProvider#getStrategy()
+ */
+ @Override
+ public IFocusingStrategy getStrategy() {
+ return new TabForwardFocusingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategy.java
new file mode 100644
index 0000000..251b7f5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategy.java
@@ -0,0 +1,115 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import java.util.ArrayList;
+
+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.extension.model.extension.ExtensionModelFactory;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YFormLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YHorizontalLayout;
+import org.eclipse.osbp.ecview.core.extension.model.extension.YVerticalLayout;
+
+import org.eclipse.osbp.ecview.extension.model.YLayoutingInfo;
+import org.eclipse.osbp.ecview.extension.model.YStrategyLayout;
+import org.eclipse.osbp.ecview.extension.model.YSuspect;
+import org.eclipse.osbp.ecview.extension.model.YSuspectInfo;
+
+/**
+ * Vertical layouting.
+ */
+public class VerticalLayoutLayoutingStrategy extends AbstractLayoutingStrategy {
+
+ /**
+ * The Enum Group.
+ */
+ public enum Group {
+
+ /** The discount. */
+ DISCOUNT("discount"),
+
+ /** The nondiscount. */
+ NONDISCOUNT("non-discount"),
+
+ /** The nothing. */
+ NOTHING("nothing");
+
+ /** The group id. */
+ private final String groupId;
+
+ /**
+ * Instantiates a new group.
+ *
+ * @param groupId
+ * the group id
+ */
+ Group(String groupId) {
+ this.groupId = groupId;
+ }
+ }
+
+ /**
+ * Instantiates a new vertical layout layouting strategy.
+ */
+ public VerticalLayoutLayoutingStrategy() {
+ super(null);
+ }
+
+ // @Override
+ // public void layout(YLayoutingInfo layoutingInfo) {
+ // YStrategyLayout yLayout = layoutingInfo.getLayout();
+ // layoutingInfo.getActiveSuspectInfos().clear();
+ //
+ // YVerticalLayout content = (YVerticalLayout) createContentLayout();
+ //
+ // for (YSuspect suspect : new ArrayList<YSuspect>(
+ // yLayout.getSuspects())) {
+ // YSuspectInfo suspectInfo = layoutingInfo
+ // .createSuspectInfo(suspect);
+/**
+ // layoutingInfo.getActiveSuspectInfos().add(suspectInfo);
+ //
+ // YEmbeddable yEmbeddable = prepareElementForSuspect(suspectInfo);
+ //
+/**
+/**
+/**
+/**
+/**
+/**
+/**
+ // content.addElement(yEmbeddable);
+ // }
+ //
+ // layoutingInfo.setContent(content);
+ // }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#createContentLayout()
+ */
+ @Override
+ protected YLayout createContentLayout() {
+ return ExtensionModelFactory.eINSTANCE.createYVerticalLayout();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.strategy.AbstractLayoutingStrategy#addElement(org.eclipse.osbp.ecview.core.common.model.core.YLayout, org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable)
+ */
+ @Override
+ protected void addElement(YLayout layout, YEmbeddable element) {
+ layout.addElement(element);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategyProvider.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategyProvider.java
new file mode 100644
index 0000000..0528b9b
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/VerticalLayoutLayoutingStrategyProvider.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy;
+
+import org.osgi.service.component.annotations.Component;
+
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategy;
+import org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider;
+
+/**
+ * The Class VerticalLayoutLayoutingStrategyProvider.
+ */
+@Component(immediate = true, service = ILayoutingStrategyProvider.class, property = { "ecview.layouting.id=VerticalLayoutLayoutingStrategy" })
+public class VerticalLayoutLayoutingStrategyProvider implements
+ ILayoutingStrategyProvider {
+
+ /** The Constant ID. */
+ public static final String ID = "VerticalLayoutLayoutingStrategy";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osbp.ecview.extension.api.ILayoutingStrategyProvider#getStrategy()
+ */
+ @Override
+ public ILayoutingStrategy getStrategy() {
+ return new VerticalLayoutLayoutingStrategy();
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java
new file mode 100644
index 0000000..e2b0b50
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/NamingConventionsUtil.java
@@ -0,0 +1,146 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.osbp.dsl.semantic.common.types.LEnum;
+import org.eclipse.osbp.dsl.semantic.common.types.LType;
+import org.eclipse.osbp.dsl.semantic.common.types.LTypedPackage;
+
+/**
+ * This util is used to convert between dto packages and entity packages.
+ */
+public class NamingConventionsUtil {
+
+ /** The Constant pathReplacements. */
+ private static final List<Pair> pathReplacements;
+
+ static {
+ pathReplacements = new ArrayList<Pair>();
+ pathReplacements.add(new Pair(".dtos.", ".entities."));
+ pathReplacements.add(new Pair(".dtos", ".entitymodel"));
+ pathReplacements.add(new Pair("/dto/", "/entity/"));
+ pathReplacements.add(new Pair("/dtos/", "/entities/"));
+ pathReplacements.add(new Pair(".dto", ".entity"));
+ }
+
+ /**
+ * Replaces package fragments of the Auto-DTOs and returns the package name
+ * used for the Entity.
+ *
+ * @param packageName
+ * the package name
+ * @return the string
+ */
+ public static String toEntityPackage(String packageName) {
+ if (packageName == null) {
+ return "";
+ }
+ String result = packageName;
+ for (Pair pair : pathReplacements) {
+ result = pair.replace(result);
+ }
+ return result;
+ }
+
+ /**
+ * Replaces package fragments of the Auto-DTOs and returns the package name
+ * used for the Entity.
+ *
+ * @param lPackage
+ * the l package
+ * @return the string
+ */
+ public static String toEntityPackage(LTypedPackage lPackage) {
+ return toEntityPackage(lPackage.getName());
+ }
+
+ /**
+ * Returns the name of the entity for the given type.
+ *
+ * @param lType
+ * the l type
+ * @return the string
+ */
+ public static String toEntityName(LType lType) {
+ return (lType instanceof LEnum) ? lType.getName() : toEntityName(lType
+ .getName());
+ }
+
+ /**
+ * Returns the name of the entity for the given type.
+ *
+ * @param prefix
+ * the prefix
+ * @return the string
+ */
+ public static String toEntityName(String prefix) {
+ int idx = prefix.lastIndexOf("Dto");
+ return prefix.substring(0, idx);
+ }
+
+ /**
+ * Returns the full qualified name of the entity for the given type.
+ *
+ * @param fqnDto
+ * the fqn dto
+ * @return the string
+ */
+ public static String toFqnEntityName(String fqnDto) {
+ int idx = fqnDto.lastIndexOf(".");
+ String pckgName = fqnDto.substring(0, idx+1);
+ String dtoName = fqnDto.substring(idx+1);
+ return toEntityPackage(pckgName).concat(toEntityName(dtoName));
+ }
+
+ /**
+ * The Class Pair.
+ */
+ private static class Pair {
+
+ /** The source. */
+ private final String source;
+
+ /** The target. */
+ private final String target;
+
+ /**
+ * Instantiates a new pair.
+ *
+ * @param source
+ * the source
+ * @param target
+ * the target
+ */
+ public Pair(String source, String target) {
+ super();
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * Replace.
+ *
+ * @param value
+ * the value
+ * @return the string
+ */
+ public String replace(String value) {
+ return value.replace(source, target);
+ }
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/test/NamingConventionsUtilTest.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/test/NamingConventionsUtilTest.java
new file mode 100644
index 0000000..8569c25
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/util/test/NamingConventionsUtilTest.java
@@ -0,0 +1,53 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+package org.eclipse.osbp.ecview.extension.strategy.util.test;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.eclipse.osbp.ecview.extension.strategy.util.NamingConventionsUtil;
+
+/**
+ * The Class NamingConventionsUtilTest.
+ */
+public class NamingConventionsUtilTest {
+
+ /** The dto fqn. */
+ String dtoFqn = "com.osbp.myfirstapp.dtos.AddressDto";
+
+ /** The entity fqn. */
+ String entityFqn = "com.osbp.myfirstapp.entities.Address";
+
+ /**
+ * Sets the up.
+ *
+ * @throws Exception
+ * the exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * Test.
+ */
+ @Test
+ public void test() {
+ String toFqnEntity = NamingConventionsUtil.toFqnEntityName(dtoFqn);
+ assertEquals(entityFqn, toFqnEntity);
+ }
+
+}
diff --git a/org.eclipse.osbp.ecview.extension.tests/.project b/org.eclipse.osbp.ecview.extension.tests/.project
new file mode 100644
index 0000000..fb32424
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/.project
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.tests</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.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.babel.editor.rbeBuilder</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.ecview.extension.tests/LICENSE.txt b/org.eclipse.osbp.ecview.extension.tests/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/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.ecview.extension.tests/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..40d0892
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.tests
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.tests
+Bundle-Vendor: Eclipse OSBP
+Bundle-Version: 0.9.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Import-Package: org.osgi.framework;version="1.8.0",
+ org.osgi.service.component;version="1.2.0",
+ org.osgi.service.component.annotations;version="1.2.0",
+ org.slf4j
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.junit;bundle-version="4.11.0",
+ org.knowhowlab.osgi.testing.assertions;bundle-version="[1.3.0,1.3.1)",
+ org.knowhowlab.osgi.testing.utils;bundle-version="[1.2.2,1.2.3)",
+ org.eclipse.osbp.utils.functionnormalizer;bundle-version="[0.9.0,0.10.0)"
+Service-Component: OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.FormLayoutLayoutingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabBackwardFocusingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterBackwardFocusingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.EnterForwardFocusingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.TabForwardFocusingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.VerticalLayoutLayoutingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.HorizontalLayoutLayoutingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.GridLayoutLayoutingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.AltEnterForwardFocusingStrategyProvider.xml,
+ OSGI-INF/org.eclipse.osbp.ecview.extension.strategy.CssLayoutLayoutingStrategyProvider.xml
diff --git a/org.eclipse.osbp.ecview.extension.tests/about.html b/org.eclipse.osbp.ecview.extension.tests/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/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.ecview.extension.tests/epl-v10.html b/org.eclipse.osbp.ecview.extension.tests/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/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.ecview.extension.tests/license.html b/org.eclipse.osbp.ecview.extension.tests/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/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.ecview.extension.tests/notice.html b/org.eclipse.osbp.ecview.extension.tests/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.tests/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.ecview.extension.widgetset/.project b/org.eclipse.osbp.ecview.extension.widgetset/.project
new file mode 100644
index 0000000..6571d5f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/.project
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osbp.ecview.extension.widgetset</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.babel.editor.rbeBuilder</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.eclipse.xtext.ui.shared.xtextNature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.babel.editor.rbeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/LICENSE.txt b/org.eclipse.osbp.ecview.extension.widgetset/LICENSE.txt
new file mode 100644
index 0000000..ff42ad4
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..8eb1f47
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.eclipse.osbp.ecview.extension.widgetset
+Bundle-SymbolicName: org.eclipse.osbp.ecview.extension.widgetset
+Bundle-Version: 0.9.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: Eclipse OSBP
+Require-Bundle: com.vaadin.client;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.server;bundle-version="[7.5.7,7.7.0)",
+ com.vaadin.shared;bundle-version="[7.5.7,7.7.0)",
+ com.google.guava;bundle-version="[10.0.0,19.0.0)",
+ org.eclipse.core.databinding;bundle-version="[1.4.1,1.5.0)",
+ org.eclipse.core.databinding.beans;bundle-version="[1.2.200,1.5.0)",
+ org.eclipse.core.databinding.observable;bundle-version="[1.4.1,1.5.0)",
+ org.eclipse.core.databinding.property;bundle-version="[1.4.200,1.5.0)",
+ org.eclipse.osbp.runtime.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.common;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.runtime.web.vaadin.databinding;bundle-version="[0.9.0,0.10.0)",
+ org.jsoup;bundle-version="1.7.2",
+ org.eclipse.osbp.ecview.extension.grid.presentation;bundle-version="[0.9.0,0.10.0)",
+ org.eclipse.osbp.ecview.extension.grid.presentation.clientside;bundle-version="[0.9.0,0.10.0)"
+Export-Package: org.eclipse.osbp.ecview.extension.widgetset;
+ uses:="com.vaadin.server,
+ com.vaadin.ui";version="0.9.0"
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/VAADIN/README.txt b/org.eclipse.osbp.ecview.extension.widgetset/VAADIN/README.txt
new file mode 100644
index 0000000..03ebe59
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/VAADIN/README.txt
@@ -0,0 +1 @@
+just to have the folder in the archive
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/about.html b/org.eclipse.osbp.ecview.extension.widgetset/about.html
new file mode 100644
index 0000000..64c0598
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/about.ini b/org.eclipse.osbp.ecview.extension.widgetset/about.ini
new file mode 100644
index 0000000..7df671f
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/about.mappings b/org.eclipse.osbp.ecview.extension.widgetset/about.mappings
new file mode 100644
index 0000000..4511a0a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/about.properties b/org.eclipse.osbp.ecview.extension.widgetset/about.properties
new file mode 100644
index 0000000..b06f816
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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:
+# Loetz GmbH&Co.KG - initial API and implementation
+#
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=org.eclipse.osbp.ecview.extension.widgetset
+
+################ 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\
+ Loetz GmbH&Co.KG - implementation\n
+################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/build.properties b/org.eclipse.osbp.ecview.extension.widgetset/build.properties
new file mode 100644
index 0000000..2169fdb
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/build.properties
@@ -0,0 +1,12 @@
+output.. = target/classes/
+bin.includes = about.properties, about.mappings, about.ini, about.html, META-INF/,\
+ .settings/,\
+ .,\
+ license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+src.includes = about.properties, about.mappings, about.ini, about.html, license.html,\
+ LICENSE.txt,\
+ epl-v10.html
+source.. = src/,\
+ VAADIN/
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/epl-v10.html b/org.eclipse.osbp.ecview.extension.widgetset/epl-v10.html
new file mode 100644
index 0000000..b398acc
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/license.html b/org.eclipse.osbp.ecview.extension.widgetset/license.html
new file mode 100644
index 0000000..6e579a5
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/notice.html b/org.eclipse.osbp.ecview.extension.widgetset/notice.html
new file mode 100644
index 0000000..c3d34c3
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/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.ecview.extension.widgetset/pom-compileWidgetset.xml b/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml
new file mode 100644
index 0000000..735da78
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/pom-compileWidgetset.xml
@@ -0,0 +1,224 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.widgetset</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <osbp.runtimeweb.version>0.9.1-SNAPSHOT</osbp.runtimeweb.version>
+ <osbee.version>0.1.0-SNAPSHOT</osbee.version>
+ <vaadin.version>7.5.7</vaadin.version>
+ <vaadin.plugin.version>7.5.7</vaadin.plugin.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>vaadin-addons</id>
+ <url>http://vaadin.com/nexus/content/repositories/vaadin-addons/</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation.clientside</artifactId>
+ <version>${osbee.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.grid.presentation</artifactId>
+ <version>${osbee.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.vaadin.addons</groupId>
+ <artifactId>vaadin-grid-util</artifactId>
+ <version>1.0.8</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-server</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiled</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared-deps</artifactId>
+ <scope>provided</scope>
+ <version>1.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiler</artifactId>
+ <scope>provided</scope>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-themes</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <!-- This add sources, .gwt.xml files etc to jar from source directory.
+ Not quite maven convention byt easiest to setup this way. -->
+ <directory>src</directory>
+ </resource>
+ <resource>
+ <directory>src</directory>
+ </resource>
+ </resources>
+ <sourceDirectory>src</sourceDirectory>
+
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>0.21.0</version>
+ <extensions>true</extensions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <version>${vaadin.plugin.version}</version>
+ <configuration>
+ <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
+ <!-- <runTarget>mobilemail</runTarget> -->
+ <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
+ way compatible with Vaadin eclipse plugin. -->
+ <webappDirectory>${basedir}/VAADIN/widgetsets
+ </webappDirectory>
+ <hostedWebapp>${basedir}/VAADIN/widgetsets
+ </hostedWebapp>
+ <noServer>true</noServer>
+ <!-- Remove draftCompile when project is ready -->
+ <draftCompile>true</draftCompile>
+ <strict>true</strict>
+ <compileReport>false</compileReport>
+ <style>PRETTY</style>
+ <logLevel>INFO</logLevel>
+ <runTarget>http://localhost:8080/</runTarget>
+
+ <!-- Remove these when going to release dependencies -->
+ <force>true</force>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
+ <!-- directory is cleaned properly -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/VAADIN/widgetsets</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[2.3.0-1,)</versionRange>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[1.0.2,)</versionRange>
+ <goals>
+ <goal>update-widgetset</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/pom.xml b/org.eclipse.osbp.ecview.extension.widgetset/pom.xml
new file mode 100644
index 0000000..1d2d2ef
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/pom.xml
@@ -0,0 +1,198 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.aggregator</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.eclipse.osbp.ecview.extension.widgetset</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-server</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiled</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-shared</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-client-compiler</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-themes</artifactId>
+ <version>${vaadin.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.vaadin.addons</groupId>
+ <artifactId>vaadin-grid-util</artifactId>
+ <version>1.0.7</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <version>${vaadin.plugin.version}</version>
+ <configuration>
+ <extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
+ <!-- <runTarget>mobilemail</runTarget> -->
+ <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
+ way compatible with Vaadin eclipse plugin. -->
+ <webappDirectory>${basedir}/VAADIN/widgetsets
+ </webappDirectory>
+ <hostedWebapp>${basedir}/VAADIN/widgetsets
+ </hostedWebapp>
+ <noServer>true</noServer>
+ <!-- Remove draftCompile when project is ready -->
+ <draftCompile>true</draftCompile>
+ <strict>true</strict>
+ <compileReport>false</compileReport>
+ <style>PRETTY</style>
+ <runTarget>http://localhost:8080/</runTarget>
+
+ <!-- Remove these when going to release dependencies -->
+ <force>true</force>
+ <persistentunitcache>false</persistentunitcache>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>resources</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
+ <!-- directory is cleaned properly -->
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <excludeDefaultDirectories>true</excludeDefaultDirectories>
+ <filesets>
+ <fileset>
+ <directory>VAADIN/gwt-unitCache</directory>
+ </fileset>
+ <fileset>
+ <directory>VAADIN/widgetsets</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ <executions>
+ <execution>
+ <id>cleanUnitCache</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ <execution>
+ <phase>verify</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- <plugin> <artifactId>maven-clean-plugin</artifactId> <configuration>
+ <filesets> <fileset> <directory>VAADIN/gwt-unitCache</directory> </fileset>
+ </filesets> </configuration> <executions> <execution> <phase>verify</phase>
+ </execution> </executions> </plugin> -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[2.3.0-1,)</versionRange>
+ <goals>
+ <goal>resources</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.vaadin</groupId>
+ <artifactId>vaadin-maven-plugin</artifactId>
+ <versionRange>[1.0.2,)</versionRange>
+ <goals>
+ <goal>update-widgetset</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <description>Widgetset for OSBP ECView extension</description>
+</project>
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetset.gwt.xml b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetset.gwt.xml
new file mode 100644
index 0000000..af4189a
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetset.gwt.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="com.vaadin.DefaultWidgetSet" />
+ <inherits name="org.vaadin.gridutil.WidgetSet" />
+ <inherits name="org.eclipse.osbp.ecview.extension.grid.presentation.clientside.ECViewExtensionsWidgetset" />
+
+ <!-- Uncomment the following to compile the widgetset for one browser only.
+ Multiple browsers can be specified as a comma separated list. The supported
+ user agents at the moment of writing were: ie8,ie9,gecko1_8,safari,opera
+ The value gecko1_8 is used for Firefox and safari is used for webkit based
+ browsers including Google Chrome. -->
+ <!-- <set-property name="user.agent" value="safari"/> -->
+
+ <!-- To enable SuperDevMode, uncomment this line. See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode
+ for more information and instructions. -->
+ <!-- <set-configuration-property name="devModeRedirectEnabled" value="true"
+ /> -->
+
+</module>
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetsetUI.java b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetsetUI.java
new file mode 100644
index 0000000..bc5927d
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/CxECViewWidgetsetUI.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * 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:
+ * Florian Pirchner - Initial implementation
+ *
+ */
+
+package org.eclipse.osbp.ecview.extension.widgetset;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * The Class CxECViewWidgetsetUI.
+ */
+@SuppressWarnings("serial")
+@Theme("clientsidewidget")
+public class CxECViewWidgetsetUI extends UI {
+
+ /* (non-Javadoc)
+ * @see com.vaadin.ui.UI#init(com.vaadin.server.VaadinRequest)
+ */
+ @Override
+ protected void init(VaadinRequest request) {
+ final VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+ setContent(layout);
+
+ Button button = new Button("Click Me");
+ button.addClickListener(new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new Label("Thank you for clicking"));
+ }
+ });
+ layout.addComponent(button);
+ }
+}
diff --git a/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/public/cxecview-components/styles.css b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/public/cxecview-components/styles.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/org.eclipse.osbp.ecview.extension.widgetset/src/org/eclipse/osbp/ecview/extension/widgetset/public/cxecview-components/styles.css
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..7b600f5
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,99 @@
+<?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: -->
+<!--# Cristiano Gavi??o - 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.releng.maven</groupId>
+ <artifactId>org.eclipse.osbp.releng.maven.parent.tycho</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.eclipse.osbp.ecview.extension</groupId>
+ <artifactId>org.eclipse.osbp.ecview.extension.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>
+ <osbp.gitrepo.name>${project.groupId}</osbp.gitrepo.name>
+ </properties>
+
+ <modules>
+ <!-- module>org.eclipse.osbp.ecview.extension.widgetset</module -->
+ <module>org.eclipse.osbp.ecview.extension.editparts.emf</module>
+ <module>org.eclipse.osbp.ecview.extension.presentation.vaadin</module>
+ <module>org.eclipse.osbp.ecview.extension.strategy</module>
+ <module>org.eclipse.osbp.ecview.extension.services</module>
+
+ <module>org.eclipse.osbp.ecview.extension.grid.editparts.emf</module>
+ <module>org.eclipse.osbp.ecview.extension.grid.presentation</module>
+ <module>org.eclipse.osbp.ecview.extension.grid.presentation.clientside</module>
+ <module>org.eclipse.osbp.ecview.extension.grid.sample</module>
+<!-- <module>org.eclipse.osbp.ecview.extension.grid.tests</module> -->
+
+ <module>org.eclipse.osbp.ecview.extension.widgetset</module>
+
+ <module>org.eclipse.osbp.ecview.extension.feature</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <executions>
+ <execution>
+ <id>plugin-source</id>
+ <goals>
+ <goal>plugin-source</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.osbp.tools.maven</groupId>
+ <artifactId>org.eclipse.osbp.tools.maven.entity</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <outputDirectory>src-gen</outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>