diff --git a/silecs-eclipse-plugin-feature/.project b/silecs-eclipse-plugin-feature/.project deleted file mode 100644 index a49d71b111859da650459f0e33c93f24b6a607b8..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-feature/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>silecs-eclipse-plugin-feature</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.pde.FeatureBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.FeatureNature</nature> - </natures> -</projectDescription> diff --git a/silecs-eclipse-plugin-feature/build.properties b/silecs-eclipse-plugin-feature/build.properties deleted file mode 100644 index 64f93a9f0b7328eb563aa5ad6cec7f828020e124..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-feature/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = feature.xml diff --git a/silecs-eclipse-plugin-feature/feature.xml b/silecs-eclipse-plugin-feature/feature.xml deleted file mode 100644 index 14d3b07c2d3ead3e1661234907f73e524dfe7640..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-feature/feature.xml +++ /dev/null @@ -1,746 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="silecsEclipsePluginFeature" - label="Silecs-eclipse-plugin-feature" - version="1.0.0.qualifier"> - - <description url="http://www.example.com/description"> - SILECS Eclipse Plugin - </description> - - <copyright url="http://www.example.com/copyright"> - Copyright 2016 CERN and GSI - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - </copyright> - - <license url="http://www.gnu.org/licenses"> - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. - </license> - - <requires> - <import plugin="org.eclipse.ui"/> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.ui.workbench"/> - <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.ui.ide"/> - <import plugin="org.eclipse.ui.editors"/> - <import plugin="org.eclipse.wst.xml.core"/> - <import plugin="org.eclipse.wst.xml.ui"/> - <import plugin="org.eclipse.ui.navigator.resources"/> - <import plugin="org.eclipse.core.filesystem"/> - <import plugin="org.eclipse.ui.console"/> - <import plugin="org.eclipse.ui.views"/> - <import plugin="org.eclipse.wst.validation"/> - <import plugin="org.eclipse.wst.validation.infopop"/> - <import plugin="org.eclipse.wst.validation.ui"/> - <import plugin="org.eclipse.jface.text"/> - <import plugin="org.eclipse.wst.sse.ui"/> - <import plugin="org.eclipse.ui.workbench.texteditor"/> - <import plugin="org.eclipse.text"/> - <import plugin="org.eclipse.wst.sse.core"/> - <import plugin="org.eclipse.ui.navigator"/> - <import plugin="org.eclipse.xsd"/> - <import plugin="org.eclipse.wst.xsd.core"/> - <import plugin="org.eclipse.core.expressions"/> - <import plugin="org.eclipse.cdt"/> - <import plugin="org.eclipse.cdt.core"/> - <import plugin="org.eclipse.cdt.ui"/> - <import plugin="org.eclipse.cdt.managedbuilder.ui"/> - <import plugin="org.eclipse.ltk.core.refactoring"/> - <import plugin="org.eclipse.ltk.ui.refactoring"/> - <import plugin="org.eclipse.equinox.launcher"/> - </requires> - - <plugin - id="silecs.eclipse.plugin" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - -</feature> diff --git a/silecs-eclipse-plugin-update-site/.gitignore b/silecs-eclipse-plugin-update-site/.gitignore deleted file mode 100644 index 0d55b7c9e466968a8c393ab03368b92beffa603d..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/features/* -/plugins/* \ No newline at end of file diff --git a/silecs-eclipse-plugin-update-site/.project b/silecs-eclipse-plugin-update-site/.project deleted file mode 100644 index e9558b3fd21bb03479a7f7815581694fac94a1eb..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>silecs-eclipse-plugin-update-site</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.pde.UpdateSiteBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.UpdateSiteNature</nature> - </natures> -</projectDescription> diff --git a/silecs-eclipse-plugin-update-site/artifacts.jar b/silecs-eclipse-plugin-update-site/artifacts.jar deleted file mode 100644 index a87d7ab050a527669b91f8d1c7c95b33f7f74ff4..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin-update-site/artifacts.jar and /dev/null differ diff --git a/silecs-eclipse-plugin-update-site/content.jar b/silecs-eclipse-plugin-update-site/content.jar deleted file mode 100644 index 5d4662ba608c642e81076909afa6682abd697802..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin-update-site/content.jar and /dev/null differ diff --git a/silecs-eclipse-plugin-update-site/deliverToWebDav.sh b/silecs-eclipse-plugin-update-site/deliverToWebDav.sh deleted file mode 100755 index c5ff0fe1e226fab7ac1578d3787e1e0b5194c23d..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/deliverToWebDav.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash - -kinit - -function copyFileToWebDav -{ - -cadaver -t <<EOF -open https://www.acc.gsi.de/dav/eclipse-luna/silecs -mput $1 -quit -EOF - -} - -for file in features/* -do - copyFileToWebDav $file -done - -for file in plugins/* -do - copyFileToWebDav $file -done - -copyFileToWebDav artifacts.jar -copyFileToWebDav content.jar -copyFileToWebDav index.html -copyFileToWebDav site.xml \ No newline at end of file diff --git a/silecs-eclipse-plugin-update-site/index.html b/silecs-eclipse-plugin-update-site/index.html deleted file mode 100644 index c6627db314105eedc477f199d603166222e9ec59..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/index.html +++ /dev/null @@ -1,60 +0,0 @@ -<html> -<head> -<title>silecs-eclipse-plugin-update-site</title> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<style>@import url("web/site.css");</style> -<script type="text/javascript"> - var returnval = 0; - var stylesheet, xmlFile, cache, doc; - function init(){ - // NSCP 7.1+ / Mozilla 1.4.1+ / Safari - // Use the standard DOM Level 2 technique, if it is supported - if (document.implementation && document.implementation.createDocument) { - xmlFile = document.implementation.createDocument("", "", null); - stylesheet = document.implementation.createDocument("", "", null); - if (xmlFile.load){ - xmlFile.load("site.xml"); - stylesheet.load("web/site.xsl"); - } else { - alert("Document could not be loaded by browser."); - } - xmlFile.addEventListener("load", transform, false); - stylesheet.addEventListener("load", transform, false); - } - //IE 6.0+ solution - else if (window.ActiveXObject) { - xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0"); - xmlFile.async = false; - xmlFile.load("site.xml"); - stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0"); - stylesheet.async = false; - stylesheet.load("web/site.xsl"); - cache = new ActiveXObject("msxml2.XSLTemplate.3.0"); - cache.stylesheet = stylesheet; - transformData(); - } - } - // separate transformation function for IE 6.0+ - function transformData(){ - var processor = cache.createProcessor(); - processor.input = xmlFile; - processor.transform(); - data.innerHTML = processor.output; - } - // separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+ - function transform(){ - returnval+=1; - if (returnval==2){ - var processor = new XSLTProcessor(); - processor.importStylesheet(stylesheet); - doc = processor.transformToDocument(xmlFile); - document.getElementById("data").innerHTML = doc.documentElement.innerHTML; - } - } -</script> -</head> -<body onload="init();"> -<!--[insert static HTML here]--> -<div id="data"><!-- this is where the transformed data goes --></div> -</body> -</html> diff --git a/silecs-eclipse-plugin-update-site/install.sh b/silecs-eclipse-plugin-update-site/install.sh deleted file mode 100755 index c989b3929f85415071d268398d7650509b60c3fa..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -e - -INSTALL_DIR=$1 - -SCRIPT=$(readlink -f "$0") -SCRIPTPATH=$(dirname "$SCRIPT") # path where this script is located in - -mkdir -p ${INSTALL_DIR} -cp -ruv ${SCRIPTPATH}/* ${INSTALL_DIR} \ No newline at end of file diff --git a/silecs-eclipse-plugin-update-site/site.xml b/silecs-eclipse-plugin-update-site/site.xml deleted file mode 100644 index 1989289c07c32d6510da46f3c5798247ecc6c1a7..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/site.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<site> - <feature url="features/silecsEclipsePluginFeature_1.0.0.201602241715.jar" id="silecsEclipsePluginFeature" version="1.0.0.201602241715"> - <category name="0.9.0"/> - </feature> - <feature url="features/silecsEclipsePluginFeature_1.0.0.201604071714.jar" id="silecsEclipsePluginFeature" version="1.0.0.201604071714"> - <category name="0.10.0"/> - </feature> - <feature url="features/silecsEclipsePluginFeature_1.0.0.201607291027.jar" id="silecsEclipsePluginFeature" version="1.0.0.201607291027"> - <category name="1.0.0"/> - </feature> - <feature url="features/silecsEclipsePluginFeature_1.0.0.201608011414.jar" id="silecsEclipsePluginFeature" version="1.0.0.201608011414"> - <category name="1.0.0"/> - </feature> - <category-def name="0.9.0" label="0.9.0"/> - <category-def name="0.10.0" label="0.10.0"/> - <category-def name="1.0.0" label="1.0.0"/> -</site> diff --git a/silecs-eclipse-plugin-update-site/test.txt b/silecs-eclipse-plugin-update-site/test.txt deleted file mode 100644 index 5e40c0877058c504203932e5136051cf3cd3519b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/test.txt +++ /dev/null @@ -1 +0,0 @@ -asdf \ No newline at end of file diff --git a/silecs-eclipse-plugin-update-site/web/site.css b/silecs-eclipse-plugin-update-site/web/site.css deleted file mode 100644 index 62c6f9ffa4472e7893b59ccfdb9665254a6a07b2..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/web/site.css +++ /dev/null @@ -1,12 +0,0 @@ -<STYLE type="text/css"> -td.spacer {padding-bottom: 10px; padding-top: 10px;} -.title { font-family: sans-serif; color: #99AACC;} -.bodyText { font-family: sans-serif; font-size: 9pt; color:#000000; } -.sub-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white;} -.log-text {font-family: sans-serif; font-style: normal; font-weight: lighter; font-size: 8pt; color:black;} -.big-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white; border-top:10px solid white;} -.light-row {background:#FFFFFF} -.dark-row {background:#EEEEFF} -.header {background:#99AADD} -#indent {word-wrap : break-word;width :300px;text-indent:10px;} -</STYLE> diff --git a/silecs-eclipse-plugin-update-site/web/site.xsl b/silecs-eclipse-plugin-update-site/web/site.xsl deleted file mode 100644 index ccb882e7a9bd9ff08af8311a66d48d20cc34676c..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin-update-site/web/site.xsl +++ /dev/null @@ -1,214 +0,0 @@ -<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl="urn:schemas-microsoft-com:xslt"> -<xsl:output method="html" encoding="UTF-8"/> -<xsl:key name="cat" match="category" use="@name"/> -<xsl:template match="/"> -<xsl:for-each select="site"> - <html> - <head> - <title>silecs-eclipse-plugin-update-site</title> - <style>@import url("web/site.css");</style> - </head> - <body> - <h1 class="title">silecs-eclipse-plugin-update-site</h1> - <p class="bodyText"><xsl:value-of select="description"/></p> - <table width="100%" border="0" cellspacing="1" cellpadding="2"> - <xsl:for-each select="category-def"> - <xsl:sort select="@label" order="ascending" case-order="upper-first"/> - <xsl:sort select="@name" order="ascending" case-order="upper-first"/> - <xsl:if test="count(key('cat',@name)) != 0"> - <tr class="header"> - <td class="sub-header" width="30%"> - <xsl:value-of select="@name"/> - </td> - <td class="sub-header" width="70%"> - <xsl:value-of select="@label"/> - </td> - </tr> - <xsl:for-each select="key('cat',@name)"> - <xsl:sort select="ancestor::feature//@version" order="ascending"/> - <xsl:sort select="ancestor::feature//@id" order="ascending" case-order="upper-first"/> - <tr> - <xsl:choose> - <xsl:when test="(position() mod 2 = 1)"> - <xsl:attribute name="class">dark-row</xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="class">light-row</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <td class="log-text" id="indent"> - <xsl:choose> - <xsl:when test="ancestor::feature//@label"> - <a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@label"/></a> - <br/> - <div id="indent"> - (<xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/>) - </div> - </xsl:when> - <xsl:otherwise> - <a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/></a> - </xsl:otherwise> - </xsl:choose> - <br /> - </td> - <td> - <table> - <xsl:if test="ancestor::feature//@os"> - <tr><td class="log-text" id="indent">Operating Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@os"/></td> - </tr> - </xsl:if> - <xsl:if test="ancestor::feature//@ws"> - <tr><td class="log-text" id="indent">Windows Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@ws"/></td> - </tr> - </xsl:if> - <xsl:if test="ancestor::feature//@nl"> - <tr><td class="log-text" id="indent">Languages:</td> - <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@nl"/></td> - </tr> - </xsl:if> - <xsl:if test="ancestor::feature//@arch"> - <tr><td class="log-text" id="indent">Architecture:</td> - <td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@arch"/></td> - </tr> - </xsl:if> - </table> - </td> - </tr> - </xsl:for-each> - <tr><td class="spacer"><br/></td><td class="spacer"><br/></td></tr> - </xsl:if> - </xsl:for-each> - <xsl:if test="count(feature) > count(feature/category)"> - <tr class="header"> - <td class="sub-header" colspan="2"> - Uncategorized - </td> - </tr> - </xsl:if> - <xsl:choose> - <xsl:when test="function-available('msxsl:node-set')"> - <xsl:variable name="rtf-nodes"> - <xsl:for-each select="feature[not(category)]"> - <xsl:sort select="@id" order="ascending" case-order="upper-first"/> - <xsl:sort select="@version" order="ascending" /> - <xsl:value-of select="."/> - <xsl:copy-of select="." /> - </xsl:for-each> - </xsl:variable> - <xsl:variable name="myNodeSet" select="msxsl:node-set($rtf-nodes)/*"/> - <xsl:for-each select="$myNodeSet"> - <tr> - <xsl:choose> - <xsl:when test="position() mod 2 = 1"> - <xsl:attribute name="class">dark-row</xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="class">light-row</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <td class="log-text" id="indent"> - <xsl:choose> - <xsl:when test="@label"> - <a href="{@url}"><xsl:value-of select="@label"/></a> - <br /> - <div id="indent"> - (<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>) - </div> - </xsl:when> - <xsl:otherwise> - <a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a> - </xsl:otherwise> - </xsl:choose> - <br /><br /> - </td> - <td> - <table> - <xsl:if test="@os"> - <tr><td class="log-text" id="indent">Operating Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="@os"/></td> - </tr> - </xsl:if> - <xsl:if test="@ws"> - <tr><td class="log-text" id="indent">Windows Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="@ws"/></td> - </tr> - </xsl:if> - <xsl:if test="@nl"> - <tr><td class="log-text" id="indent">Languages:</td> - <td class="log-text" id="indent"><xsl:value-of select="@nl"/></td> - </tr> - </xsl:if> - <xsl:if test="@arch"> - <tr><td class="log-text" id="indent">Architecture:</td> - <td class="log-text" id="indent"><xsl:value-of select="@arch"/></td> - </tr> - </xsl:if> - </table> - </td> - </tr> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> - <xsl:for-each select="feature[not(category)]"> - <xsl:sort select="@id" order="ascending" case-order="upper-first"/> - <xsl:sort select="@version" order="ascending" /> - <tr> - <xsl:choose> - <xsl:when test="count(preceding-sibling::feature[not(category)]) mod 2 = 1"> - <xsl:attribute name="class">dark-row</xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="class">light-row</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <td class="log-text" id="indent"> - <xsl:choose> - <xsl:when test="@label"> - <a href="{@url}"><xsl:value-of select="@label"/></a> - <br /> - <div id="indent"> - (<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>) - </div> - </xsl:when> - <xsl:otherwise> - <a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a> - </xsl:otherwise> - </xsl:choose> - <br /><br /> - </td> - <td> - <table> - <xsl:if test="@os"> - <tr><td class="log-text" id="indent">Operating Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="@os"/></td> - </tr> - </xsl:if> - <xsl:if test="@ws"> - <tr><td class="log-text" id="indent">Windows Systems:</td> - <td class="log-text" id="indent"><xsl:value-of select="@ws"/></td> - </tr> - </xsl:if> - <xsl:if test="@nl"> - <tr><td class="log-text" id="indent">Languages:</td> - <td class="log-text" id="indent"><xsl:value-of select="@nl"/></td> - </tr> - </xsl:if> - <xsl:if test="@arch"> - <tr><td class="log-text" id="indent">Architecture:</td> - <td class="log-text" id="indent"><xsl:value-of select="@arch"/></td> - </tr> - </xsl:if> - </table> - </td> - </tr> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - </table> - </body> - </html> -</xsl:for-each> -</xsl:template> -</xsl:stylesheet> diff --git a/silecs-eclipse-plugin/.classpath b/silecs-eclipse-plugin/.classpath deleted file mode 100644 index 2dfef36bfae0d28c95af368a5d33502fbc784470..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.classpath +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry exported="true" kind="lib" path="ext-jars/xml-apis-1.3.04.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> - <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src/java"/> - <classpathentry exported="true" kind="lib" path="jaxen-1.1.6.jar"/> - <classpathentry exported="true" kind="lib" path="xalan-2.7.2.jar"/> - <classpathentry kind="output" path="target/classes"/> -</classpath> diff --git a/silecs-eclipse-plugin/.gitignore b/silecs-eclipse-plugin/.gitignore deleted file mode 100644 index 60a467d9aaa342a744e145a01fc09ce311517422..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/target/ -/ext-jars/* -/jaxen-1.1.6.jar -/xalan-2.7.2.jar diff --git a/silecs-eclipse-plugin/.project b/silecs-eclipse-plugin/.project deleted file mode 100644 index 5a975ee6bac89ea407edd3d2741ff7402b84d3c1..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.project +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>silecs-eclipse-plugin</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.m2e.core.maven2Builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.m2e.core.maven2Nature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.springsource.ide.eclipse.gradle.core.nature</nature> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.python.pydev.pythonNature</nature> - </natures> -</projectDescription> diff --git a/silecs-eclipse-plugin/.pydevproject b/silecs-eclipse-plugin/.pydevproject deleted file mode 100644 index 3328e176e60c319bf15e7d7b046e023a9121f736..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.pydevproject +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?eclipse-pydev version="1.0"?><pydev_project> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">jython 2.7</pydev_property> -<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> -<path>/${PROJECT_DIR_NAME}/src/scripts</path> -</pydev_pathproperty> -</pydev_project> diff --git a/silecs-eclipse-plugin/.settings/org.eclipse.core.resources.prefs b/silecs-eclipse-plugin/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 8dd9b1df3d66f1efc3bc1c9e516c16a1b034e689..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/test/java=UTF-8 -encoding/<project>=UTF-8 diff --git a/silecs-eclipse-plugin/.settings/org.eclipse.jdt.core.prefs b/silecs-eclipse-plugin/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 13b3428acd87c3f94042e61eed221c15ce682bfa..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/silecs-eclipse-plugin/.settings/org.eclipse.ltk.core.refactoring.prefs b/silecs-eclipse-plugin/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index b196c64a3418b865f0476d2e21d11eae3dd4b2da..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/silecs-eclipse-plugin/.settings/org.eclipse.m2e.core.prefs b/silecs-eclipse-plugin/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1cb2389f85fe6381425d29f0a9866fb65..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/silecs-eclipse-plugin/JNLP-INF/APPLICATION_TEMPLATE.JNLP b/silecs-eclipse-plugin/JNLP-INF/APPLICATION_TEMPLATE.JNLP deleted file mode 100644 index cf8e499a329c2ada3ee7ad325a94439cb87fb69b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/JNLP-INF/APPLICATION_TEMPLATE.JNLP +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<jnlp spec="1.0+" codebase="*" href="silecs_launcher.jnlp"> <!-- URL to the site containing the jnlp application. It should match the - value used on export. Href, the name of this file --> - <information> - <!-- user readable name of the application --> - <title> Silecs-Eclipse-Plugin</title> - <!-- vendor name --> - <vendor>CERN</vendor> - <!-- vendor homepage --> - <homepage href="https://wikis/display/SIL/SILECs+Home"/> - <!-- product description --> - <description>Silecs Configuration tool</description> - </information> - - <!--request all permissions from the application. This does not change --> - <security> - <all-permissions /> - </security> - <update check="always" policy="always"></update> - - <!-- The name of the main class to execute. This does not change --> - <application-desc main-class="cern.silecs.activator.WebStartLauncher"> - <argument>-nosplash</argument> - <argument>-consoleLog</argument> - <argument>-data</argument> - <argument>@noDefault</argument> - </application-desc> - - <resources> - <!-- Reference to the launcher jar.--> - <jar href="*" /> - - <property name="app.name" value="Silecs-Eclipse-Plugin"></property> - <property name="app.version" value="1.m.p"></property> - - <!-- The id of the product to run, like found in the overview page of the - product editor --> - <property name="eclipse.application" value="silecs.eclipse.plugin.application" /> - <property name="osgi.parentClassloader" value="current" /> - <property name="osgi.framework" value="org.eclipse.osgi" /> - <property name="osgi.bundles" - value="org.eclipse.core.runtime@start,org.eclipse.equinox.common@2:start,org.eclipse.equinox.ds@1:start,org.eclipse.equinox.simpleconfigurator@1:start,org.eclipse.osgi@-1:start,org.eclipse.equinox.event@3:start" /> - </resources> - - <resources os="Windows"> - <j2se version="1.8+" - java-vm-args="-Xms128m -Xmx1024m -Dpython.cachedir.skip=true -Dpython.cachedir=/tmp -Dpython.home=. -Dpython.console.encoding=UTF-8" /> - - <property name="osgi.instance.area" value="@user.home/Silecs-Eclipse-Plugin/1.m.p/"/> - <property name="osgi.configuration.area" value="@user.home/Silecs-Eclipse-Plugin/1.m.p/"/> - - <extension name="Wrapper feature" - href="*" /> - </resources> - - <resources os="Linux"> - <j2se version="1.8+" - java-vm-args="-Xms128m -Xmx1024m -Dpython.cachedir.skip=true -Dpython.cachedir=/tmp -Dpython.home=. -Dpython.console.encoding=UTF-8" /> - - <property name="jnlp.osgi.instance.area" value="@user.home/Silecs-Eclipse-Plugin/1.m.p/" /> - <property name="jnlp.osgi.configuration.area" value="@user.home/Silecs-Eclipse-Plugin/1.m.p/" /> - <property name="jnlp.Dosgi.user.area" value="@user.home"/> - <property name="osgi.ws" value="gtk"/> - - <extension name="Wrapper feature" - href="*" /> - - </resources> -</jnlp> \ No newline at end of file diff --git a/silecs-eclipse-plugin/LICENSE b/silecs-eclipse-plugin/LICENSE deleted file mode 100644 index 20d40b6bceca3a6c0237d7455ebf1820aeff3680..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. \ No newline at end of file diff --git a/silecs-eclipse-plugin/META-INF/MANIFEST.MF b/silecs-eclipse-plugin/META-INF/MANIFEST.MF deleted file mode 100644 index c4986246158bbdd2d7785098e1f91aed3a7b440d..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/META-INF/MANIFEST.MF +++ /dev/null @@ -1,114 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-SymbolicName: silecs.eclipse.plugin;singleton:=true -Bundle-Version: 1.1.1.qualifier -Bundle-Activator: cern.silecs.activator.Activator -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.ui.workbench, - org.eclipse.core.resources, - org.eclipse.ui.ide, - org.eclipse.ui.editors, - org.eclipse.wst.xml.core, - org.eclipse.wst.xml.ui, - org.eclipse.ui.navigator.resources, - org.eclipse.core.filesystem, - org.eclipse.ui.console, - org.eclipse.ui.views, - org.eclipse.wst.validation, - org.eclipse.wst.validation.infopop, - org.eclipse.wst.validation.ui, - org.eclipse.jface.text, - org.eclipse.wst.sse.ui, - org.eclipse.ui.workbench.texteditor, - org.eclipse.text, - org.eclipse.wst.sse.core, - org.eclipse.ui.navigator, - org.eclipse.xsd, - org.eclipse.wst.xsd.core, - org.eclipse.core.expressions, - org.eclipse.cdt, - org.eclipse.cdt.core, - org.eclipse.cdt.ui, - org.eclipse.cdt.managedbuilder.ui, - org.eclipse.ltk.core.refactoring, - org.eclipse.ltk.ui.refactoring, - org.eclipse.equinox.launcher, - org.eclipse.cdt.make.core;bundle-version="7.3.0", - org.eclipse.cdt.make.ui;bundle-version="7.2.0", - org.eclipse.cdt.managedbuilder.core;bundle-version="8.3.0" -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: ., - ext-jars/xalan-2.7.2.jar, - ext-jars/jaxen-1.1.6.jar, - ext-jars/xml-apis-1.3.04.jar -Permissions: all-permissions -Codebase: http://abwww.cern.ch/ap/dist/silecs/1.m.p/configuration/ -Application-Name: Silecs-Eclipse-Plugin -Export-Package: org.apache.bcel, - org.apache.bcel.classfile, - org.apache.bcel.generic, - org.apache.bcel.util, - org.apache.bcel.verifier, - org.apache.bcel.verifier.exc, - org.apache.bcel.verifier.statics, - org.apache.bcel.verifier.structurals, - org.apache.regexp, - org.apache.xalan, - org.apache.xalan.client, - org.apache.xalan.extensions, - org.apache.xalan.lib, - org.apache.xalan.lib.sql, - org.apache.xalan.processor, - org.apache.xalan.res, - org.apache.xalan.serialize, - org.apache.xalan.templates, - org.apache.xalan.trace, - org.apache.xalan.transformer, - org.apache.xalan.xslt, - org.apache.xalan.xsltc, - org.apache.xalan.xsltc.cmdline, - org.apache.xalan.xsltc.cmdline.getopt, - org.apache.xalan.xsltc.compiler, - org.apache.xalan.xsltc.compiler.util, - org.apache.xalan.xsltc.dom, - org.apache.xalan.xsltc.runtime, - org.apache.xalan.xsltc.runtime.output, - org.apache.xalan.xsltc.trax, - org.apache.xalan.xsltc.util, - org.apache.xml.dtm, - org.apache.xml.dtm.ref, - org.apache.xml.dtm.ref.dom2dtm, - org.apache.xml.dtm.ref.sax2dtm, - org.apache.xml.res, - org.apache.xml.utils, - org.apache.xml.utils.res, - org.apache.xpath, - org.apache.xpath.axes, - org.apache.xpath.compiler, - org.apache.xpath.domapi, - org.apache.xpath.functions, - org.apache.xpath.jaxp, - org.apache.xpath.objects, - org.apache.xpath.operations, - org.apache.xpath.patterns, - org.apache.xpath.res, - org.jaxen, - org.jaxen.dom, - org.jaxen.dom4j, - org.jaxen.expr, - org.jaxen.expr.iter, - org.jaxen.function, - org.jaxen.function.ext, - org.jaxen.function.xslt, - org.jaxen.javabean, - org.jaxen.jdom, - org.jaxen.pattern, - org.jaxen.saxpath, - org.jaxen.saxpath.base, - org.jaxen.saxpath.helpers, - org.jaxen.util, - org.jaxen.xom, - org.w3c.dom diff --git a/silecs-eclipse-plugin/OSGI-INF/l10n/bundle.properties b/silecs-eclipse-plugin/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 3ed82f28bd9c7df0d77ed69094db2129eb83eb05..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Properties file for silecs.eclipse.plugin -Bundle-Name = Silecs-config \ No newline at end of file diff --git a/silecs-eclipse-plugin/README.md b/silecs-eclipse-plugin/README.md deleted file mode 100644 index 04caae13e4db9c1f95ff0f5113dc810a650af7ce..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# silecs-codegen - -This component of the SILECS PLC-framework is used in order to generate and manage silecs-project. - -## Getting Started - -Please check the lab-specific SILECS-Wikis for more information: - -[CERN SILECS Wiki Page][CERN_Wiki] - -[GSI SILECS Wiki Page][GSI_Wiki] - -## License - -Licensed under the GNU GENERAL PUBLIC LICENSE Version 3. See the [LICENSE file][license] for details. - -[license]: LICENSE -[CERN_Wiki]: https://wikis.cern.ch/display/SIL/SILECs+Home -[GSI_Wiki]: https://www-acc.gsi.de/wiki/Frontend/SILECS - -## Dependencies - -### Eclipse Plugins -Install Eclipse plug-in development environment – repo: Official Eclipse repo -install eclipse-core-tool – http://eclipse.org/eclipse/platform-core/updates - -### Maven -Configure the Eclipe-Maven: -https://www-acc.gsi.de/wiki/bin/viewauth/IN/Maven - -Goto project-folder in console and run: -“mvn install†-Right click on project in eclipse configure → Convert to Maven Project -Goto eclipse and run project-->Build - -## Execution - -Goto eclipse-perspective -double-click plugin.xml -Launch an Eclipse Application \ No newline at end of file diff --git a/silecs-eclipse-plugin/build.properties b/silecs-eclipse-plugin/build.properties deleted file mode 100644 index eafceb4381e27231d37cb2fdfd0e4f7d4c3c680b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -source.. = src/java/ -output.. = bin/java/,\ - bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - JNLP-INF/,\ - src/java/,\ - OSGI-INF/,\ - ext-jars/xml-apis-1.3.04.jar,\ - ext-jars/xalan-2.7.2.jar,\ - ext-jars/serializer-2.7.2.jar,\ - jaxen-1.1.6.jar,\ - xalan-2.7.2.jar -src.includes = src/ -jars.compile.order = . -qualifier = context diff --git a/silecs-eclipse-plugin/build.xml b/silecs-eclipse-plugin/build.xml deleted file mode 100644 index 223e13e363ca943932fdbc834ff2c9f9038a1c32..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/build.xml +++ /dev/null @@ -1,527 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="silecs.eclipse.plugin" default="build.jars" basedir="."> - - <property name="p2.build.repo" value="file:${buildDirectory}/buildRepo"/> - <property name="basews" value="${ws}"/> - <property name="baseos" value="${os}"/> - <property name="basearch" value="${arch}"/> - <property name="basenl" value="${nl}"/> - <property name="bundleId" value="silecs.eclipse.plugin"/> - <property name="bundleVersion" value="1.1.1.201608011414"/> - <property name="p2.publishonerror" value="false"/> - - <!-- Compiler settings. --> - <property name="javacFailOnError" value="false"/> - <property name="javacDebugInfo" value="on"/> - <property name="javacVerbose" value="false"/> - <property name="logExtension" value=".log"/> - <property name="compilerArg" value=""/> - <property name="compilation.prereq.log" value="${buildDirectory}/prereqErrors.log"/> - <property name="javacSource" value="1.3"/> - <property name="javacTarget" value="1.2"/> - <condition property="dir_bootclasspath" value="${java.home}/../Classes"> - <and> - <os family="mac"/> - <available file="${java.home}/../Classes" type="dir"/> - </and> - </condition> - <property name="dir_bootclasspath" value="${java.home}/lib"/> - <path id="path_bootclasspath"> - <fileset dir="${dir_bootclasspath}"> - <include name="*.jar"/> - </fileset> - </path> - <property name="bootclasspath" refid="path_bootclasspath"/> - <condition property="bundleBootClasspath" value="${JavaSE-1.8}" > - <isset property="JavaSE-1.8"/> - </condition> - <condition property="bundleJavacSource" value="1.8" > - <isset property="JavaSE-1.8"/> - </condition> - <condition property="bundleJavacTarget" value="1.8" > - <isset property="JavaSE-1.8"/> - </condition> - <property name="bundleJavacSource" value="${javacSource}"/> - <property name="bundleJavacTarget" value="${javacTarget}"/> - <property name="bundleBootClasspath" value="${bootclasspath}"/> - - <target name="init" depends="properties"> - <condition property="pluginTemp" value="${buildTempFolder}/plugins" > - <isset property="buildTempFolder"/> - </condition> - <property name="pluginTemp" value="${basedir}"/> - <condition property="build.result.folder" value="${pluginTemp}/silecs.eclipse.plugin_1.1.1.201608011414" > - <isset property="buildTempFolder"/> - </condition> - <property name="build.result.folder" value="${basedir}"/> - <property name="temp.folder" value="${basedir}/temp.folder"/> - <property name="plugin.destination" value="${basedir}"/> - <condition property="p2.publish.parts" value="true" > - <istrue value="${p2.gathering}"/> - </condition> - <property name="compilation.problem.marker" value="${build.result.folder}/compilation.problem"/> - <condition property="compilation.problem.marker.exists" value="true" > - <and> - <available file="${compilation.problem.marker}"/> - <isfalse value="${p2.publishonerror}"/> - </and> - </condition> - </target> - - <target name="properties" if="eclipse.running"> - <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> - - </target> - - <target name="build.update.jar" depends="init" description="Build the plug-in: silecs.eclipse.plugin for an update site."> - <delete dir="${temp.folder}"/> - <mkdir dir="${temp.folder}"/> - <antcall target="build.jars"/> - <antcall target="gather.bin.parts"> - <param name="destination.temp.folder" value="${temp.folder}/"/> - </antcall> - <jar destfile="${plugin.destination}/silecs.eclipse.plugin_1.1.1.201608011414.jar" basedir="${temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" filesetmanifest="merge"/> - <delete dir="${temp.folder}"/> - </target> - - <target name="@dot.nestedJars"> - <mkdir dir="${buildDirectory}/nestedJars/org.eclipse.equinox.registry_3.6.0.v20150318-1503"/> - <unzip src="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.registry_3.6.0.v20150318-1503.jar" dest="${buildDirectory}/nestedJars/org.eclipse.equinox.registry_3.6.0.v20150318-1503" overwrite="false"> - <patternset includes="runtime_registry_compatibility.jar"/> - </unzip> - <mkdir dir="${buildDirectory}/nestedJars/com.ibm.icu_54.1.1.v201501272100"/> - <unzip src="../../../../../../../../opt/eclipse/mars/plugins/com.ibm.icu_54.1.1.v201501272100.jar" dest="${buildDirectory}/nestedJars/com.ibm.icu_54.1.1.v201501272100" overwrite="false"> - <patternset includes="icu-data.jar"/> - </unzip> - <mkdir dir="${buildDirectory}/nestedJars/org.eclipse.e4.core.services_2.0.0.v20150403-1912"/> - <unzip src="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.services_2.0.0.v20150403-1912.jar" dest="${buildDirectory}/nestedJars/org.eclipse.e4.core.services_2.0.0.v20150403-1912" overwrite="false"> - <patternset includes="injection_annotations.jar"/> - </unzip> - </target> - <target name="@dot" depends="init,@dot.nestedJars" unless="@dot" description="Create jar: silecs.eclipse.plugin @dot."> - <delete dir="${build.result.folder}/@dot"/> - <mkdir dir="${build.result.folder}/@dot"/> - <path id="@dot.classpath"> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui_3.107.0.v20150507-1945.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.runtime_3.11.1.v20150903-1804.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/javax.annotation_1.2.0.v201401042248.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/javax.inject_1.0.0.v20091030.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.osgi_3.10.102.v20160118-1700.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.osgi.compatibility.state_1.0.100.v20150402-1551.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.jobs_3.7.0.v20150330-2103.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.runtime.compatibility.registry_3.6.0.v20150318-1505/runtime_registry_compatibility.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.runtime.compatibility.registry_3.6.0.v20150318-1505"/> - <pathelement path="${buildDirectory}/nestedJars/org.eclipse.equinox.registry_3.6.0.v20150318-1503/runtime_registry_compatibility.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.registry_3.6.0.v20150318-1503.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/javax.xml_1.3.4.v201005080400.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.preferences_3.5.300.v20150408-1437.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.contenttype_3.5.0.v20150421-2214.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.app_1.3.300.v20150423-1356.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.osgi.services_3.5.0.v20150519-2006.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/javax.servlet_3.1.0.v201410161800.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.swt_3.104.2.v20160212-1350.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.swt.gtk.linux.x86_64_3.104.2.v20160212-1350.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jface_3.11.1.v20160128-1644.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.commands_3.7.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.bidi_0.10.0.v20130327-1442.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.workbench_3.107.1.v20160120-2131.jar"/> - <pathelement path="${buildDirectory}/nestedJars/com.ibm.icu_54.1.1.v201501272100/icu-data.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/com.ibm.icu_54.1.1.v201501272100.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.commands_0.11.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.expressions_3.5.0.v20150421-2214.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.contexts_1.4.0.v20150828-0818.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.di_1.5.0.v20150421-2214.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.di.annotations_1.4.0.v20150528-1451.jar"/> - <pathelement path="${buildDirectory}/nestedJars/org.eclipse.e4.core.services_2.0.0.v20150403-1912/injection_annotations.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.services_2.0.0.v20150403-1912.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.workbench_1.3.1.v20160203-0951.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.model.workbench_1.1.100.v20150407-1430.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.ecore_2.11.2.v20160208-0816.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.common_2.11.1.v20160208-0816.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.resources_3.10.1.v20150725-1910.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ant.core_3.4.0.v20150428-1928.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.variables_3.2.800.v20130819-1716.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.filesystem_1.5.0.v20150725-1910.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.filesystem.java7_1.0.100.v20150423-0754.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.filesystem.linux.x86_64_1.2.200.v20140124-1940.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.emf.xpath_0.1.100.v20150513-0856.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.commons.jxpath_1.3.0.v200911051830.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.services_1.2.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.di_1.1.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.core.di.extensions_0.13.0.v20150421-2214.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.ecore.change_2.11.0.v20160208-0816.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.ecore.xmi_2.11.1.v20160208-0816.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.workbench.renderers.swt_0.13.0.v20150901-1347.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.workbench.swt_0.13.0.v20150504-0621.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.databinding_1.5.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.databinding.observable_1.5.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.databinding.property_1.5.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jface.databinding_1.7.0.v20150406-2148.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.css.core_0.11.0.v20150511-1937.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.w3c.css.sac_1.3.1.v200903091627.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.batik.css_1.7.0.v201011041433.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.w3c.dom.events_3.0.0.draft20060413_v201105210656.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.w3c.dom.svg_1.1.0.v201011041433.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.w3c.dom.smil_1.0.1.v200903091627.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.batik.util_1.7.0.v201011041433.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.batik.util.gui_1.7.0.v200903091627.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.css.swt_0.12.0.v20150511-1003.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.bindings_0.11.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.workbench3_0.13.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.css.swt.theme_0.10.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.swt.gtk_1.0.1.v20150708-1529.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.widgets_1.1.0.v20150427-1751.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.ds_1.4.300.v20150423-1356.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.util_1.0.500.v20130404-1337.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.event_1.3.100.v20140115-1647.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.help_3.6.0.v20130326-1254.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.e4.ui.workbench.addons.swt_1.2.0.v20150512-1414.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.ide_3.11.0.v20150825-2158.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.views_3.8.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jface.text_3.10.0.v20150603-1752.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.text_3.5.400.v20150505-1044.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.forms_3.6.200.v20150506-2029.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.p2.engine_2.4.0.v20150511-1532.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.p2.core_2.4.0.v20150527-1706.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.p2.metadata_2.3.0.v20150511-1532.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.p2.metadata.repository_1.2.200.v20150428-1613.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.p2.repository_2.3.100.v20150428-1613.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.security_1.2.100.v20150423-1356.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.tukaani.xz_1.3.0.v201308270617.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.editors_3.9.0.v20150213-1939.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.workbench.texteditor_3.9.100.v20141023-1946.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.compare.core_3.5.500.v20150505-1058.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.filebuffers_3.5.500.v20140723-1040.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.xml.core_1.1.902.v201501211904.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.xerces_2.9.0.v201101211617.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.xml.resolver_1.2.0.v201005080400.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.xml.serializer_2.7.1.v201005080400.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.uriresolver_1.2.200.v201505132009.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.sse.core_1.1.900.v201401092025.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.validation_1.2.700.v201508251749.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.frameworks_1.2.200.v201304241450.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.environment_1.0.400.v200912181831.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.osgi.util_3.3.100.v20150423-1351.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.core_1.2.0.v200908251833.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.project.facet.core_1.4.300.v201111030423.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jem.util_2.1.200.v201404021757.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.emf_1.2.400.v201505132009.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.emfworkbench.integration_1.2.101.v201107081800.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.edit_2.11.1.v20160208-0841.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.xml.ui_1.1.501.v201501212057.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.sse.ui_1.3.400.v201505141512.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.debug.ui_3.11.101.v20160203-1230.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.console_3.6.100.v20150822-1912.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.debug.core_3.10.0.v20150303-1130.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.search_3.10.0.v20150318-0856.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ltk.core.refactoring_3.6.201.v20150819-1034.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ltk.ui.refactoring_3.7.200.v20140625-1835.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.navigator_3.6.0.v20150422-0725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.compare_3.5.600.v20150420-1449.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.team.core_3.7.100.v20150203-1452.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.team.ui_3.7.200.v20150203-1452.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.ui_1.1.500.v200911182011.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.validation.ui_1.2.500.v201310231452.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.common.frameworks.ui_1.2.400.v201504292002.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.navigator.resources_3.5.1.v20160128-1644.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.views.properties.tabbed_3.6.100.v20150423-0822.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.validation.infopop_1.0.300.v201309101952.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.xsd_2.11.0.v20160208-0841.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.wst.xsd.core_1.1.900.v201401141857.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt_8.8.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.intro_3.4.300.v20141007-1449.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.help.base_4.0.301.v20160212-1500.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.http.jetty_3.1.2.v20160115-1350.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.http.servlet_1.2.2.v20160202-2102.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.http_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.util_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.slf4j.api_1.7.2.v20121108-1250.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/ch.qos.logback.slf4j_1.0.7.v201505121915.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.slf4j.impl.log4j12_1.7.2.v20131105-2200.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.log4j_1.2.15.v201012070815.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/ch.qos.logback.core_1.0.7.v20121108-1250.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/ch.qos.logback.classic_1.0.7.v20121108-1250.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.logback.appender_1.6.2.20150902-0002.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.core.ui_1.6.2.20150902-0002.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.core_1.6.2.20150902-0002.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/takari-local-repository-0.9.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/takari-filemanager-0.7.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-core-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-model-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-settings-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-settings-builder-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-builder-support-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-repository-metadata-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-artifact-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-plugin-api-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-model-builder-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-aether-provider-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-api-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-util-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-interpolation-1.21.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-utils-3.0.20.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-classworlds-2.5.2.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-component-annotations-1.5.5.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-sec-dispatcher-1.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-embedder-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-cipher-1.7.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/commons-cli-1.2.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/maven-compat-3.3.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/wagon-provider-api-2.9.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/org.eclipse.sisu.plexus-0.3.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/cdi-api-1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/jsr250-api-1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/org.eclipse.sisu.inject-0.3.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/sisu-guice-3.2.5-no_aop.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/guava-18.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/plexus-build-api-0.0.7.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-impl-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-spi-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-connector-okhttp-0.15.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/okhttp-2.3.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/okio-1.3.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-connector-basic-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/aether-transport-wagon-1.0.2.v20150114.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/wagon-file-2.9.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime_1.6.2.20150902-0001/jars/commons-lang-2.6.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.6.2.20150902-0001"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.6.2.20150902-0001/jars/slf4j-simple-1.7.5.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/archetype-common-2.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/archetype-catalog-2.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/archetype-descriptor-2.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/archetype-registry-2.3.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/maven-invoker-2.1.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/commons-collections-3.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/commons-io-2.2.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/commons-lang-2.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/dom4j-1.6.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/jchardet-1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/jdom-1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/oro-2.0.8.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/plexus-velocity-1.1.8.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.archetype.common_1.6.2.20150902-0001/velocity-1.5.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.indexer_1.6.2.20150902-0001"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.indexer_1.6.2.20150902-0001/indexer-core-3.1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.indexer_1.6.2.20150902-0001/indexer-artifact-3.1.0.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.indexer_1.6.2.20150902-0001/lucene-core-2.4.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.maven.indexer_1.6.2.20150902-0001/lucene-highlighter-2.4.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.workspace.cli_0.3.1.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/com.google.guava_15.0.0.v201403281430.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.m2e.model.edit_1.6.2.20150902-0002.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.emf.ecore.edit_2.9.0.v20160208-0841.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.server_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.io_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.servlet_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.jetty.security_9.2.13.v20150730.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.lucene.analysis_3.5.0.v20120725-1805.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.apache.lucene.core_3.5.0.v20120725-1805.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.net_1.2.300.v20141118-1725.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.core.net.linux.x86_64_1.1.100.v20140124-2013.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.ui.cheatsheets_3.4.200.v20131227-1524.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.help.ui_4.0.100.v20140401-0608.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.core_5.11.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.core.native_5.8.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.core.linux_5.3.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.core.linux.x86_64_5.3.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.ui_5.11.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.managedbuilder.ui_8.2.2.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.make.core_7.3.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.make.ui_7.2.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.cdt.managedbuilder.core_8.3.0.201509131935.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar"/> - <pathelement path="../../../../../../../../opt/eclipse/mars/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417"/> - <pathelement path="ext-jars/xalan-2.7.2.jar"/> - <pathelement path="${build.result.folder}/../silecs.eclipse.plugin_1.1.1.201608011414/ext-jars/xalan-2.7.2.jar"/> - <pathelement path="ext-jars/jaxen-1.1.6.jar"/> - <pathelement path="${build.result.folder}/../silecs.eclipse.plugin_1.1.1.201608011414/ext-jars/jaxen-1.1.6.jar"/> - <pathelement path="ext-jars/xml-apis-1.3.04.jar"/> - <pathelement path="${build.result.folder}/../silecs.eclipse.plugin_1.1.1.201608011414/ext-jars/xml-apis-1.3.04.jar"/> - </path> - <!-- compile the source code --> - <javac destdir="${build.result.folder}/@dot" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" > - <compilerarg line="${compilerArg}" compiler="${build.compiler}"/> - <classpath refid="@dot.classpath" /> - <src path="src/java/" /> - <compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" /> - <compilerarg line="-log '${build.result.folder}/@dot${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter" /> - </javac> - <antcall target="checkCompilationResults"/> - <!-- Copy necessary resources --> - <copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false"> - <fileset dir="src/java/"> - <exclude name="**/*.java"/> - <exclude name="**/package.htm*"/> - </fileset> - </copy> - </target> - - <target name="src.zip" depends="init" unless="src.zip"> - <mkdir dir="${build.result.folder}"/> - <antcall target="zip.src.zip"/> - </target> - <target name="zip.src.zip"> - <zip destfile="${build.result.folder}/src.zip" filesonly="false" whenempty="skip" update="false"> - <fileset dir="src/java/"> - <include name="**/*.java"/> - </fileset> - </zip> - </target> - <target name="copy.src.zip"> - <copy todir="${source.destination.folder}/" failonerror="true" overwrite="true"> - <fileset dir="src/java/"> - <include name="**/*.java"/> - </fileset> - </copy> - </target> - - <target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: silecs.eclipse.plugin."> - <delete file="${compilation.problem.marker}" quiet="true"/> - <available property="@dot" file="${build.result.folder}/@dot"/> - <antcall target="@dot"/> - </target> - - <target name="checkCompilationResults" if="compilation.error.occured"> - <echo file="${compilation.problem.marker}" message="silecs.eclipse.plugin_1.1.1.201608011414${line.separator}compilation.error.occured=${compilation.error.occured}"/> - <eclipse.logCompileError log="${compilation.prereq.log}" bundle="silecs.eclipse.plugin_1.1.1.201608011414"> - </eclipse.logCompileError> - </target> - - <target name="build.sources" depends="init"> - <available property="src.zip" file="${build.result.folder}/src.zip"/> - <antcall target="src.zip"/> - </target> - - <target name="publish.bin.parts" depends="init" if="p2.publish.parts" unless="compilation.problem.marker.exists"> - <mkdir dir="${build.result.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - <copy todir="${build.result.folder}" failonerror="true" overwrite="true"> - <fileset dir="${basedir}"> - <include name="META-INF/MANIFEST.MF"/> - <include name="plugin.xml"/> - <include name="fragment.xml"/> - </fileset> - </copy> - <eclipse.versionReplacer path="${build.result.folder}" version="1.1.1.201608011414"/> - <antcall target="apitools.generation"> - <param name="projectLocation" value="${basedir}"/> - <param name="binary.folders" value="${build.result.folder}/@dot:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/xml-apis-1.3.04.jar:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/jaxen-1.1.6.jar:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/xalan-2.7.2.jar"/> - <param name="projectName" value="${bundleId}_${bundleVersion}"/> - <param name="target.folder" value="${build.result.folder}"/> - </antcall> - <eclipse.gatherBundle - metadataRepository="${p2.build.repo}" - artifactRepository="${p2.build.repo}" - buildResultFolder="${build.result.folder}" - unpack="false" - baseDirectory="${basedir}" - /> - </target> - - <target name="gather.bin.parts" depends="init" if="destination.temp.folder"> - <mkdir dir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - <copy todir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" failonerror="true" overwrite="false"> - <fileset dir="${build.result.folder}/@dot"> - <include name="**"/> - </fileset> - </copy> - <copy todir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" failonerror="true" overwrite="true"> - <fileset dir="${basedir}"> - <include name="plugin.xml"/> - <include name="META-INF/"/> - <include name="icons/"/> - <include name="JNLP-INF/"/> - <include name="src/java/"/> - <include name="OSGI-INF/"/> - <include name="ext-jars/xml-apis-1.3.04.jar"/> - <include name="ext-jars/xalan-2.7.2.jar"/> - <include name="ext-jars/serializer-2.7.2.jar"/> - <include name="jaxen-1.1.6.jar"/> - <include name="xalan-2.7.2.jar"/> - </fileset> - </copy> - <eclipse.versionReplacer path="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" version="1.1.1.201608011414"/> - <antcall target="apitools.generation"> - <param name="projectLocation" value="${basedir}"/> - <param name="binary.folders" value="${build.result.folder}/@dot:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/xml-apis-1.3.04.jar:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/jaxen-1.1.6.jar:/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin/ext-jars/xalan-2.7.2.jar"/> - <param name="projectName" value="${bundleId}_${bundleVersion}"/> - <param name="target.folder" value="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - </antcall> - </target> - - <target name="build.zips" depends="init"> - </target> - - <target name="gather.sources" depends="init" if="destination.temp.folder"> - <mkdir dir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - <copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" failonerror="false" overwrite="false"/> - <antcall target="copy.src.includes"> - <param name="source.destination.folder" value="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - </antcall> - </target> - - <target name="gather.individual.sources" depends="init"> - <antcall target="copy.src.zip"> - <param name="source.destination.folder" value="${destination.temp.folder}"/> - </antcall> - <antcall target="copy.src.includes"> - <param name="source.destination.folder" value="${destination.temp.folder}"/> - </antcall> - </target> - - <target name="copy.src.includes" depends="init"> - <copy todir="${source.destination.folder}" failonerror="false" overwrite="false"> - <fileset dir="${basedir}"> - <include name="src/"/> - </fileset> - </copy> - </target> - - <target name="gather.logs" depends="init" if="destination.temp.folder"> - <mkdir dir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414"/> - <copy todir="${destination.temp.folder}/silecs.eclipse.plugin_1.1.1.201608011414" failonerror="false" overwrite="false"> - <fileset dir="${build.result.folder}"> - <include name="@dot${logExtension}"/> - </fileset> - </copy> - </target> - - <target name="clean" depends="init" description="Clean the plug-in: silecs.eclipse.plugin of all the zips, jars and logs created."> - <delete dir="${build.result.folder}/@dot"/> - <delete file="${build.result.folder}/src.zip"/> - <delete file="${plugin.destination}/silecs.eclipse.plugin_1.1.1.201608011414.jar"/> - <delete file="${plugin.destination}/silecs.eclipse.plugin_1.1.1.201608011414.zip"/> - <delete dir="${temp.folder}"/> - <delete file="${compilation.problem.marker}" quiet="true"/> - </target> - - <target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder."> - <eclipse.convertPath fileSystemPath="/common/home/bel/schwinn/lnx/git/git/silecs-eclipse-plugin" property="resourcePath"/> - <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/> - </target> - - <target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: silecs.eclipse.plugin."> - <delete dir="${temp.folder}"/> - <mkdir dir="${temp.folder}"/> - <antcall target="build.jars"/> - <antcall target="build.sources"/> - <antcall target="gather.bin.parts"> - <param name="destination.temp.folder" value="${temp.folder}/"/> - </antcall> - <antcall target="gather.sources"> - <param name="destination.temp.folder" value="${temp.folder}/"/> - </antcall> - <delete> - <fileset dir="${temp.folder}"> - <include name="**/*.bin${logExtension}"/> - </fileset> - </delete> - <zip destfile="${plugin.destination}/silecs.eclipse.plugin_1.1.1.201608011414.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/> - <delete dir="${temp.folder}"/> - </target> - - <target name="apitools.generation" if="generateAPIDescription"> - <apitooling.apigeneration projectName="${projectName}" project="${projectLocation}" binary="${binary.folders}" target="${target.folder}" extramanifests="${extraManifests}" allownonapiproject="${allowNonApiProject}" /> - </target> - -</project> diff --git a/silecs-eclipse-plugin/icons/class-document.png b/silecs-eclipse-plugin/icons/class-document.png deleted file mode 100644 index 80984b14d8f98dba890f8e9e56b08f7c642ba50c..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/class-document.png and /dev/null differ diff --git a/silecs-eclipse-plugin/icons/deploy-document.png b/silecs-eclipse-plugin/icons/deploy-document.png deleted file mode 100644 index 894abc409c39559e46105f195802d42f64241321..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/deploy-document.png and /dev/null differ diff --git a/silecs-eclipse-plugin/icons/diag-tool.gif b/silecs-eclipse-plugin/icons/diag-tool.gif deleted file mode 100644 index 3748db1fddb2fe61380bac4dc029d6a617236453..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/diag-tool.gif and /dev/null differ diff --git a/silecs-eclipse-plugin/icons/generated-code.gif b/silecs-eclipse-plugin/icons/generated-code.gif deleted file mode 100644 index 18ffabe77f499a954f2ef0d2077da4ff4365e391..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/generated-code.gif and /dev/null differ diff --git a/silecs-eclipse-plugin/icons/silecs-logo.ico b/silecs-eclipse-plugin/icons/silecs-logo.ico deleted file mode 100644 index 2b22b71097787713417cae9933d9604b169ea962..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/silecs-logo.ico and /dev/null differ diff --git a/silecs-eclipse-plugin/icons/validate-document.gif b/silecs-eclipse-plugin/icons/validate-document.gif deleted file mode 100644 index 23c97f09e677bb8812b26d4415fd97997e5c95a4..0000000000000000000000000000000000000000 Binary files a/silecs-eclipse-plugin/icons/validate-document.gif and /dev/null differ diff --git a/silecs-eclipse-plugin/plugin.xml b/silecs-eclipse-plugin/plugin.xml deleted file mode 100644 index 8784193cb84f6f0c476d61505d47b513715ec6df..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/plugin.xml +++ /dev/null @@ -1,874 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="4.5"?> -<plugin> - <extension - id="application" - point="org.eclipse.core.runtime.applications"> - <application> - <run - class="cern.silecs.view.Application"> - </run> - </application> - </extension> - <extension - point="org.eclipse.core.resources.natures" - id="cern.fesa.plugin.core.fesaClassProjectNature" - name="cern.fesa.plugin.core.fesaClassProjectNature"> - </extension> - - <extension - point="org.eclipse.ui.perspectives"> - <perspective - class="cern.silecs.view.Perspective" - fixed="false" - id="silecs.eclipse.plugin.perspective" - name="Silecs"> - </perspective> - </extension> - <extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension - targetID="silecs.eclipse.plugin.perspective"> - <view - closeable="false" - id="cern.silecs.view.explorer" - minimized="false" - moveable="false" - ratio="0.25" - relationship="left" - relative="org.eclipse.ui.editorss" - visible="true"> - </view> - <view - closeable="false" - id="org.eclipse.ui.views.ProblemView" - minimized="false" - ratio="0.8f" - relationship="bottom" - relative="org.eclipse.ui.editorss" - visible="true"> - </view> - <view - closeable="false" - id="org.eclipse.ui.console.ConsoleView" - minimized="false" - relationship="stack" - relative="org.eclipse.ui.views.ProblemView"> - </view> - <view - closeable="false" - id="org.eclipse.wst.xml.ui.views.annotations.XMLAnnotationsView" - minimized="false" - relationship="stack" - relative="org.eclipse.ui.views.ProblemView" - visible="true"> - </view> - </perspectiveExtension> - </extension> - <extension - point="org.eclipse.ui.ide.projectNatureImages"> - <image - icon="icons/deploy-document.png" - id="cern.silecs.control.core.DeployProjectNature.img" - natureId="cern.silecs.control.core.deployprojectnature"> - </image> - <image - icon="icons/class-document.png" - id="cern.silecs.control.core.DesignProjectNature.img" - natureId="cern.silecs.control.core.designprojectnature"> - </image> - </extension> - <extension - id="deployprojectnature" - point="org.eclipse.core.resources.natures"> - <runtime> - <run - class="cern.silecs.control.core.DeployProjectNature"> - </run> - </runtime> - </extension> - <extension - point="org.eclipse.ui.commands"> - <category - id="cern.silecs.view.category" - name="Cat"> - </category> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.ValidateHandler" - id="cern.silecs.control.handlers.validate" - name="SILECS Validate"> - <commandParameter - id="silecs-eclipse-plugin.commandParameter" - name="silecs-eclipse-plugin.commandParameter" - optional="false"> - </commandParameter> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.GenerateCodeHandler" - id="cern.silecs.control.handlers.generatecodehandler" - name="SILECS Generate Code"> - <commandParameter - id="silecs-eclipse-plugin.commandParameter" - name="silecs-eclipse-plugin.commandParameter" - optional="false"> - </commandParameter> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.AboutSilecsHandler" - id="cern.silecs.control.handlers.aboutsilecs" - name="About Silecs"> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.SilecsWikis" - id="cern.silecs.control.handlers.silecswikis" - name="Silecs Wikis"> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.ExpandAllHandler" - id="cern.silecs.control.handlers.expandallhandler" - name="Expand All"> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.DiagnosticToolHandler" - id="cern.silecs.control.handlers.launchdiagnostitoolhandler" - name="SILECS Diagnostic Tool"> - <commandParameter - id="silecs-eclipse-plugin.commandParameter" - name="silecs-eclipse-plugin.commandParameter" - optional="false"> - </commandParameter> - </command> - <command - categoryId="cern.silecs.view.category" - defaultHandler="cern.silecs.control.handlers.UpdateSilecsProjectHandler" - id="cern.silecs.control.handlers.updatesilecsprojecthandler" - name="SILECS Update Project"> - <commandParameter - id="silecs-eclipse-plugin.commandParameter" - name="silecs-eclipse-plugin.commandParameter" - optional="false"> - </commandParameter> - </command> - </extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - locationURI="menu:org.eclipse.ui.main.menu"> - <menu - label="Silecs"> - <command - commandId="cern.silecs.control.handlers.silecswikis" - label="Silecs wikis" - style="push"> - </command> - <command - commandId="cern.silecs.control.handlers.aboutsilecs" - label="About Silecs" - style="push"> - </command> - - <visibleWhen - checkEnabled="false"> - <reference - definitionId="cern.silecs.view.perspectivedefinition"> - </reference> - </visibleWhen> - </menu> - - </menuContribution> - <menuContribution - locationURI="toolbar:org.eclipse.ui.main.toolbar"> - <toolbar - id="cern.silecs.view.toolbars.projectFunctions" - label="SILECS Toolbar"> - <command - commandId="cern.silecs.control.handlers.validate" - icon="icons/validate-document.gif" - label="SILECS Validate" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.view.editors.design.activeEditor"> - </reference> - <reference - definitionId="cern.silecs.view.editors.deploy.activeEditor"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="toolbar"> - </parameter> - </command> - <command - commandId="cern.silecs.control.handlers.generatecodehandler" - icon="icons/generated-code.gif" - label="SILECS Generate Code" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.view.editors.design.activeEditor"> - </reference> - <reference - definitionId="cern.silecs.view.editors.deploy.activeEditor"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="toolbar"> - </parameter> - </command> - <command - commandId="cern.silecs.control.handlers.launchdiagnostitoolhandler" - icon="icons/diag-tool.gif" - label="SILECS Diagnostic Tool" - style="push"> - <visibleWhen - checkEnabled="false"> - <reference - definitionId="cern.silecs.view.editors.deploy.activeEditor"> - </reference> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="toolbar"> - </parameter> - </command> - </toolbar> - </menuContribution> - <menuContribution - allPopups="false" - locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions"> - <menu - id="silecs_submenu" - label="SILECS"> - <command - commandId="cern.silecs.control.handlers.validate" - label="SILECS Validate" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.control.core.designprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.control.core.deployprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.menu.designFile"> - </reference> - <reference - definitionId="cern.silecs.menu.deployFile"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="menubar"> - </parameter> - </command> - <command - commandId="cern.silecs.control.handlers.generatecodehandler" - label="SILECS Generate Code" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.control.core.designprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.control.core.deployprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.menu.designFile"> - </reference> - <reference - definitionId="cern.silecs.menu.deployFile"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="menubar"> - </parameter> - </command> - <command - commandId="cern.silecs.control.handlers.launchdiagnostitoolhandler" - label="SILECS Diagnostic Tool" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.control.core.deployprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.menu.deployFile"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="menubar"> - </parameter> - </command> - <command - commandId="cern.silecs.control.handlers.updatesilecsprojecthandler" - label="Update SILECS version" - style="push"> - <visibleWhen - checkEnabled="false"> - <or> - <reference - definitionId="cern.silecs.control.core.designprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.control.core.deployprojectdefinition"> - </reference> - <reference - definitionId="cern.silecs.menu.designFile"> - </reference> - <reference - definitionId="cern.silecs.menu.deployFile"> - </reference> - </or> - </visibleWhen> - <parameter - name="silecs-eclipse-plugin.commandParameter" - value="menubar"> - </parameter> - </command> - </menu> - </menuContribution> - <menuContribution - allPopups="false" - locationURI="popup:cern.silecs.view.explorer#PopupMenu?after=additions"> - <menu - id="silecs_submenu" - label="SILECS"> - </menu> - </menuContribution> - </extension> - <extension - point="org.eclipse.ui.editors"> - <editor - class="cern.silecs.view.editor.DesignMultiPageEditor" - contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor" - default="true" - icon="icons/class-document.png" - extensions="xml" - filenames="silecsdesign" - id="cern.silecs.view.editors.design" - name="XML Editor"> - <contentTypeBinding - contentTypeId="cern.silecs.model.contenttype.design"> - </contentTypeBinding> - </editor> - <editor - class="cern.silecs.view.editor.DeployMultiPageEditor" - contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor" - default="true" - icon="icons/deploy-document.png" - extensions="xml" - filenames="silecsdeploy" - id="cern.silecs.view.editors.deploy" - name="XML Editor"> - <contentTypeBinding - contentTypeId="cern.silecs.model.contenttype.deploy"> - </contentTypeBinding> - </editor> - </extension> - <extension - id="designprojectnature" - point="org.eclipse.core.resources.natures"> - <runtime> - <run - class="cern.silecs.control.core.DesignProjectNature"> - </run> - </runtime> - </extension> - <extension - id="cern.silecs.view.marker" - name="%silecs.marker.problem" - point="org.eclipse.core.resources.markers"> - <super - type="org.eclipse.core.resources.problemmarker"> - </super> - <persistent - value="false"> - </persistent> - <attribute - name="xPath"> - </attribute> - </extension> - <extension - point="org.eclipse.ui.editors.markerUpdaters"> - <updater - class="cern.silecs.view.marker.SilecsMarkerUpdater" - id="cern.silecs.view.marker.updater" - markerType="cern.silecs.view.marker"> - </updater> - </extension> - <extension - point="org.eclipse.ui.newWizards"> - <category - id="cern.silecs.view.category.wizards" - name="Silecs"> - </category> - <wizard - category="cern.silecs.view.category.wizards" - class="cern.silecs.view.wizards.NewSilecsDesignWizard" - finalPerspective="silecs.eclipse.plugin.perspective" - icon="icons/class-document.png" - id="cern.silecs.view.wizards.newdesignclass" - name="Design" - project="true"> - </wizard> - <wizard - category="cern.silecs.view.category.wizards" - class="cern.silecs.view.wizards.NewSilecsDeployWizard" - finalPerspective="silecs.eclipse.plugin.perspective" - icon="icons/deploy-document.png" - id="cern.silecs.view.wizards.newdeployclass" - name="Deploy" - project="true"> - </wizard> - </extension> - <extension - id="product" - point="org.eclipse.core.runtime.products"> - <product - application="silecs.eclipse.plugin.application" - name="Silecs-Eclipse-Plugin 1.1.1"> - <property - name="appName" - value="Silecs-Eclipse-Plugin 1.1.1"> - </property> - </product> - </extension> - <extension - point="org.eclipse.ui.importWizards"> - <category - id="cern.silecs.view.category.wizards" - name="Silecs"> - </category> - <wizard - category="cern.silecs.view.category.wizards" - class="cern.silecs.view.wizards.ImportDeployFileWizard" - icon="icons/deploy-document.png" - id="cern.silecs.view.wizards.importdeploywizard" - name="Import Silecs-1 Deploy-Unit File"> - </wizard> - <wizard - category="cern.silecs.view.category.wizards" - class="cern.silecs.view.wizards.ImportDesignFileWizard" - icon="icons/class-document.png" - id="cern.silecs.view.wizards.importdesignfilewizard" - name="Import Silecs-1 Design File"> - </wizard> - </extension> - <extension - point="org.eclipse.team.core.fileTypes"> - <fileTypes - extension="*.silecsdesign" - type="text"> - </fileTypes> - <fileTypes - extension="*.silecsdeploy" - type="text"> - </fileTypes> - </extension> - <extension - point="org.eclipse.core.contenttype.contentTypes"> - <content-type - base-type="org.eclipse.core.runtime.xml" - file-extensions="silecsdesign" - id="cern.silecs.model.contenttype.design" - name="Design"> - </content-type> - <content-type - base-type="org.eclipse.core.runtime.xml" - file-extensions="silecsdeploy" - id="cern.silecs.model.contenttype.deploy" - name="Deploy"> - </content-type> - </extension> - <extension - point="org.eclipse.core.expressions.definitions"> - <definition id="cern.silecs.designFile"> - <iterate ifEmpty="false"> - <adapt - type="org.eclipse.core.resources.IFile"> - <test - property="org.eclipse.core.resources.extension" - value="silecsdesign"> - </test> - </adapt> - </iterate> - </definition> - - <definition id="cern.silecs.deployFile"> - <iterate ifEmpty="false"> - <adapt - type="org.eclipse.core.resources.IFile"> - <test - property="org.eclipse.core.resources.extension" - value="silecsdeploy"> - </test> - </adapt> - </iterate> - </definition> - - <definition - id="cern.silecs.menu.designFile"> - <with - variable="activeMenuSelection"> - <reference - definitionId="cern.silecs.designFile"> - </reference> - </with> - </definition> - - <definition - id="cern.silecs.menu.deployFile"> - <with - variable="activeMenuSelection"> - <reference - definitionId="cern.silecs.deployFile"> - </reference> - </with> - </definition> - - <definition - id="cern.silecs.control.core.deployprojectdefinition"> - <iterate - ifEmpty="false"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="cern.silecs.control.core.deployprojectnature"> - </test> - </adapt> - </iterate> - </definition> - <definition - id="cern.silecs.control.core.designprojectdefinition"> - <iterate - ifEmpty="false"> - <adapt - type="org.eclipse.core.resources.IProject"> - <test - property="org.eclipse.core.resources.projectNature" - value="cern.silecs.control.core.designprojectnature"> - </test> - </adapt> - </iterate> - </definition> - <definition - id="cern.silecs.view.editors.design.activeEditor"> - <with variable="activeEditorId"> - <equals - value="cern.silecs.view.editors.design"> - </equals> - </with> - </definition> - <definition - id="cern.silecs.view.editors.deploy.activeEditor"> - <with variable="activeEditorId"> - <equals - value="cern.silecs.view.editors.deploy"> - </equals> - </with> - </definition> - <definition - id="cern.silecs.view.perspectivedefinition"> - <with - variable="activeWorkbenchWindow.activePerspective"> - <equals - value="silecs.eclipse.plugin.perspective"> - </equals> - </with> - </definition> - </extension> - <extension - point="org.eclipse.ui.decorators"> - <decorator - adaptable="true" - class="org.eclipse.cdt.internal.ui.navigator.CNavigatorProblemsLabelDecorator" - id="cern.silecs.view.decorators.ErrorDecorator" - label="Project error decorator" - lightweight="true" - location="BOTTOM_LEFT" - objectClass="org.eclipse.core.resources.IResource" - state="true"> - <enablement> - <and> - <objectClass - name="org.eclipse.core.resources.IResource"> - </objectClass> - <or> - <objectClass - name="org.eclipse.core.resources.IFolder"> - </objectClass> - <objectClass - name="org.eclipse.core.resources.IFile"> - </objectClass> - </or> - </and> - </enablement> - </decorator> - </extension> - <extension - point="org.eclipse.ui.bindings"> - <scheme - id="cern.silecs.control.bindingscheme" - name="Binding scheme"> - </scheme> - <key - commandId="cern.silecs.control.handlers.expandallhandler" - contextId="org.eclipse.ui.contexts.window" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="M1+M2+A"> - </key> - </extension> - <extension - point="org.eclipse.ui.views"> - <category - id="cern.silecs.view.ui" - name="Silecs"> - </category> - <view - category="cern.silecs.view.ui" - class="cern.silecs.view.explorer.SilecsProjectExplorer" - icon="icons/silecs-logo.ico" - id="cern.silecs.view.explorer" - name="Silecs Explorer" - restorable="true"> - </view> - </extension> - <extension - point="org.eclipse.ui.navigator.navigatorContent"> - <commonFilter - activeByDefault="true" - id="cern.silecs.view.explorer.filter.hiddenfiles" - name=".* resources" - visibleInUI="true"> - <filterExpression> - <and> - <adapt - type="org.eclipse.core.resources.IResource"> - <test - property="org.eclipse.core.resources.name" - value=".*"> - </test> - </adapt> - </and> - </filterExpression> - </commonFilter> - <navigatorContent - activeByDefault="true" - contentProvider="cern.silecs.view.explorer.ProjectContent" - id="cern.silecs.view.explorer.content" - labelProvider="org.eclipse.ui.model.WorkbenchLabelProvider" - name="Silecs Project Content" - priority="normal"> - <triggerPoints> - <or> - <adapt - type="org.eclipse.core.resources.IWorkspaceRoot"> - </adapt> - <adapt - type="org.eclipse.core.resources.IFolder"> - </adapt> - <adapt - type="org.eclipse.core.resources.IProject"> - <or> - <test - property="org.eclipse.core.resources.projectNature" - value="cern.silecs.control.core.DesignProjectNature"> - </test> - <test - property="org.eclipse.core.resources.projectNature" - value="cern.silecs.control.core.DeployProjectNature"> - </test> - </or> - </adapt> - </or> - </triggerPoints> - <possibleChildren> - <or> - <adapt - type="org.eclipse.core.resources.IProject"> - </adapt> - <adapt - type="org.eclipse.core.resources.IFolder"> - </adapt> - <adapt - type="org.eclipse.core.resources.IFile"> - </adapt> - </or> - </possibleChildren> - <commonSorter - class="cern.silecs.view.explorer.ContentSorter" - id="cern.silecs.view.explorer.sorter.ContentSorter"> - </commonSorter> - <dropAssistant - class="org.eclipse.cdt.internal.ui.navigator.CNavigatorDropAdapterAssistant" - id="cern.silecs.view.explorer.resourceDropAdapter"> - <possibleDropTargets> - <or> - <adapt - type="org.eclipse.core.resources.IProject"> - </adapt> - <adapt - type="org.eclipse.core.resources.IFolder"> - </adapt> - <adapt - type="org.eclipse.core.resources.IFile"> - </adapt> - </or></possibleDropTargets> - </dropAssistant> - <actionProvider - class="org.eclipse.cdt.internal.ui.navigator.CNavigatorEditActionProvider" - id="cern.silecs.view.explorer.actions.EditActions"> - </actionProvider> - <actionProvider - class="org.eclipse.cdt.internal.ui.navigator.CNavigatorRefactorActionProvider" - id="cern.silecs.view.explorer.actions.RefactorActions"> - </actionProvider> - </navigatorContent> - </extension> - <extension - point="org.eclipse.ui.navigator.viewer"> - <viewer - viewerId="cern.silecs.view.explorer"> - <popupMenu - allowsPlatformContributions="true" - id="cern.silecs.view.explorer#PopupMenu"> - <insertionPoint - name="group.new" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.goto"> - </insertionPoint> - <insertionPoint - name="group.open" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.openwith"> - </insertionPoint> - <insertionPoint - name="silecs" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.edit" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.reorganize" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.port" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.generate" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.search" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.build" - separator="true"> - </insertionPoint> - <insertionPoint - name="additions" - separator="true"> - </insertionPoint> - <insertionPoint - name="group.properties" - separator="true"> - </insertionPoint> - </popupMenu> - </viewer> - <viewerContentBinding - viewerId="cern.silecs.view.explorer"> - <includes> - <contentExtension - isRoot="true" - pattern="cern.silecs.view.explorer.content"> - </contentExtension> - <contentExtension - pattern="cern.silecs.view.explorer.filter.*"> - </contentExtension> - <contentExtension - pattern="org.eclipse.ui.navigator.resources.linkHelper"> - </contentExtension> - <contentExtension - pattern="org.eclipse.ui.navigator.resources.filters.workingSet"> - </contentExtension> - </includes> - </viewerContentBinding> - <viewerActionBinding - viewerId="cern.silecs.view.explorer"> - <includes> - <actionExtension - pattern="org.eclipse.ui.navigator.resources.*"> - </actionExtension> - <actionExtension - pattern="cern.silecs.view.explorer.*"> - </actionExtension> - </includes> - </viewerActionBinding> - <dragAssistant - class="org.eclipse.cdt.internal.ui.navigator.CNavigatorDragAdapterAssistant" - viewerId="cern.silecs.view.explorer"> - </dragAssistant> - </extension> - <extension - point="org.eclipse.core.runtime.preferences"> - <initializer - class="cern.silecs.view.preferences.PreferenceInitializer"> - </initializer> - </extension> - <extension - point="org.eclipse.ui.preferencePages"> - <page - class="cern.silecs.view.preferences.MainPreferencePage" - id="Silecs" - name="Silecs"> - </page> - <page - category="Silecs" - class="cern.silecs.view.preferences.EditorPreferencePage" - id="cern.silecs.plugin.preferences.editor" - name="XML-Editor"> - </page> - <page - category="Silecs" - class="cern.silecs.view.preferences.LoggingPreferencePage" - id="cern.silecs.plugin.preferences.logging" - name="Logging"> - </page> - </extension> -</plugin> diff --git a/silecs-eclipse-plugin/pom.xml b/silecs-eclipse-plugin/pom.xml deleted file mode 100644 index e5072770c65e97672772afea2756c64221d84824..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>de.gsi.cs.co</groupId> - <artifactId>csco-parent</artifactId> - <version>1.0.7</version> - </parent> - <groupId>de.gsi.cs.co.fe</groupId> - <artifactId>silecs.eclipse.plugin</artifactId> - <name>silecs-eclipse-plugin</name> - <packaging>eclipse-plugin</packaging> - <version>1.1.1.qualifier</version> - <description>Management of Silecs projects</description> - <url>https://www-acc.gsi.de/wiki/Frontend/SILECS</url> - - <properties> - <tycho-version>0.21.0</tycho-version> - <platform-version-name>mars</platform-version-name> - <eclipse-site>http://download.eclipse.org/releases/${platform-version-name}</eclipse-site> - </properties> - <profiles> - <profile> - <id>platform-mars</id> - <activation> - <property> - <name>platform-version-name</name> - <value>mars</value> - </property> - </activation> - <properties> - <eclipse-site>http://download.eclipse.org/releases/mars</eclipse-site> - <platform-version>[4.4,4.6)</platform-version> - <swtbot-site>http://download.eclipse.org/technology/swtbot/mars/dev-build/update-site</swtbot-site> - </properties> - </profile> - </profiles> - <repositories> - <repository> - <id>default</id> - <url>https://artifacts.acc.gsi.de/nexus/content/repositories/default</url> - </repository> - <repository> - <id>mars</id> - <layout>p2</layout> - <url>${eclipse-site}</url> - </repository> - </repositories> - <dependencies> - <dependency> - <groupId>xalan</groupId> - <artifactId>xalan</artifactId> - <version>2.7.2</version> - </dependency> - <dependency> - <groupId>jaxen</groupId> - <artifactId>jaxen</artifactId> - <version>1.1.6</version> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.10</version> - <configuration> - <pde>true</pde> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.8</source> - <target>1.8</target> - <compilerVersion>1.8</compilerVersion> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>process-sources</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>xalan</groupId> - <artifactId>xalan</artifactId> - </artifactItem> - <artifactItem> - <groupId>jaxen</groupId> - <artifactId>jaxen</artifactId> - </artifactItem> - </artifactItems> - <outputDirectory>${basedir}/ext-jars</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-clean-plugin</artifactId> - <version>2.3</version> - <configuration> - <filesets> - <fileset> - <directory>${basedir}/ext-jars</directory> - <includes> - <include>*.jar</include> - </includes> - <followSymlinks>false</followSymlinks> - </fileset> - </filesets> - </configuration> - </plugin> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>tycho-maven-plugin</artifactId> - <version>${tycho-version}</version> - <extensions>true</extensions> - <configuration> - <pomDependencies>consider</pomDependencies> - <executionEnvironment>JavaSE-1.8</executionEnvironment> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/silecs-eclipse-plugin/project.properties b/silecs-eclipse-plugin/project.properties deleted file mode 100644 index 2dbdd52b87fef7611b3bef21047ff3062168df25..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/project.properties +++ /dev/null @@ -1,3 +0,0 @@ -eclipseLocalOverride=true -javadoc.enabled=false -junit.enabled=false \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/activator/Activator.java b/silecs-eclipse-plugin/src/java/cern/silecs/activator/Activator.java deleted file mode 100644 index 3eea8ab4e369787cf2fee72a3ab48e016fb60d42..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/activator/Activator.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.activator; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "silecs.eclipse.plugin"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/activator/WebStartLauncher.java b/silecs-eclipse-plugin/src/java/cern/silecs/activator/WebStartLauncher.java deleted file mode 100644 index e3ee96efdd0e8c262947eb1a51fde70ee44380c5..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/activator/WebStartLauncher.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.activator; - -import java.util.Properties; -import java.util.Set; - -import org.eclipse.equinox.launcher.WebStartMain; - -/** - * This class is only used by jnlp launcher. - * It is not used locally. - */ -@SuppressWarnings("restriction") -public class WebStartLauncher { - - public static void main(String[] args) { - Properties properties = System.getProperties(); - // copy properties to avoid ConcurrentModificationException - Properties copiedProperties = new Properties(); - copiedProperties.putAll(properties); - Set<Object> keys = copiedProperties.keySet(); - for (Object key : keys) { - if (key instanceof String) { - String keyString = (String) key; - if (keyString.startsWith("jnlp.")) { - // re set all properties starting with the jnlp-prefix - // and set them without the prefix - String property = System.getProperty(keyString); - String replacedKeyString = keyString.replaceFirst("jnlp.", ""); - - System.setProperty(replacedKeyString, property); - } - } - } - - WebStartMain.main(args); - } -} \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DeployProjectNature.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DeployProjectNature.java deleted file mode 100644 index 8442589c9338b48c8237f7b1cf18c7a01c2d9db9..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DeployProjectNature.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.core; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -public class DeployProjectNature extends SilecsProjectNature implements IProjectNature { - - private static final String CERN_FESA_PLUGIN_CORE_FESA_DEPLOY_PROJECT_NATURE = "cern.fesa.plugin.core.fesaDeployProjectNature"; - public static final String NATURE_ID = "cern.silecs.control.core.deployprojectnature"; - - public static void addDeployNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Add silecs deploy nature", 2); - addNature(project, NATURE_ID, new SubProgressMonitor(monitor, 1)); - addCppNature(project, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void removeDeployNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Remove silecs deploy nature", 2); - removeNature(project, NATURE_ID, new SubProgressMonitor(monitor, 1)); - removeCppNature(project, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void convertToDeployNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Converting project to silecs deploy nature", 2); - removeAllNatures(project, new SubProgressMonitor(monitor, 1)); - addDeployNature(project, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void addFESADeployUnitNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Adding FESA Class Nature to project", 2); - try { - addNature(project, CERN_FESA_PLUGIN_CORE_FESA_DEPLOY_PROJECT_NATURE, new SubProgressMonitor(monitor, 1)); - addManageBuilderNature(project,mon); - } finally { - monitor.done(); - } - } - - public static void removeFESADeployUnitNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Removing FESA Nature from project", 2); - try { - removeNature(project, CERN_FESA_PLUGIN_CORE_FESA_DEPLOY_PROJECT_NATURE, new SubProgressMonitor(monitor, 1)); - removeManageBuilderNature(project,mon); - } finally { - monitor.done(); - } - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DesignProjectNature.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DesignProjectNature.java deleted file mode 100644 index be974ee2d0cbbe390ba7a8adfaaa39f70c812b99..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/DesignProjectNature.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.core; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; - -import cern.silecs.view.console.ConsoleHandler; - -public class DesignProjectNature extends SilecsProjectNature implements IProjectNature { - - public static final String NATURE_ID = "cern.silecs.control.core.designprojectnature"; - - private static final String CERN_FESA_PLUGIN_CORE_FESA_CLASS_PROJECT_NATURE = "cern.fesa.plugin.core.fesaClassProjectNature"; - - public static void addClassNature(IProject project, IProgressMonitor mon) throws CoreException { - ConsoleHandler.printMessage("Debug0", true); - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Add silecs class nature", 2); - ConsoleHandler.printMessage("Debug1", true); - addNature(project, NATURE_ID, new SubProgressMonitor(monitor, 1)); - ConsoleHandler.printMessage("Debug2", true); - addCppNature(project, new SubProgressMonitor(monitor, 1)); - ConsoleHandler.printMessage("Debug3", true); - } finally { - monitor.done(); - } - } - - public static void removeClassNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Remove silecs class nature", 2); - removeNature(project, NATURE_ID, new SubProgressMonitor(monitor, 1)); - removeCppNature(project, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void convertToClassNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - try { - monitor.beginTask("Converting project to silecs class nature", 2); - removeAllNatures(project, new SubProgressMonitor(monitor, 1)); - addClassNature(project, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void addFESAClassNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Adding FESA Class Nature to project", 2); - try { - addNature(project, CERN_FESA_PLUGIN_CORE_FESA_CLASS_PROJECT_NATURE, new SubProgressMonitor(monitor, 1)); - addManageBuilderNature(project,mon); - } finally { - monitor.done(); - } - } - - public static void removeFESAClassNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Removing FESA Nature from project", 2); - try { - removeNature(project, CERN_FESA_PLUGIN_CORE_FESA_CLASS_PROJECT_NATURE, new SubProgressMonitor(monitor, 1)); - removeManageBuilderNature(project,mon); - } finally { - monitor.done(); - } - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/SilecsProjectNature.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/core/SilecsProjectNature.java deleted file mode 100644 index c7ea191aaf544cff030f57b991561a6870db0806..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/core/SilecsProjectNature.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.core; - - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; - -import org.eclipse.core.runtime.SubProgressMonitor; - -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.view.console.ConsoleHandler; - - -public abstract class SilecsProjectNature extends CCProjectNature { - - public static final String PROJECT_FILE = ".project"; - public static final String CDT_PROJECT_FILE = ".cproject"; - - private static final String ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_SCANNER_CONFIG_NATURE = "org.eclipse.cdt.managedbuilder.core.ScannerConfigNature"; - private static final String ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_MANAGED_BUILD_NATURE = "org.eclipse.cdt.managedbuilder.core.managedBuildNature"; - - private static final String FESA_BUILD_COMMAND_1 = "org.eclipse.cdt.managedbuilder.core.genmakebuilder"; - private static final String FESA_BUILD_COMMAND_2 = "org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder"; - - protected static void removeAllNatures(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - try { - IProjectDescription desc = project.getDescription(); - desc.setNatureIds(new String[0]); - project.setDescription(desc, null); - } finally { - monitor.done(); - } - } - - protected static void addCppNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Adding C++ Nature to project", 2); - - try { - addNature(project, C_NATURE_ID, new SubProgressMonitor(monitor, 1)); - addNature(project, CC_NATURE_ID, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - protected static void removeCppNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - - monitor.beginTask("Removing C++ Nature from project", 2); - - try { - removeNature(project, C_NATURE_ID, new SubProgressMonitor(monitor, 1)); - removeNature(project, CC_NATURE_ID, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - @Override - public void configure() throws CoreException { - // Do nothing. this allow to put fesa nature first - } - - public static SilecsConstants.ProjectType getProjectType(IProject project) throws CoreException, SilecsException { - if (project.hasNature(DesignProjectNature.NATURE_ID)) { - return SilecsConstants.ProjectType.DESIGN_PROJECT; - } else if (project.hasNature(DeployProjectNature.NATURE_ID)) { - return SilecsConstants.ProjectType.DEPLOY_PROJECT; - } else { - throw new SilecsException("Project " + project.getName() + " has no fesa nature"); - } - } - - protected static void addManageBuilderNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - monitor.beginTask("Adding Managebuilder Nature to project", 2); - - try { - addCppNature(project,mon); - addNature(project, ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_MANAGED_BUILD_NATURE, new SubProgressMonitor(monitor, 1)); - addNature(project, ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_SCANNER_CONFIG_NATURE, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - protected static void removeManageBuilderNature(IProject project, IProgressMonitor mon) throws CoreException { - IProgressMonitor monitor = mon; - if (mon == null) { - monitor = new NullProgressMonitor(); - } - - monitor.beginTask("Removing Managebuilder Nature from project", 2); - - try { - removeCppNature(project,mon); - removeNature(project, ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_MANAGED_BUILD_NATURE, new SubProgressMonitor(monitor, 1)); - removeNature(project, ORG_ECLIPSE_CDT_MANAGEDBUILDER_CORE_SCANNER_CONFIG_NATURE, new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - public static void addBuildSpecs(IProject project) - { - try { - IProjectDescription desc = project.getDescription(); - ICommand[] commands = new ICommand[2]; - final ICommand command0 = desc.newCommand(); - final ICommand command1 = desc.newCommand(); - command0.setBuilderName(FESA_BUILD_COMMAND_1); - command1.setBuilderName(FESA_BUILD_COMMAND_2); - commands[0] = command0; - commands[1] = command1; - - //remove auto-build options - commands[0].setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false); - commands[1].setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false); - commands[1].setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, false); - desc.setBuildSpec(commands); - project.setDescription(desc, null); - } catch (CoreException e) { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/AboutSilecsHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/AboutSilecsHandler.java deleted file mode 100644 index f639039ecd0fc41201df6c276d1f879c64f36b5a..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/AboutSilecsHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -import cern.silecs.utils.SilecsConstants; -import cern.silecs.view.dialogs.SilecsMessageDialog; - -/** - * This handler displays basic information about the Silecs tool. - */ -public class AboutSilecsHandler extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell(); - - //GSI-Hack .. use GSI-Support - String dialogMessage = "About SILECS\n\n" - + "A 'Design project' defines the data to be exchanged with the controller (blocks and the registers) in a hardware independent manners while a 'Deploy project' binds several design instances on a physical controller. \n" - + "Purpose of this tool is to provide an easy-to-use graphical interface to guide the user in the definition of his design/deploy projects and to generate the client and controller resources necessary for the communication via the Silecs communication library.\n\n" - - + "If you are using this tool you may also be interests in: \n" - + "\u2022 Silecs communication library \n" - + "\u2022 Silecs diagnostic tool \n\n" - + "Support contact: silecs-support@gsi.de \n" - + "Silecs wiki: "+ SilecsConstants.SILECS_WIKIS_PATH + "\n\n\n" - - + "Copyright 2016 CERN and GSI\n" - + "This program is free software: you can redistribute it and/or modify\n" - + "it under the terms of the GNU General Public License as published by\n" - + "the Free Software Foundation, either version 3 of the License, or\n" - + "(at your option) any later version.\n\n" - - + "This program is distributed in the hope that it will be useful,\n" - + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - + "GNU General Public License for more details.\n\n" - + "You should have received a copy of the GNU General Public License\n" - + "along with this program. If not, see <http://www.gnu.org/licenses/>.\n\n"; - - - MessageDialog dialog = new SilecsMessageDialog(shell, "About Silecs", null, dialogMessage, - MessageDialog.INFORMATION, new String[] { "OK" }, 0); - dialog.open(); - return null; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/BaseHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/BaseHandler.java deleted file mode 100644 index 5167a21e23ffc0fd4d9510d5261c27e301037baa..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/BaseHandler.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.ide.IDE; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.utils.SilecsUtils; - -public abstract class BaseHandler extends AbstractHandler { - - - - /** - * Gives the list of selected documents - * Asks the user to save the file if dirty in an editor - * - * @param event - * @return - */ - protected List<IFile> retrieveIeplcFiles(ExecutionEvent event) { - List<IFile> files = retrieveIeplcFilesNonCheck(event); - return ensureFileSaved(files); - } - - /** - * Gives the Ieplc file form file selection or project selection - * @param event - * @return - */ - private List<IFile> retrieveIeplcFilesNonCheck(ExecutionEvent event) { - List<IFile> files = new ArrayList<IFile>(); - - // get from where the command was fired - Object trigger = event.getTrigger(); - if (trigger instanceof Event) { - Event ev = (Event) trigger; - - if (ev.widget instanceof MenuItem) { - // if fired by a popup - IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveMenuSelection(event); - - for (Object o : selection.toList()) { - if (o instanceof IFile) { - files.add((IFile) o); - } else if (o instanceof IProject) { - // if project selected return the design or du file - IProject project = (IProject) o; - try { - files.add(retriveIeplcFileFromProject(project)); - } catch (CoreException e) { - // if project nature can't be retrieve, log but do nothing - //LOGGER.error("Could not retrieve project nature for {}", project.getName()); - } catch (Exception e) { - //LOGGER.error("Project nature not supported for {}", project.getName()); - } - - } - } - - } else { - // the command was fired by a shortcut or a toolbar button - IEditorPart editor = HandlerUtil.getActiveEditor(event); - IFileEditorInput input = (IFileEditorInput) editor.getEditorInput(); - files.add(input.getFile()); - } - } - - return files; - } - - /** - * Gives the list of selected project - * - * @param event - * @return - */ - protected List<IProject> retrieveProjects(ExecutionEvent event) { - List<IProject> projects = new ArrayList<IProject>(); - - // get from where the command was fired - Object trigger = event.getTrigger(); - if (trigger instanceof Event) { - Event ev = (Event) trigger; - - if (ev.widget instanceof MenuItem) { - IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveMenuSelection(event); - List<?> resources = IDE.computeSelectedResources(selection); - for (Object o : resources) { - if (o instanceof IProject) { - projects.add((IProject) o); - } else if (o instanceof IFile) { - IProject project = ((IFile) o).getProject(); - - if (project != null) { - projects.add(project); - } - } - } - } else { - IEditorPart editor = HandlerUtil.getActiveEditor(event); - if (editor == null) return projects; - IFileEditorInput input = (IFileEditorInput) editor.getEditorInput(); - projects.add(input.getFile().getProject()); - } - } - - if (projects.isEmpty()) { - //LOGGER.info("No projects could be retrieved"); - } - - return projects; - } - - /** - * Finds the Ieplc file from the project root - * @param project - * @return - * @throws Exception - * @throws Exception - */ - private IFile retriveIeplcFileFromProject(IProject project) throws Exception { - if (project.hasNature(DeployProjectNature.NATURE_ID)) { - return SilecsUtils.getSilecsDeployFile(project); - } else if (project.hasNature(DesignProjectNature.NATURE_ID)) { - return SilecsUtils.getSilecsDesignFile(project); - } else { - throw new Exception(); - } - } - - /** - * Ensure the documents are not dirty in an open editor - * @param files - * @return - */ - private List<IFile> ensureFileSaved(List<IFile> files) { - if (IDE.saveAllEditors(files.toArray(new IResource[files.size()]), true)) { - return files; - } else { - return Collections.<IFile> emptyList(); - } - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/DiagnosticToolHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/DiagnosticToolHandler.java deleted file mode 100644 index 362d5d1168c35266f49b41f16611fec465799087..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/DiagnosticToolHandler.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class DiagnosticToolHandler extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - try - { - ConsoleHandler.clear(); - - IProject project = SilecsUtils.extractSilecsFileFromEvent(event).getProject(); - - if( project.hasNature(DeployProjectNature.NATURE_ID) == false ) - throw new Exception("The project: " + project.getName() + " is not a silecs-deploy-project"); - - SilecsUtils.checkSilecsVersion(project); - IFile deployFile = SilecsUtils.getSilecsDeployFile(project); - - String binary = MainPreferencePage.getDiagToolBasePath(SilecsUtils.getSilecsVersion(project)) + "/bin/x86_64/silecs-diagnostic"; - String snap7lib = MainPreferencePage.getSNAP7LibraryBasePath(SilecsUtils.getSilecsVersion(project)) + "/bin/x86_64-linux"; - - ConsoleHandler.printMessage("Starting Silecs Diagnostic Tool from:" + binary, true); - - String[] command = new String[3]; - command[0] = binary; - command[1] = "-d"; - command[2] = deployFile.getRawLocation().makeAbsolute().toOSString(); - String envVarName = "LD_LIBRARY_PATH"; - Map<String, String> env = new HashMap<String, String>(); - env.put(envVarName, snap7lib); - ConsoleHandler.printMessage("Setting environment variable: '" + envVarName + "' to '" + snap7lib + "'", true); - ConsoleHandler.printMessage("Executing command: " + command[0] + " " + command[1] + " " + command[2], true); - OSExecute.executeCommand(env, command); - } - catch (Exception e) - { - ConsoleHandler.printError("Could not launch Silecs Diagnostic Tool", true); - e.printStackTrace(); - } - - return null; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ExpandAllHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ExpandAllHandler.java deleted file mode 100644 index e9e4559a389dafc760d9ad9e50e5baccc3c203a0..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ExpandAllHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import java.util.ArrayList; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.ISelectionService; -import org.eclipse.ui.PlatformUI; -import cern.silecs.view.explorer.SilecsProjectExplorer; - -/** - * This handler is responsible for expanding selected projects in the silecs explorer.<br> - * It calls SilecsProjectExplorer's expandHelper to expand projects to src-file level. - */ -public class ExpandAllHandler extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - ArrayList<IProject> projects = new ArrayList<>(); - - ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService(); - - IStructuredSelection selections = (IStructuredSelection) selectionService - .getSelection(SilecsProjectExplorer.VIEW_ID); - - for(Object selection : selections.toArray()) { - if(selection instanceof IProject) - projects.add((IProject)selection); - } - - SilecsProjectExplorer explorer = (SilecsProjectExplorer) PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getActivePage().findView(SilecsProjectExplorer.VIEW_ID); - - explorer.expandHelper(root, projects); - - return null; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/GenerateCodeHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/GenerateCodeHandler.java deleted file mode 100644 index 94b33bc8334030a2f9c6e566f7d16c5220fbf6f5..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/GenerateCodeHandler.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -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.jface.wizard.IWizard; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.job.BaseProjectJob; -import cern.silecs.view.job.GenerateClassJob; -import cern.silecs.view.job.GenerateDeployJob; -import cern.silecs.view.preferences.MainPreferencePage; -import cern.silecs.view.wizards.GenerateCodeWizard; - -public class GenerateCodeHandler extends BaseHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - ConsoleHandler.clear(); - - BaseProjectJob job = null; - try { - IFile silecsFile = SilecsUtils.extractSilecsFileFromEvent(event); - IProject project = silecsFile.getProject(); - SilecsUtils.checkSilecsVersion(project); - - IFolder src = project.getFolder("src"); - if(project.hasNature(DesignProjectNature.NATURE_ID) ) - { - IFile fesaDesignDoc = src.getFile(project.getName() + ".design"); - boolean designDocExists = fesaDesignDoc.exists(); - if(designDocExists) - { - IFile backup = src.getFile(fesaDesignDoc.getName() + ".backup"); - ConsoleHandler.printMessage("Existing FESA Design document detected - new data will be inserted", true); - ConsoleHandler.printWarning("Please note that old, obsolete xml-elements are not deleted automatically! Sometimes this can lead to an invalid FESA Design document!", true); - ConsoleHandler.printWarning("If this is the case, please remove the obsolete elements by hand.", true); - ConsoleHandler.printMessage("A backup of your old document will be saved at: " + backup.getRawLocation().makeAbsolute(), true); - if(backup.exists()) - backup.delete(true, null); - fesaDesignDoc.copy(backup.getFullPath(), true, null); - } - else - { - File[] templates = MainPreferencePage.getFESADesignTemplates(); - File template = pickTemplate(event,templates); - if( template == null) // cancel pressed - return null; - ConsoleHandler.printMessage("The following template will be used:" + template.getAbsolutePath(), true); - InputStream source = new FileInputStream(template); - fesaDesignDoc.create(source, IResource.NONE, null); - } - job = new GenerateClassJob(project, fesaDesignDoc); - } - else if(project.hasNature(DeployProjectNature.NATURE_ID) ) - { - IFile fesaDeployDoc = src.getFile(project.getName() + ".deploy"); - boolean deployDocExists = fesaDeployDoc.exists(); - if(deployDocExists) - { - IFile backup = src.getFile(fesaDeployDoc.getName() + ".backup"); - ConsoleHandler.printMessage("Existing FESA Deploy-Unit document detected - new data will be inserted", true); - ConsoleHandler.printWarning("Please note that old, obsolete xml-elements are not deleted automatically! Sometimes this can lead to an invalid FESA Deploy-Unit document !", true); - ConsoleHandler.printWarning("If this is the case, please remove the obsolete elements by hand.", true); - ConsoleHandler.printMessage("A backup of your old document will be saved at: " + backup.getRawLocation().makeAbsolute(), true); - if(backup.exists()) - backup.delete(true, null); - fesaDeployDoc.copy(backup.getFullPath(), true, null); - } - else - { - File[] templates = MainPreferencePage.getFESADeployUnitTemplates(); - File template = pickTemplate(event,templates); - if( template == null) // cancel pressed - return null; - ConsoleHandler.printMessage("The following template will be used:" + template.getAbsolutePath(), true); - InputStream source = new FileInputStream(template); - fesaDeployDoc.create(source, IResource.NONE, null); - } - - job = new GenerateDeployJob(project, fesaDeployDoc,!deployDocExists); - } - else - { - ConsoleHandler.printError("Failed to find SILECS Project Nature", true); - return null; - } - } catch (Exception e) - { - ConsoleHandler.printError("Failed to generate code: ", true); - ConsoleHandler.printStackTrace(e); - return null; - } - - job.setUser(true); - job.schedule(); - - return null; - } - - private File pickTemplate(ExecutionEvent event, File[] templates) throws SilecsException - { - if(templates.length < 1) - { - String error = "Failed to generate FESA Class. No templates found. please fix your FESA-PATH in the preferences!"; - ConsoleHandler.printError(error, true); - throw new SilecsException(error); - } - if( templates.length == 1 ) - { - return templates[0]; - } - //TODO: Would be nice to add the possibility to pick a foreign template from the file system - Shell activeShell = HandlerUtil.getActiveShell(event); - IWizard wizard = new GenerateCodeWizard(templates); - WizardDialog dialog = new WizardDialog(activeShell, wizard); - dialog.open(); - return ((GenerateCodeWizard)wizard).getChoice(); - } - - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/SilecsWikis.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/SilecsWikis.java deleted file mode 100644 index 0973f9857731e9f63a3ab9809feccb1ac182d93a..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/SilecsWikis.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; - -import cern.silecs.utils.SilecsUtils; -import cern.silecs.utils.SilecsConstants; - -import java.awt.Desktop; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -/** - * This handler opens silecs-wiki in the browser. - */ -public class SilecsWikis extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - // Open windows default browser (or firefox under linux) and load Silecs Wikis pages - try { - if (SilecsUtils.isWindows) { - Desktop.getDesktop().browse(new URI(SilecsConstants.SILECS_WIKIS_PATH)); - } else { - Runtime runtime = Runtime.getRuntime(); - runtime.exec("/usr/bin/firefox -new-window " + SilecsConstants.SILECS_WIKIS_PATH); - } - } catch (IOException e) { - e.printStackTrace(); - } catch (URISyntaxException e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/UpdateSilecsProjectHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/UpdateSilecsProjectHandler.java deleted file mode 100644 index 6966b771dc8669d9c8107b720fd6b7aaa802155d..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/UpdateSilecsProjectHandler.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.wizard.IWizard; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.job.BaseProjectJob; - -import cern.silecs.view.job.UpdateVersionJob; -import cern.silecs.view.wizards.UpdateSilecsProjectWizard; - - -public class UpdateSilecsProjectHandler extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException - { - - ConsoleHandler.clear(); - - BaseProjectJob job = null; - - try - { - String newVersion = pickVersion(event); - IFile silecsFile = SilecsUtils.extractSilecsFileFromEvent(event); - IProject project = silecsFile.getProject(); - job = new UpdateVersionJob(project, newVersion); - - } catch (Exception e) - { - ConsoleHandler.printError("Failed to update SILECS version: " , true); - ConsoleHandler.printStackTrace(e); - return null; - } - - job.setUser(true); - job.schedule(); - - return null; - } - - private String pickVersion(ExecutionEvent event) throws SilecsException - { - Shell activeShell = HandlerUtil.getActiveShell(event); - IWizard wizard = new UpdateSilecsProjectWizard(); - WizardDialog dialog = new WizardDialog(activeShell, wizard); - dialog.open(); - return ((UpdateSilecsProjectWizard)wizard).getSelectedVersion(); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ValidateHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ValidateHandler.java deleted file mode 100644 index 37e7e05a24b1b20b91d87d07d371b425ddb3eba7..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/handlers/ValidateHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.resources.IFile; - -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.job.ValidationJob; -import cern.silecs.utils.SilecsUtils; - - -public class ValidateHandler extends BaseHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - ConsoleHandler.clear(); - ConsoleHandler.printMessage("Validating XML ...", true); - ValidationJob job; - try - { - IFile file = SilecsUtils.extractSilecsFileFromEvent(event); - SilecsUtils.checkSilecsVersion(file.getProject()); - job = new ValidationJob(file); - } - catch (Exception e) - { - ConsoleHandler.printError("Failed to validate file:", true); - ConsoleHandler.printStackTrace(e); - return null; - } - - job.schedule(); - return null; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/Validator.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/Validator.java deleted file mode 100644 index e9e019754aaa974ba24106ec24f8dcd9182ad05f..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/Validator.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.validation; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.List; - -import org.apache.xerces.parsers.DOMParser; -import org.apache.xerces.xni.parser.XMLInputSource; -import org.eclipse.core.resources.IFile; - -import cern.silecs.control.validation.internal.Handler; -import cern.silecs.model.document.SilecsDocumentError; -import cern.silecs.view.console.ConsoleHandler; - -/** - * Class used for validating single xmlFile - */ -public class Validator -{ - /** - * This method takes as an argument xml file.<br> - * If the document is not xml file or is somehow broken list with "Document is not parsed correctly" error is returned."<br> - * - * External python validation is called in this method! - * - * @param xmlFile - * @return list of errors - */ - public static List<SilecsDocumentError> validate(File xmlFile) - { - List<SilecsDocumentError> errors = null; - try { - // create DOM parser which validates, use a grammar pool, - // support xincludes and allow the access to the nodes - // during the parsing - DOMParser parser = new DOMParser(); - - parser.setFeature("http://xml.org/sax/features/validation", true); - parser.setFeature("http://apache.org/xml/features/validation/schema", true); - parser.setFeature("http://apache.org/xml/features/honour-all-schemaLocations", true); - parser.setFeature("http://apache.org/xml/features/xinclude", true); - parser.setFeature("http://apache.org/xml/features/xinclude/fixup-base-uris", false); - parser.setFeature("http://apache.org/xml/features/xinclude/fixup-language", false); - parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); - - // Set the error handler - Handler handler = new Handler(xmlFile, parser); - parser.setErrorHandler(handler); - - // create the input - String uri = xmlFile.toURI().toString().replace("%20", " "); - - InputStream inputStream = new FileInputStream(xmlFile); - XMLInputSource inputSource = new XMLInputSource("", uri, uri, inputStream, "UTF-8"); - parser.parse(inputSource); - - // get the errors and the model - errors = handler.getErrors(); - errors.addAll(internalRules.validate(xmlFile)); - - } - catch (Exception e) - { - ConsoleHandler.printError("Document " + xmlFile.getName() + " has not been parsed correctly: " + e.getMessage(), true); - ConsoleHandler.printStackTrace(e); - } - - return errors; - } - - public static boolean isDocumentValid(IFile silecsDocument) - { - try - { - File xmlFile = new File(silecsDocument.getLocationURI()); - if (validate(xmlFile).isEmpty()) - return true; - return false; - } - catch (Exception e) - { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - return false; - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internal/Handler.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internal/Handler.java deleted file mode 100644 index 56f49f716173eca614b42b3282197cff55f6dbad..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internal/Handler.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.validation.internal; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.xerces.parsers.DOMParser; -import org.w3c.dom.Element; -import org.xml.sax.ErrorHandler; -import org.xml.sax.SAXException; -import org.xml.sax.SAXNotRecognizedException; -import org.xml.sax.SAXNotSupportedException; -import org.xml.sax.SAXParseException; - -import cern.silecs.model.document.SilecsDocumentError; -import cern.silecs.model.document.SilecsDocumentError.ErrorLevel; -import cern.silecs.view.console.ConsoleHandler; - -public class Handler implements ErrorHandler -{ - private static final String CURRENT_NODE = "http://apache.org/xml/properties/dom/current-element-node"; - - private final DOMParser parser; - private final String fileName; - private List<SilecsDocumentError> errors; - - public Handler(File xmlFile, DOMParser parser) { - this.parser = parser; - this.fileName = xmlFile.getName(); - this.errors = new ArrayList<SilecsDocumentError>(); - } - - @Override - public void warning(SAXParseException e) throws SAXException { - addError(ErrorLevel.WARNING, e); - } - - @Override - public void error(SAXParseException e) throws SAXException { - addError(ErrorLevel.ERROR, e); - } - - @Override - public void fatalError(SAXParseException e) throws SAXException { - addError(ErrorLevel.FATAL, e); - } - - public final List<SilecsDocumentError> getErrors() { - return errors; - } - - private void addError(ErrorLevel level, SAXParseException e) { - Element element = null; - try - { - element = (Element) parser.getProperty(CURRENT_NODE); - } - catch (SAXNotRecognizedException | SAXNotSupportedException e1) - { - ConsoleHandler.printStackTrace(e1); - return; - } - SilecsDocumentError error = null; - String file = e.getSystemId(); - if (!file.endsWith(fileName)) { - // if the error is in the included xml or in the schema, we want to report the problem - // on the validated file but with a specific message - error = new SilecsDocumentError(level, "Error in included file: " + file + " at " + e.getLineNumber() + ":" - + e.getColumnNumber() + " => " + e.getMessage(), -1, -1, null); - } else { - error = new SilecsDocumentError(level, e, element); - } - - errors.add(error); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internalRules.java b/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internalRules.java deleted file mode 100644 index 0b2524b4df1acb7b70fc6ec8b6a218a1f9c008b9..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/control/validation/internalRules.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.control.validation; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import cern.silecs.model.document.SilecsDocumentError; -import cern.silecs.utils.SilecsUtils; - -public class internalRules { - - public static List<SilecsDocumentError> validate(File file) throws ParserConfigurationException, SAXException, IOException - { - // Some of the XSD-checks are version-specific. This is painful and will vanish some day when using XSD1.1 for all checks - //String silecs_version = - - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(file); - - if( SilecsUtils.isSilecsDesign(file.getAbsolutePath()) ) - { - errors.addAll(classRule_RegisterDim2(doc)); - errors.addAll(classRule_RO_Slave(doc)); - errors.addAll(classRule_WO_Master(doc)); - errors.addAll(classRule_StringLength(doc)); - } - if( SilecsUtils.isSilecsDeploy(file.getAbsolutePath()) ) - { - errors.addAll(deployRule_addressing_SchneiderM340(doc)); - errors.addAll(deployRule_addressing_BeckhoffCX90xx(doc)); - } - return errors; - } - - private static String getXPath(Node node) - { - Node parent = node.getParentNode(); - if (parent == null) - { - return "/"; - } - - if(!((Element)node).getAttribute("name").isEmpty()) - return getXPath(parent) + "/" + node.getNodeName() + "[@name='"+ ((Element)node).getAttribute("name") + "']"; - - return getXPath(parent) + "/" + node.getNodeName(); - } - - private static List<SilecsDocumentError> classRule_RegisterDim2(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList regNodes = doc.getElementsByTagName("Register"); - for( int i = 0; i< regNodes.getLength() ; i++) - { - Element register = (Element)regNodes.item(i); - if( register.hasAttribute("array-dim2") && !register.hasAttribute("array-dim1") ) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "array-dim1 is required if array-dim2 is defined", -1, -1,getXPath(register)); - errors.add(newError); - } - } - return errors; - } - - private static List<SilecsDocumentError> classRule_RO_Slave(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList blockNodes = doc.getElementsByTagName("Block"); - for( int i = 0; i< blockNodes.getLength() ; i++) - { - Element block = (Element)blockNodes.item(i); - if( block.getAttribute("mode").equals("READ-ONLY") ) - { - NodeList registerNodes = block.getElementsByTagName("Register"); - for( int j = 0; j< registerNodes.getLength() ; j++) - { - Element register = (Element)registerNodes.item(j); - if( register.getAttribute("synchro").equals("SLAVE") ) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "Register cannot have SLAVE synchro attribute within READ-ONLY block", -1, -1,getXPath(register)); - errors.add(newError); - } - } - } - } - return errors; - } - - private static List<SilecsDocumentError> classRule_WO_Master(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList blockNodes = doc.getElementsByTagName("Block"); - for( int i = 0; i< blockNodes.getLength() ; i++) - { - Element block = (Element)blockNodes.item(i); - if( block.getAttribute("mode").equals("WRITE-ONLY")) - { - NodeList registerNodes = block.getElementsByTagName("Register"); - for( int j = 0; j< registerNodes.getLength() ; j++) - { - Element register = (Element)registerNodes.item(j); - if( register.getAttribute("synchro").equals("MASTER") ) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "Register cannot have MASTER synchro attribute within WRITE-ONLY block", -1, -1,getXPath(register)); - errors.add(newError); - } - } - } - } - return errors; - } - - private static List<SilecsDocumentError> classRule_StringLength(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList registerNodes = doc.getElementsByTagName("Register"); - for( int j = 0; j< registerNodes.getLength() ; j++) - { - Element register = (Element)registerNodes.item(j); - if( register.getAttribute("format").equals("string") == false ) - { - if( register.hasAttribute("string-len")) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "string-len attribute only allowed for @format='string'.", -1, -1,getXPath(register)); - errors.add(newError); - } - } - } - return errors; - } - - private static List<SilecsDocumentError> deployRule_addressing_SchneiderM340(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList schneiderPLCNode = doc.getElementsByTagName("Schneider-PLC"); - for( int i = 0; i< schneiderPLCNode.getLength() ; i++) - { - Element plc = (Element)schneiderPLCNode.item(i); - if( plc.getAttribute("model").equals("M340")) - { - int basAddress = Integer.parseInt( plc.getAttribute("base-address")); - if( basAddress%2 != 0 ) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "Only even addressing is allowed for UNITY_M340. Please change the base address value to an even number.", -1, -1,getXPath(plc)); - errors.add(newError); - } - } - } - return errors; - } - - private static List<SilecsDocumentError> deployRule_addressing_BeckhoffCX90xx(Document doc) - { - List<SilecsDocumentError> errors = new ArrayList<SilecsDocumentError>(); - NodeList schneiderPLCNode = doc.getElementsByTagName("Beckhoff-PLC"); - for( int i = 0; i< schneiderPLCNode.getLength() ; i++) - { - Element plc = (Element)schneiderPLCNode.item(i); - if( plc.getAttribute("model").equals("CX9020")) - { - int basAddress = Integer.parseInt( plc.getAttribute("base-address")); - if( basAddress%2 != 0 ) - { - SilecsDocumentError newError = new SilecsDocumentError( SilecsDocumentError.ErrorLevel.ERROR, "Only even addressing is allowed for TWINCAT_CX9020. Please change the base address value to an even number.", -1, -1,getXPath(plc)); - errors.add(newError); - } - } - } - return errors; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/model/document/SilecsDocumentError.java b/silecs-eclipse-plugin/src/java/cern/silecs/model/document/SilecsDocumentError.java deleted file mode 100644 index 1e0f25d495e4582a6d5b167d525f5fab6c207015..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/model/document/SilecsDocumentError.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.model.document; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.w3c.dom.Node; -import org.xml.sax.SAXParseException; - -import cern.silecs.utils.XmlUtils; - - -public class SilecsDocumentError { - - public enum ErrorLevel { - INFO, - WARNING, - ERROR, - FATAL - } - - /** - * error level - */ - public final ErrorLevel level; - - /** - * text with the description of the error - */ - public final String message; - - /** - * line of the error - */ - public final int lineNumber; - - /** - * column of the error - */ - public final int columnNumber; - - /** - * Element which cause the error - */ - public final String xPath; - - /** - * If an identity constraint has been violated, this contains the name of the violated key - */ - public final String violatedKey; - - /** - * If an identity constraint has been violated, this contains the incorrect value which is the cause of the error - */ - public final String incorrectValue; - - private static final String CONSTRAINT_MESSAGE_PATTERN = "cvc-identity-constraint.4.3: Key '(.*)' with value '(.*)' not found for identity constraint of element '(.*)'\\."; - - public SilecsDocumentError(ErrorLevel level, String message, int lineNumber, int columnNumber, String xPath) { - this.level = level; - this.message = message; - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - this.xPath = xPath; - - String key = ""; - String value = ""; - Pattern constraintPattern = Pattern.compile(CONSTRAINT_MESSAGE_PATTERN); - Matcher m = constraintPattern.matcher(message); - if (m.find()) { - key = m.group(1); - value = m.group(2); - } - - this.violatedKey = key; - this.incorrectValue = value; - } - - public SilecsDocumentError(ErrorLevel level, SAXParseException e, Node node) { - this(level, e.getMessage(), e.getLineNumber(), e.getColumnNumber(), XmlUtils.xPathFromNode(node)); - } - - public boolean isIdentityConstraintError() { - return !violatedKey.isEmpty(); - } - - @Override - public String toString() { - return lineNumber + ":" + columnNumber + " => " + message; - } -} - diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/model/document/XmlBasedDocument.java b/silecs-eclipse-plugin/src/java/cern/silecs/model/document/XmlBasedDocument.java deleted file mode 100644 index e48c06af87bf6d8692b6843fcd8739776f872c2c..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/model/document/XmlBasedDocument.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.model.document; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactoryConfigurationError; - -import org.apache.xpath.XPathAPI; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.XmlUtils; -import cern.silecs.view.console.ConsoleHandler; - -public class XmlBasedDocument { - - public static final String XML_EXTENSION = ".xml"; - public static final String XSD_EXTENSION = ".xsd"; - - protected Document xmlDocument; - - /** - * Abstract class for data access object based on xml DOM - */ - public XmlBasedDocument(Document xmlDocument) { - this.xmlDocument = xmlDocument; - } - - /** - * Give the DOM - * - * @return - */ - public Document getXmlDocument() { - return xmlDocument; - } - - /** - * Helper that gives the list of element from an xPath query - * - * @param xPathQuery - * @return - * @throws SilecsException - */ - public List<Element> getElements(String xPathQuery) throws SilecsException { - return getElements(xmlDocument, xPathQuery); - } - - /** - * Helper that gives the list of element from an xPath query - * - * @param node node from where the query is executed - * @param xPathQuery - * @return - * @throws SilecsException - */ - public List<Element> getElements(Node node, String xPathQuery) throws SilecsException { - List<Node> nodes = getNodes(node, xPathQuery); - List<Element> elements = new ArrayList<Element>(nodes.size()); - - for (Node n : nodes) { - if (n instanceof Element) { - elements.add((Element) n); - } - } - - return elements; - } - - /** - * Helper that gives the first element from an xPath query - * - * @param xPathQuery - * @return - * @throws SilecsException - */ - public Element getSingleElement(String xPathQuery) throws SilecsException { - Node foundNode = getSingleNode(xPathQuery); - if (foundNode instanceof Element) { - return (Element) foundNode; - } else { - return null; - } - } - - /** - * Helper that gives the first element from an xPath query - * - * @param node node from where the query is executed - * @param xPathQuery - * @return - * @throws SilecsException - */ - public Element getSingleElement(Node node, String xPathQuery) throws SilecsException { - Node foundNode = getSingleNode(node, xPathQuery); - if (foundNode instanceof Element) { - return (Element) foundNode; - } else { - return null; - } - } - - public List<Node> getNodes(String xPathQuery) throws SilecsException { - return getNodes(xmlDocument, xPathQuery); - } - - public List<Node> getNodes(Node node, String xPathQuery) throws SilecsException { - if (xPathQuery == null || xPathQuery.isEmpty()) { - return Collections.emptyList(); - } - - // check the node is from the document - if (node != xmlDocument && node.getOwnerDocument() != xmlDocument) { - throw new SilecsException("The given node is not part of the document being queried"); - } - - try { - NodeList foundNodes = XPathAPI.selectNodeList(node, xPathQuery); - List<Node> nodes = new ArrayList<Node>(foundNodes.getLength()); - - for (int i = 0; i < foundNodes.getLength(); i++) { - nodes.add(foundNodes.item(i)); - } - - return nodes; - } catch (TransformerException e) { - throw new SilecsException("Could not get entity's node using xpath " + xPathQuery, e); - } - } - - /** - * Helper that gives the first node from an xPath query - * - * @param xPathQuery - * @return - * @throws SilecsException - */ - public Node getSingleNode(String xPathQuery) throws SilecsException { - if (xPathQuery == null || xPathQuery.isEmpty()) { - return null; - } - - try { - return XPathAPI.selectSingleNode(xmlDocument, xPathQuery); - } catch (TransformerException e) { - throw new SilecsException("Could not get entity's node using xpath " + xPathQuery, e); - } - } - - /** - * Helper that gives the first node from an xPath query - * - * @param node node from where the query is executed - * @param xPathQuery - * @return - * @throws SilecsException - */ - public Node getSingleNode(Node node, String xPathQuery) throws SilecsException { - if (xPathQuery == null || xPathQuery.isEmpty()) { - return null; - } - - // check the node is from the document - if (node.getOwnerDocument() != xmlDocument) { - throw new SilecsException("The given node is not part of the document being queried"); - } - - try { - return XPathAPI.selectSingleNode(node, xPathQuery); - } catch (TransformerException e) { - throw new SilecsException("Could not get entity's node using xpath " + xPathQuery, e); - } - } - - /** - * Helper that gives the tag name of the elements matched by the xpath - * - * @param xPathQuery - * @return - * @throws SilecsException - */ - public List<String> getTagNames(String xPathQuery) throws SilecsException { - List<Element> elements = getElements(xPathQuery); - List<String> nodeNames = new ArrayList<String>(elements.size()); - - for (Element e : elements) { - nodeNames.add(e.getTagName()); - } - - return nodeNames; - } - - /** - * Give the string representation of the DOM - */ - @Override - public String toString() - { - try - { - return XmlUtils.nodeToString(xmlDocument); - } - catch( TransformerException e) - { - ConsoleHandler.printStackTrace(e); - return super.toString(); - } - catch(TransformerFactoryConfigurationError e) - { - ConsoleHandler.printStackTrace(e.getException()); - return super.toString(); - } - } -} \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/model/exception/SilecsException.java b/silecs-eclipse-plugin/src/java/cern/silecs/model/exception/SilecsException.java deleted file mode 100644 index 0e8ff657122b1112613458f7a58064a88ecd9c11..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/model/exception/SilecsException.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.model.exception; - - -public class SilecsException extends Exception { - - private static final long serialVersionUID = 5282474727123991544L; - - /** - * The error code which can be used to localize the error messages - */ - private final int errorCode; - - /** Empty constructor **/ - public SilecsException() { - this.errorCode = -1; - } - - /** - * Constructor with the Silecs error code - * - * @param errorCode - */ - public SilecsException(int errorCode) { - this.errorCode = errorCode; - } - - /** - * Constructor - * - * @param message - */ - public SilecsException(String message) { - super(message); - this.errorCode = -1; - } - - /** - * Constructor with the Silecs error code - * - * @param errorCode - * @param message - */ - public SilecsException(int errorCode, String message) { - super(message); - this.errorCode = errorCode; - } - - /** - * Constructor - * - * @param message - * @param cause previous cause of the error (exception chaining) - */ - public SilecsException(String message, Throwable cause) { - super(message, cause); - this.errorCode = -1; - } - - /** - * Constructor - * - * @param errorCode - * @param message - * @param cause - */ - public SilecsException(int errorCode, String message, Throwable cause) { - super(message, cause); - this.errorCode = errorCode; - } - - /** - * Returns the Silecs error code - * -1 is the default value if no error code is set - * @return - */ - public int getErrorCode() { - return errorCode; - } -} - diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/utils/OSExecute.java b/silecs-eclipse-plugin/src/java/cern/silecs/utils/OSExecute.java deleted file mode 100644 index 929f7d2043198f0f53e8d9381c1ed62b6e57dceb..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/utils/OSExecute.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.utils; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import cern.silecs.model.exception.SilecsException; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class OSExecute -{ - - public static String getlatestSilecsFesaCodegen(String codegenBaseDirectory, String silecsVersion) throws SilecsException - { - String fesaBaseDirectory = codegenBaseDirectory + "/fesa"; - if(!new File(fesaBaseDirectory).exists()) - { - throw new SilecsException("The directory: '" + fesaBaseDirectory + "' does not exist. Please check your Eclipse-Silecs preferences!"); - } - List<String> availableFesaVersions = MainPreferencePage.getAllFesaVersions(); - String selectedFesaVersion = MainPreferencePage.getFESAVersion(); - String tempFesaVersion = selectedFesaVersion; - int fesaVersionIndex = availableFesaVersions.lastIndexOf(selectedFesaVersion); - String fesaDirectory = ""; - while(true) - { - String fesaVersionUnderscored = tempFesaVersion.replaceAll("\\.", "_"); - fesaDirectory = fesaBaseDirectory + "/fesa_" + fesaVersionUnderscored; - if(new File(fesaDirectory).exists()) - { - return fesaDirectory; - } - fesaVersionIndex ++ ; - if( fesaVersionIndex >= availableFesaVersions.size() ) - { - throw new SilecsException("No matching silecs code-generation found for FESA-version '" + selectedFesaVersion + "'. Please select a more recent FESA-version in the Eclipse-Silecs preferences!"); - } - ConsoleHandler.printError("No silecs code-generation for the FESA-version '" + tempFesaVersion + "' found. Attempt to use silecs-codegen for the older FESA-version: '" + availableFesaVersions.get(fesaVersionIndex) + "'", true); - tempFesaVersion = availableFesaVersions.get(fesaVersionIndex); - } - } - - - public static void executePython(String file, String method, String silecsVersion, String[] parameters) throws IOException, InterruptedException, SilecsException - { - String[] command = new String[3]; - command[0] = "python"; - command[1] = "-c"; - - String codegenBaseDirectory = MainPreferencePage.getCodeGenBasePath(silecsVersion); - String fesaDirectory = getlatestSilecsFesaCodegen(codegenBaseDirectory, silecsVersion); - - // Add required root directories - command[2] = "import sys; "; - command[2] += "sys.path.append('" + codegenBaseDirectory + "'); "; - command[2] += "sys.path.append('" + codegenBaseDirectory + "/migration'); "; - command[2] += "sys.path.append('" + fesaDirectory + "'); "; - - // import file - command[2] += "import " + file + "; "; - - // execute method - command[2] += file +"." + method + "("; - - for(int i=0;i<parameters.length;i++) - { - command[2] += "'" + parameters[i] + "'"; - if( i < parameters.length - 1) - { - command[2] += ","; - } - } - command[2] += ")"; - int exitCode = executeCommand(command); - if (exitCode != 0) - { - throw new SilecsException("Executing python-command '" + command[2] + "' failed. Error code: " + exitCode); - } - } - - class Environment - { - String environmentVariableName; - - - }; - - public static int executeCommand(String... command) throws IOException, InterruptedException, SilecsException - { - Map<String, String> env = new HashMap<String, String>(); - return executeCommand(env, command); - } - - public static int executeCommand(Map<String, String> environmentVariables, String... command) throws IOException, InterruptedException, SilecsException - { - ProcessBuilder pb = new ProcessBuilder(command); - Map<String, String> env = pb.environment(); - env.putAll(environmentVariables); - - Process process = pb.start(); - process.waitFor(); - int exitCode = process.exitValue(); - - BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = input.readLine()) != null) - { - ConsoleHandler.printMessage(line, true); - } - input.close(); - - BufferedReader error = new BufferedReader(new InputStreamReader(process.getErrorStream())); - - while ((line = error.readLine()) != null) - { - ConsoleHandler.printError(line, true); - } - error.close(); - - return exitCode; - } -} \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsConstants.java b/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsConstants.java deleted file mode 100644 index a9f157a0b3cfe4e0fbc42a5fd0a02a68cce30baa..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsConstants.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.utils; - -import java.util.Arrays; -import java.util.List; - -public class SilecsConstants { - - public enum ProjectType { - DESIGN_PROJECT, - DEPLOY_PROJECT - } - - public static final String SILECS_NAME = "Silecs-Eclipse-Plugin"; - - //consistency check - public static final String DESIGN_CLASS_NODE = "SILECS-Class"; - - public static final String DEPLOY_UNIT_NODE = "Deploy-Unit"; - - public static final String NAME = "name"; - - public static final String HOST_NAME = "host-name"; - - // schema files - public static final String DESIGN_SCHEMA_XSD = "DesignSchema.xsd"; - - public static final String DEPLOY_SCHEMA_XSD = "DeploySchema.xsd"; - - //file extensions - public static final String IEDESIGN_FILE = "silecsdesign"; - - public static final String IEDEPLOY_FILE = "silecsdeploy"; - - //name patterns - public static final String DESIGN_PATTERN = "[A-Z][A-Za-z0-9_]*"; - - public static final String DEPLOY_PATTERN = "[A-Z][A-Za-z0-9_]*"; - - public static final int MAX_DESIGN_LENGTH = 20; - - public static final int MAX_DEPLOY_LENGTH = 20; - - // SILECS versions which are supported by this plugin - public static final String[] SUPPORTED_SILECS_MAJOR_VERSIONS = { "1","DEV"}; - public static final List<String> ADDITIONAL_SILECS_TARGET_MIGRATION_VERSIONS = Arrays.asList("0.10.0"); //e.g. in order to allow migration from 0.9.0 to 0.10.0 - public static final int DEFAULT_SILECS_VERSION_INDEX = 0; - - // SILECS Versions which are NOT supported by this plugin - // All other versions foudn in the silecs-search path are supported - public static final String[] SILECS_VERSION_BLACKLIST = { "0.9.0" }; - - //Wizards - //New Design Wizard - public static final String NEW_DESIGN_WIZARD_TITLE = "New Design Wizard"; - public static final String NEW_DESIGN_PAGE_TITLE = "New Design Project"; - - //New Deploy Wizard - public static final String NEW_DEPLOY_WIZARD_TITLE = "New Deploy Wizard"; - public static final String NEW_DEPLOY_PAGE_TITLE = "New Deploy Project"; - - //New Class Wizard Page - - public static final String INVAILD_PROJECT_NAME= "Invaild project name. Project name must follow pattern:"; - - public static final String INITIAL_PROJECT_VERSION = "1.0.0"; - - //Generate Fesa Class Wizard - public static final String GENERATE_FESA_CLASS_WIZARD_TITLE = "Generate Fesa Class Wizard"; - public static final String GENERATE_FESA_CLASS_PAGE_TITLE = "Generate Fesa Class"; - - //Generate Client Resources Wizard - public static final String GENERATE_CLIENT_RESOURCES_WIZARD_TITLE = "Generate Client Resources Wizard"; - public static final String GENERATE_CLIENT_RESOURCES_PAGE_TITLE = "Generate Client Resources"; - - //Deliver Client Resources Wizard - public static final String DELIVER_CLIENT_RESOURCES_WIZARD_TITLE = "Deliver Client Resources Wizard"; - public static final String DELIVER_CLIENT_RESOURCES_PAGE_TITLE = "Deliver Client Resources"; - - //GSI-Hack Use GSI SILECS Wiki - //public static final String SILECS_WIKIS_PATH = "https://wikis.cern.ch/display/SIL"; - public static final String SILECS_WIKIS_PATH = "https://www-acc.gsi.de/wiki/Frontend/SILECS"; -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsUtils.java b/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsUtils.java deleted file mode 100644 index 517c96b2aada23468032ccb5db10a437472ba972..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/utils/SilecsUtils.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.utils; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ITreeSelection; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorDescriptor; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.part.FileEditorInput; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -import cern.silecs.activator.Activator; -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class SilecsUtils { - - public static final String CLASS_VERSION_MATCHER = "version"; - - static public String userName; - static public boolean isWindows = false; - static { - String system = System.getProperty("os.name"); - isWindows = system.toLowerCase().contains("win"); - userName = System.getProperty("user.name"); - } - - public static String findInBundle(String resourceToLocate) { - try { - URL fileURL = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID), new Path(resourceToLocate), null); - fileURL = FileLocator.toFileURL(fileURL); - if(isWindows) - return fileURL.getPath().toString().substring(1); - - return fileURL.getPath().toString(); - } catch (Exception e1) { - e1.printStackTrace(); - } - return null; - } - - public static String getSilecsDesignFilePath(String workspacePath, String projectName) { - return workspacePath + "/" + projectName + "/" + getSilecsDesignFilePathRelative(projectName); - } - - public static String getSilecsDeployFilePath(String workspacePath, String projectName) { - return workspacePath + "/" + projectName + "/" + getSilecsDeployFilePathRelative(projectName); - } - - public static String getSilecsDesignFilePathRelative(String projectName) { - return "/src/" + projectName + "." + SilecsConstants.IEDESIGN_FILE; - } - - public static String getSilecsDeployFilePathRelative(String projectName){ - return "/src/" + projectName + "." + SilecsConstants.IEDEPLOY_FILE; - } - - public static Boolean isSilecsDesign(String filePath) - { - String extension = ""; - int i = filePath.lastIndexOf('.'); - if (i > 0) - extension = filePath.substring(i+1); - if(extension.equals(SilecsConstants.IEDESIGN_FILE) ) - return true; - return false; - } - - public static Boolean isSilecsDeploy(String filePath) - { - String extension = ""; - int i = filePath.lastIndexOf('.'); - if (i > 0) - extension = filePath.substring(i+1); - if(extension.equals(SilecsConstants.IEDEPLOY_FILE) ) - return true; - return false; - } - - public static IFile getSilecsDesignFile(IProject project) { - return project.getFile(getSilecsDesignFilePathRelative(project.getName())); - } - - public static IFile getSilecsDeployFile(IProject project) { - return project.getFile(getSilecsDeployFilePathRelative(project.getName())); - } - - public static IFile getSilecsDocument(IProject project) throws Exception - { - if ( project.hasNature(DesignProjectNature.NATURE_ID) ) - { - return SilecsUtils.getSilecsDesignFile(project); - } - else if( project.hasNature(DeployProjectNature.NATURE_ID) ) - { - return SilecsUtils.getSilecsDeployFile(project); - } - else - throw new Exception("The project: " + project.getName() + " is not a silecs-project"); - } - - public static String getSilecsVersion(IProject project) throws SilecsException { - String filePath = ""; - try - { - if( project.hasNature(DeployProjectNature.NATURE_ID) ) - { - filePath = getSilecsDeployFile(project).getRawLocation().makeAbsolute().toOSString(); - } - else if( project.hasNature(DesignProjectNature.NATURE_ID) ) - { - filePath = getSilecsDesignFile(project).getRawLocation().makeAbsolute().toOSString(); - } - else - { - throw new SilecsException("Faild to extract project nature from: " + project.getName()); - } - - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(filePath); - Node root; - if( project.hasNature(DesignProjectNature.NATURE_ID) ) - root = doc.getElementsByTagName("SILECS-Design").item(0); - else - root = doc.getElementsByTagName("SILECS-Deploy").item(0); - return root.getAttributes().getNamedItem("silecs-version").getTextContent(); - } - catch(Exception ex) - { - ConsoleHandler.printError("Faild to extract silecs-version from: " + filePath, true); - - throw new SilecsException("Faild to extract silecs-version from: " + filePath, ex); - } - } - - public static String getSilecsDesignVersion(String filePath) throws SilecsException { - try - { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(filePath); - Node classNode = doc.getElementsByTagName("SILECS-Class").item(0); - return classNode.getAttributes().getNamedItem(CLASS_VERSION_MATCHER).getNodeValue(); - } - catch(Exception ex) - { - ConsoleHandler.printError("Faild to extract class-version from: " + filePath, true); - throw new SilecsException("Faild to extract class-version from: " + filePath, ex); - } - } - - public static String getDeployVersion(String filePath) throws SilecsException { - try - { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(filePath); - Node deployNode = doc.getElementsByTagName("Deploy-Unit").item(0); - return deployNode.getAttributes().getNamedItem(CLASS_VERSION_MATCHER).getNodeValue(); - } - catch(Exception ex) - { - ConsoleHandler.printError("Faild to extract deploy-version from: " + filePath, true); - throw new SilecsException("Faild to extract deploy-version from: " + filePath, ex); - } - } - - public static void openInEditor(final IFile file) - { - Display.getDefault().asyncExec(new Runnable() { - @Override - public void run() { - IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(file.getName()); - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - try { - page.openEditor(new FileEditorInput(file), desc.getId()); - } catch (Exception e) { - ConsoleHandler.printError("Failed to open file:" + file, true); - e.printStackTrace(); - } - } - }); - } - - - public static void checkSilecsVersion(IProject project) throws SilecsException - { - String version = getSilecsVersion(project); - if( isSilecsVersionSupported(version) == false ) - { - throw new SilecsException("The old silecs version: '" + version + "' is not supported by this silecs-plugin. Please update your SILECS project to a more recent version (right-click --> SILECS Update Project)"); - } - } - - - public static Boolean isSilecsVersionSupported(String version) - { - for(String supportedVersion: SilecsConstants.SUPPORTED_SILECS_MAJOR_VERSIONS) - { - if(version.startsWith(supportedVersion)) - return true; - } - return false; - } - - public static List<String> readOutAvailableSilecsVersions() - { - List<String> silecsVersions = new ArrayList<String>(); - if (MainPreferencePage.isLocalDirectoryUsed()) - { - silecsVersions.add("DEV"); - return silecsVersions; - } - - // We just pick any sub-project - File silecsBaseFolder = new File(MainPreferencePage.getGlobalSilecsDirectory() + "/silecs-model"); - for (final File fileEntry : silecsBaseFolder.listFiles()) - { - silecsVersions.add(fileEntry.getName()); - } - Collections.sort(silecsVersions); - Collections.reverse(silecsVersions); - return silecsVersions; - } - - public static IFile extractSilecsFileFromEvent(ExecutionEvent event) throws Exception - { - String parameter = event.getParameter("silecs-eclipse-plugin.commandParameter"); - if ( parameter.equals("menubar")) - { - IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); - IWorkbenchPage activePage = window.getActivePage(); - - // Get the Selection from the active WorkbenchPage page - ISelection selection = activePage.getSelection(); - if(selection instanceof ITreeSelection) // Event was triggered by right-click on project - { - TreeSelection treeSelection = (TreeSelection) selection; - TreePath[] treePaths = treeSelection.getPaths(); - TreePath treePath = treePaths[0]; - - // The first segment should be a IProject - Object firstSegmentObj = treePath.getFirstSegment(); - IProject theProject = (IProject) ((IAdaptable)firstSegmentObj).getAdapter(IProject.class); - if( theProject == null ) - { - ConsoleHandler.printError("Failed to find the right project", true); - throw new ExecutionException("Failed to find the right project"); - } - return getSilecsDocument(theProject); - } - } - if (parameter.equals("toolbar")) - { - // The default: the toolbar button was pressed - IEditorPart editor = HandlerUtil.getActiveEditor(event); - if (editor == null) - { - ConsoleHandler.printError("Failed to find active SILECS editor", true); - throw new Exception("Failed to find active SILECS editor"); - } - return ((IFileEditorInput) editor.getEditorInput()).getFile(); - } - String message = new String("Failed to find correct silecs-project/file - command: '" + event.getCommand().getName() + "' send with parameter: '" + parameter + "'."); - ConsoleHandler.printError(message, true); - throw new Exception(message); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/utils/XmlUtils.java b/silecs-eclipse-plugin/src/java/cern/silecs/utils/XmlUtils.java deleted file mode 100644 index 218810bb45642afd65e41e01083ebe9463c6293b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/utils/XmlUtils.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.utils; - -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; -import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery; -import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentLoader; -import org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.InferredGrammarBuildingCMDocumentLoader; -import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil; - -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -@SuppressWarnings("restriction") -public class XmlUtils { - - private static TransformerFactory TRANSFORMER_FACTORY; - - public static String nodeToString(Node node) throws TransformerFactoryConfigurationError, TransformerException { - Transformer transformer = createPrettyTransformer(); - - // if given node is not a complete document, we do not - // put the xml declaration. we also omit if the document already has - // a type - if (!(node instanceof Document) || ((Document) node).getDoctype() != null) { - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); - } - - // write node to string - DOMSource source = new DOMSource(node); - StringWriter writer = new StringWriter(); - StreamResult result = new StreamResult(writer); - transformer.transform(source, result); - - return writer.toString(); - } - - - private static Transformer createPrettyTransformer() throws TransformerConfigurationException, - TransformerFactoryConfigurationError { - if (TRANSFORMER_FACTORY == null) { - TRANSFORMER_FACTORY = TransformerFactory.newInstance(); - } - Transformer t = TRANSFORMER_FACTORY.newTransformer(); - t.setOutputProperty(OutputKeys.INDENT, "yes"); - t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); - - return t; - } - - public static String xPathFromNode(Node node) { - if (node == null) { - return ""; - } - - switch (node.getNodeType()) { - case Node.DOCUMENT_NODE: - return ""; - - case Node.ATTRIBUTE_NODE: - Attr attr = (Attr) node; - return xPathFromNode(attr.getOwnerElement()) + "/@" + attr.getName(); - - case Node.ELEMENT_NODE: - Element elem = (Element) node; - Node parent = elem.getParentNode(); - String name = elem.getTagName(); - NodeList childs = parent.getChildNodes(); - - int index = 1; - for (int i = 0; i < childs.getLength(); i++) { - Node n = childs.item(i); - if (n.equals(elem)) { - // first element in xPath is 1, not 0 - return xPathFromNode(parent) + "/" + node.getNodeName() + "[" + index + "]"; - } else if (n instanceof Element && n.getNodeName().equals(name)) { - // there is another element with the same name before in the list - index++; - } - } - - default: - throw new IllegalStateException("Unexpected Node type: " + node.getNodeType()); - } - } - - /** - * Return the string contained in the string builder. Remove the ending if equals to the parameter (use for joining - * strings in loops) - * - * @param stringBuilder - * @param endingToRemove - * @return - */ - public static String finalize(StringBuilder stringBuilder, String endingToRemove) { - if (stringBuilder == null) { - throw new IllegalArgumentException("stringBuilder cannot be null"); - } else if (endingToRemove == null) { - throw new IllegalArgumentException("endingToRemove cannot be null"); - } - - int length = stringBuilder.length(); - int endingLength = endingToRemove.length(); - if (length > endingLength && stringBuilder.substring(length - endingLength).equals(endingToRemove)) { - return stringBuilder.substring(0, length - endingLength); - } else { - return stringBuilder.toString(); - } - } - - public static void reloadDependencies() { - List<IEditorReference> editors = new ArrayList<>(); - for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) { - for (IWorkbenchPage page : window.getPages()) { - editors.addAll(Arrays.asList(page.getEditorReferences())); - } - } - - for (IEditorReference er : editors) { - IEditorPart editor = er.getEditor(false); - ITextEditor textEditor = null; - if (editor instanceof ITextEditor) - textEditor = (ITextEditor) editor; - else if (editor != null) { - Object o = editor.getAdapter(ITextEditor.class); - if (o != null) - textEditor = (ITextEditor) o; - } - if (textEditor != null) { - IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()); - IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document); - if (model != null) { - ModelQuery modelQuery = null; - try { - modelQuery = ModelQueryUtil.getModelQuery(model); - } finally { - model.releaseFromRead(); - } - Document domDocument = ((IDOMModel) model).getDocument(); - if ((modelQuery != null) && (modelQuery.getCMDocumentManager() != null)) { - modelQuery.getCMDocumentManager().getCMDocumentCache().clear(); - CMDocumentLoader loader = new InferredGrammarBuildingCMDocumentLoader(domDocument, modelQuery); - loader.loadCMDocuments(); - } - } - } - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/Application.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/Application.java deleted file mode 100644 index b74bc99f94b48dbfbf47bcfbc1aa523a04439c48..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/Application.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view; - -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PlatformUI; - -/** - * This class controls all aspects of the application's execution - */ -public class Application implements IApplication { - - /* (non-Javadoc) - * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) - */ - @Override - public Object start(IApplicationContext context) throws Exception { - Display display = PlatformUI.createDisplay(); - - // Displaying ChooseWorkspace Dialog and then assigning new workspace to the application - // Add "-data @noDefault" to PROGRAM ARGUMENTS to make workspace choosing working - - try { - int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); - if (returnCode == PlatformUI.RETURN_RESTART) - return IApplication.EXIT_RESTART; - else - return IApplication.EXIT_OK; - } finally { - display.dispose(); - } - - } - - /* (non-Javadoc) - * @see org.eclipse.equinox.app.IApplication#stop() - */ - @Override - public void stop() { - if (!PlatformUI.isWorkbenchRunning()) - return; - final IWorkbench workbench = PlatformUI.getWorkbench(); - final Display display = workbench.getDisplay(); - display.syncExec(new Runnable() { - @Override - public void run() { - if (!display.isDisposed()) - workbench.close(); - } - }); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationActionBarAdvisor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationActionBarAdvisor.java deleted file mode 100644 index 8ff8da6b0065c64f6c68e8989fc6296d5702b5cb..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationActionBarAdvisor.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view; - - -import org.eclipse.ui.application.ActionBarAdvisor; -import org.eclipse.ui.application.IActionBarConfigurer; - -public class ApplicationActionBarAdvisor extends ActionBarAdvisor { - - public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { - super(configurer); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchAdvisor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchAdvisor.java deleted file mode 100644 index 6d6f682299a1a5173f2c37a7785a680ebc0ff39c..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchAdvisor.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view; - -import java.net.URL; -import java.net.URLClassLoader; - -import org.eclipse.core.resources.IProject; -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.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.IWorkbenchPreferenceConstants; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.application.IWorkbenchConfigurer; -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.application.WorkbenchAdvisor; -import org.eclipse.ui.application.WorkbenchWindowAdvisor; -import org.eclipse.ui.ide.IDE; - -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.XmlUtils; -import cern.silecs.view.console.ConsoleHandler; - -/** - * In this class a lot of initialization takes place because this is the point when workbench is already created. - */ -public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { - - private static final String PERSPECTIVE_ID = "silecs.eclipse.plugin.perspective"; //$NON-NLS-1$ - - @Override - public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { - return new ApplicationWorkbenchWindowAdvisor(configurer); - } - - @Override - public String getInitialWindowPerspectiveId() { - return PERSPECTIVE_ID; - } - - @Override - public void initialize(IWorkbenchConfigurer configurer) { - super.initialize(configurer); - - configurer.setSaveAndRestore(true); - PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false); - - IDE.registerAdapters(); - } - - @Override - public IAdaptable getDefaultPageInput() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchWindowAdvisor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchWindowAdvisor.java deleted file mode 100644 index c8de392a0c5cc35b0c0b6466a33ffa02642a41e6..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/ApplicationWorkbenchWindowAdvisor.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.swt.graphics.Point; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.application.ActionBarAdvisor; -import org.eclipse.ui.application.IActionBarConfigurer; -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.application.WorkbenchWindowAdvisor; -import org.eclipse.ui.internal.dialogs.WorkbenchWizardElement; -import org.eclipse.ui.internal.wizards.AbstractExtensionWizardRegistry; -import org.eclipse.ui.wizards.IWizardCategory; -import org.eclipse.ui.wizards.IWizardDescriptor; - -import cern.silecs.utils.SilecsConstants; - -@SuppressWarnings("restriction") -public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { - - public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { - super(configurer); - } - - @Override - public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { - return new ApplicationActionBarAdvisor(configurer); - } - - @Override - public void preWindowOpen() { - IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); - configurer.setInitialSize(new Point(700, 500)); - configurer.setShowCoolBar(true); - configurer.setShowStatusLine(true); - configurer.setTitle(SilecsConstants.SILECS_NAME); //$NON-NLS-1$ - configurer.setShowProgressIndicator(true); - } - - @Override - public void postWindowOpen() { - super.postWindowOpen(); - - addChangedEditorListener(); - - // removing unnecessary wizards from new and import menu. - AbstractExtensionWizardRegistry wizardRegistry = (AbstractExtensionWizardRegistry) PlatformUI.getWorkbench() - .getNewWizardRegistry(); - IWizardCategory[] categories = PlatformUI.getWorkbench().getNewWizardRegistry().getRootCategory() - .getCategories(); - - for (IWizardDescriptor wizard : getAllWizards(categories)) { - if (wizard.getCategory().getId().matches("org.eclipse.ui.Basic")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.wst.xml.examples")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.wst.XMLCategory")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.cdt.ui.newCWizards")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } - - } - - wizardRegistry = (AbstractExtensionWizardRegistry) PlatformUI.getWorkbench().getImportWizardRegistry(); - - categories = PlatformUI.getWorkbench().getImportWizardRegistry().getRootCategory().getCategories(); - - for (IWizardDescriptor wizard : getAllWizards(categories)) { - if (wizard.getCategory().getId().matches("org.eclipse.cdt.ui.importWizardCategory")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.debug.ui")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.wst.XMLCategory")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } else if (wizard.getCategory().getId().matches("org.eclipse.team.ui.importWizards")) { - WorkbenchWizardElement wizardElement = (WorkbenchWizardElement) wizard; - wizardRegistry.removeExtension(wizardElement.getConfigurationElement().getDeclaringExtension(), - new Object[] { wizardElement }); - } - } - } - - private IWizardDescriptor[] getAllWizards(IWizardCategory[] categories) { - List<IWizardDescriptor> results = new ArrayList<IWizardDescriptor>(); - for (IWizardCategory wizardCategory : categories) { - results.addAll(Arrays.asList(wizardCategory.getWizards())); - results.addAll(Arrays.asList(getAllWizards(wizardCategory.getCategories()))); - } - return results.toArray(new IWizardDescriptor[0]); - } - - private void addChangedEditorListener() { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage(); - page.addPartListener(new IPartListener() { - - @Override - public void partOpened(IWorkbenchPart part) { - setApplicationTitle(); - } - - @Override - public void partDeactivated(IWorkbenchPart part) { - setApplicationTitle(); - } - - @Override - public void partClosed(IWorkbenchPart part) { - setApplicationTitle(); - } - - @Override - public void partBroughtToTop(IWorkbenchPart part) { - setApplicationTitle(); - } - - @Override - public void partActivated(IWorkbenchPart part) { - setApplicationTitle(); - } - - private void setApplicationTitle() { -// IEditorPart editorPart = page.getActiveEditor(); -// IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); -// -// if (editorPart != null) { -// IFileEditorInput editorInput = (IFileEditorInput) editorPart.getEditorInput(); -// IFile file = editorInput.getFile(); -// -// configurer.setTitle(file.getFullPath() + " - " + SilecsConstants.SILECS_NAME + " - " -// + ResourcesPlugin.getWorkspace()); -// } else { -// configurer.setTitle(SilecsConstants.SILECS_NAME + " - " + ResourcesPlugin.getWorkspace() ); -// } - } - }); - - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/Perspective.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/Perspective.java deleted file mode 100644 index 2404834644e28a901eaf779fd06e1fadf56045e9..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/Perspective.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view; - -import org.eclipse.ui.IPageLayout; -import org.eclipse.ui.IPerspectiveFactory; - -public class Perspective implements IPerspectiveFactory { - - @Override - public void createInitialLayout(IPageLayout layout) { - // TODO Auto-generated method stub - - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/console/ConsoleHandler.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/console/ConsoleHandler.java deleted file mode 100644 index 454b9d51eb499bed8b5bba565f69c9ede511f368..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/console/ConsoleHandler.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.console; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.MessageConsole; -import org.eclipse.ui.console.MessageConsoleStream; - -public class ConsoleHandler { - - private static MessageConsole console; - private static MessageConsoleStream messageStream; - private static MessageConsoleStream errorStream; - private static MessageConsoleStream warningStream; - - static { - console = new MessageConsole("Console", null); - ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console }); - - messageStream = console.newMessageStream(); - errorStream = console.newMessageStream(); - warningStream = console.newMessageStream(); - - final Display display = Display.getDefault(); - Display.getDefault().asyncExec(new Runnable() - { - public void run() - { - errorStream.setColor(display.getSystemColor(SWT.COLOR_RED)); - warningStream.setColor(display.getSystemColor(SWT.COLOR_DARK_YELLOW)); - } - }); - } - - public static void clear() { - console.clearConsole(); - } - - /** - * Prints message in the silecs console. - * - * @param message Message to appear in the console - * @param activateOnWrite determines whether to activate the console - */ - public static void printMessage(String message, boolean activateOnWrite) { - messageStream.setActivateOnWrite(activateOnWrite); - messageStream.println(message); - } - - /** - * Prints error message in the silecs console. - * - * @param Error message to appear in the console - * @param activateOnWrite determines whether to activate the console - */ - public static void printError(String message, boolean activateOnWrite) { - errorStream.setActivateOnWrite(activateOnWrite); - errorStream.println(message); - } - - - private static void printTrace(Throwable ex) { - if( ex == null) - return; - StackTraceElement[] stacktrace = ex.getStackTrace(); - - for(int i=1; i<stacktrace.length; i++){ - errorStream.println(stacktrace[i].toString()); - } - } - - public static void printStackTrace(Exception ex) { - errorStream.println(ex.getLocalizedMessage()); - errorStream.println("Stacktrace: "); - printTrace(ex); - errorStream.println("Caused by: "); - printTrace(ex.getCause()); - errorStream.setActivateOnWrite(true); - } - - - /** - * Prints error message in the silecs console. - * - * @param Warning message to appear in the console - * @param activateOnWrite determines whether to activate the console - */ - public static void printWarning(String message, boolean activateOnWrite) { - warningStream.setActivateOnWrite(activateOnWrite); - warningStream.println(message); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/dialogs/SilecsMessageDialog.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/dialogs/SilecsMessageDialog.java deleted file mode 100644 index d9ea6851c4660c1ae28051ad0ab6f2bc27672988..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/dialogs/SilecsMessageDialog.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.dialogs; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -import cern.silecs.utils.SilecsUtils; - -/** - * This class adds Silecs logo to jface Message Dialog. - * @see MessageDialog - */ -public class SilecsMessageDialog extends MessageDialog{ - - private Image image = null; - - /** - * @see MessageDialog#MessageDialog(Shell, String, Image, String, int, String[], int) - */ - public SilecsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, - int dialogImageType, String[] dialogButtonLabels, int defaultIndex) { - super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex); - - String imagePath = SilecsUtils.findInBundle("icons/silecs-logo.ico"); - image = new Image(PlatformUI.getWorkbench().getDisplay(), imagePath); - } - - @Override - public Image getImage() { - return image; - } -} \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DeployMultiPageEditor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DeployMultiPageEditor.java deleted file mode 100644 index e1d4967fa4d1aff77d3c8f3a4474b7b4a4c12ffc..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DeployMultiPageEditor.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor; - -public class DeployMultiPageEditor extends XMLMultiPageEditor { - - public static String ID = "cern.silecs.view.editors.deploy"; - public DeployMultiPageEditor() { - super(); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DesignMultiPageEditor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DesignMultiPageEditor.java deleted file mode 100644 index f8f5711c18b3ff0c2c6045265fcf323bcd107f80..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/DesignMultiPageEditor.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor; - -public class DesignMultiPageEditor extends XMLMultiPageEditor { - - public static String ID = "cern.silecs.view.editors.design"; - public DesignMultiPageEditor() { - super(); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/XMLMultiPageEditor.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/XMLMultiPageEditor.java deleted file mode 100644 index 1ca464a886bf93d38cab85deb6b371cb3e46a9b6..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/XMLMultiPageEditor.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.ResourcesPlugin; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.swt.layout.GridData; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils; -import org.eclipse.wst.xml.core.internal.document.NodeImpl; -import org.eclipse.wst.xml.ui.internal.XMLUIPlugin; -import org.eclipse.wst.xml.ui.internal.tabletree.IDesignViewer; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeHelpContextIds; -import org.eclipse.core.runtime.IProgressMonitor; - -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.editor.internal.SilecsXMLTableTreeViewer; -import cern.silecs.view.job.ValidationJob; - -@SuppressWarnings("restriction") -public class XMLMultiPageEditor extends XMLMultiPageEditorPart { - - SilecsXMLTableTreeViewer xmlTableTreeViewer; - - public XMLMultiPageEditor() { - super(); - } - - @Override - public void init(IEditorSite site, IEditorInput input) throws PartInitException { - super.init(site, input); - - // useless to instantiate toolbar since not used - noToolbar(); - } - - @Override - public void dispose() { - ResourcesPlugin.getWorkspace().removeResourceChangeListener(xmlTableTreeViewer); - super.dispose(); - } - - @Override - protected void createPages() { - super.createPages(); - - // add itself as resource change listener - ResourcesPlugin.getWorkspace().addResourceChangeListener(xmlTableTreeViewer, IResourceChangeEvent.POST_CHANGE); - } - - @Override - protected IDesignViewer createDesignPage() { - xmlTableTreeViewer = new SilecsXMLTableTreeViewer(getContainer(), this); - xmlTableTreeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH)); - - // Set the default info-pop for XML design viewer. - XMLUIPlugin.getInstance().getWorkbench().getHelpSystem() - .setHelp(xmlTableTreeViewer.getControl(), XMLTableTreeHelpContextIds.XML_DESIGN_VIEW_HELPID); - - return xmlTableTreeViewer; - } - - public IDocument getDocument() { - IDocument document = null; - StructuredTextEditor textEditor = (StructuredTextEditor) getAdapter(StructuredTextEditor.class); - if (textEditor != null) { - document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()); - } - - return document; - } - - public static XMLMultiPageEditor getOpenedEditor(IFile file) { - - // get all the opened editors - List<IEditorReference> editors = new ArrayList<>(); - for (IWorkbenchWindow window : PlatformUI.getWorkbench().getWorkbenchWindows()) { - for (IWorkbenchPage page : window.getPages()) { - editors.addAll(Arrays.asList(page.getEditorReferences())); - } - } - - for (IEditorReference er : editors) { - IEditorPart editor = er.getEditor(false); - try { - IEditorInput editorInput = er.getEditorInput(); - if (editor instanceof XMLMultiPageEditor && editorInput instanceof IFileEditorInput) { - IFileEditorInput input = (IFileEditorInput) editorInput; - - if (input.getFile().equals(file)) { - return (XMLMultiPageEditor) editor; - } - } - } catch (PartInitException e) { - e.printStackTrace(); - } - } - return null; - } - - - public NodeImpl getNodeAtPosition(int line, int column) { - try { - // line 1 is considered as line 0 by eclipse - // same for columns - if (line > 0) { - IRegion region = getDocument().getLineInformation(line - 1); - ITextViewer viewer = ((StructuredTextEditor) getAdapter(StructuredTextEditor.class)).getTextViewer(); - return (NodeImpl) ContentAssistUtils.getNodeAt(viewer, region.getOffset() + column - 2); - } - } catch (BadLocationException e) { - e.printStackTrace(); - } - - return null; - } - - @Override - public void doSave(IProgressMonitor monitor) - { - IEditorInput editorInput = getEditorInput(); - if (editorInput instanceof IFileEditorInput) - { - IFile fesaFile = ((IFileEditorInput) editorInput).getFile(); - - super.doSave(monitor); - - ConsoleHandler.printMessage("Validating XML ...", true); - ValidationJob job; - job = new ValidationJob(fesaFile); - job.schedule(); - } - } - - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SchemaHelper.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SchemaHelper.java deleted file mode 100644 index 0754660b4aab4defc7008bc0e6ea851301fe851e..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SchemaHelper.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor.internal; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration; -import org.eclipse.wst.xml.core.internal.document.CMNodeUtil; -import org.eclipse.wst.xsd.contentmodel.internal.XSDImpl.XSDElementDeclarationAdapter; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDIdentityConstraintDefinition; -import org.w3c.dom.Element; - -@SuppressWarnings("restriction") -public abstract class SchemaHelper { - - public static List<XSDIdentityConstraintDefinition> findIdentityConstraints(Element element) { - CMElementDeclaration elemDecl = CMNodeUtil.getElementDeclaration(element); - if (elemDecl instanceof XSDElementDeclarationAdapter) { - XSDElementDeclarationAdapter xsdElemAdapt = (XSDElementDeclarationAdapter) elemDecl; - XSDElementDeclaration xsdElementDecl = (XSDElementDeclaration) xsdElemAdapt.getKey(); - - // get all the key constraints definitions - List<XSDIdentityConstraintDefinition> constraints = xsdElementDecl.getResolvedElementDeclaration() - .getIdentityConstraintDefinitions(); - constraints.addAll(xsdElementDecl.getResolvedElementDeclaration().getIdentityConstraintDefinitions()); - - return constraints; - } else { - return Collections.emptyList(); - } - } - - public static XSDIdentityConstraintDefinition findIdentityConstraint(Element element, String constraintName) { - List<XSDIdentityConstraintDefinition> constraints = findIdentityConstraints(element); - for (XSDIdentityConstraintDefinition c : constraints) { - if (c.getName().equals(constraintName)) { - return c; - } - } - - return null; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsTableColumnViewerLabelProvider.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsTableColumnViewerLabelProvider.java deleted file mode 100644 index 75fd12b9903bfb462cc76dd9996ffe4f5e13962c..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsTableColumnViewerLabelProvider.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor.internal; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.CellLabelProvider; -import org.eclipse.jface.viewers.LabelProviderChangedEvent; -import org.eclipse.jface.viewers.ViewerCell; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Display; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider; -import org.w3c.dom.Node; - -import cern.silecs.utils.XmlUtils; - - -/** - * Label provider for the design view of the FesaEditor - */ -@SuppressWarnings("restriction") -public class SilecsTableColumnViewerLabelProvider extends CellLabelProvider { - - private static final int TOOLTIP_DELAY_MS = 500; - - // since we could not have multiple inheritance in java, - // we inject the base label provider in this CellLabelProvider - // which adds support for tool-tips in the registered treeViewer - private final XMLTableTreeContentProvider baseLabelProvider; - - // These 2 maps behave like a bidirectional map - // marker -> node - // node -> Set<marker> - private final Map<IMarker, Node> markerToNode = new HashMap<>(); - private final Map<Node, Set<IMarker>> nodeToMarkers = new HashMap<>(); - - public SilecsTableColumnViewerLabelProvider(XMLTableTreeContentProvider baseLabelProvider) { - this.baseLabelProvider = baseLabelProvider; - } - - /** - * Register an error/warning with its associated node - * Fire a label provider changed event - * - * @param marker - * @param node - */ - public void addFault(IMarker marker, Node node) { - markerToNode.put(marker, node); - if (nodeToMarkers.containsKey(node)) { - nodeToMarkers.get(node).add(marker); - } else { - Set<IMarker> markers = new HashSet<>(); - markers.add(marker); - nodeToMarkers.put(node, markers); - } - - fireLabelProviderChanged(new LabelProviderChangedEvent(this, node)); - } - - /** - * Remove the marker and its associated node from the faulty list - * Fire a label provider changed event - * - * @param marker - */ - public void removeFault(IMarker marker) { - Node node = markerToNode.remove(marker); - if (node != null) { - Set<IMarker> markers = nodeToMarkers.get(node); - markers.remove(marker); - if (markers.isEmpty()) { - nodeToMarkers.remove(node); - } - fireLabelProviderChanged(new LabelProviderChangedEvent(this, node)); - } - } - - /** - * Clears all the registered marker/nodes - */ - public void clearFaults() { - markerToNode.clear(); - nodeToMarkers.clear(); - } - - /** - * Provide a tool-tip for the faulty node with the error message of the associated markers - */ - @Override - public String getToolTipText(Object element) { - if (nodeToMarkers.containsKey(element)) { - Set<IMarker> markers = nodeToMarkers.get(element); - StringBuilder sb = new StringBuilder(); - for (IMarker marker : markers) { - try { - sb.append(marker.getAttribute(IMarker.MESSAGE) + "\n"); - } catch (CoreException e) { - // don't do anything - } - } - - return XmlUtils.finalize(sb, "\n"); - } - - return null; - } - - @Override - public Point getToolTipShift(Object object) { - return new Point(5, 5); - } - - @Override - public int getToolTipDisplayDelayTime(Object object) { - return TOOLTIP_DELAY_MS; - } - - @Override - public int getToolTipTimeDisplayed(Object object) { - return -1; - } - - /** - * Use the base label provider for the content If the element is fault, compute the background color - */ - @Override - public void update(ViewerCell cell) { - Object element = cell.getElement(); - int index = cell.getColumnIndex(); - - cell.setText(baseLabelProvider.getColumnText(element, index)); - cell.setImage(baseLabelProvider.getColumnImage(element, index)); - - cell.setForeground(baseLabelProvider.getForeground(element, index)); - if (nodeToMarkers.containsKey(element)) { - // background of the faulty cell - cell.setBackground(computeCellBackground((Node) element)); - } else { - cell.setBackground(baseLabelProvider.getBackground(element, index)); - } - } - - /** - * Helper to compute the background color of a faulty cell - * - * @param node - * @return - */ - private Color computeCellBackground(Node node) { - Set<IMarker> markers = nodeToMarkers.get(node); - int color = SWT.COLOR_YELLOW; - for (IMarker marker : markers) { - if (marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR) == IMarker.SEVERITY_ERROR) { - color = SWT.COLOR_RED; - break; - } - } - return Display.getCurrent().getSystemColor(color); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeContentProvider.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeContentProvider.java deleted file mode 100644 index 1fce623e91e8395c392e162adf62e5606a6cfe1b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeContentProvider.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor.internal; - -import org.eclipse.osgi.util.TextProcessor; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider; -import org.w3c.dom.Attr; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -import cern.silecs.utils.SilecsConstants; - -@SuppressWarnings("restriction") -public class SilecsXMLTableTreeContentProvider extends XMLTableTreeContentProvider{ - - @Override - public String getColumnText(Object object, int column) { - String result = super.getColumnText(object, column); - - if ((result.isEmpty() || result.startsWith("(")) && object instanceof Element && column == 1) { - result = getElementValueHelper((Element) object); - } - - result = TextProcessor.process(result); - return result != null ? result : ""; - } - - private String getElementValueHelper(Element element) { - - StringBuilder sb = new StringBuilder(); - if (element.hasAttributes()) { - NamedNodeMap map = element.getAttributes(); - - sb.append("("); - // put name first - Attr name = (Attr) map.getNamedItem(SilecsConstants.NAME); - if (name != null) { - sb.append(name.getValue() + ": "); - } - - // put other attributes - for (int i = 0; i < map.getLength(); i++) { - Attr a = (Attr) map.item(i); - String attrName = a.getName(); - - // name has already been added - // do not propagate id - if (!(attrName.equals(SilecsConstants.NAME))) { - sb.append(attrName + "=" + a.getValue() + ", "); - } - } - - } - - if (sb.length() < 2) { - // if we didn't find smth interesting - // the node behaves like a container - return getContainerElementValueHelper(element); - } else if (sb.charAt(0) == '(') { - // remove the last comma/colon and close the parenthesis - sb.setLength(sb.length() - 2); - sb.append(")"); - } - - return sb.toString(); - } - - private String getContainerElementValueHelper(Element element) { - if (element.hasAttribute(SilecsConstants.NAME)) { - return element.getAttribute(SilecsConstants.NAME); - } else if (element.hasChildNodes()) { - NodeList nodeList = element.getChildNodes(); - - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node n = nodeList.item(i); - if (n instanceof Element) { - String val = getContainerElementValueHelper((Element) n); - if (!val.isEmpty()) { - if (sb.length() != 0) { - sb.append(", "); - } - - sb.append(val); - } - - } - } - - return sb.toString(); - } else { - return ""; - } - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreePropertyDescriptionFactory.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreePropertyDescriptionFactory.java deleted file mode 100644 index e0a32b4484ccc455c693190e9764b054f5b2248f..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreePropertyDescriptionFactory.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor.internal; - -import java.io.File; -import java.io.FileFilter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.TreeSet; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.wst.xml.core.internal.contentmodel.CMNode; -import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreePropertyDescriptorFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.view.console.ConsoleHandler; - -@SuppressWarnings("restriction") -class SilecsXMLTableTreePropertyDescriptorFactory extends XMLTableTreePropertyDescriptorFactory { - - public static final String DESIGN_NAME_MATCHER = "silecs-design-name"; - public static final String DESIGN_VERSION_MATCHER = "silecs-design-version"; - - - @Override - protected IPropertyDescriptor createPropertyDescriptorHelper(String name, Element element, CMNode cmNode) - { - Collection<String> values = null; - try - { - if (isSilecsDesignName(element,name)) - { - - values = getPossibleClassNames(); - } - if (isSilecsDesignVersion(element,name) ) - { - if( !element.getAttribute(DESIGN_NAME_MATCHER).isEmpty() ) - { - values = getPossibleClassVersions(element.getAttribute(DESIGN_NAME_MATCHER)); - } - } - } - catch (SilecsException e) - { - ConsoleHandler.printStackTrace(e); - } - - if (values != null && !values.isEmpty()) - { - return new EnumeratedStringPropertyDescriptor(name, name, values.toArray(new String[values.size()])); - } - else - { - return super.createPropertyDescriptorHelper(name, element, cmNode); - } - } - - private static boolean isSilecsDesignName(Element element, String attribute) - { - if (element.getTagName().matches("SilecsDesign") && attribute.matches(DESIGN_NAME_MATCHER)) - return true; - return false; - } - - private static boolean isSilecsDesignVersion(Element element, String attribute) - { - if (element.getTagName().matches("SilecsDesign") && attribute.matches(DESIGN_VERSION_MATCHER)) - return true; - return false; - } - - private static List<String> getPossibleClassNames() throws SilecsException - { - Set<File> classes = getClassFiles(); - String searchTerm = "." + SilecsConstants.IEDESIGN_FILE; - List<String> classNames = new ArrayList<>(); - - for (File classFile : classes) - { - String className = classFile.getName().replace(searchTerm,""); - classNames.add(className); - } - return classNames; - } - - private static List<String> getPossibleClassVersions(String className) throws SilecsException - { - Set<File> classes = getClassFiles(); - List<String> classVersions = new ArrayList<>(); - String searchTerm = "." + SilecsConstants.IEDESIGN_FILE; - - for (File classFile : classes) - { - String classNameFile = classFile.getName().replace(searchTerm,""); - //ConsoleHandler.printMessage("getPossibleClassVersions - classNameFile: " + classNameFile, true); - //ConsoleHandler.printMessage("getPossibleClassVersions - className: " + className, true); - if (classNameFile.equals(className) ) - { - try - { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(classFile); - Node classNode = doc.getElementsByTagName("SILECS-Class").item(0); - if( classNode != null ) - { - classVersions.add( classNode.getAttributes().getNamedItem("version").getNodeValue() ); - } - } - catch(Exception e) - { - e.printStackTrace(); - ConsoleHandler.printError("No version found in class: " + classNameFile, true); - } - } - } - return classVersions; - } - - private static Set<File> getClassFiles() throws SilecsException - { - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - Set<File> projects = listDirectories(workspaceRoot.getLocation().toFile()); - Set<File> classes = new HashSet<File>(); - - String searchTerm = "." + SilecsConstants.IEDESIGN_FILE; - for (File p : projects) - { - File designFolder = new File(p.getAbsolutePath()+"/src"); - if( !designFolder.exists() ) - continue; - - File[] listOfFiles = designFolder.listFiles(); - for (int i = 0; i < listOfFiles.length; i++) - { - if (listOfFiles[i].getName().endsWith(searchTerm)) - { - classes.add(listOfFiles[i]); - } - } - } - return classes; - } - - private static Set<File> listDirectories(File directory) - { - File[] directories = directory.listFiles(new FileFilter() - { - @Override - public boolean accept(File pathname) - { - return pathname.isDirectory(); - } - }); - - if (directories != null) - { - return new TreeSet<File>(Arrays.asList(directories)); - } - else - { - return Collections.emptySet(); - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeViewer.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeViewer.java deleted file mode 100644 index e70cdcc88f98be7ffb4b0257266cb5d57d57b9bb..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/editor/internal/SilecsXMLTableTreeViewer.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.editor.internal; - -import java.util.Arrays; -import java.util.Comparator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; -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.runtime.CoreException; -import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.wst.xml.core.internal.document.NodeImpl; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeContentProvider; -import org.eclipse.wst.xml.ui.internal.tabletree.XMLTableTreeViewer; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import cern.silecs.view.marker.SilecsMarker; - -@SuppressWarnings("restriction") -public class SilecsXMLTableTreeViewer extends XMLTableTreeViewer implements IResourceChangeListener{ - - - - private final IEditorPart parentEditor; - private final SilecsTableColumnViewerLabelProvider labelProvider; - - - /** - * @param parent - */ - public SilecsXMLTableTreeViewer(Composite parent, IEditorPart parentEditor) { - super(parent); - this.parentEditor = parentEditor; - - this.propertyDescriptorFactory = new SilecsXMLTableTreePropertyDescriptorFactory(); - XMLTableTreeContentProvider provider = new SilecsXMLTableTreeContentProvider(); - setContentProvider(provider); - this.labelProvider = new SilecsTableColumnViewerLabelProvider(provider); - setLabelProvider(labelProvider); - ColumnViewerToolTipSupport.enableFor(this); - } - - @Override - protected void inputChanged(Object input, Object oldInput) { - super.inputChanged(input, oldInput); - - labelProvider.clearFaults(); - IEditorInput editorInput = parentEditor.getEditorInput(); - if (editorInput instanceof IFileEditorInput) { - try { - IFile inputFile = ((IFileEditorInput) editorInput).getFile(); - IMarker[] markers = inputFile.findMarkers(SilecsMarker.TYPE, false, IResource.DEPTH_ZERO); - - for (IMarker m : markers) { - displayMarker(m); - } - } catch (CoreException e) { -// LOGGER.error(e.getMessage()); - } - } - refresh(); - } - - - @Override - public void refresh(Object element, boolean updateLabels) { - super.refresh(element, updateLabels); - - // we also want to refresh label of parents elements - if (element instanceof Element) { - Node parent = ((Element) element).getParentNode(); - while (parent != null) { - super.refresh(parent, updateLabels); - parent = parent.getParentNode(); - } - } - } - - - @Override - public void resourceChanged(IResourceChangeEvent event) { - IEditorInput editorInput = parentEditor.getEditorInput(); - if (editorInput instanceof IFileEditorInput) { - // only apply changes if input is a file - final IFile inputFile = ((IFileEditorInput) editorInput).getFile(); - - // sort the markers so that we handle first the deletion and the the creation - final IMarkerDelta makerDelta[] = event.findMarkerDeltas(SilecsMarker.TYPE, false); - Arrays.sort(makerDelta, new Comparator<IMarkerDelta>() { - @Override - public int compare(IMarkerDelta md1, IMarkerDelta md2) { - if (md1.getKind() == IResourceDelta.ADDED) { - return md2.getKind() == IResourceDelta.ADDED ? 0 : 1; - } else if (md1.getKind() == IResourceDelta.REMOVED) { - return md2.getKind() == IResourceDelta.REMOVED ? 0 : -1; - } else if (md2.getKind() == IResourceDelta.ADDED) { - return -1; - } else if (md2.getKind() == IResourceDelta.REMOVED) { - return 1; - } else { - return 0; - } - } - }); - - getControl().getDisplay().syncExec(new Runnable() { - @Override - public void run() { - // this is a hack to avoid automatic scrolling to - // one of the faulty nodes - TreeItem item = getTree().getTopItem(); - for (IMarkerDelta md : makerDelta) { - if (md.getResource().equals(inputFile)) { - if (md.getKind() == IResourceDelta.ADDED) { - displayMarker(md.getMarker()); - } else if (md.getKind() == IResourceDelta.REMOVED) { - removeMarker(md.getMarker()); - } - } - } - - if (item != null) { - getTree().setTopItem(item); - } - } - }); - } - } - - public void displayMarker(final IMarker marker) { - NodeImpl node = null; - try { - node = (NodeImpl) marker.getAttribute(SilecsMarker.NODE_ATTR); - if (node != null) { - labelProvider.addFault(marker, node); - reveal(node); - } - } catch (CoreException e) { - //LOGGER.error("Could not highlight node: {}", e.getMessage()); - } - } - - public void removeMarker(final IMarker marker) { - labelProvider.removeFault(marker); - } - - @Override - public String getTitle() { - return "Tree View"; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ContentSorter.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ContentSorter.java deleted file mode 100644 index 091b1a61ee7cecf3bc542cb062899c08df2317f8..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ContentSorter.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.explorer; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.ui.views.navigator.ResourceComparator; - -import cern.silecs.control.core.DesignProjectNature; - -public class ContentSorter extends ViewerSorter { - - private ResourceComparator resourceComparator; - - public ContentSorter() { - resourceComparator = new ResourceComparator(ResourceComparator.NAME); - } - - @Override - public int compare(Viewer viewer, Object e1, Object e2) { - if (e1 instanceof IProject && e2 instanceof IProject) { - - IProject f1 = (IProject) e1; - IProject f2 = (IProject) e2; - - if (!f1.isOpen() || !f2.isOpen()) - return resourceComparator.compare(viewer, e1, e2); - - boolean f1b = false; - boolean f2b = false; - try { - f1b = f1.hasNature(DesignProjectNature.NATURE_ID); - f2b = f2.hasNature(DesignProjectNature.NATURE_ID); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (f1b ^ f2b) - if (f1b == true) { - return -1; - } else { - return 1; - } - } - - // else let the resource comparator do the ordering - return resourceComparator.compare(viewer, e1, e2); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ProjectContent.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ProjectContent.java deleted file mode 100644 index 77bf8566ff72ec30a6358e15e84c046fa669f5ce..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/ProjectContent.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.explorer; - -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.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Display; - -public class ProjectContent implements ITreeContentProvider, IResourceChangeListener { - - private Viewer attachedViewer; - - private static final Object[] NO_OBJECTS = new Object[0]; - - public ProjectContent() { - ResourcesPlugin.getWorkspace().addResourceChangeListener(this); - } - - @Override - public void dispose() { - ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - attachedViewer = viewer; - } - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement instanceof IWorkspaceRoot) { - // if root return the projects - return ((IWorkspaceRoot) inputElement).getProjects(); - } else if (inputElement instanceof IProject || inputElement instanceof IFolder) { - // if folder or project, return the content - return getChildren(inputElement); - } else { - return NO_OBJECTS; - } - } - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof IProject) { - IProject p = (IProject) parentElement; - try { - return p.members(); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } else if (parentElement instanceof IFolder) { - try { - return ((IFolder) parentElement).members(); - } catch (CoreException e) { - // The resource is not found - return NO_OBJECTS; - } - } - return NO_OBJECTS; - } - - @Override - public Object getParent(Object element) { - if (element instanceof IProject) { - return ((IProject) element).getWorkspace().getRoot(); - } else if (element instanceof IFolder) { - IFolder folder = (IFolder) element; - if (folder.getParent() instanceof IProject) { - // parent of folder is the project - return folder.getProject(); - } else { - return folder.getParent(); - } - } else if (element instanceof IFile) { - IFile file = (IFile) element; - return file.getParent(); - } else { - return null; - } - } - - @Override - public boolean hasChildren(Object element) { - IResource[] members = null; - - try { - if (element instanceof IFolder) { - members = ((IFolder) element).members(); - } - } catch (CoreException e) { - // error while accessing members - } - - // has children if element is project or not empty folder - return element instanceof IProject || (members != null && members.length > 0); - } - - @Override - public void resourceChanged(IResourceChangeEvent event) { - if (attachedViewer != null && !attachedViewer.getControl().isDisposed()) { - - // make the UI thread update the viewer - Display.getDefault().asyncExec(new Runnable() { - - @Override - public void run() { - attachedViewer.refresh(); - } - }); - } - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/SilecsProjectExplorer.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/SilecsProjectExplorer.java deleted file mode 100644 index 927d6507b69dc6ea0716c35f7dbc140b0b0b45b3..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/explorer/SilecsProjectExplorer.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.explorer; - -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.navigator.CommonNavigator; -import org.eclipse.ui.navigator.CommonViewer; -import org.eclipse.ui.navigator.ICommonActionConstants; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.utils.SilecsUtils; - -/** - * This class is a subclass of CommonNavigator that provide changes concerning expanding tree. - * - * @see CommonNavigator - */ -public class SilecsProjectExplorer extends CommonNavigator { - - public static final String VIEW_ID = "cern.silecs.view.explorer"; - - @Override - public void createPartControl(Composite aParent) { - super.createPartControl(aParent); - CommonViewer viewer = getCommonViewer(); - - IActionBars bars = getViewSite().getActionBars(); - final IStatusLineManager lineManager = bars.getStatusLineManager(); - - final ILabelProvider labelProvider = (ILabelProvider) viewer.getLabelProvider(); - - viewer.addPostSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - - ISelection aSelection = event.getSelection(); - if (aSelection != null && !aSelection.isEmpty() && aSelection instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) aSelection; - IResource file = null; - - if (selection.size() == 1 && selection.getFirstElement() instanceof IProject) { - IProject project = (IProject) selection.getFirstElement(); - try { - if (project.hasNature(DesignProjectNature.NATURE_ID)) { - file = SilecsUtils.getSilecsDesignFile(project); - } else if (project.hasNature(DeployProjectNature.NATURE_ID)) { - file = SilecsUtils.getSilecsDeployFile(project); - } - } catch (Exception e) { - e.printStackTrace(); - } - - } else if(selection.size() == 1 && selection.getFirstElement() instanceof IFile) { - file = (IFile) selection.getFirstElement(); - } - - if(file != null) { - Image img = null; - img = labelProvider.getImage(((IStructuredSelection) aSelection).getFirstElement()); - long modificationTime = file.getLocalTimeStamp() / 1000; - - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm:ss"); - LocalDateTime dateAndTime = LocalDateTime.ofEpochSecond(modificationTime, 0, ZoneOffset.ofHours(2)); - - lineManager.setMessage(img,"Last modfication: " + formatter.format(dateAndTime) + " : " + file.getFullPath()); - } - } - - } - }); - - } - - /** - * This method is responsible for expanding the project tree from the root to the silecs file(*.silecsdesign or - * *.silecsdeploy) - */ - @Override - protected void handleDoubleClick(DoubleClickEvent anEvent) { - - IStructuredSelection selection = (IStructuredSelection) anEvent.getSelection(); - Object element = selection.getFirstElement(); - if (element instanceof IProject && !((IProject) element).isOpen()) { - try { - ((IProject) element).open(new NullProgressMonitor()); - } catch (CoreException e) { - e.printStackTrace(); - } - return; - - } else if (element instanceof IProject && ((IProject) element).isOpen()) { - List<IProject> projectList = new ArrayList<IProject>(); - projectList.add((IProject) element); - - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - - expandHelper(root, projectList); - return; - } - super.handleDoubleClick(anEvent); - } - - /** - * This method expands elements in the tree. Since the tool does not have knowledge about project structure it must - * be done recursively. - * - * @param root {@link WorkspaceRoot} - * @param projects List of projects that need to be expanded - */ - public void expandHelper(IWorkspaceRoot root, List<IProject> projects) { - for (IProject project : projects) { - if (project.isOpen()) { - try { - IFile file = null; - if (project.hasNature(DeployProjectNature.NATURE_ID)) { - file = SilecsUtils.getSilecsDeployFile(project); - } else if (project.hasNature(DesignProjectNature.NATURE_ID)) { - file = SilecsUtils.getSilecsDesignFile(project); - } - if (file == null) - continue; - - IContainer parent = file.getParent(); - List<Object> toExpand = new ArrayList<>(); - - do { - toExpand.add(0, parent); - } while ((parent = parent.getParent()) != root); - boolean expand = !getCommonViewer().getExpandedState(project); - for(Object o: toExpand ) - expand(o, expand); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - - /** - * Expands single element in the viewer - * - * @param element - * @return true if expanded - */ - private boolean expand(Object element, boolean expand) { - IAction openHandler = getViewSite().getActionBars().getGlobalActionHandler(ICommonActionConstants.OPEN); - - if (openHandler == null) { - - TreeViewer viewer = getCommonViewer(); - if (viewer.isExpandable(element)) { - viewer.setExpandedState(element, expand); - return true; - } - } - return false; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseFileJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseFileJob.java deleted file mode 100644 index 563bb7bb18ec813cc30f2ef0c1a2c5f27f952062..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseFileJob.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.resources.WorkspaceJob; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; - -import cern.silecs.activator.Activator; - -public abstract class BaseFileJob extends WorkspaceJob { - - protected final IFile file; - protected final Map<IResource, Exception> failures; - - - /** - * @param name - */ - public BaseFileJob(String name, IFile file) { - super(name); - this.file = file; - this.failures = new HashMap<IResource, Exception>(); - - // set the job rule - setRule(createJobRule()); - } - - public Map<IResource, Exception> getFailures(){ - return failures; - } - - protected IStatus computeReturnStatus() { - if (failures.isEmpty()) { - return Status.OK_STATUS; - } else { - // return INFO status so that eclipse does not open the default error pop up - // we handle manually the error reporting - return new Status(IStatus.INFO, Activator.PLUGIN_ID, ""); - } - } - - - /** - * Create the job rule to avoid concurrency on the used resources - * - * @return rule used for the job - */ - protected ISchedulingRule createJobRule() { - return null; - } - - protected final ISchedulingRule workspaceRule() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - - - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseProjectJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseProjectJob.java deleted file mode 100644 index ba409025f0c037380eb1d09ae0b12601171501a4..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/BaseProjectJob.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import java.util.HashMap; -import java.util.Map; - - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.resources.WorkspaceJob; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; - -import cern.silecs.activator.Activator; - -public abstract class BaseProjectJob extends WorkspaceJob { - - protected final IProject project; - protected final Map<IResource, Exception> failures; - - /** - * @param name - */ - public BaseProjectJob(String name, IProject project) { - super(name); - this.failures = new HashMap<IResource, Exception>(); - this.project = project; - - // set the job rule - setRule(createJobRule()); - } - - public Map<IResource, Exception> getFailures() { - return failures; - } - - protected IStatus computeReturnStatus() { - if (failures.isEmpty()) { - return Status.OK_STATUS; - } else { - // return INFO status so that eclipse does not open the default error pop up - // we handle manually the error reporting - return new Status(IStatus.INFO, Activator.PLUGIN_ID, ""); - } - } - - /** - * Create the job rule to avoid concurrency on the used resources - * - * @return rule used for the job - */ - protected ISchedulingRule createJobRule() { - return null; - } - - protected final ISchedulingRule workspaceRule() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateClassJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateClassJob.java deleted file mode 100644 index 263b22d9c155c7df409a9c9ed9a0cb87f3f6f913..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateClassJob.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SubProgressMonitor; - -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.control.validation.Validator; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class GenerateClassJob extends BaseProjectJob { - - private static final String JOB_NAME = "Generate SILECS Class Job"; - - IFile fesaDesignXML; - - public GenerateClassJob(IProject project, IFile fesaDesignDoc) { - super(JOB_NAME, project); - fesaDesignXML = fesaDesignDoc; - } - - @Override - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - String workspacePath = workspaceRoot.getLocation().toFile().getPath(); - - monitor.beginTask("Generate Fesa Classes", 1); - - generateFesaClass(workspacePath, new SubProgressMonitor(monitor, 1)); - DesignProjectNature.addFESAClassNature(project,monitor); - DesignProjectNature.addBuildSpecs(project); - monitor.done(); - - return computeReturnStatus(); - } - - boolean generateFesaClass(String workspacePath, IProgressMonitor monitor) - { - String projectName = project.getName(); - String projectPath = workspacePath + "/" + projectName; - try { - String silecsDesignFilePath = SilecsUtils.getSilecsDesignFilePath(workspacePath, projectName); - String silecsVersion = SilecsUtils.getSilecsVersion(project); - String silecsLibraryBasePath = MainPreferencePage.getSilecsLibraryBasePath(silecsVersion); - - ConsoleHandler.printMessage("Generating FESA class: " + projectName, false); - - if (!Validator.isDocumentValid(SilecsUtils.getSilecsDesignFile(project))) - { - ConsoleHandler.printError( "Failed to generated FESA class: '" + projectName + "'. Please fix all design errors first!", true); - return false; - } - - monitor.beginTask("Generating " + projectName, 2); - OSExecute.executePython("generateFesaDesign","fillDesignFile",silecsVersion,new String[]{MainPreferencePage.getFESAVersion(),projectName,workspacePath,MainPreferencePage.getFESADesignSchemaPath()}); - OSExecute.executePython("generateSourceCode","genCppFiles",silecsVersion,new String[]{projectName, workspacePath,silecsDesignFilePath}); // attention - Cpp Codegen has to happen AFTER design file codegen - OSExecute.executePython("generateBuildEnvironment","genMakefileClass",silecsVersion,new String[]{projectPath,silecsLibraryBasePath}); - OSExecute.executePython("generateBuildEnvironment","genCProjectFile",silecsVersion,new String[]{projectPath.toString()}); - project.refreshLocal(IResource.DEPTH_INFINITE, null); - SilecsUtils.openInEditor(fesaDesignXML); - monitor.worked(1); - } catch (Exception e) { - e.printStackTrace(); - ConsoleHandler.printError("Failed to generate FESA class: " + projectName, true); - ConsoleHandler.printStackTrace(e); - return false; - } - - monitor.done(); - ConsoleHandler.printMessage( "Successfully generated FESA class: " + projectName, true); - return true; - - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateDeployJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateDeployJob.java deleted file mode 100644 index 2fb5f6c4bda37a7d067d044d153505fba24ebb96..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/GenerateDeployJob.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.SubProgressMonitor; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.validation.Validator; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class GenerateDeployJob extends BaseProjectJob { - - private static final String JOB_NAME = "Generate SILECS Deploy Job"; - - IFile fesaDeployDoc_; - boolean createdNewDeployDoc_; - - public GenerateDeployJob(IProject project, IFile fesaDeployDoc, boolean createdNewDeployDoc) { - super(JOB_NAME, project); - fesaDeployDoc_ = fesaDeployDoc; - createdNewDeployDoc_ = createdNewDeployDoc; - } - - @Override - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - String workspacePath = workspaceRoot.getLocation().toFile().getPath(); - - monitor.beginTask("Generating Code", 1); - generateDeploy(workspacePath, new SubProgressMonitor(monitor, 1)); - monitor.done(); - - return computeReturnStatus(); - } - - private void generateDeploy(String workspacePath, IProgressMonitor monitor ) - { - String projectName = project.getName(); - - try { - String deployPath = SilecsUtils.getSilecsDeployFilePath(workspacePath,projectName); - String deployVersion = SilecsUtils.getDeployVersion(deployPath); - String silecsVersion = SilecsUtils.getSilecsVersion(project); - - monitor.beginTask("Generating: " + projectName, 2); - - ConsoleHandler.printMessage("Generating Code for: " + projectName, false); - if (!Validator.isDocumentValid(SilecsUtils.getSilecsDeployFile(project))) - { - ConsoleHandler.printError( "Failed to generated code for: '" + projectName + "'. Please fix all xml errors first!", true); - return; - } - - OSExecute.executePython("genparam","genParam",silecsVersion,new String[]{workspacePath, projectName, deployVersion,silecsVersion}); - OSExecute.executePython("genplcsrc","genPlcSrc",silecsVersion,new String[]{workspacePath, projectName,silecsVersion}); - OSExecute.executePython("genduwrapper","genDuWrapper",silecsVersion,new String[]{workspacePath, projectName, deployVersion}); - OSExecute.executePython("generateBuildEnvironment","genCProjectFile",silecsVersion,new String[]{project.getLocation().toString()}); - - String silecsLibraryBasePath = MainPreferencePage.getSilecsLibraryBasePath(SilecsUtils.getSilecsVersion(project)); - String snap7LibraryBasePath = MainPreferencePage.getSNAP7LibraryBasePath(SilecsUtils.getSilecsVersion(project)); - OSExecute.executePython("generateBuildEnvironment","genMakefileDU",silecsVersion,new String[]{ workspacePath + "/" + projectName, silecsLibraryBasePath,snap7LibraryBasePath}); - OSExecute.executePython("fillFESADeployUnit","fillDeployUnit",silecsVersion,new String[]{ workspacePath, projectName, MainPreferencePage.getFESADeployUnitSchemaPath(), MainPreferencePage.getFESAVersion() }); - - DeployProjectNature.addFESADeployUnitNature(project,monitor); - DeployProjectNature.addBuildSpecs(project); - - project.refreshLocal(IResource.DEPTH_INFINITE, null); - - ConsoleHandler.printMessage("Succeeded in generated code for " + projectName, true); - - if(createdNewDeployDoc_) - SilecsUtils.openInEditor(fesaDeployDoc_); - - monitor.worked(1); - - } catch (Exception e) { - e.printStackTrace(); - ConsoleHandler.printError("Failed to generate code for " + projectName, true); - ConsoleHandler.printStackTrace(e); - } - } -} \ No newline at end of file diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/UpdateVersionJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/UpdateVersionJob.java deleted file mode 100644 index d12e3f61b0b76743765cdf934e05dc62e3fb9f39..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/UpdateVersionJob.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import java.io.File; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; - -public class UpdateVersionJob extends BaseProjectJob { - - private static final String JOB_NAME = "Update SILECS Version Job"; - - String newVersion_; - String oldVersion_; - - public UpdateVersionJob(IProject project, String newVersion ) { - super(JOB_NAME, project); - newVersion_ = newVersion; - } - - @Override - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException - { - monitor.beginTask("Updating Silecs Version", 1); - updateVersion(monitor); - monitor.done(); - return computeReturnStatus(); - } - - boolean updateVersion(IProgressMonitor monitor) - { - try { - oldVersion_ = SilecsUtils.getSilecsVersion(project); - - int result = oldVersion_.compareTo(newVersion_); - if( result >= 0) - { - throw new SilecsException("Migration from "+ oldVersion_ +" to "+ newVersion_ +" not possible. The target-version always needto newer than the current version"); - } - - String codeGenBasePath = MainPreferencePage.getCodeGenBasePath(newVersion_); - String silecsDocumentPath = SilecsUtils.getSilecsDocument(project).getRawLocation().makeAbsolute().toOSString(); - String oldVersionUnderscored = oldVersion_.replace(".", "_"); - String newVersionUnderscored = newVersion_.replace(".", "_"); - String migrationScript = codeGenBasePath + "/migration/" + oldVersionUnderscored + "to" + newVersionUnderscored + ".py"; - - if(! new File(migrationScript).exists()) - { - ConsoleHandler.printWarning("There is no Migration Script for an update from: '" + oldVersion_ + "' to '" + newVersion_ + "'. Using generic migration-script. Only basic xml-version strings will be changed.", true); - migrationScript = codeGenBasePath + "/migration/migrationBase.py"; - if(! new File(migrationScript).exists()) - { - throw new SilecsException("The Migration Script: '" + migrationScript + "' does not exist. Please check your Eclipse-Silecs preferences!"); - } - } - - String newXMLSchema = MainPreferencePage.getModelBasePath(newVersion_) + "/"; - if ( project.hasNature(DesignProjectNature.NATURE_ID) ) - { - newXMLSchema += SilecsConstants.DESIGN_SCHEMA_XSD; - } - else if( project.hasNature(DeployProjectNature.NATURE_ID) ) - { - newXMLSchema += SilecsConstants.DEPLOY_SCHEMA_XSD; - } - else - throw new Exception("The project: " + project.getName() + " is not a silecs-project"); - - OSExecute.executeCommand("python", migrationScript, silecsDocumentPath, newXMLSchema, oldVersion_, newVersion_); - ConsoleHandler.printMessage("Updating Silecs Version from '" + oldVersion_ + "'to '" + newVersion_ + "'", false); - - monitor.beginTask("Updating Silecs Version " + project.getName(), 2); - - project.refreshLocal(IResource.DEPTH_INFINITE, null); - - monitor.worked(1); - } catch (Exception e) { - e.printStackTrace(); - ConsoleHandler.printError("Failed to update SILECS version of: " + project.getName(), true); - ConsoleHandler.printStackTrace(e); - return false; - } - - monitor.done(); - ConsoleHandler.printMessage( "Successfully updated SILECS version of: " + project.getName(), true); - return true; - - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/ValidationJob.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/job/ValidationJob.java deleted file mode 100644 index 35af12fa1dbcc98a0a6f6829afaeb9a6ee6ef7a8..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/job/ValidationJob.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.job; - -import java.io.File; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; -import org.eclipse.wst.xml.core.internal.document.AttrImpl; -import org.eclipse.wst.xml.core.internal.document.ElementImpl; -import org.eclipse.wst.xml.core.internal.document.NodeImpl; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; -import org.eclipse.xsd.XSDIdentityConstraintDefinition; -import org.eclipse.xsd.XSDXPathDefinition; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -import cern.silecs.control.validation.Validator; -import cern.silecs.model.document.SilecsDocumentError; -import cern.silecs.model.document.XmlBasedDocument; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.editor.XMLMultiPageEditor; -import cern.silecs.view.editor.internal.SchemaHelper; -import cern.silecs.view.marker.SilecsMarker; - -@SuppressWarnings("restriction") -public class ValidationJob extends BaseFileJob -{ - private static final String JOB_NAME = "silecs validation job"; - - public ValidationJob(IFile file) { - this(JOB_NAME, file); - - } - - public ValidationJob(String name, IFile file) { - super(name, file); - } - - @Override - public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { - boolean hasErros = false; - try - { - // monitor.beginTask(Messages.get(Message.VALIDATION_PROCESS) + " ...", silecsFiles.size() * 2); - monitor.beginTask("Validation Job", 1); - try - { - hasErros = !isValid(file, new SubProgressMonitor(monitor, 1)); - file.refreshLocal(IResource.DEPTH_ZERO, null); - } - catch (Exception e) - { - failures.put(file, e); - } - - return computeReturnStatus(); - } - finally - { - // Open problem view if there are some errors - if (hasErros) { - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - IWorkbenchPage activepage = PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getActivePage(); - IViewPart pbv = activepage.findView("org.eclipse.ui.views.ProblemView"); - if (pbv != null) { - activepage.bringToTop(pbv); - } - } - }); - } - - monitor.done(); - } - } - - protected boolean isValid(IFile silecsFile, IProgressMonitor monitor) { - IProgressMonitor mon = monitor; - if (mon == null) { - mon = new NullProgressMonitor(); - } - - try { - mon.beginTask("Validation", 1); - - List<SilecsDocumentError> errors = null; - - File file = new File(silecsFile.getLocationURI()); - - errors = Validator.validate(file); - - final XMLMultiPageEditor editor = XMLMultiPageEditor.getOpenedEditor(silecsFile); - - updateMarkers(silecsFile, errors, editor); - - // return true if document is valid - if (errors.isEmpty()) { - ConsoleHandler.printMessage("Document " + silecsFile.getName() + " is valid", true); - return true; - } - ConsoleHandler.printError("Document " + silecsFile.getName() + " is not valid", true); - return false; - } finally { - mon.done(); - } - } - - private void updateMarkers(IFile silecsFile, List<SilecsDocumentError> errors, XMLMultiPageEditor editor) { - // remove old markers - try - { - silecsFile.deleteMarkers(SilecsMarker.TYPE, false, IResource.DEPTH_ZERO); - } - catch (CoreException e) - { - ConsoleHandler.printStackTrace(e); - } - - for (SilecsDocumentError error : errors) - { - try - { - createMarker(silecsFile, error, editor); - } - catch (Exception e) - { - ConsoleHandler.printMessage("Could not create marker for " + error, true); - } - } - - } - - private IMarker createMarker(IFile file, SilecsDocumentError error, XMLMultiPageEditor editor) throws CoreException, SilecsException { - IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(file); - if (model instanceof IDOMModel) - { - try { - NodeImpl hintNode = null; - XmlBasedDocument xmlDocument = new XmlBasedDocument(((IDOMModel) model).getDocument()); - - if (error.xPath != null) - { - hintNode = (NodeImpl) xmlDocument.getSingleNode(error.xPath); - } - - // first try to get accurate not thanks to the schema - if (error.isIdentityConstraintError() && hintNode instanceof Element) { - XSDIdentityConstraintDefinition def = SchemaHelper.findIdentityConstraint((Element) hintNode, - error.violatedKey); - - // def = null can happen when eclipse has not finished to build the schema - if (def != null) { - List<Node> candidates = xmlDocument.getNodes(hintNode, def.getSelector().getValue()); - for (Node candidate : candidates) { - for (XSDXPathDefinition field : def.getFields()) { - List<Node> values = xmlDocument.getNodes(candidate, field.getValue()); - for (Node v : values) { - if ((v instanceof AttrImpl && ((AttrImpl) v).getValue() - .equals(error.incorrectValue)) - || (v instanceof Element) - && ((ElementImpl) v).getTextContent().equals(error.incorrectValue)) { - return SilecsMarker.create(file, error, (NodeImpl) v); - } - } - } - } - } - } - - // try to get the node thanks to the document position - if (editor != null) { - NodeImpl node = editor.getNodeAtPosition(error.lineNumber, error.columnNumber); - if (node != null) { - hintNode = node; - } - } - - // if fail, use the hint node found with the xpath provided by the validator - if (hintNode != null) { - return SilecsMarker.create(file, error, hintNode); - } - } - catch (SilecsException e) - { - ConsoleHandler.printMessage("Could not get precise location for marker: " + e.getMessage(), true); - throw e; - } - } - return SilecsMarker.create(file, error); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarker.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarker.java deleted file mode 100644 index ea12b390d142db5516ba5ba05f85ffcc8084180b..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarker.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.marker; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.xml.core.internal.document.NodeImpl; - -import cern.silecs.model.document.SilecsDocumentError; - -@SuppressWarnings("restriction") -public abstract class SilecsMarker { - -// private static final Logger LOGGER = LoggerFactory.getLogger(SilecsMarker.class); - - public static final String TYPE = "cern.silecs.view.marker"; - - public static final String NODE_ATTR = "node"; - - public static IMarker create(IFile file, SilecsDocumentError error, NodeImpl node) throws CoreException { - IMarker marker = create(file, error); - if (node != null) { - marker.setAttribute(IMarker.CHAR_START, node.getStartOffset()); - marker.setAttribute(IMarker.CHAR_END, node.getEndOffset()); - marker.setAttribute(NODE_ATTR, node); - } - - return marker; - } - - public static IMarker create(IFile file, SilecsDocumentError error) throws CoreException { - IMarker marker = file.createMarker(SilecsMarker.TYPE); - - marker.setAttribute(IMarker.MESSAGE, error.message); - marker.setAttribute(IMarker.LINE_NUMBER, error.lineNumber); - switch (error.level) { - case INFO: - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); - break; - case WARNING: - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING); - break; - default: - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); - break; - } - - return marker; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarkerUpdater.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarkerUpdater.java deleted file mode 100644 index ed8193fa31bb408db06e082ad16d73f22121a690..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/marker/SilecsMarkerUpdater.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.marker; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.Position; -import org.eclipse.ui.texteditor.IMarkerUpdater; - -public class SilecsMarkerUpdater implements IMarkerUpdater { - - @Override - public String getMarkerType() { - return SilecsMarker.TYPE; - } - - @Override - public String[] getAttribute() { - return null; - } - - @Override - public boolean updateMarker(IMarker marker, IDocument document, Position position) { - try { - int start = position.getOffset(); - int end = position.getOffset() + position.getLength(); - marker.setAttribute(IMarker.CHAR_START, start); - marker.setAttribute(IMarker.CHAR_END, end); - return true; - } catch (CoreException e) { - return false; - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/EditorPreferencePage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/EditorPreferencePage.java deleted file mode 100644 index 8ed40f1a98f0c2e29c1c01e7a895fd7dea9326cc..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/EditorPreferencePage.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.preferences; - -import org.eclipse.jface.preference.ColorSelector; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import cern.silecs.activator.Activator; - -public class EditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - -// // validate on save -// public static final String VALIDATE_ON_SAVE = "VALIDATE_ON_SAVE"; -// -// // colors -// public static final String EDITABLE_COLOR_R = "XML_EDITOR_COLOR_EDITABLE_R"; -// public static final String EDITABLE_COLOR_G = "XML_EDITOR_COLOR_EDITABLE_G"; -// public static final String EDITABLE_COLOR_B = "XML_EDITOR_COLOR_EDITABLE_B"; -// -// public static final String CONTENT_COLOR_R = "XML_EDITOR_COLOR_CONTENT_R"; -// public static final String CONTENT_COLOR_G = "XML_EDITOR_COLOR_CONTENT_G"; -// public static final String CONTENT_COLOR_B = "XML_EDITOR_COLOR_CONTENT_B"; -// -// // link documentation to the editor -// public static final String LINK_DOCUMENTATION = "DISPLAY_DOCUMENTATION"; -// public static final String BRING_DOCUMENTATION_TO_FRONT = "DOCUMENTATION_TO_FRONT"; -// -// public static final String SHOW_GENERATED = "SHOW_GENERATED"; -// -// // default theme -// public static final RGB DEFAULT_EDITABLE = new RGB(0, 0, 0); -// public static final RGB DEFAULT_CONTENT = new RGB(130, 170, 150); -// -// // ocean theme -// public static final RGB OCEAN_EDITABLE = new RGB(0, 0, 128); -// public static final RGB OCEAN_CONTENT = new RGB(0, 206, 209); -// -// // fire theme -// public static final RGB FIRE_EDITABLE = new RGB(205, 79, 57); -// public static final RGB FIRE_CONTENT = new RGB(205, 205, 0); -// -// private Button validationOnSave; -// -// private ColorSelector editableColorSelector; -// private ColorSelector contentColorSelector; -// -// private Button linkDocumentation; -// private Button bringDocumentationToFront; -// private Button showGeneratedContent; - - @Override - public void init(IWorkbench workbench) { - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Not yet available"); - } - - @Override - protected Control createContents(Composite parent) { - Composite container = new Composite(parent, SWT.NONE); -// -// IPreferenceStore prefs = getPreferenceStore(); -// - GridLayout layout = new GridLayout(1, false); - container.setLayout(layout); -// -// // validation options -// Group validationGroup = new Group(container, SWT.NONE); -// validationGroup.setText("Validation"); -// validationGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); -// layout = new GridLayout(1, false); -// validationGroup.setLayout(layout); -// validationOnSave = new Button(validationGroup, SWT.CHECK); -// validationOnSave.setText("Validate after Safe"); -// validationOnSave.setSelection(prefs.getBoolean(VALIDATE_ON_SAVE)); -// -// // color options -// Group colorGroup = new Group(container, SWT.NONE); -// colorGroup.setText("Colors"); -// colorGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); -// layout = new GridLayout(2, false); -// colorGroup.setLayout(layout); -// -// Label editableColorLabel = new Label(colorGroup, SWT.NONE); -// editableColorLabel.setText("Editable Text color"); -// -// contentColorSelector = new ColorSelector(colorGroup); -// RGB contentColor = new RGB(prefs.getInt(CONTENT_COLOR_R), prefs.getInt(CONTENT_COLOR_G), -// prefs.getInt(CONTENT_COLOR_B)); -// contentColorSelector.setColorValue(contentColor); -// -// Label contentColorLabel = new Label(colorGroup, SWT.NONE); -// contentColorLabel.setText("Content Text Color"); -// -// editableColorSelector = new ColorSelector(colorGroup); -// RGB editableColor = new RGB(prefs.getInt(EDITABLE_COLOR_R), prefs.getInt(EDITABLE_COLOR_G), -// prefs.getInt(EDITABLE_COLOR_B)); -// editableColorSelector.setColorValue(editableColor); -// -// Group buttonGroup = new Group(colorGroup, SWT.NONE); -// buttonGroup.setText("Color Scheme"); -// RowLayout buttonLayout = new RowLayout(SWT.HORIZONTAL); -// buttonLayout.marginLeft = 5; -// buttonLayout.marginRight = 5; -// buttonLayout.marginTop = 5; -// buttonLayout.marginBottom = 5; -// buttonLayout.spacing = 5; -// buttonLayout.pack = false; -// buttonLayout.justify = true; -// buttonGroup.setLayout(buttonLayout); -// GridData buttonGridData = new GridData(SWT.FILL, SWT.FILL, true, false); -// buttonGridData.horizontalSpan = 2; -// buttonGroup.setLayoutData(buttonGridData); -// -// -// Button defaultScheme = new Button(buttonGroup, SWT.PUSH); -// defaultScheme.setText("default"); -// -// Button oceanScheme = new Button(buttonGroup, SWT.PUSH); -// oceanScheme.setText("ocean"); -// -// Button fireScheme = new Button(buttonGroup, SWT.PUSH); -// fireScheme.setText("fire"); -// -// defaultScheme.addListener(SWT.Selection, new Listener() { -// -// @Override -// public void handleEvent(Event event) { -// contentColorSelector.setColorValue(DEFAULT_CONTENT); -// editableColorSelector.setColorValue(DEFAULT_EDITABLE); -// } -// }); -// -// oceanScheme.addListener(SWT.Selection, new Listener() { -// -// @Override -// public void handleEvent(Event event) { -// contentColorSelector.setColorValue(OCEAN_CONTENT); -// editableColorSelector.setColorValue(OCEAN_EDITABLE); -// } -// }); -// -// fireScheme.addListener(SWT.Selection, new Listener() { -// -// @Override -// public void handleEvent(Event event) { -// contentColorSelector.setColorValue(FIRE_CONTENT); -// editableColorSelector.setColorValue(FIRE_EDITABLE); -// } -// }); -// -// Group others = new Group(container, SWT.NONE); -// others.setText("Others"); -// others.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); -// layout = new GridLayout(1, false); -// others.setLayout(layout); -// linkDocumentation = new Button(others, SWT.CHECK); -// linkDocumentation.setText("Link Documentation"); -// linkDocumentation.setSelection(prefs.getBoolean(LINK_DOCUMENTATION)); -// bringDocumentationToFront = new Button(others, SWT.CHECK); -// bringDocumentationToFront.setText("Bring Documentation to Front"); -// bringDocumentationToFront.setSelection(prefs.getBoolean(BRING_DOCUMENTATION_TO_FRONT)); -// -// showGeneratedContent = new Button(others, SWT.CHECK); -// showGeneratedContent.setText("Show generated content"); -// showGeneratedContent.setSelection(prefs.getBoolean(SHOW_GENERATED)); -// - return container; - } -// - @Override - public boolean performOk() { -// IPreferenceStore prefs = getPreferenceStore(); -// -// RGB content = contentColorSelector.getColorValue(); -// RGB editable = editableColorSelector.getColorValue(); -// -// prefs.setValue(VALIDATE_ON_SAVE, validationOnSave.getSelection()); -// -// prefs.setValue(CONTENT_COLOR_R, content.red); -// prefs.setValue(CONTENT_COLOR_G, content.green); -// prefs.setValue(CONTENT_COLOR_B, content.blue); -// prefs.setValue(EDITABLE_COLOR_R, editable.red); -// prefs.setValue(EDITABLE_COLOR_G, editable.green); -// prefs.setValue(EDITABLE_COLOR_B, editable.blue); -// -// prefs.setValue(LINK_DOCUMENTATION, linkDocumentation.getSelection()); -// prefs.setValue(BRING_DOCUMENTATION_TO_FRONT, bringDocumentationToFront.getSelection()); -// prefs.setValue(SHOW_GENERATED, showGeneratedContent.getSelection()); -// - return true; - } - - @Override - protected void performDefaults() { -// validationOnSave.setSelection(true); -// -// contentColorSelector.setColorValue(DEFAULT_CONTENT); -// editableColorSelector.setColorValue(DEFAULT_EDITABLE); -// -// linkDocumentation.setSelection(true); -// bringDocumentationToFront.setSelection(false); -// showGeneratedContent.setSelection(false); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/LoggingPreferencePage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/LoggingPreferencePage.java deleted file mode 100644 index b10a026077dc3f1bb90d57f31969b21c3b30b1d6..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/LoggingPreferencePage.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.preferences; - -import java.io.File; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import cern.silecs.activator.Activator; - -public class LoggingPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - - public static final String[] LOG_LEVELS = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE", "OFF" }; - public static final int DEFAULT_LOG_LEVEL_INDEX = 3; - public static final String DEFAULT_LOG_DIRECTORY = System.getProperty("user.home") + "/.logs/fesa-plugin"; - - public static final String LOG_LEVEL = "fesaLog.level"; - public static final String LOG_DIRECTORY = "fesaLog.directory"; - public static final String BRING_CONSOLE_TO_FRONT = "CONSOLE_TO_FRONT"; - - private Combo logLevel; - private Text logDirectory; - - @Override - public void init(IWorkbench workbench) { - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("SILECS Logging"); - } - - @Override - protected Control createContents(Composite parent) { - IPreferenceStore prefs = getPreferenceStore(); - - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(3, false); - container.setLayout(layout); - - Label level = new Label(container, SWT.NONE); - level.setText("Log Level"); - logLevel = new Combo(container, SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); - logLevel.setItems(LOG_LEVELS); - logLevel.select(prefs.getInt(LOG_LEVEL)); - GridData dataLayout = new GridData(); - dataLayout.horizontalSpan = 2; - logLevel.setLayoutData(dataLayout); - - Label directory = new Label(container, SWT.NONE); - directory.setText("Log Directory"); - logDirectory = new Text(container, SWT.BORDER); - logDirectory.setText(prefs.getString(LOG_DIRECTORY)); - dataLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - logDirectory.setLayoutData(dataLayout); - - Button browse = new Button(container, SWT.PUSH); - browse.setText("browse"); - browse.addListener(SWT.Selection, new Listener() { - - @Override - public void handleEvent(Event event) { - DirectoryDialog dirDialog = new DirectoryDialog(getShell()); - logDirectory.setText(dirDialog.open()); - } - }); - - return container; - } - - @Override - public boolean performOk() { - IPreferenceStore prefs = getPreferenceStore(); - - int levelIndex = logLevel.getSelectionIndex(); - File logDir = new File(logDirectory.getText()); - - if (!logDir.isDirectory()) { - setErrorMessage("Invalid Path !" + logDir.getAbsolutePath()); - return false; - } - - prefs.setValue(LOG_LEVEL, levelIndex); - prefs.setValue(LOG_DIRECTORY, logDir.getAbsolutePath()); - - - return true; - } - - @Override - protected void performDefaults() { - logLevel.select(DEFAULT_LOG_LEVEL_INDEX); - logDirectory.setText(DEFAULT_LOG_DIRECTORY); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/MainPreferencePage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/MainPreferencePage.java deleted file mode 100644 index 20a9e8c95c539398c6a91c7d984a36ee26c717ab..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/MainPreferencePage.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.preferences; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import cern.silecs.activator.Activator; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.view.console.ConsoleHandler; - -public class MainPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { - - public static final String SILECS_DIRECTORY_TAG = "SILECS_DIRECTORY"; - public static final String FESA_DIRECTORY_TAG = "FESA_DIRECTORY"; - public static final String LOCAL_DIRECTORY_TAG = "LOCAL_DIRECTORY"; - public static final String USE_LOCAL_DIRECTORY_TAG = "USE_LOCAL_DIRECTORY"; - public static final String FESSA_VERSION_TAG = "FESA_VERSION"; - - public static final String SILECS_DIRECTORY_DEFAULT = "/common/usr/cscofe/silecs"; - public static final String FESA_DIRECTORY_DEFAULT = "/opt/fesa"; - public static final Boolean USE_LOCAL_DIRECTORY_DEFAULT = false; - - private static List<String> fesaVersions_ = readOutAvailableFesaVersions(); - - private static Text silecsDirectory; - private static Text fesaDirectory; - private static Button useLocalWorkspace; - private static Text localWorkspaceDirectory; - private static Combo fesaVersion; - - public static boolean isLocalDirectoryUsed() - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - return prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG); - } - - public static String getGlobalSilecsDirectory() - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - return prefs.getString(SILECS_DIRECTORY_TAG); - } - - public static String getModelBasePath(String modelVersion) - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - if(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)) - return prefs.getString(LOCAL_DIRECTORY_TAG) + "/silecs-model/src/xml"; - else - return prefs.getString(SILECS_DIRECTORY_TAG) + "/silecs-model/" + modelVersion + "/" + "xml"; - } - - public static String getCodeGenBasePath(String codegenVersion) - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - if(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)) - return prefs.getString(LOCAL_DIRECTORY_TAG) + "/silecs-codegen/src/xml"; - else - return prefs.getString(SILECS_DIRECTORY_TAG) + "/silecs-codegen/" + codegenVersion + "/" + "xml"; - } - - public static String getDiagToolBasePath(String diagToolVersion) - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - if(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)) - return prefs.getString(LOCAL_DIRECTORY_TAG) + "/silecs-diagnostic-cpp/build"; - else - return prefs.getString(SILECS_DIRECTORY_TAG) + "/silecs-diagnostic-cpp/" + diagToolVersion; - } - - public static String getSilecsLibraryBasePath(String silecsLibraryVersion) - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - if(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)) - return prefs.getString(LOCAL_DIRECTORY_TAG) + "/silecs-communication-cpp/build"; - else - return prefs.getString(SILECS_DIRECTORY_TAG) + "/silecs-communication-cpp/" + silecsLibraryVersion; - } - - public static String getSNAP7LibraryBasePath(String silecsLibraryVersion) - { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - if(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)) - return prefs.getString(LOCAL_DIRECTORY_TAG) + "/snap7/snap7-full/build"; - else - return prefs.getString(SILECS_DIRECTORY_TAG) + "/snap7/" + silecsLibraryVersion; - } - - public static String getFESAVersion() throws SilecsException - { - int index = Activator.getDefault().getPreferenceStore().getInt(FESSA_VERSION_TAG); - return fesaVersions_.get(index); - } - - public static File[] getFESADesignTemplates() throws SilecsException - { - return getFESATemplates("design"); - } - - public static File[] getFESADeployUnitTemplates() throws SilecsException - { - return getFESATemplates("deployment"); - } - - public static String getFESADeployUnitSchemaPath() throws SilecsException - { - String fesaBaseDirectory = Activator.getDefault().getPreferenceStore().getString(FESA_DIRECTORY_TAG); - return new String(fesaBaseDirectory + "/fesa-model-gsi/" + getFESAVersion() + "/xml/deployment/deployment-gsi.xsd"); - } - - public static String getFESADesignSchemaPath() throws SilecsException - { - String fesaBaseDirectory = Activator.getDefault().getPreferenceStore().getString(FESA_DIRECTORY_TAG); - return new String(fesaBaseDirectory + "/fesa-model-gsi/" + getFESAVersion() + "/xml/design/design-gsi.xsd"); - } - - protected static File[] getFESATemplates(String type) throws SilecsException - { - String fesaBaseDirectory = Activator.getDefault().getPreferenceStore().getString(FESA_DIRECTORY_TAG); - File folderModel = new File(fesaBaseDirectory + "/fesa-model/" + getFESAVersion() + "/xml/" + type + "/templates"); - File folderModelGSI = new File(fesaBaseDirectory + "/fesa-model-gsi/" + getFESAVersion() + "/xml/" + type + "/templates"); - - File[] templatesModel = folderModel.listFiles(); - if( templatesModel == null) - templatesModel = new File[0]; - - File[] templatesModelGSI = folderModelGSI.listFiles(); - if( templatesModelGSI == null) - templatesModelGSI = new File[0]; - - if ( (templatesModel.length + templatesModelGSI.length) == 0 ) - { - ConsoleHandler.printMessage("Template search folder 1: " + folderModel.getPath(), true); - ConsoleHandler.printMessage("Template search folder 2: " + folderModelGSI.getPath(), true); - throw new SilecsException("No templates found there! Please fix the 'FESA Base Path' in the Preferences!"); - } - File[] templates= new File[templatesModel.length+templatesModelGSI.length]; - System.arraycopy(templatesModel, 0, templates, 0, templatesModel.length); - System.arraycopy(templatesModelGSI, 0, templates, templatesModel.length, templatesModelGSI.length); - return templates; - } - - public static String getLocalDirectoryDefault() - { - return System.getProperty("user.home") + "/workspace"; - } - - @Override - protected void createFieldEditors() - { - // TODO Auto-generated method stub - } - - @Override - public void init(IWorkbench workbench) - { - setDescription("SILECS Preferences"); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - } - - protected void switchEnableLocalWorkspace(Boolean localEnabled) - { - fesaDirectory.setEnabled(true);//to stay backward -compartible - silecsDirectory.setEnabled(!localEnabled); - localWorkspaceDirectory.setEnabled(localEnabled); - } - - public static List<String> getAllFesaVersions() - { - return fesaVersions_; - } - - protected static List<String> readOutAvailableFesaVersions() - { - String fesaModelDirectory = Activator.getDefault().getPreferenceStore().getString(FESA_DIRECTORY_TAG) + "/fesa-model-gsi"; - File fesaBaseFolder = new File(fesaModelDirectory); - - List<String> fesaVersions = new ArrayList<String>(); - for (final File fileEntry : fesaBaseFolder.listFiles()) - { - fesaVersions.add(fileEntry.getName()); - } - Collections.sort(fesaVersions); - Collections.reverse(fesaVersions); - return fesaVersions; - } - - @Override - protected Control createContents(Composite parent) - { - IPreferenceStore prefs = getPreferenceStore(); - - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(3, false); - container.setLayout(layout); - - GridData dataLayout = new GridData(); - dataLayout.horizontalSpan = 2; - - { // fesa base - Label directory = new Label(container, SWT.NONE); - directory.setText("FESA Base Path"); - fesaDirectory = new Text(container, SWT.BORDER); - fesaDirectory.setText(prefs.getString(FESA_DIRECTORY_TAG)); - dataLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - fesaDirectory.setLayoutData(dataLayout); - - Button browse = new Button(container, SWT.PUSH); - browse.setText("browse"); - browse.addListener(SWT.Selection, new Listener() { - - @Override - public void handleEvent(Event event) { - DirectoryDialog dirDialog = new DirectoryDialog(getShell()); - fesaDirectory.setText(dirDialog.open()); - } - }); - } - - { // FESA version - Label level = new Label(container, SWT.NONE); - level.setText("FESA Version to use"); - fesaVersion = new Combo(container, SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); - fesaVersion.setItems(fesaVersions_.toArray(new String[fesaVersions_.size()])); - fesaVersion.select(prefs.getInt(FESSA_VERSION_TAG)); - dataLayout = new GridData(); - dataLayout.horizontalSpan = 2; - fesaVersion.setLayoutData(dataLayout); - } - - { // silecs base - Label directory = new Label(container, SWT.NONE); - directory.setText("SILECS Base Path"); - silecsDirectory = new Text(container, SWT.BORDER); - silecsDirectory.setText(prefs.getString(SILECS_DIRECTORY_TAG)); - dataLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - silecsDirectory.setLayoutData(dataLayout); - - Button browse = new Button(container, SWT.PUSH); - browse.setText("browse"); - browse.addListener(SWT.Selection, new Listener() { - - @Override - public void handleEvent(Event event) { - DirectoryDialog dirDialog = new DirectoryDialog(getShell()); - silecsDirectory.setText(dirDialog.open()); - } - }); - } - - useLocalWorkspace = new Button(container, SWT.CHECK); - useLocalWorkspace.setText("Use local workspace"); - dataLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - dataLayout.horizontalSpan = 3; - useLocalWorkspace.setLayoutData(dataLayout); - useLocalWorkspace.setSelection(prefs.getBoolean(USE_LOCAL_DIRECTORY_TAG)); - useLocalWorkspace.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event event) { - switchEnableLocalWorkspace(useLocalWorkspace.getSelection()); - } - }); - - { // Local SILECS Workspace - Label directory = new Label(container, SWT.NONE); - directory.setText("Local SILECS Workspace"); - localWorkspaceDirectory = new Text(container, SWT.BORDER); - localWorkspaceDirectory.setText(prefs.getString(LOCAL_DIRECTORY_TAG)); - dataLayout = new GridData(SWT.FILL, SWT.TOP, true, false); - localWorkspaceDirectory.setLayoutData(dataLayout); - - Button browse = new Button(container, SWT.PUSH); - browse.setText("browse"); - browse.addListener(SWT.Selection, new Listener() { - - @Override - public void handleEvent(Event event) { - DirectoryDialog dirDialog = new DirectoryDialog(getShell()); - localWorkspaceDirectory.setText(dirDialog.open()); - } - }); - } - - switchEnableLocalWorkspace(useLocalWorkspace.getSelection()); - return container; - } - - @Override - public boolean performOk() - { - IPreferenceStore prefs = getPreferenceStore(); - prefs.setValue(SILECS_DIRECTORY_TAG, silecsDirectory.getText()); - prefs.setValue(FESA_DIRECTORY_TAG, fesaDirectory.getText()); - prefs.setValue(USE_LOCAL_DIRECTORY_TAG, useLocalWorkspace.getSelection()); - prefs.setValue(LOCAL_DIRECTORY_TAG, localWorkspaceDirectory.getText()); - prefs.setValue(FESSA_VERSION_TAG, fesaVersion.getSelectionIndex()); - return true; - } - - @Override - protected void performDefaults() - { - silecsDirectory.setText(SILECS_DIRECTORY_DEFAULT); - fesaDirectory.setText(FESA_DIRECTORY_DEFAULT); - useLocalWorkspace.setSelection(USE_LOCAL_DIRECTORY_DEFAULT); - localWorkspaceDirectory.setText(MainPreferencePage.getLocalDirectoryDefault()); - localWorkspaceDirectory.setEnabled(false); - fesaVersion.select(0); - switchEnableLocalWorkspace(useLocalWorkspace.getSelection()); - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/PreferenceInitializer.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/PreferenceInitializer.java deleted file mode 100644 index f82a6d2f08afb9403752163df1641ff970c96002..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.preferences; - - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.swt.graphics.RGB; - -import cern.silecs.activator.Activator; - - -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - @Override - public void initializeDefaultPreferences() { - IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); - - prefs.setDefault(MainPreferencePage.SILECS_DIRECTORY_TAG, MainPreferencePage.SILECS_DIRECTORY_DEFAULT); - prefs.setDefault(MainPreferencePage.FESA_DIRECTORY_TAG, MainPreferencePage.FESA_DIRECTORY_DEFAULT); - prefs.setDefault(MainPreferencePage.LOCAL_DIRECTORY_TAG, MainPreferencePage.getLocalDirectoryDefault()); - prefs.setDefault(MainPreferencePage.USE_LOCAL_DIRECTORY_TAG, MainPreferencePage.USE_LOCAL_DIRECTORY_DEFAULT); - - // init the xml editor preferences -// prefs.setDefault(EditorPreferencePage.VALIDATE_ON_SAVE, true); -// -// RGB dflt = EditorPreferencePage.DEFAULT_EDITABLE; -// prefs.setDefault(EditorPreferencePage.EDITABLE_COLOR_R, dflt.red); -// prefs.setDefault(EditorPreferencePage.EDITABLE_COLOR_G, dflt.green); -// prefs.setDefault(EditorPreferencePage.EDITABLE_COLOR_B, dflt.blue); -// -// dflt = EditorPreferencePage.DEFAULT_CONTENT; -// prefs.setDefault(EditorPreferencePage.CONTENT_COLOR_R, dflt.red); -// prefs.setDefault(EditorPreferencePage.CONTENT_COLOR_G, dflt.green); -// prefs.setDefault(EditorPreferencePage.CONTENT_COLOR_B, dflt.blue); -// -// prefs.setDefault(EditorPreferencePage.LINK_DOCUMENTATION, true); -// prefs.setDefault(EditorPreferencePage.BRING_DOCUMENTATION_TO_FRONT, false); -// prefs.setDefault(EditorPreferencePage.SHOW_GENERATED, false); - - // logging preferences - prefs.setDefault(LoggingPreferencePage.LOG_LEVEL, LoggingPreferencePage.DEFAULT_LOG_LEVEL_INDEX); - prefs.setDefault(LoggingPreferencePage.LOG_DIRECTORY, LoggingPreferencePage.DEFAULT_LOG_DIRECTORY); - prefs.setDefault(LoggingPreferencePage.BRING_CONSOLE_TO_FRONT, true); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/GenerateCodeWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/GenerateCodeWizard.java deleted file mode 100644 index 05ab3ed3cbd275fb0ff7e0bed0c834cea0ec819f..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/GenerateCodeWizard.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.wizard.Wizard; - -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.wizards.page.PickTemplatePage; - -public class GenerateCodeWizard extends Wizard -{ - private File[] templates; - File choice = null; - PickTemplatePage page; - - public GenerateCodeWizard(File[] templateFiles) { - super(); - setWindowTitle("Pick a template"); - templates = templateFiles; - } - - @Override - public void addPages() { - super.addPages(); - - List<String> templateNames = new ArrayList<String>(); - for( File file : templates) - { - templateNames.add(file.getName()); - } - String[] simpleArray = new String[ templateNames.size() ]; - page = new PickTemplatePage("Pick a template",templateNames.toArray(simpleArray)); - addPage(page); - } - - public File getChoice() - { - return choice; - } - - @Override - public boolean performFinish() { - String template = page.getTemplate(); - //ConsoleHandler.printMessage("template selected: " + template , true); - for( File file : templates) - { - //ConsoleHandler.printMessage("file available: " + file.getName() , true); - if( file.getName().equals(template)) - choice = file; - } - //ConsoleHandler.printMessage("choice full path: " + choice.getAbsolutePath() , true); - return true; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDeployFileWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDeployFileWizard.java deleted file mode 100644 index 496d5b7eafb87898d5a35a69c44e6a725174bf6f..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDeployFileWizard.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.wizard.Wizard; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.utils.XmlUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.wizards.page.ChooseFilePage; -import cern.silecs.view.wizards.page.SilecsProjectPage; - -public class ImportDeployFileWizard extends Wizard { - - private ChooseFilePage firstPage; - private SilecsProjectPage secondPage; - - public ImportDeployFileWizard() { - setWindowTitle("Import Deploy-Unit File Wizard"); - } - - @Override - public void addPages() { - super.addPages(); - - firstPage = new ChooseFilePage("Import Deploy-Unit file to workspace", SilecsConstants.ProjectType.DEPLOY_PROJECT); - secondPage = new SilecsProjectPage("Import Deploy-Unit file to workspace", - SilecsConstants.ProjectType.DEPLOY_PROJECT, - "Enter new deploy-unit name", - "Enter new deploy-unit version"); - - addPage(firstPage); - addPage(secondPage); - } - - @Override - public boolean performFinish() { - try { - ConsoleHandler.clear(); - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - - String newDeployName = secondPage.getprojectNameText(); - IProject project = workspaceRoot.getProject(newDeployName); - - XmlUtils.reloadDependencies(); - - IProgressMonitor monitor = new NullProgressMonitor(); - DeployProjectNature.addDeployNature(project, monitor); - - SilecsUtils.openInEditor(SilecsUtils.getSilecsDeployFile(project)); - } catch (Exception e) { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - } - - return true; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDesignFileWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDesignFileWizard.java deleted file mode 100644 index 76afc4082962c114ccfcbaf8bb4b417667b535dd..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/ImportDesignFileWizard.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.wizard.Wizard; - -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.wizards.page.ChooseFilePage; -import cern.silecs.view.wizards.page.SilecsProjectPage; - -public class ImportDesignFileWizard extends Wizard { - - private ChooseFilePage firstPage; - private SilecsProjectPage secondPage; - - public ImportDesignFileWizard() { - setWindowTitle("Import Design File Wizard"); - } - - @Override - public void addPages() { - super.addPages(); - - firstPage = new ChooseFilePage("Import Design file to workspace", SilecsConstants.ProjectType.DESIGN_PROJECT); - secondPage = new SilecsProjectPage("Set Design properties", - SilecsConstants.ProjectType.DESIGN_PROJECT, - "Enter new deploy-unit name", - "Enter new deploy-unit version"); - - addPage(firstPage); - addPage(secondPage); - } - - @Override - public boolean performFinish() { - try { - ConsoleHandler.clear(); - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - - String designName = secondPage.getprojectNameText(); - IProject project = workspaceRoot.getProject(designName); - - IProgressMonitor monitor = new NullProgressMonitor(); - DesignProjectNature.addClassNature(project, monitor); - - SilecsUtils.openInEditor(SilecsUtils.getSilecsDesignFile(project)); - - } catch (Exception e) { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - } - return true; - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDeployWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDeployWizard.java deleted file mode 100644 index 4cde66a16cc379ede5a955acaad0bb26ca40b11c..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDeployWizard.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; - -import java.io.File; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; - -import cern.silecs.control.core.DeployProjectNature; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.utils.XmlUtils; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; -import cern.silecs.view.wizards.page.SilecsProjectPage; - -public class NewSilecsDeployWizard extends Wizard implements INewWizard -{ - - SilecsProjectPage page; - - public NewSilecsDeployWizard() { - super(); - setWindowTitle(SilecsConstants.NEW_DEPLOY_WIZARD_TITLE); - } - - @Override - public void addPages() { - super.addPages(); - page = new SilecsProjectPage(SilecsConstants.NEW_DEPLOY_PAGE_TITLE, - SilecsConstants.ProjectType.DEPLOY_PROJECT, - "Enter deploy-unit name", - "Enter silecs version"); - addPage(page); - } - - @Override - public boolean performFinish() - { - try - { - ConsoleHandler.clear(); - String deployName = page.getprojectNameText(); - String silecsVersion = page.getsilecsVersionText(); - String deploySchema = MainPreferencePage.getModelBasePath(silecsVersion) + "/" + SilecsConstants.DEPLOY_SCHEMA_XSD; - if(! new File(deploySchema).exists()) - { - throw new SilecsException("The Deploy Schema: '" + deploySchema + "' does not exist. Please check your Eclipse-Silecs preferences!"); - } - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - String workspacePath = workspaceRoot.getLocation().toFile().getPath(); - - IProject project = workspaceRoot.getProject(deployName); - OSExecute.executePython("iefiles","newDeployProject",silecsVersion,new String[]{workspacePath, deployName,deploySchema,silecsVersion}); - XmlUtils.reloadDependencies(); - - IFile deployFile = SilecsUtils.getSilecsDeployFile(project); - - IProgressMonitor monitor = new NullProgressMonitor(); - //project.create(monitor); - //DeployProjectNature.addDeployNature(project, monitor); TODO: No idea why this does not work - - IProjectDescription description = project.getWorkspace().newProjectDescription(project.getName()); - String[] newNatures = new String[1]; - newNatures[0] = DeployProjectNature.NATURE_ID; - description.setNatureIds(newNatures); - - project.create(description, null); - - project.open(IResource.FORCE, monitor); - - SilecsUtils.openInEditor(deployFile); - } - catch (Exception e) - { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - } - return true; - } - - @Override - public void init(IWorkbench arg0, IStructuredSelection arg1) { - // TODO Auto-generated method stub - - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDesignWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDesignWizard.java deleted file mode 100644 index 7d915f52faa27725d734b9aecd67ad845d7a8c2f..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/NewSilecsDesignWizard.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; - -import java.io.File; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; - -import cern.silecs.control.core.DesignProjectNature; -import cern.silecs.model.exception.SilecsException; -import cern.silecs.utils.OSExecute; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.utils.SilecsConstants; -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.preferences.MainPreferencePage; -import cern.silecs.view.wizards.page.SilecsProjectPage; - -public class NewSilecsDesignWizard extends Wizard implements INewWizard{ - - SilecsProjectPage page; - - public NewSilecsDesignWizard() { - super(); - setWindowTitle(SilecsConstants.NEW_DESIGN_WIZARD_TITLE); - } - - @Override - public void addPages() { - super.addPages(); - - page = new SilecsProjectPage(SilecsConstants.NEW_DESIGN_PAGE_TITLE, - SilecsConstants.ProjectType.DESIGN_PROJECT, - "Enter design name", - "Enter silecs version"); - - addPage(page); - } - - @Override - public boolean performFinish() - { - try - { - ConsoleHandler.clear(); - String designName = page.getprojectNameText(); - String silecsVersion = page.getsilecsVersionText(); - String designSchema = MainPreferencePage.getModelBasePath(silecsVersion) + "/" +SilecsConstants.DESIGN_SCHEMA_XSD; - - if(! new File(designSchema).exists()) - { - throw new SilecsException("The Design Schema: '" + designSchema + "' does not exist. Please check your Eclipse-Silecs preferences!"); - } - - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - String workspacePath = workspaceRoot.getLocation().toFile().getPath(); - - IProject project = workspaceRoot.getProject(designName); - OSExecute.executePython("iefiles","newDesignProject",silecsVersion, new String[]{workspacePath, designName, designSchema, silecsVersion}); - - IFile designFile = SilecsUtils.getSilecsDesignFile(project); - - - IProgressMonitor monitor = new NullProgressMonitor(); - //project.create(monitor); - - IProjectDescription description = project.getWorkspace().newProjectDescription(project.getName()); - String[] newNatures = new String[1]; - newNatures[0] = DesignProjectNature.NATURE_ID; - description.setNatureIds(newNatures); - - project.create(description, null); - - project.open(IResource.FORCE, monitor); - //DesignProjectNature.addClassNature(project, monitor); TODO: No idea why this does not work - SilecsUtils.openInEditor(designFile); - } - catch (Exception e) - { - e.printStackTrace(); - ConsoleHandler.printStackTrace(e); - } - return true; - } - - @Override - public void init(IWorkbench arg0, IStructuredSelection arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/UpdateSilecsProjectWizard.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/UpdateSilecsProjectWizard.java deleted file mode 100644 index 2de9a3eff1ea63d1faac6e747630f70b7a895755..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/UpdateSilecsProjectWizard.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards; - -import org.eclipse.jface.wizard.Wizard; - -import cern.silecs.view.console.ConsoleHandler; -import cern.silecs.view.wizards.page.PickVersionPage; - -public class UpdateSilecsProjectWizard extends Wizard -{ - String selectedVersion; - PickVersionPage page; - - public UpdateSilecsProjectWizard() { - super(); - setWindowTitle("Pick a version"); - } - - @Override - public void addPages() { - super.addPages(); - page = new PickVersionPage("Select the new SILECS version"); - addPage(page); - } - - public String getSelectedVersion() - { - return selectedVersion; - } - - @Override - public boolean performFinish() { - ConsoleHandler.clear(); - selectedVersion = page.getsilecsVersionText(); - ConsoleHandler.printMessage("selected version: " + selectedVersion , true); - return true; - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/ChooseFilePage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/ChooseFilePage.java deleted file mode 100644 index 0f26be830db2ecf8640ed8e906abc0380f3c78f4..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/ChooseFilePage.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards.page; - - -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.PlatformUI; - -import cern.silecs.utils.SilecsConstants; - -public class ChooseFilePage extends WizardPage{ - - private Composite container; - - private Text filePathText; - - private SilecsConstants.ProjectType projectType; - - /** - * @param pageName - */ - public ChooseFilePage(String pageName, SilecsConstants.ProjectType type) { - super(pageName); - setTitle(pageName); - - projectType = type; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 3; - - Label classNameLabel = new Label(container, SWT.NONE); - classNameLabel.setText("Enter file path"); - - filePathText = new Text(container, SWT.BORDER | SWT.SINGLE); - filePathText.setText(""); - filePathText.addModifyListener(new ModifyListener() { - - @Override - public void modifyText(ModifyEvent e) { - setErrorMessage(null); - setMessage(null, IMessageProvider.WARNING); - setPageComplete(true); - - saveProjectData(); - } - }); - - Button locateFileButton = new Button(container, SWT.NONE); - locateFileButton.setText("Select file"); - locateFileButton.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterPath(ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath()); - filePathText.setText(dialog.open()); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - // do nothing - } - }); - - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - filePathText.setLayoutData(gd); - - setControl(container); - setPageComplete(false); - } - - public String getFilePath() { - return filePathText.getText(); - } - - protected void saveProjectData() { - try { - String originalFilePath = filePathText.getText(); - - switch(projectType) { - case DESIGN_PROJECT: - int dotAfterDesignName = originalFilePath.lastIndexOf('.'); - String designName = originalFilePath.substring(0, dotAfterDesignName); - int dotBeforeDesignName = designName.lastIndexOf('.'); - designName = designName.substring(dotBeforeDesignName); - ((SilecsProjectPage) getNextPage()).setprojectNameText(designName); - break; - - case DEPLOY_PROJECT: - int dotAfterDUName = originalFilePath.lastIndexOf('.'); - String deployName = originalFilePath.substring(0, dotAfterDUName); - int dotBeforeDUName = deployName.lastIndexOf('.'); - deployName = deployName.substring(dotBeforeDUName); - ((SilecsProjectPage) getNextPage()).setprojectNameText(deployName); - break; - } - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickTemplatePage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickTemplatePage.java deleted file mode 100644 index aa99505c3f8bc5465de61f9f652e822017a949a2..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickTemplatePage.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards.page; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; - -public class PickTemplatePage extends WizardPage{ - - private String[] templates; - private Composite container; - private Combo templatePicker; - - /** - * @param pageName - */ - public PickTemplatePage(String pageName, String[] templateNames) { - super(pageName); - setTitle(pageName); - templates = templateNames; - } - - @Override - public void createControl(Composite parent) { - container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 1; - - templatePicker = new Combo(container, SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); - templatePicker.setItems(templates); - templatePicker.select(0); - GridData dataLayout = new GridData(); - dataLayout.horizontalSpan = 1; - templatePicker.setLayoutData(dataLayout); - setControl(container); - } - - public String getTemplate() { - return templatePicker.getText(); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickVersionPage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickVersionPage.java deleted file mode 100644 index 0326bee9c616178e900bbd7153a9516b0b1d5b51..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/PickVersionPage.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards.page; - -import java.util.List; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; - -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 cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.SilecsUtils; - -public class PickVersionPage extends WizardPage { - - private Combo silecsVersionText; - private String silecsVersionDescription; - - public PickVersionPage(String pageName) - { - super(pageName); - setTitle(pageName); - silecsVersionDescription = "New silecs version"; - } - - @Override - public void createControl(Composite parent) - { - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label classVersionLabel = new Label(container, SWT.NONE); - classVersionLabel.setText(silecsVersionDescription); - - silecsVersionText = new Combo(container, SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); - List<String> availableSilecsVersions = SilecsUtils.readOutAvailableSilecsVersions(); - availableSilecsVersions.addAll(SilecsConstants.ADDITIONAL_SILECS_TARGET_MIGRATION_VERSIONS); - silecsVersionText.setItems(availableSilecsVersions.toArray(new String[availableSilecsVersions.size()])); - silecsVersionText.select(SilecsConstants.DEFAULT_SILECS_VERSION_INDEX); - GridData dataLayout = new GridData(); - dataLayout.horizontalSpan = 2; - silecsVersionText.setLayoutData(dataLayout); - - // required to avoid an error in the system - setControl(container); - setPageComplete(true); - } - - public String getsilecsVersionText() { - return silecsVersionText.getText(); - } -} diff --git a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/SilecsProjectPage.java b/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/SilecsProjectPage.java deleted file mode 100644 index 61a31e3b8b6599a738315d45b0a108d182793091..0000000000000000000000000000000000000000 --- a/silecs-eclipse-plugin/src/java/cern/silecs/view/wizards/page/SilecsProjectPage.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2016 CERN and GSI -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -package cern.silecs.view.wizards.page; - -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -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.swt.widgets.Text; - -import cern.silecs.utils.SilecsConstants; -import cern.silecs.utils.SilecsUtils; -import cern.silecs.view.preferences.MainPreferencePage; - -public class SilecsProjectPage extends WizardPage { - - private Text projectNameText; - private String projectNameDescription; - - private Combo silecsVersionText; - private String silecsVersionDescription; - - private String projectNamePattern; - private int maxNameLength; - - - private class PatternMatcherListener implements ModifyListener{ - - @Override - public void modifyText(ModifyEvent e) { - String name = projectNameText.getText(); - setErrorMessage(null); - setMessage(null, IMessageProvider.WARNING); - setPageComplete(true); - - if (!name.matches(projectNamePattern)) { - setErrorMessage(SilecsConstants.INVAILD_PROJECT_NAME + "\n" + projectNamePattern); - setPageComplete(false); - } else if(name.length() > maxNameLength) { - setErrorMessage("Name cannot be longer than " + maxNameLength + " characters"); - setPageComplete(false); - } else if (workspaceContainsProject(projectNameText.getText())) { - setErrorMessage("Project with this name already exists in the workspace"); - setPageComplete(false); - } - } - - } - - /** - * @param pageName - * @param projectNameLabelDescryption For example "Enter project name:" - * @param projectVersionLabelDescryption - * @param type - */ - public SilecsProjectPage(String pageName, SilecsConstants.ProjectType type, String projectNameLabelDescryption, - String silecsVersionLabelDescryption) { - super("New Silecs Project Page"); - setTitle(pageName); - - projectNameDescription = projectNameLabelDescryption; - silecsVersionDescription = silecsVersionLabelDescryption; - - if (type == SilecsConstants.ProjectType.DEPLOY_PROJECT) { - projectNamePattern = SilecsConstants.DEPLOY_PATTERN; - maxNameLength = SilecsConstants.MAX_DEPLOY_LENGTH; - } - else if (type == SilecsConstants.ProjectType.DESIGN_PROJECT) { - projectNamePattern = SilecsConstants.DESIGN_PATTERN; - maxNameLength = SilecsConstants.MAX_DESIGN_LENGTH; - } - } - - - @Override - public void createControl(Composite parent) { - Composite container = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 2; - - Label classNameLabel = new Label(container, SWT.NONE); - classNameLabel.setText(projectNameDescription); - - projectNameText = new Text(container, SWT.BORDER | SWT.SINGLE); - projectNameText.setText(""); - projectNameText.addModifyListener(new PatternMatcherListener()); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - projectNameText.setLayoutData(gd); - - Label classVersionLabel = new Label(container, SWT.NONE); - classVersionLabel.setText(silecsVersionDescription); - - silecsVersionText = new Combo(container, SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); - List<String> availableSilecsVersions = SilecsUtils.readOutAvailableSilecsVersions(); - silecsVersionText.setItems(availableSilecsVersions.toArray(new String[availableSilecsVersions.size()])); - silecsVersionText.select(SilecsConstants.DEFAULT_SILECS_VERSION_INDEX); - GridData dataLayout = new GridData(); - dataLayout.horizontalSpan = 2; - silecsVersionText.setLayoutData(dataLayout); - - // required to avoid an error in the system - setControl(container); - setPageComplete(false); - } - - public String getprojectNameText() { - return projectNameText.getText(); - } - - public String getsilecsVersionText() { - return silecsVersionText.getText(); - } - - public void setprojectNameText(String text) { - projectNameText.setText(text); - } - - public void setsilecsVersionText(String text) { - silecsVersionText.setText(text); - } - - private boolean workspaceContainsProject(String name) { - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IProject project = workspaceRoot.getProject(name); - return project.exists(); - } -} diff --git a/snap7/.gitignore b/snap7/.gitignore index 77dde58da0c40cb32d6c72ee919b4574ef5c2bdb..07cc7ee8b748f8b795cdfc33645efd42e8048b70 100644 --- a/snap7/.gitignore +++ b/snap7/.gitignore @@ -1 +1,2 @@ -snap7-full/ \ No newline at end of file +snap7-full/ +/snap7-full-1.4.0.tar.gz