This was required by the Eclipse team as one precondition for the next release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>tags/V1_9_7
Per: https://www.eclipse.org/legal/epl-v10.html | |||||
Per: https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
Eclipse Public License - v 1.0 | |||||
Eclipse Public License - v 2.0 | |||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC | |||||
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM | |||||
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. | |||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE | |||||
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION | |||||
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. | |||||
1. DEFINITIONS | 1. DEFINITIONS | ||||
"Contribution" means: | "Contribution" means: | ||||
a) in the case of the initial Contributor, the initial code and documentation | |||||
distributed under this Agreement, and | |||||
b) in the case of each subsequent Contributor: | |||||
i) changes to the Program, and | |||||
ii) additions to the Program; | |||||
where such changes and/or additions to the Program originate from and are | |||||
distributed by that particular Contributor. A Contribution 'originates' from a | |||||
Contributor if it was added to the Program by such Contributor itself or | |||||
anyone acting on such Contributor's behalf. Contributions do not include | |||||
additions to the Program which: (i) are separate modules of software | |||||
distributed in conjunction with the Program under their own license agreement, | |||||
and (ii) are not derivative works of the Program. | |||||
"Contributor" means any person or entity that distributes the Program. | |||||
a) in the case of the initial Contributor, the initial content | |||||
Distributed under this Agreement, and | |||||
"Licensed Patents" mean patent claims licensable by a Contributor which are | |||||
necessarily infringed by the use or sale of its Contribution alone or when | |||||
combined with the Program. | |||||
b) in the case of each subsequent Contributor: | |||||
i) changes to the Program, and | |||||
ii) additions to the Program; | |||||
where such changes and/or additions to the Program originate from | |||||
and are Distributed by that particular Contributor. A Contribution | |||||
"originates" from a Contributor if it was added to the Program by | |||||
such Contributor itself or anyone acting on such Contributor's behalf. | |||||
Contributions do not include changes or additions to the Program that | |||||
are not Modified Works. | |||||
"Program" means the Contributions distributed in accordance with this Agreement. | |||||
"Contributor" means any person or entity that Distributes the Program. | |||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. | |||||
"Licensed Patents" mean patent claims licensable by a Contributor which | |||||
are necessarily infringed by the use or sale of its Contribution alone | |||||
or when combined with the Program. | |||||
"Program" means the Contributions Distributed in accordance with this | |||||
Agreement. | |||||
"Recipient" means anyone who receives the Program under this Agreement | |||||
or any Secondary License (as applicable), including Contributors. | |||||
"Derivative Works" shall mean any work, whether in Source Code or other | |||||
form, that is based on (or derived from) the Program and for which the | |||||
editorial revisions, annotations, elaborations, or other modifications | |||||
represent, as a whole, an original work of authorship. | |||||
"Modified Works" shall mean any work in Source Code or other form that | |||||
results from an addition to, deletion from, or modification of the | |||||
contents of the Program, including, for purposes of clarity any new file | |||||
in Source Code form that contains any contents of the Program. Modified | |||||
Works shall not include works that contain only declarations, | |||||
interfaces, types, classes, structures, or files of the Program solely | |||||
in each case in order to link to, bind by name, or subclass the Program | |||||
or Modified Works thereof. | |||||
"Distribute" means the acts of a) distributing or b) making available | |||||
in any manner that enables the transfer of a copy. | |||||
"Source Code" means the form of a Program preferred for making | |||||
modifications, including but not limited to software source code, | |||||
documentation source, and configuration files. | |||||
"Secondary License" means either the GNU General Public License, | |||||
Version 2.0, or any later versions of that license, including any | |||||
exceptions or additional permissions as identified by the initial | |||||
Contributor. | |||||
2. GRANT OF RIGHTS | 2. GRANT OF RIGHTS | ||||
a) Subject to the terms of this Agreement, each Contributor hereby grants | |||||
Recipient a non-exclusive, worldwide, royalty-free copyright license to | |||||
reproduce, prepare derivative works of, publicly display, publicly perform, | |||||
distribute and sublicense the Contribution of such Contributor, if any, | |||||
and such derivative works, in source code and object code form. | |||||
b) Subject to the terms of this Agreement, each Contributor hereby grants | |||||
Recipient a non-exclusive, worldwide, royalty-free patent license under | |||||
Licensed Patents to make, use, sell, offer to sell, import and otherwise | |||||
transfer the Contribution of such Contributor, if any, in source code and | |||||
object code form. This patent license shall apply to the combination of | |||||
the Contribution and the Program if, at the time the Contribution is added | |||||
by the Contributor, such addition of the Contribution causes such combination | |||||
to be covered by the Licensed Patents. The patent license shall not apply to | |||||
any other combinations which include the Contribution. No hardware per se | |||||
is licensed hereunder. | |||||
c) Recipient understands that although each Contributor grants the licenses to | |||||
its Contributions set forth herein, no assurances are provided by any | |||||
Contributor that the Program does not infringe the patent or other | |||||
intellectual property rights of any other entity. Each Contributor disclaims | |||||
any liability to Recipient for claims brought by any other entity based on | |||||
infringement of intellectual property rights or otherwise. As a condition to | |||||
exercising the rights and licenses granted hereunder, each Recipient hereby | |||||
assumes sole responsibility to secure any other intellectual property rights | |||||
needed, if any. For example, if a third party patent license is required to | |||||
allow Recipient to distribute the Program, it is Recipient's responsibility | |||||
to acquire that license before distributing the Program. | |||||
d) Each Contributor represents that to its knowledge it has sufficient | |||||
copyright rights in its Contribution, if any, to grant the copyright license | |||||
set forth in this Agreement. | |||||
a) Subject to the terms of this Agreement, each Contributor hereby | |||||
grants Recipient a non-exclusive, worldwide, royalty-free copyright | |||||
license to reproduce, prepare Derivative Works of, publicly display, | |||||
publicly perform, Distribute and sublicense the Contribution of such | |||||
Contributor, if any, and such Derivative Works. | |||||
b) Subject to the terms of this Agreement, each Contributor hereby | |||||
grants Recipient a non-exclusive, worldwide, royalty-free patent | |||||
license under Licensed Patents to make, use, sell, offer to sell, | |||||
import and otherwise transfer the Contribution of such Contributor, | |||||
if any, in Source Code or other form. This patent license shall | |||||
apply to the combination of the Contribution and the Program if, at | |||||
the time the Contribution is added by the Contributor, such addition | |||||
of the Contribution causes such combination to be covered by the | |||||
Licensed Patents. The patent license shall not apply to any other | |||||
combinations which include the Contribution. No hardware per se is | |||||
licensed hereunder. | |||||
c) Recipient understands that although each Contributor grants the | |||||
licenses to its Contributions set forth herein, no assurances are | |||||
provided by any Contributor that the Program does not infringe the | |||||
patent or other intellectual property rights of any other entity. | |||||
Each Contributor disclaims any liability to Recipient for claims | |||||
brought by any other entity based on infringement of intellectual | |||||
property rights or otherwise. As a condition to exercising the | |||||
rights and licenses granted hereunder, each Recipient hereby | |||||
assumes sole responsibility to secure any other intellectual | |||||
property rights needed, if any. For example, if a third party | |||||
patent license is required to allow Recipient to Distribute the | |||||
Program, it is Recipient's responsibility to acquire that license | |||||
before distributing the Program. | |||||
d) Each Contributor represents that to its knowledge it has | |||||
sufficient copyright rights in its Contribution, if any, to grant | |||||
the copyright license set forth in this Agreement. | |||||
e) Notwithstanding the terms of any Secondary License, no | |||||
Contributor makes additional grants to any Recipient (other than | |||||
those set forth in this Agreement) as a result of such Recipient's | |||||
receipt of the Program under the terms of a Secondary License | |||||
(if permitted under the terms of Section 3). | |||||
3. REQUIREMENTS | 3. REQUIREMENTS | ||||
A Contributor may choose to distribute the Program in object code form under | |||||
its own license agreement, provided that: | |||||
a) it complies with the terms and conditions of this Agreement; and | |||||
b) its license agreement: | |||||
i) effectively disclaims on behalf of all Contributors all warranties and | |||||
conditions, express and implied, including warranties or conditions of title | |||||
and non-infringement, and implied warranties or conditions of | |||||
merchantability and fitness for a particular purpose; | |||||
ii) effectively excludes on behalf of all Contributors all liability for | |||||
damages, including direct, indirect, special, incidental and consequential | |||||
damages, such as lost profits; | |||||
iii) states that any provisions which differ from this Agreement are offered by | |||||
that Contributor alone and not by any other party; and | |||||
iv) states that source code for the Program is available from such Contributor, | |||||
and informs licensees how to obtain it in a reasonable manner on or through | |||||
a medium customarily used for software exchange. | |||||
When the Program is made available in source code form: | |||||
a) it must be made available under this Agreement; and | |||||
b) a copy of this Agreement must be included with each copy of the Program. | |||||
Contributors may not remove or alter any copyright notices contained within | |||||
the Program. | |||||
Each Contributor must identify itself as the originator of its Contribution, | |||||
if any, in a manner that reasonably allows subsequent Recipients to identify | |||||
the originator of the Contribution. | |||||
3.1 If a Contributor Distributes the Program in any form, then: | |||||
a) the Program must also be made available as Source Code, in | |||||
accordance with section 3.2, and the Contributor must accompany | |||||
the Program with a statement that the Source Code for the Program | |||||
is available under this Agreement, and informs Recipients how to | |||||
obtain it in a reasonable manner on or through a medium customarily | |||||
used for software exchange; and | |||||
b) the Contributor may Distribute the Program under a license | |||||
different than this Agreement, provided that such license: | |||||
i) effectively disclaims on behalf of all other Contributors all | |||||
warranties and conditions, express and implied, including | |||||
warranties or conditions of title and non-infringement, and | |||||
implied warranties or conditions of merchantability and fitness | |||||
for a particular purpose; | |||||
ii) effectively excludes on behalf of all other Contributors all | |||||
liability for damages, including direct, indirect, special, | |||||
incidental and consequential damages, such as lost profits; | |||||
iii) does not attempt to limit or alter the recipients' rights | |||||
in the Source Code under section 3.2; and | |||||
iv) requires any subsequent distribution of the Program by any | |||||
party to be under a license that satisfies the requirements | |||||
of this section 3. | |||||
3.2 When the Program is Distributed as Source Code: | |||||
a) it must be made available under this Agreement, or if the | |||||
Program (i) is combined with other material in a separate file or | |||||
files made available under a Secondary License, and (ii) the initial | |||||
Contributor attached to the Source Code the notice described in | |||||
Exhibit A of this Agreement, then the Program may be made available | |||||
under the terms of such Secondary Licenses, and | |||||
b) a copy of this Agreement must be included with each copy of | |||||
the Program. | |||||
3.3 Contributors may not remove or alter any copyright, patent, | |||||
trademark, attribution notices, disclaimers of warranty, or limitations | |||||
of liability ("notices") contained within the Program from any copy of | |||||
the Program which they Distribute, provided that Contributors may add | |||||
their own appropriate notices. | |||||
4. COMMERCIAL DISTRIBUTION | 4. COMMERCIAL DISTRIBUTION | ||||
Commercial distributors of software may accept certain responsibilities with | |||||
respect to end users, business partners and the like. While this license is | |||||
intended to facilitate the commercial use of the Program, the Contributor | |||||
who includes the Program in a commercial product offering should do so in | |||||
a manner which does not create potential liability for other Contributors. | |||||
Therefore, if a Contributor includes the Program in a commercial product | |||||
offering, such Contributor ("Commercial Contributor") hereby agrees to | |||||
defend and indemnify every other Contributor ("Indemnified Contributor") | |||||
against any losses, damages and costs (collectively "Losses") arising from | |||||
claims, lawsuits and other legal actions brought by a third party against | |||||
the Indemnified Contributor to the extent caused by the acts or omissions | |||||
of such Commercial Contributor in connection with its distribution of the | |||||
Program in a commercial product offering. The obligations in this section | |||||
do not apply to any claims or Losses relating to any actual or alleged | |||||
intellectual property infringement. In order to qualify, an Indemnified | |||||
Contributor must: a) promptly notify the Commercial Contributor in writing | |||||
of such claim, and b) allow the Commercial Contributor to control, and | |||||
cooperate with the Commercial Contributor in, the defense and any | |||||
related settlement negotiations. The Indemnified Contributor may | |||||
Commercial distributors of software may accept certain responsibilities | |||||
with respect to end users, business partners and the like. While this | |||||
license is intended to facilitate the commercial use of the Program, | |||||
the Contributor who includes the Program in a commercial product | |||||
offering should do so in a manner which does not create potential | |||||
liability for other Contributors. Therefore, if a Contributor includes | |||||
the Program in a commercial product offering, such Contributor | |||||
("Commercial Contributor") hereby agrees to defend and indemnify every | |||||
other Contributor ("Indemnified Contributor") against any losses, | |||||
damages and costs (collectively "Losses") arising from claims, lawsuits | |||||
and other legal actions brought by a third party against the Indemnified | |||||
Contributor to the extent caused by the acts or omissions of such | |||||
Commercial Contributor in connection with its distribution of the Program | |||||
in a commercial product offering. The obligations in this section do not | |||||
apply to any claims or Losses relating to any actual or alleged | |||||
intellectual property infringement. In order to qualify, an Indemnified | |||||
Contributor must: a) promptly notify the Commercial Contributor in | |||||
writing of such claim, and b) allow the Commercial Contributor to control, | |||||
and cooperate with the Commercial Contributor in, the defense and any | |||||
related settlement negotiations. The Indemnified Contributor may | |||||
participate in any such claim at its own expense. | participate in any such claim at its own expense. | ||||
For example, a Contributor might include the Program in a commercial product | |||||
offering, Product X. That Contributor is then a Commercial Contributor. If | |||||
that Commercial Contributor then makes performance claims, or offers | |||||
warranties related to Product X, those performance claims and warranties | |||||
are such Commercial Contributor's responsibility alone. Under this section, | |||||
the Commercial Contributor would have to defend claims against the other | |||||
Contributors related to those performance claims and warranties, and if a | |||||
court requires any other Contributor to pay any damages as a result, the | |||||
Commercial Contributor must pay those damages. | |||||
For example, a Contributor might include the Program in a commercial | |||||
product offering, Product X. That Contributor is then a Commercial | |||||
Contributor. If that Commercial Contributor then makes performance | |||||
claims, or offers warranties related to Product X, those performance | |||||
claims and warranties are such Commercial Contributor's responsibility | |||||
alone. Under this section, the Commercial Contributor would have to | |||||
defend claims against the other Contributors related to those performance | |||||
claims and warranties, and if a court requires any other Contributor to | |||||
pay any damages as a result, the Commercial Contributor must pay | |||||
those damages. | |||||
5. NO WARRANTY | 5. NO WARRANTY | ||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON | |||||
AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER | |||||
EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR | |||||
CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A | |||||
PARTICULAR PURPOSE. Each Recipient is solely responsible for determining | |||||
the appropriateness of using and distributing the Program and assumes all | |||||
risks associated with its exercise of rights under this Agreement , | |||||
including but not limited to the risks and costs of program errors, compliance | |||||
with applicable laws, damage to or loss of data, programs or equipment, and | |||||
unavailability or interruption of operations. | |||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT | |||||
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" | |||||
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR | |||||
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF | |||||
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR | |||||
PURPOSE. Each Recipient is solely responsible for determining the | |||||
appropriateness of using and distributing the Program and assumes all | |||||
risks associated with its exercise of rights under this Agreement, | |||||
including but not limited to the risks and costs of program errors, | |||||
compliance with applicable laws, damage to or loss of data, programs | |||||
or equipment, and unavailability or interruption of operations. | |||||
6. DISCLAIMER OF LIABILITY | 6. DISCLAIMER OF LIABILITY | ||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY | |||||
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION | |||||
LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||||
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE | |||||
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE | |||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT | |||||
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS | |||||
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST | |||||
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||||
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE | |||||
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE | |||||
POSSIBILITY OF SUCH DAMAGES. | POSSIBILITY OF SUCH DAMAGES. | ||||
7. GENERAL | 7. GENERAL | ||||
If any provision of this Agreement is invalid or unenforceable under applicable | |||||
law, it shall not affect the validity or enforceability of the remainder of | |||||
the terms of this Agreement, and without further action by the parties hereto, | |||||
such provision shall be reformed to the minimum extent necessary to make | |||||
such provision valid and enforceable. | |||||
If Recipient institutes patent litigation against any entity (including a | |||||
cross-claim or counterclaim in a lawsuit) alleging that the Program itself | |||||
(excluding combinations of the Program with other software or hardware) | |||||
infringes such Recipient's patent(s), then such Recipient's rights granted | |||||
under Section 2(b) shall terminate as of the date such litigation is filed. | |||||
All Recipient's rights under this Agreement shall terminate if it fails to | |||||
comply with any of the material terms or conditions of this Agreement and | |||||
does not cure such failure in a reasonable period of time after becoming | |||||
aware of such noncompliance. If all Recipient's rights under this Agreement | |||||
terminate, Recipient agrees to cease use and distribution of the Program as | |||||
soon as reasonably practicable. However, Recipient's obligations under this | |||||
Agreement and any licenses granted by Recipient relating to the Program | |||||
shall continue and survive. | |||||
Everyone is permitted to copy and distribute copies of this Agreement, but | |||||
in order to avoid inconsistency the Agreement is copyrighted and may only | |||||
be modified in the following manner. The Agreement Steward reserves the | |||||
right to publish new versions (including revisions) of this Agreement from | |||||
time to time. No one other than the Agreement Steward has the right to | |||||
modify this Agreement. The Eclipse Foundation is the initial Agreement | |||||
Steward. The Eclipse Foundation may assign the responsibility to serve as | |||||
the Agreement Steward to a suitable separate entity. Each new version of | |||||
the Agreement will be given a distinguishing version number. The Program | |||||
(including Contributions) may always be distributed subject to the | |||||
version of the Agreement under which it was received. In addition, after | |||||
a new version of the Agreement is published, Contributor may elect to | |||||
distribute the Program (including its Contributions) under the new version. | |||||
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient | |||||
receives no rights or licenses to the intellectual property of any | |||||
Contributor under this Agreement, whether expressly, by implication, | |||||
estoppel or otherwise. All rights in the Program not expressly granted | |||||
under this Agreement are reserved. | |||||
This Agreement is governed by the laws of the State of New York and the | |||||
intellectual property laws of the United States of America. No party to this | |||||
Agreement will bring a legal action under this Agreement more than one year | |||||
after the cause of action arose. Each party waives its rights to a jury | |||||
trial in any resulting litigation. | |||||
If any provision of this Agreement is invalid or unenforceable under | |||||
applicable law, it shall not affect the validity or enforceability of | |||||
the remainder of the terms of this Agreement, and without further | |||||
action by the parties hereto, such provision shall be reformed to the | |||||
minimum extent necessary to make such provision valid and enforceable. | |||||
If Recipient institutes patent litigation against any entity | |||||
(including a cross-claim or counterclaim in a lawsuit) alleging that the | |||||
Program itself (excluding combinations of the Program with other software | |||||
or hardware) infringes such Recipient's patent(s), then such Recipient's | |||||
rights granted under Section 2(b) shall terminate as of the date such | |||||
litigation is filed. | |||||
All Recipient's rights under this Agreement shall terminate if it | |||||
fails to comply with any of the material terms or conditions of this | |||||
Agreement and does not cure such failure in a reasonable period of | |||||
time after becoming aware of such noncompliance. If all Recipient's | |||||
rights under this Agreement terminate, Recipient agrees to cease use | |||||
and distribution of the Program as soon as reasonably practicable. | |||||
However, Recipient's obligations under this Agreement and any licenses | |||||
granted by Recipient relating to the Program shall continue and survive. | |||||
Everyone is permitted to copy and distribute copies of this Agreement, | |||||
but in order to avoid inconsistency the Agreement is copyrighted and | |||||
may only be modified in the following manner. The Agreement Steward | |||||
reserves the right to publish new versions (including revisions) of | |||||
this Agreement from time to time. No one other than the Agreement | |||||
Steward has the right to modify this Agreement. The Eclipse Foundation | |||||
is the initial Agreement Steward. The Eclipse Foundation may assign the | |||||
responsibility to serve as the Agreement Steward to a suitable separate | |||||
entity. Each new version of the Agreement will be given a distinguishing | |||||
version number. The Program (including Contributions) may always be | |||||
Distributed subject to the version of the Agreement under which it was | |||||
received. In addition, after a new version of the Agreement is published, | |||||
Contributor may elect to Distribute the Program (including its | |||||
Contributions) under the new version. | |||||
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient | |||||
receives no rights or licenses to the intellectual property of any | |||||
Contributor under this Agreement, whether expressly, by implication, | |||||
estoppel or otherwise. All rights in the Program not expressly granted | |||||
under this Agreement are reserved. Nothing in this Agreement is intended | |||||
to be enforceable by any entity that is not a Contributor or Recipient. | |||||
No third-party beneficiary rights are created under this Agreement. | |||||
Exhibit A - Form of Secondary Licenses Notice | |||||
"This Source Code may also be made available under the following | |||||
Secondary Licenses when the conditions for such availability set forth | |||||
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), | |||||
version(s), and exceptions or additional permissions here}." | |||||
Simply including a copy of this Agreement, including this Exhibit A | |||||
is not sufficient to license the Source Code under Secondary Licenses. | |||||
If it is not possible or desirable to put the notice in a particular | |||||
file, then You may include the notice in a location (such as a LICENSE | |||||
file in a relevant directory) where a recipient would be likely to | |||||
look for such a notice. | |||||
You may add additional accurate notices of copyright ownership. |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* IDE manager for standalone AJDE application. | * IDE manager for standalone AJDE application. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class BrowserManager { | public class BrowserManager { | ||||
/** | /** | ||||
* Find and create the set of build configuration files | * Find and create the set of build configuration files | ||||
* | |||||
* | |||||
* @param configFilesArgs | * @param configFilesArgs | ||||
*/ | */ | ||||
private void setUpConfigFiles(String[] configFilesArgs) { | private void setUpConfigFiles(String[] configFilesArgs) { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser; | package org.aspectj.tools.ajbrowser; | ||||
/** | /** | ||||
* Run ajbrowser if args contains only .lst files and ajc otherwise. | * Run ajbrowser if args contains only .lst files and ajc otherwise. | ||||
* | |||||
* | |||||
* @param args the String[] of args to interpret | * @param args the String[] of args to interpret | ||||
*/ | */ | ||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
/** | /** | ||||
* Invoke the compiler if there are arguments and some are not .lst files. | * Invoke the compiler if there are arguments and some are not .lst files. | ||||
* | |||||
* | |||||
* @return false if compiler was not invoked and the browser main should be | * @return false if compiler was not invoked and the browser main should be | ||||
*/ | */ | ||||
static boolean compilerMain(String[] args) { | static boolean compilerMain(String[] args) { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.core; | package org.aspectj.tools.ajbrowser.core; | ||||
public class BrowserBuildProgressMonitor extends Thread implements IBuildProgressMonitor { | public class BrowserBuildProgressMonitor extends Thread implements IBuildProgressMonitor { | ||||
public static final String PROGRESS_HEADING = "AspectJ Build"; | public static final String PROGRESS_HEADING = "AspectJ Build"; | ||||
private BuildProgressPanel progressDialog = null; | private BuildProgressPanel progressDialog = null; | ||||
private JDialog dialog = null; | private JDialog dialog = null; | ||||
private TopFrame topFrame; | private TopFrame topFrame; | ||||
private BrowserMessageHandler handler; | private BrowserMessageHandler handler; | ||||
public BrowserBuildProgressMonitor(BrowserMessageHandler handler) { | public BrowserBuildProgressMonitor(BrowserMessageHandler handler) { | ||||
this.handler = handler; | this.handler = handler; | ||||
topFrame = (TopFrame) BrowserManager.getDefault().getRootFrame(); | topFrame = (TopFrame) BrowserManager.getDefault().getRootFrame(); | ||||
dialog.setContentPane(progressDialog); | dialog.setContentPane(progressDialog); | ||||
dialog.setSize(550, 120); | dialog.setSize(550, 120); | ||||
try { | try { | ||||
dialog.setLocationRelativeTo(topFrame); | |||||
dialog.setLocationRelativeTo(topFrame); | |||||
} catch (NoSuchMethodError nsme) { | } catch (NoSuchMethodError nsme) { | ||||
// running on 1.3 | // running on 1.3 | ||||
} | } | ||||
} | } | ||||
public void finish(boolean wasFullBuild) { | public void finish(boolean wasFullBuild) { | ||||
Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("build finished..."); | Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("build finished..."); | ||||
progressDialog.finish(); | progressDialog.finish(); | ||||
dialog.dispose(); | |||||
dialog.dispose(); | |||||
if (handler.getMessages().isEmpty()) { | if (handler.getMessages().isEmpty()) { | ||||
topFrame.hideMessagesPanel(handler); | topFrame.hideMessagesPanel(handler); | ||||
} else { | } else { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.core; | package org.aspectj.tools.ajbrowser.core; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.core; | package org.aspectj.tools.ajbrowser.core; | ||||
if (t != null) { | if (t != null) { | ||||
t.printStackTrace(new PrintWriter(stringWriter)); | t.printStackTrace(new PrintWriter(stringWriter)); | ||||
return stringWriter.getBuffer().toString(); | return stringWriter.getBuffer().toString(); | ||||
} | |||||
} | |||||
return "<no stack trace available>"; | return "<no stack trace available>"; | ||||
} | } | ||||
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.core; | package org.aspectj.tools.ajbrowser.core; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.core; | package org.aspectj.tools.ajbrowser.core; | ||||
public static final String BUILD_OUTPUTPATH = "build.outputpath"; | public static final String BUILD_OUTPUTPATH = "build.outputpath"; | ||||
public static final String JAVA_CLASSPATH = "java.class.path"; | public static final String JAVA_CLASSPATH = "java.class.path"; | ||||
public static final String NONSTANDARD_OPTIONS = "ajc.nonStandardOptions"; | public static final String NONSTANDARD_OPTIONS = "ajc.nonStandardOptions"; | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
Ajde.getDefault().getIdeUIAdapter().displayStatusInformation(" no corresponding source line to seek to"); | Ajde.getDefault().getIdeUIAdapter().displayStatusInformation(" no corresponding source line to seek to"); | ||||
} | } | ||||
} | } | ||||
public void showSourceLine(int lineNumber, boolean highlight) { | public void showSourceLine(int lineNumber, boolean highlight) { | ||||
showSourceLine(filePath, lineNumber, highlight); | showSourceLine(filePath, lineNumber, highlight); | ||||
} | } | ||||
public void showSourceLine(String filePath, int lineNumber, boolean highlight) { | public void showSourceLine(String filePath, int lineNumber, boolean highlight) { | ||||
//AjdeUIManager.getDefault().getIdeUIAdapter().resetEditor(); | //AjdeUIManager.getDefault().getIdeUIAdapter().resetEditor(); | ||||
this.filePath = filePath; | this.filePath = filePath; | ||||
// if (oldPath != filePath && !Ajde.INSTANCE.BROWSER_MANAGER.isGlobalMode()) { | // if (oldPath != filePath && !Ajde.INSTANCE.BROWSER_MANAGER.isGlobalMode()) { | ||||
// Ajde.INSTANCE.BROWSER_MANAGER.updateView(); | // Ajde.INSTANCE.BROWSER_MANAGER.updateView(); | ||||
public void showSourcelineAnnotation(String filePath, int lineNumber, java.util.List items) { } | public void showSourcelineAnnotation(String filePath, int lineNumber, java.util.List items) { } | ||||
public void addEditorViewForSourceLine(String filePath, int lineNumber) { | public void addEditorViewForSourceLine(String filePath, int lineNumber) { | ||||
} | } | ||||
public void saveContents() throws IOException { | public void saveContents() throws IOException { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.ui; | package org.aspectj.tools.ajbrowser.ui; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.ui; | package org.aspectj.tools.ajbrowser.ui; | ||||
public class BrowserRuntimeProperties implements IRuntimeProperties { | public class BrowserRuntimeProperties implements IRuntimeProperties { | ||||
private UserPreferencesAdapter preferencesAdapter; | private UserPreferencesAdapter preferencesAdapter; | ||||
public BrowserRuntimeProperties(UserPreferencesAdapter preferencesAdapter) { | public BrowserRuntimeProperties(UserPreferencesAdapter preferencesAdapter) { | ||||
this.preferencesAdapter = preferencesAdapter; | this.preferencesAdapter = preferencesAdapter; | ||||
} | } | ||||
public String getClassToExecute() { | public String getClassToExecute() { | ||||
return preferencesAdapter.getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS); | return preferencesAdapter.getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS); | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.ui; | package org.aspectj.tools.ajbrowser.ui; | ||||
import org.aspectj.ajde.IdeUIAdapter; | import org.aspectj.ajde.IdeUIAdapter; | ||||
* information in the status bar at the bottom of the AjBrowser GUI. | * information in the status bar at the bottom of the AjBrowser GUI. | ||||
*/ | */ | ||||
public class BrowserUIAdapter implements IdeUIAdapter { | public class BrowserUIAdapter implements IdeUIAdapter { | ||||
public void displayStatusInformation(String message) { | public void displayStatusInformation(String message) { | ||||
BrowserManager.getDefault().setStatusInformation(message); | BrowserManager.getDefault().setStatusInformation(message); | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.ui; | package org.aspectj.tools.ajbrowser.ui; | ||||
/** | /** | ||||
* Responsible for controlling the editor. | * Responsible for controlling the editor. | ||||
* | |||||
* | |||||
* <p><b>TODO:</b> remove coupling to <CODE>BasicEditor</CODE></p> | * <p><b>TODO:</b> remove coupling to <CODE>BasicEditor</CODE></p> | ||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Panel the displays both ajc and runtime options | * Panel the displays both ajc and runtime options | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class BrowserOptionsPanel extends OptionsPanel { | public class BrowserOptionsPanel extends OptionsPanel { | ||||
private static final long serialVersionUID = 4491319302490183151L; | private static final long serialVersionUID = 4491319302490183151L; | ||||
private JPanel runOptions_panel = new JPanel(); | private JPanel runOptions_panel = new JPanel(); | ||||
private JPanel build_panel = new JPanel(); | private JPanel build_panel = new JPanel(); | ||||
getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS) | getProjectPreference(PreferenceStoreConstants.RUNTIME_MAINCLASS) | ||||
); | ); | ||||
} | } | ||||
public void saveOptions() throws IOException { | |||||
public void saveOptions() throws IOException { | |||||
BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | ||||
PreferenceStoreConstants.BUILD_OUTPUTPATH, outputPath_field.getText()); | PreferenceStoreConstants.BUILD_OUTPUTPATH, outputPath_field.getText()); | ||||
BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | ||||
PreferenceStoreConstants.BUILD_CLASSPATH, classpath_field.getText()); | PreferenceStoreConstants.BUILD_CLASSPATH, classpath_field.getText()); | ||||
BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | BrowserManager.getDefault().getPreferencesAdapter().setProjectPreference( | ||||
PreferenceStoreConstants.RUNTIME_MAINCLASS, classToRun_field.getText()); | PreferenceStoreConstants.RUNTIME_MAINCLASS, classToRun_field.getText()); | ||||
} | |||||
} | |||||
private void jbInit() throws Exception { | private void jbInit() throws Exception { | ||||
border1 = | border1 = |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.tools.ajbrowser.ui.swing; | package org.aspectj.tools.ajbrowser.ui.swing; | ||||
/** | /** | ||||
* UI for standalone operation. | * UI for standalone operation. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class TopFrame extends JFrame { | public class TopFrame extends JFrame { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
// */ | // */ | ||||
//public class JemmyDriver implements Scenario { | //public class JemmyDriver implements Scenario { | ||||
// | // | ||||
// public static final String CUT | |||||
// public static final String CUT | |||||
// = "org.aspectj.tools.ajbrowser.Main"; | // = "org.aspectj.tools.ajbrowser.Main"; | ||||
// public static final String DRIVER | |||||
// public static final String DRIVER | |||||
// = "org.aspectj.tools.ajbrowser.JemmyDriver"; | // = "org.aspectj.tools.ajbrowser.JemmyDriver"; | ||||
// | |||||
// | |||||
// // XXX need to fix literal path locations | // // XXX need to fix literal path locations | ||||
// public static final String USERDIR | |||||
// public static final String USERDIR | |||||
// = "j:/home/wes/dev/tools/aj/examples"; | // = "j:/home/wes/dev/tools/aj/examples"; | ||||
// public static final String FILENAME_RELATIVE | |||||
// public static final String FILENAME_RELATIVE | |||||
// = USERDIR + "spacewar/debug.lst"; | // = USERDIR + "spacewar/debug.lst"; | ||||
// public static final String FILENAME | |||||
// public static final String FILENAME | |||||
// = USERDIR + "/" + FILENAME_RELATIVE; | // = USERDIR + "/" + FILENAME_RELATIVE; | ||||
// | // | ||||
// public static void main(String[] argv) { | // public static void main(String[] argv) { | ||||
// // grab parameter - pass in .lst file | // // grab parameter - pass in .lst file | ||||
// if (null != param) { | // if (null != param) { | ||||
// Class c = param.getClass(); | // Class c = param.getClass(); | ||||
// if (c.isArray() && | |||||
// if (c.isArray() && | |||||
// (String.class == c.getComponentType())) { | // (String.class == c.getComponentType())) { | ||||
// args = (String[]) param; | // args = (String[]) param; | ||||
// if (0 < args.length) { | // if (0 < args.length) { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core; | package org.aspectj.ajde.core; | ||||
* The class to be used by tools to drive a build. An AjCompiler is created with a unique id (for example the absolute pathname of a | * The class to be used by tools to drive a build. An AjCompiler is created with a unique id (for example the absolute pathname of a | ||||
* project or .lst file) along with implementations of ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. Tools | * project or .lst file) along with implementations of ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. Tools | ||||
* then call build() or buildFresh() on this AjCompiler. | * then call build() or buildFresh() on this AjCompiler. | ||||
* | |||||
* | |||||
* <p> | * <p> | ||||
* An AjCompiler is associated with one id, therefore a new one needs to be created for a new id (project, .lst file etc.). It is | * An AjCompiler is associated with one id, therefore a new one needs to be created for a new id (project, .lst file etc.). It is | ||||
* the responsibility of the tools to manage the lifecycle of the AjCompiler's. | * the responsibility of the tools to manage the lifecycle of the AjCompiler's. | ||||
/** | /** | ||||
* Creates a new AjCompiler for the given id, ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. None of | * Creates a new AjCompiler for the given id, ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. None of | ||||
* the arguments can be null. | * the arguments can be null. | ||||
* | |||||
* | |||||
* @param compilerId - Unique String used to identify this AjCompiler | * @param compilerId - Unique String used to identify this AjCompiler | ||||
* @param compilerConfig - ICompilerConfiguration implementation | * @param compilerConfig - ICompilerConfiguration implementation | ||||
* @param buildProgressMonitor - IBuildProgressMonitor implementation | * @param buildProgressMonitor - IBuildProgressMonitor implementation | ||||
/** | /** | ||||
* Set a CustomMungerFactory to the compiler's weaver | * Set a CustomMungerFactory to the compiler's weaver | ||||
* | |||||
* | |||||
* The type of factory should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it | * The type of factory should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it | ||||
* is Object for now. | * is Object for now. | ||||
* | |||||
* | |||||
* @param factory | * @param factory | ||||
*/ | */ | ||||
public void setCustomMungerFactory(Object factory) { | public void setCustomMungerFactory(Object factory) { | ||||
/** | /** | ||||
* @return the CustomMungerFactory from the compiler's weaver | * @return the CustomMungerFactory from the compiler's weaver | ||||
* | |||||
* | |||||
* The return type should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, | * The return type should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, | ||||
* it is Object for now. | * it is Object for now. | ||||
*/ | */ |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core; | package org.aspectj.ajde.core; | ||||
/** | /** | ||||
* Interface that handles messages sent from the compiler. | * Interface that handles messages sent from the compiler. | ||||
* Implementations define which messages are logged and whether | * Implementations define which messages are logged and whether | ||||
* the handler aborts the process. | |||||
* the handler aborts the process. | |||||
*/ | */ | ||||
public interface IBuildMessageHandler { | public interface IBuildMessageHandler { | ||||
/** | |||||
/** | |||||
* Handle message by reporting and/or throwing an AbortException. | * Handle message by reporting and/or throwing an AbortException. | ||||
* | |||||
* | |||||
* @param message the IMessage to handle - never null | * @param message the IMessage to handle - never null | ||||
* @return true if this message was handled by this handler | * @return true if this message was handled by this handler | ||||
* @throws IllegalArgumentException if message is null | * @throws IllegalArgumentException if message is null | ||||
/** | /** | ||||
* Signal whether this will ignore messages of a given type. | * Signal whether this will ignore messages of a given type. | ||||
* Clients may use this to avoid constructing or sending | |||||
* Clients may use this to avoid constructing or sending | |||||
* certain messages. | * certain messages. | ||||
* | |||||
* | |||||
* @return true if this handler is ignoring all messages of this type | * @return true if this handler is ignoring all messages of this type | ||||
*/ | */ | ||||
boolean isIgnoring(IMessage.Kind kind); | boolean isIgnoring(IMessage.Kind kind); | ||||
/** | /** | ||||
* Allow fine grained configuration after initialization. | |||||
* | |||||
* Allow fine grained configuration after initialization. | |||||
* | |||||
* @param kind | * @param kind | ||||
*/ | */ | ||||
void dontIgnore(IMessage.Kind kind); | void dontIgnore(IMessage.Kind kind); | ||||
/** | /** | ||||
* Allow fine grained configuration after initialization. | |||||
* | |||||
* Allow fine grained configuration after initialization. | |||||
* | |||||
* @param kind | * @param kind | ||||
*/ | */ | ||||
void ignore(IMessage.Kind kind); | void ignore(IMessage.Kind kind); | ||||
} | } |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2006 Contributors.All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Copyright (c) 2006 Contributors.All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Adrian Colyer Initial implementation | * Adrian Colyer Initial implementation | ||||
* Helen Hawkins bug 166580 and 148190 | * Helen Hawkins bug 166580 and 148190 | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
* Return the directory root under which the results of compiling the given source file. For example, if the source file | * Return the directory root under which the results of compiling the given source file. For example, if the source file | ||||
* contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to | * contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to | ||||
* "target/classes/a/b/C.class" | * "target/classes/a/b/C.class" | ||||
* | |||||
* | |||||
* @param compilationUnit the compilation unit that has been compiled | * @param compilationUnit the compilation unit that has been compiled | ||||
* @return a File object representing the root directory under which compilation results for this unit should be written | * @return a File object representing the root directory under which compilation results for this unit should be written | ||||
*/ | */ | ||||
/** | /** | ||||
* For environments where multiple source folders are supported, they need to be included in the model. This method allows | * For environments where multiple source folders are supported, they need to be included in the model. This method allows | ||||
* AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java" | * AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java" | ||||
* | |||||
* | |||||
* @param sourceFile the File object for the source file | * @param sourceFile the File object for the source file | ||||
* @return the source folder where this file came from, or null if in project root or source folders not supported. | * @return the source folder where this file came from, or null if in project root or source folders not supported. | ||||
*/ | */ | ||||
/** | /** | ||||
* When copying resources from source folders to output location, return the root directory under which the resource should be | * When copying resources from source folders to output location, return the root directory under which the resource should be | ||||
* copied. | * copied. | ||||
* | |||||
* | |||||
* @param resource the resource to be copied | * @param resource the resource to be copied | ||||
* @return a File object representing the root directory under which this resource should be copied | * @return a File object representing the root directory under which this resource should be copied | ||||
*/ | */ | ||||
/** | /** | ||||
* Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also | * Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also | ||||
* supplied. | * supplied. | ||||
* | |||||
* | |||||
* @param outputfile the file that has been written | * @param outputfile the file that has been written | ||||
* @param fileType the kind of file from the FILETYPE_XXX constants defined in this type | * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type | ||||
*/ | */ | ||||
/** | /** | ||||
* Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also | * Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also | ||||
* supplied. | * supplied. | ||||
* | |||||
* | |||||
* @param file the file that has been written | * @param file the file that has been written | ||||
* @param fileType the kind of file from the FILETYPE_XXX constants defined in this type | * @param fileType the kind of file from the FILETYPE_XXX constants defined in this type | ||||
*/ | */ |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core; | package org.aspectj.ajde.core; | ||||
* Class containing the current custom java options | * Class containing the current custom java options | ||||
*/ | */ | ||||
public final class JavaOptions { | public final class JavaOptions { | ||||
public static final String COMPLIANCE_LEVEL = CompilerOptions.OPTION_Compliance; | public static final String COMPLIANCE_LEVEL = CompilerOptions.OPTION_Compliance; | ||||
public static final String SOURCE_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_Source; | public static final String SOURCE_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_Source; | ||||
public static final String TARGET_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_TargetPlatform; | public static final String TARGET_COMPATIBILITY_LEVEL = CompilerOptions.OPTION_TargetPlatform; | ||||
public static final String VERSION_14 = CompilerOptions.VERSION_1_4; | public static final String VERSION_14 = CompilerOptions.VERSION_1_4; | ||||
public static final String VERSION_15 = CompilerOptions.VERSION_1_5; | public static final String VERSION_15 = CompilerOptions.VERSION_1_5; | ||||
public static final String VERSION_16 = CompilerOptions.VERSION_1_6; | public static final String VERSION_16 = CompilerOptions.VERSION_1_6; | ||||
// by default will use the platform default encoding | |||||
// by default will use the platform default encoding | |||||
public static final String CHARACTER_ENCODING = CompilerOptions.OPTION_Encoding; | public static final String CHARACTER_ENCODING = CompilerOptions.OPTION_Encoding; | ||||
// indicates if unused/optimizable local variables need to be preserved (debugging purpose) | // indicates if unused/optimizable local variables need to be preserved (debugging purpose) | ||||
public static final String PRESERVE_ALL_LOCALS = CompilerOptions.OPTION_PreserveUnusedLocal; | public static final String PRESERVE_ALL_LOCALS = CompilerOptions.OPTION_PreserveUnusedLocal; | ||||
public static final String PRESERVE = CompilerOptions.PRESERVE; | public static final String PRESERVE = CompilerOptions.PRESERVE; | ||||
public static final String OPTIMIZE = CompilerOptions.OPTIMIZE_OUT; | public static final String OPTIMIZE = CompilerOptions.OPTIMIZE_OUT; | ||||
// Warning constants | // Warning constants | ||||
public static final String WARN_METHOD_WITH_CONSTRUCTOR_NAME = CompilerOptions.OPTION_ReportMethodWithConstructorName; | public static final String WARN_METHOD_WITH_CONSTRUCTOR_NAME = CompilerOptions.OPTION_ReportMethodWithConstructorName; | ||||
public static final String WARN_OVERRIDING_PACKAGE_DEFAULT_METHOD = CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod; | |||||
public static final String WARN_DEPRECATION = CompilerOptions.OPTION_ReportDeprecation; | |||||
public static final String WARN_HIDDEN_CATCH_BLOCKS = CompilerOptions.OPTION_ReportHiddenCatchBlock; | |||||
public static final String WARN_UNUSED_LOCALS = CompilerOptions.OPTION_ReportUnusedLocal; | |||||
public static final String WARN_UNUSED_PARAMETER = CompilerOptions.OPTION_ReportUnusedParameter; | |||||
public static final String WARN_UNUSED_IMPORTS = CompilerOptions.OPTION_ReportUnusedImport; | |||||
public static final String WARN_SYNTHETIC_ACCESS = CompilerOptions.OPTION_ReportSyntheticAccessEmulation; | |||||
public static final String WARN_ASSERT_IDENITIFIER = CompilerOptions.OPTION_ReportAssertIdentifier; | |||||
public static final String WARN_OVERRIDING_PACKAGE_DEFAULT_METHOD = CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod; | |||||
public static final String WARN_DEPRECATION = CompilerOptions.OPTION_ReportDeprecation; | |||||
public static final String WARN_HIDDEN_CATCH_BLOCKS = CompilerOptions.OPTION_ReportHiddenCatchBlock; | |||||
public static final String WARN_UNUSED_LOCALS = CompilerOptions.OPTION_ReportUnusedLocal; | |||||
public static final String WARN_UNUSED_PARAMETER = CompilerOptions.OPTION_ReportUnusedParameter; | |||||
public static final String WARN_UNUSED_IMPORTS = CompilerOptions.OPTION_ReportUnusedImport; | |||||
public static final String WARN_SYNTHETIC_ACCESS = CompilerOptions.OPTION_ReportSyntheticAccessEmulation; | |||||
public static final String WARN_ASSERT_IDENITIFIER = CompilerOptions.OPTION_ReportAssertIdentifier; | |||||
public static final String WARN_NON_NLS = CompilerOptions.OPTION_ReportNonExternalizedStringLiteral; | public static final String WARN_NON_NLS = CompilerOptions.OPTION_ReportNonExternalizedStringLiteral; | ||||
// warning option constants | // warning option constants | ||||
public static final String IGNORE = CompilerOptions.IGNORE; | public static final String IGNORE = CompilerOptions.IGNORE; | ||||
public static final String WARNING = CompilerOptions.WARNING; | public static final String WARNING = CompilerOptions.WARNING; | ||||
// Debug constants | |||||
// Debug constants | |||||
public static final String DEBUG_SOURCE = CompilerOptions.OPTION_SourceFileAttribute; | public static final String DEBUG_SOURCE = CompilerOptions.OPTION_SourceFileAttribute; | ||||
public static final String DEBUG_LINES = CompilerOptions.OPTION_LocalVariableAttribute; | public static final String DEBUG_LINES = CompilerOptions.OPTION_LocalVariableAttribute; | ||||
public static final String DEBUG_VARS = CompilerOptions.OPTION_LineNumberAttribute; | public static final String DEBUG_VARS = CompilerOptions.OPTION_LineNumberAttribute; | ||||
// Debug option constants | // Debug option constants | ||||
public static final String GENERATE = CompilerOptions.GENERATE; | public static final String GENERATE = CompilerOptions.GENERATE; | ||||
public static final String DO_NOT_GENERATE = CompilerOptions.DO_NOT_GENERATE; | public static final String DO_NOT_GENERATE = CompilerOptions.DO_NOT_GENERATE; | ||||
private static Map<String,String> defaultOptionsMap; | private static Map<String,String> defaultOptionsMap; | ||||
/** | /** | ||||
* @return the java options map with the default settings | * @return the java options map with the default settings | ||||
*/ | */ | ||||
public static Map<String,String> getDefaultJavaOptions() { | public static Map<String,String> getDefaultJavaOptions() { | ||||
if (defaultOptionsMap != null) return defaultOptionsMap; | if (defaultOptionsMap != null) return defaultOptionsMap; | ||||
defaultOptionsMap = new HashMap<>(); | defaultOptionsMap = new HashMap<>(); | ||||
defaultOptionsMap.put(COMPLIANCE_LEVEL, VERSION_14); | defaultOptionsMap.put(COMPLIANCE_LEVEL, VERSION_14); | ||||
defaultOptionsMap.put(SOURCE_COMPATIBILITY_LEVEL, VERSION_13); | defaultOptionsMap.put(SOURCE_COMPATIBILITY_LEVEL, VERSION_13); | ||||
defaultOptionsMap.put(DEBUG_SOURCE, GENERATE); | defaultOptionsMap.put(DEBUG_SOURCE, GENERATE); | ||||
defaultOptionsMap.put(DEBUG_LINES, GENERATE); | defaultOptionsMap.put(DEBUG_LINES, GENERATE); | ||||
defaultOptionsMap.put(DEBUG_VARS, DO_NOT_GENERATE); | defaultOptionsMap.put(DEBUG_VARS, DO_NOT_GENERATE); | ||||
return defaultOptionsMap; | return defaultOptionsMap; | ||||
} | } | ||||
/** | /** | ||||
* @return true if the given value is a valid JVM version | * @return true if the given value is a valid JVM version | ||||
* (JavaOptions.VERSION_13, JavaOptions.VERSION_134, JavaOptions.VERSION_15, | * (JavaOptions.VERSION_13, JavaOptions.VERSION_134, JavaOptions.VERSION_15, | ||||
} | } | ||||
/** | /** | ||||
* @return true if the given option is JavaOptions.PRESERVE or | |||||
* @return true if the given option is JavaOptions.PRESERVE or | |||||
* JavaOptions.OPTIMIZE and false otherwise | * JavaOptions.OPTIMIZE and false otherwise | ||||
*/ | */ | ||||
public static boolean isValidPreserveAllLocalsOption(String option) { | public static boolean isValidPreserveAllLocalsOption(String option) { | ||||
return PRESERVE.equals(option) || OPTIMIZE.equals(option); | return PRESERVE.equals(option) || OPTIMIZE.equals(option); | ||||
} | } | ||||
/** | /** | ||||
* @return true if the given option is JavaOptions.IGNORE or | |||||
* @return true if the given option is JavaOptions.IGNORE or | |||||
* JavaOptions.WARNING and false otherwise | * JavaOptions.WARNING and false otherwise | ||||
*/ | */ | ||||
public static boolean isIgnoreOrWarning(String option) { | public static boolean isIgnoreOrWarning(String option) { | ||||
return IGNORE.equals(option) || WARNING.equals(option); | return IGNORE.equals(option) || WARNING.equals(option); | ||||
} | } | ||||
/** | /** | ||||
* @return true if the given option is JavaOptions.GENERATE or | |||||
* @return true if the given option is JavaOptions.GENERATE or | |||||
* JavaOptions.DO_NOT_GENERATE and false otherwise | * JavaOptions.DO_NOT_GENERATE and false otherwise | ||||
*/ | */ | ||||
public static boolean isGenerateOrNot(String option) { | public static boolean isGenerateOrNot(String option) { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins converted to new interface (pr148190) | |||||
* Helen Hawkins converted to new interface (pr148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
import org.aspectj.bridge.IProgressListener; | import org.aspectj.bridge.IProgressListener; | ||||
/** | /** | ||||
* Enables the compiler/weaver progres to be related to the user via the | |||||
* IBuildProgressMonitor as well as relating whether or not the user has | |||||
* Enables the compiler/weaver progres to be related to the user via the | |||||
* IBuildProgressMonitor as well as relating whether or not the user has | |||||
* cancelled the build progress back to the compiler/weaver. | * cancelled the build progress back to the compiler/weaver. | ||||
*/ | */ | ||||
public class AjdeCoreBuildNotifierAdapter implements IProgressListener { | public class AjdeCoreBuildNotifierAdapter implements IProgressListener { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core.internal; | package org.aspectj.ajde.core.internal; | ||||
public class AjdeCoreMessageHandlerAdapter implements IMessageHandler { | public class AjdeCoreMessageHandlerAdapter implements IMessageHandler { | ||||
private IBuildMessageHandler handler; | private IBuildMessageHandler handler; | ||||
public AjdeCoreMessageHandlerAdapter(IBuildMessageHandler messageHandler) { | public AjdeCoreMessageHandlerAdapter(IBuildMessageHandler messageHandler) { | ||||
this.handler = messageHandler; | this.handler = messageHandler; | ||||
} | } | ||||
public void dontIgnore(Kind kind) { | public void dontIgnore(Kind kind) { | ||||
handler.dontIgnore(kind); | handler.dontIgnore(kind); | ||||
} | } |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2006 Contributors.All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Copyright (c) 2006 Contributors.All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Adrian Colyer Initial implementation | * Adrian Colyer Initial implementation | ||||
* Helen Hawkins converted to new interface (bug 148190) | * Helen Hawkins converted to new interface (bug 148190) | ||||
* | |||||
* | |||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core.internal; | package org.aspectj.ajde.core.internal; | ||||
/** | /** | ||||
* Return a map from fully qualified jar/dir entries to handle components. | * Return a map from fully qualified jar/dir entries to handle components. | ||||
* | |||||
* | |||||
* @return a map from inpath entries (jars/dirs) to handle components. | * @return a map from inpath entries (jars/dirs) to handle components. | ||||
*/ | */ | ||||
public Map<File,String> getInpathMap() { | public Map<File,String> getInpathMap() { |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core; | package org.aspectj.ajde.core; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core; | package org.aspectj.ajde.core; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version | * Helen Hawkins - initial version | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core.tests; | package org.aspectj.ajde.core.tests; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2004 Contributors. | * Copyright (c) 2004 Contributors. | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Andy Clement Initial version | * Andy Clement Initial version | ||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
* weaving phases - this testcase verifies a few cases, making sure the process | * weaving phases - this testcase verifies a few cases, making sure the process | ||||
* stops when expected. It can check the disk contents, but it doesn't right | * stops when expected. It can check the disk contents, but it doesn't right | ||||
* now. | * now. | ||||
* | |||||
* | |||||
* Two different .lst files are used during these tests: LoadsaCode.lst and | * Two different .lst files are used during these tests: LoadsaCode.lst and | ||||
* EvenMoreCode.lst which contain mixes of aspects and classes | * EvenMoreCode.lst which contain mixes of aspects and classes | ||||
* | |||||
* | |||||
* Here are some things to think about that will help you understand what is on | * Here are some things to think about that will help you understand what is on | ||||
* the disk when we cancel the compiler. | * the disk when we cancel the compiler. | ||||
* | |||||
* | |||||
* There are 3 important phases worth remembering : - Compile all the types - | * There are 3 important phases worth remembering : - Compile all the types - | ||||
* Weave all the aspects - Weave all the classes | * Weave all the aspects - Weave all the classes | ||||
* | |||||
* | |||||
* Each of those steps goes through all the types. This means during the 'weave | * Each of those steps goes through all the types. This means during the 'weave | ||||
* all the aspects' step we are jumping over classes and during the 'weave all | * all the aspects' step we are jumping over classes and during the 'weave all | ||||
* the classes ' step we are jumping over aspects. Why is this important? | * the classes ' step we are jumping over aspects. Why is this important? | ||||
* | |||||
* | |||||
* | |||||
* | |||||
* We only write bytes out during the 'weave all the classes ' phase and it is | * We only write bytes out during the 'weave all the classes ' phase and it is | ||||
* even during that phase that we write out the bytes for aspects. This means if | * even during that phase that we write out the bytes for aspects. This means if | ||||
* you cancel during compilation or during the weaving of aspects - there will | * you cancel during compilation or during the weaving of aspects - there will | ||||
* After first weave class message, get it to cancel, there should be one | * After first weave class message, get it to cancel, there should be one | ||||
* more warning message about cancelling the weave and their should be | * more warning message about cancelling the weave and their should be | ||||
* nothing on the disk. | * nothing on the disk. | ||||
* | |||||
* | |||||
* EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj | * EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj | ||||
* Cl3.java A4.aj | * Cl3.java A4.aj | ||||
* | |||||
* | |||||
*/ | */ | ||||
public void testCancelFirstClassWeave() { | public void testCancelFirstClassWeave() { | ||||
if (debugTests) | if (debugTests) | ||||
* After first weave aspect message, get it to cancel, there should be one | * After first weave aspect message, get it to cancel, there should be one | ||||
* more warning message about cancelling the weave and their should be | * more warning message about cancelling the weave and their should be | ||||
* nothing on the disk. | * nothing on the disk. | ||||
* | |||||
* | |||||
* EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj | * EvenMoreCode.lst contains: A1.aj Cl1.java A2.aj Cl2.java HW.java A3.aj | ||||
* Cl3.java A4.aj | * Cl3.java A4.aj | ||||
* | |||||
* | |||||
*/ | */ | ||||
public void testCancelSecondClassWeave() { | public void testCancelSecondClassWeave() { | ||||
if (debugTests) | if (debugTests) |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2003 Contributors. | * Copyright (c) 2003 Contributors. | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* AMC 2003 initial version | * AMC 2003 initial version | ||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
private TestCompilerConfiguration compilerConfig; | private TestCompilerConfiguration compilerConfig; | ||||
private String[] files = { "apackage" + File.separator + "InitCatcher.java", | private String[] files = { "apackage" + File.separator + "InitCatcher.java", | ||||
"apackage" + File.separator + "SomeClass.java" }; | "apackage" + File.separator + "SomeClass.java" }; | ||||
protected void setUp() throws Exception { | protected void setUp() throws Exception { | ||||
super.setUp(); | super.setUp(); | ||||
initialiseProject("declare-warning"); | initialiseProject("declare-warning"); | ||||
handler = null; | handler = null; | ||||
compilerConfig = null; | compilerConfig = null; | ||||
} | } | ||||
public void testMessages() { | public void testMessages() { | ||||
// bug 33474 | // bug 33474 | ||||
// The build has happened, what messages did the compiler give, and do they | // The build has happened, what messages did the compiler give, and do they | ||||
assertTrue("not two messages: " + msgs, false); | assertTrue("not two messages: " + msgs, false); | ||||
} | } | ||||
assertEquals("Two warning messages should be produced",2,msgs.size()); | assertEquals("Two warning messages should be produced",2,msgs.size()); | ||||
TestMessageHandler.TestMessage msg = | |||||
TestMessageHandler.TestMessage msg = | |||||
(TestMessageHandler.TestMessage) msgs.get(0); | (TestMessageHandler.TestMessage) msgs.get(0); | ||||
assertEquals( 8, msg.getContainedMessage().getSourceLocation().getLine()); | assertEquals( 8, msg.getContainedMessage().getSourceLocation().getLine()); | ||||
assertEquals( "Please don't call init methods", msg.getContainedMessage().getMessage()); | assertEquals( "Please don't call init methods", msg.getContainedMessage().getMessage()); | ||||
// this name has a tester specific prefix, followed by the location of the file. | // this name has a tester specific prefix, followed by the location of the file. | ||||
// we can validate the ending. | // we can validate the ending. | ||||
fullyQualifiedFile = fullyQualifiedFile.replace('\\','/'); // ignore platform differences in slashes | fullyQualifiedFile = fullyQualifiedFile.replace('\\','/'); // ignore platform differences in slashes | ||||
assertTrue( "Fully-qualified source file location returned", | |||||
assertTrue( "Fully-qualified source file location returned", | |||||
fullyQualifiedFile.endsWith("/declare-warning/apackage/SomeClass.java")); | fullyQualifiedFile.endsWith("/declare-warning/apackage/SomeClass.java")); | ||||
} catch (IOException ex) { | } catch (IOException ex) { | ||||
assertTrue( "Unable to convert source file location: " + msg.getContainedMessage().getSourceLocation().getSourceFile(), false); | assertTrue( "Unable to convert source file location: " + msg.getContainedMessage().getSourceLocation().getSourceFile(), false); | ||||
} | } | ||||
} | } | ||||
public void testDeclareMessageContents() { | public void testDeclareMessageContents() { | ||||
List<TestMessage> msgs = handler.getMessages(); | List<TestMessage> msgs = handler.getMessages(); | ||||
IMessage msg = ((TestMessageHandler.TestMessage)msgs.get(1)).getContainedMessage(); | IMessage msg = ((TestMessageHandler.TestMessage)msgs.get(1)).getContainedMessage(); |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM Corporation and others. | * Copyright (c) 2004 IBM Corporation and others. | ||||
* All rights reserved. This program and the accompanying materials | |||||
* are made available under the terms of the Eclipse Public License v1.0 | |||||
* All rights reserved. This program and the accompanying materials | |||||
* are made available under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | * Contributors: | ||||
* Matthew Webster - initial implementation | * Matthew Webster - initial implementation | ||||
* Helen Hawkins - Converted to new interface (bug 148190) | * Helen Hawkins - Converted to new interface (bug 148190) |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2003 Contributors. | * Copyright (c) 2003 Contributors. | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Mik Kersten initial implementation | * Mik Kersten initial implementation | ||||
* Andy Clement Copied/changed for -inpath testing | |||||
* Andy Clement Copied/changed for -inpath testing | |||||
* Helen Hawkins Changed to use new ajde interface (bug 148190) | * Helen Hawkins Changed to use new ajde interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.core.tests; | package org.aspectj.ajde.core.tests; | ||||
/** | /** | ||||
* Inputs to the compiler: inpath = 'indir1/' source = 'src' output = a jar file | * Inputs to the compiler: inpath = 'indir1/' source = 'src' output = a jar file | ||||
* | |||||
* | |||||
* Expected result = output jar file contains contents of indir1 and class file for source that was in src | * Expected result = output jar file contains contents of indir1 and class file for source that was in src | ||||
*/ | */ | ||||
public void testInpathToOutjar() { | public void testInpathToOutjar() { | ||||
/** | /** | ||||
* Similar to the first test but outputs to a directory rather than a jar. | * Similar to the first test but outputs to a directory rather than a jar. | ||||
* | |||||
* | |||||
*/ | */ | ||||
public void testInpathToBin() { | public void testInpathToBin() { | ||||
Set<File> inpath = new HashSet<>(); | Set<File> inpath = new HashSet<>(); | ||||
/** | /** | ||||
* Inputs to the compiler: inpath is 'indir2' that contains a helloworld source file and class file. source is 'src2' which | * Inputs to the compiler: inpath is 'indir2' that contains a helloworld source file and class file. source is 'src2' which | ||||
* contains Aspect.java which weaves before advice into the HelloWorld code from 'indir2' | * contains Aspect.java which weaves before advice into the HelloWorld code from 'indir2' | ||||
* | |||||
* | |||||
* Expected result: HelloWorld copied through to output jar and 'weaved'. Compiled version of Aspect.java put into the output | * Expected result: HelloWorld copied through to output jar and 'weaved'. Compiled version of Aspect.java put into the output | ||||
* jar. The HelloWorld.java source file is also copied through to the output jar. | * jar. The HelloWorld.java source file is also copied through to the output jar. | ||||
* | |||||
* | |||||
* An extra check is done at the end of this test to verify that HelloWorld has changed size (due to the weaving). | * An extra check is done at the end of this test to verify that HelloWorld has changed size (due to the weaving). | ||||
*/ | */ | ||||
public void testInpathToOutjar2() { | public void testInpathToOutjar2() { | ||||
/** | /** | ||||
* More complex inpath - a jar and a directory | * More complex inpath - a jar and a directory | ||||
* | |||||
* | |||||
* Inputs: -inpath injar.jar;indir2 source is 'src2' which contains Aspect.java | * Inputs: -inpath injar.jar;indir2 source is 'src2' which contains Aspect.java | ||||
* | |||||
* | |||||
* Expected result: Result should be a directory containing the contents of injar.jar and indir2 and the Aspect.class file. | * Expected result: Result should be a directory containing the contents of injar.jar and indir2 and the Aspect.class file. | ||||
* | |||||
* | |||||
*/ | */ | ||||
public void testInpathAndInjarToBin() { | public void testInpathAndInjarToBin() { | ||||
Set<File> inpath = new HashSet<>(); | Set<File> inpath = new HashSet<>(); |
/******************************************************************************* | /******************************************************************************* | ||||
* Copyright (c) 2004 IBM Corporation and others. | * Copyright (c) 2004 IBM Corporation and others. | ||||
* All rights reserved. This program and the accompanying materials | |||||
* are made available under the terms of the Eclipse Public License v1.0 | |||||
* All rights reserved. This program and the accompanying materials | |||||
* are made available under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution, and is available at | * which accompanies this distribution, and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | * Contributors: | ||||
* IBM Corporation - initial API and implementation | * IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - Converted to new interface (bug 148190) | * Helen Hawkins - Converted to new interface (bug 148190) | ||||
private String[] weave = { "src" + File.separator + "Main.java", | private String[] weave = { "src" + File.separator + "Main.java", | ||||
"src" + File.separator + "Logging.aj" }; | "src" + File.separator + "Logging.aj" }; | ||||
private TestMessageHandler handler; | private TestMessageHandler handler; | ||||
private TestCompilerConfiguration compilerConfig; | private TestCompilerConfiguration compilerConfig; | ||||
handler = null; | handler = null; | ||||
compilerConfig = null; | compilerConfig = null; | ||||
} | } | ||||
public void testWeave () { | public void testWeave () { | ||||
File outjar = openFile(outjarName); | File outjar = openFile(outjarName); | ||||
compilerConfig.setOutjar(outjar.getAbsolutePath()); | compilerConfig.setOutjar(outjar.getAbsolutePath()); | ||||
+ handler.getMessages(), handler.getMessages().isEmpty()); | + handler.getMessages(), handler.getMessages().isEmpty()); | ||||
checkManifest(outjar); | checkManifest(outjar); | ||||
} | } | ||||
public void testNoWeave () { | public void testNoWeave () { | ||||
File outjar = openFile(outjarName); | File outjar = openFile(outjarName); | ||||
compilerConfig.setOutjar(outjar.getAbsolutePath()); | compilerConfig.setOutjar(outjar.getAbsolutePath()); | ||||
+ handler.getMessages(), handler.getMessages().isEmpty()); | + handler.getMessages(), handler.getMessages().isEmpty()); | ||||
checkManifest(outjar); | checkManifest(outjar); | ||||
} | } | ||||
private void checkManifest (File outjarFile) { | private void checkManifest (File outjarFile) { | ||||
Manifest manifest = null; | Manifest manifest = null; | ||||
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2003 Contributors. All rights reserved. | * Copyright (c) 2003 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Matthew Webster initial implementation | * Matthew Webster initial implementation |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2003 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Mik Kersten initial implementation | |||||
* Copyright (c) 2003 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Mik Kersten initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.core.tests; | package org.aspectj.ajde.core.tests; | ||||
/** | /** | ||||
* Look in the specified jar file for resources (anything not .class) and add it the resources Set. | * Look in the specified jar file for resources (anything not .class) and add it the resources Set. | ||||
* | |||||
* | |||||
* @param injarFile jar file to open up | * @param injarFile jar file to open up | ||||
* @param resources the set where resources should be accumulated | * @param resources the set where resources should be accumulated | ||||
* @param wantDirectories should any directories found in the jar be included | * @param wantDirectories should any directories found in the jar be included |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2004 Contributors. | * Copyright (c) 2004 Contributors. | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Andy Clement Initial version | * Andy Clement Initial version | ||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Aim: Check we haven't damaged 'normal compilation' when not supplying -Xreweavable. Also determines baseline sizes for the | * Aim: Check we haven't damaged 'normal compilation' when not supplying -Xreweavable. Also determines baseline sizes for the | ||||
* compiled class files for later comparison. | * compiled class files for later comparison. | ||||
* | |||||
* | |||||
* Inputs to the compiler: NonReweavable1.lst -> CalculatePI.java -> Logger.aj -> -verbose -> -noExit | * Inputs to the compiler: NonReweavable1.lst -> CalculatePI.java -> Logger.aj -> -verbose -> -noExit | ||||
* | |||||
* | |||||
* Expected result = Compile successful, the types will not be reweavable and the weaver should not report it is running in | * Expected result = Compile successful, the types will not be reweavable and the weaver should not report it is running in | ||||
* reweavable mode. | * reweavable mode. | ||||
*/ | */ | ||||
/** | /** | ||||
* Aim: Basic call to -Xreweavable. Weaver should report it is in reweavable mode and the classes produced should be much larger | * Aim: Basic call to -Xreweavable. Weaver should report it is in reweavable mode and the classes produced should be much larger | ||||
* than normal classes (those produced in the first test). | * than normal classes (those produced in the first test). | ||||
* | |||||
* | |||||
* Inputs to the compiler: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | * Inputs to the compiler: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | ||||
* | |||||
* | |||||
* Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable | * Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable | ||||
* mode. The files produced should be larger than those created during the last test. | * mode. The files produced should be larger than those created during the last test. | ||||
*/ | */ | ||||
* Aim: Use the optional ':compress' modifier on -Xreweavable. This causes some of the meta-data for use in reweaving to be | * Aim: Use the optional ':compress' modifier on -Xreweavable. This causes some of the meta-data for use in reweaving to be | ||||
* compressed. It should succeed and produce class files smaller than straight -Xreweavable but larger than without specifying | * compressed. It should succeed and produce class files smaller than straight -Xreweavable but larger than without specifying | ||||
* -Xreweavable. | * -Xreweavable. | ||||
* | |||||
* | |||||
* Inputs to the compiler: ReweavableCompress1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable:compress -> -verbose -> | * Inputs to the compiler: ReweavableCompress1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable:compress -> -verbose -> | ||||
* -noExit | * -noExit | ||||
* | |||||
* | |||||
* Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable | * Expected result = Compile successful, the types will be reweavable and the weaver should report it is running in reweavable | ||||
* mode. The files created should have a size between the non-reweavable versions and the reweavable (without compression) | * mode. The files created should have a size between the non-reweavable versions and the reweavable (without compression) | ||||
* versions. | * versions. | ||||
* Aim: The tests above have determined that reweaving appears to be behaving in terms of the .class files it is creating. Now | * Aim: The tests above have determined that reweaving appears to be behaving in terms of the .class files it is creating. Now | ||||
* lets actually attempt a reweave. For this, we build two files as reweavable and then build a single file whilst specifying an | * lets actually attempt a reweave. For this, we build two files as reweavable and then build a single file whilst specifying an | ||||
* inpath that contains the .class files from the first compile. This should succeed. | * inpath that contains the .class files from the first compile. This should succeed. | ||||
* | |||||
* | |||||
* Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | * Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | ||||
* | |||||
* | |||||
* Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | * Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | ||||
* | |||||
* | |||||
* Expected result = Both compiles will succeed. | * Expected result = Both compiles will succeed. | ||||
*/ | */ | ||||
public void testReweavableSimpleCompile() { | public void testReweavableSimpleCompile() { | ||||
/** | /** | ||||
* Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail | * Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail | ||||
* because there is not enough information to reweave CalculatePI | * because there is not enough information to reweave CalculatePI | ||||
* | |||||
* | |||||
* Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | * Inputs to the first compile: Reweavable1.lst -> CalculatePI.java -> Logger.aj -> -Xreweavable -> -verbose -> -noExit | ||||
* | |||||
* | |||||
* Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | * Input to the second compile: Reweavable2.lst -> SecondAspect.aj -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | ||||
* | |||||
* | |||||
* Expected result = Second compile will fail - reporting that Logger is missing (it 'touched' in the first compile CalculatePI) | * Expected result = Second compile will fail - reporting that Logger is missing (it 'touched' in the first compile CalculatePI) | ||||
*/ | */ | ||||
public void testForReweavableSimpleErrorCompile() { | public void testForReweavableSimpleErrorCompile() { | ||||
/** | /** | ||||
* Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail | * Aim: Based on the test above, if we delete Logger.class between the first and second compiles the second compile should fail | ||||
* because there is not enough information to reweave CalculatePI | * because there is not enough information to reweave CalculatePI | ||||
* | |||||
* | |||||
* Inputs to the first compile: TJP1.lst -> tjp/Demo.java -> tjp/GetInfo.java -> -Xreweavable -> -verbose -> -noExit | * Inputs to the first compile: TJP1.lst -> tjp/Demo.java -> tjp/GetInfo.java -> -Xreweavable -> -verbose -> -noExit | ||||
* | |||||
* | |||||
* Now, delete bin\tjp\GetInfo.class and do a compile with: TJP2.lst -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | * Now, delete bin\tjp\GetInfo.class and do a compile with: TJP2.lst -> -Xreweavable -> -verbose -> -noExit -inpath bin\. | ||||
* | |||||
* | |||||
* Expected result = Second compile will fail - reporting that tjp.GetInfo is missing (it 'touched' in the first compile | * Expected result = Second compile will fail - reporting that tjp.GetInfo is missing (it 'touched' in the first compile | ||||
* tjp.Demo) | * tjp.Demo) | ||||
*/ | */ |
* Copyright (c) 2004 Contributors. | * Copyright (c) 2004 Contributors. | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Andy Clement Initial version | * Andy Clement Initial version |
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.core.tests.model; | package org.aspectj.ajde.core.tests.model; |
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Mik Kersten initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Mik Kersten initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | * Helen Hawkins Converted to new interface (bug 148190) | ||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.core.tests.model; | package org.aspectj.ajde.core.tests.model; |
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | |||||
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), | |||||
* 2003 Contributors. | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* AMC 01.20.2003 extended to support new AspectJ 1.1 options, | |||||
* bugzilla #29769 | |||||
* ******************************************************************/ | |||||
public aspect AjdeApiRules { | |||||
declare warning: | |||||
call(* javax.swing..*(..)) && !within(org.aspectj.ajde.ui.swing..*): | |||||
"do not use Swing outside of org.aspectj.ajde.swing"; | |||||
} | |||||
/* ******************************************************************* | |||||
* Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), | |||||
* 2003 Contributors. | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* AMC 01.20.2003 extended to support new AspectJ 1.1 options, | |||||
* bugzilla #29769 | |||||
* ******************************************************************/ | |||||
public aspect AjdeApiRules { | |||||
declare warning: | |||||
call(* javax.swing..*(..)) && !within(org.aspectj.ajde.ui.swing..*): | |||||
"do not use Swing outside of org.aspectj.ajde.swing"; | |||||
} |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde; | package org.aspectj.ajde; | ||||
* Singleton class used to initialize the Ajde ui as well as the properties required to run the compiler. Users must call | * Singleton class used to initialize the Ajde ui as well as the properties required to run the compiler. Users must call | ||||
* "Ajde.init(...)" before doing anything else. There are getter methods for the various properties that are set in the | * "Ajde.init(...)" before doing anything else. There are getter methods for the various properties that are set in the | ||||
* initialization. | * initialization. | ||||
* | |||||
* | |||||
* This also defines the factory for getting new AjCompiler instances. | * This also defines the factory for getting new AjCompiler instances. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
* @author Andy Clement | * @author Andy Clement | ||||
*/ | */ | ||||
/** | /** | ||||
* Utility to run the project main class from the project properties in the same VM using a class loader populated with the | * Utility to run the project main class from the project properties in the same VM using a class loader populated with the | ||||
* classpath and output path or jar. Errors are logged to the ErrorHandler. | * classpath and output path or jar. Errors are logged to the ErrorHandler. | ||||
* | |||||
* | |||||
* @return Thread running with process, or null if unable to start | * @return Thread running with process, or null if unable to start | ||||
*/ | */ | ||||
public Thread runInSameVM() { | public Thread runInSameVM() { | ||||
/** | /** | ||||
* Utility to run the project main class from the project properties in a new VM. Errors are logged to the ErrorHandler. | * Utility to run the project main class from the project properties in a new VM. Errors are logged to the ErrorHandler. | ||||
* | |||||
* | |||||
* @return LangUtil.ProcessController running with process, or null if unable to start | * @return LangUtil.ProcessController running with process, or null if unable to start | ||||
*/ | */ | ||||
public LangUtil.ProcessController runInNewVM() { | public LangUtil.ProcessController runInNewVM() { | ||||
/** | /** | ||||
* Set the build off in the same thread | * Set the build off in the same thread | ||||
* | |||||
* | |||||
* @param configFile | * @param configFile | ||||
* @param buildFresh - true if want to do a full build, false otherwise | * @param buildFresh - true if want to do a full build, false otherwise | ||||
*/ | */ | ||||
/** | /** | ||||
* Set the build off in a different thread. Would need to set the build off in a different thread if using a swing application | * Set the build off in a different thread. Would need to set the build off in a different thread if using a swing application | ||||
* to display the build progress. | * to display the build progress. | ||||
* | |||||
* | |||||
* @param configFile | * @param configFile | ||||
* @param buildFresh - true if want to do a full build, false otherwise | * @param buildFresh - true if want to do a full build, false otherwise | ||||
*/ | */ | ||||
/** | /** | ||||
* If the provided configFile is the same as the id for the last compiler then returns that, otherwise clears the state for the | * If the provided configFile is the same as the id for the last compiler then returns that, otherwise clears the state for the | ||||
* saved compiler and creates a new one for the provided configFile | * saved compiler and creates a new one for the provided configFile | ||||
* | |||||
* | |||||
* @param configFile | * @param configFile | ||||
* @return the AjCompiler with the id of the given configFile | * @return the AjCompiler with the id of the given configFile | ||||
*/ | */ |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
//public static IconRegistry INSTANCE = null; | //public static IconRegistry INSTANCE = null; | ||||
protected String RESOURCE_PATH = "org/aspectj/ajde/resources/"; | protected String RESOURCE_PATH = "org/aspectj/ajde/resources/"; | ||||
private final Icon START_AJDE = makeIcon("actions/startAjde.gif"); | private final Icon START_AJDE = makeIcon("actions/startAjde.gif"); | ||||
private final Icon STOP_AJDE = makeIcon("actions/stopAjde.gif"); | private final Icon STOP_AJDE = makeIcon("actions/stopAjde.gif"); | ||||
private final Icon BUILD = makeIcon("actions/build.gif"); | private final Icon BUILD = makeIcon("actions/build.gif"); | ||||
private final Icon EXECUTE = makeIcon("actions/execute.gif"); | private final Icon EXECUTE = makeIcon("actions/execute.gif"); | ||||
private final Icon AJBROWSER = makeIcon("structure/advice.gif"); | private final Icon AJBROWSER = makeIcon("structure/advice.gif"); | ||||
private final Icon AJBROWSER_ENABLED = makeIcon("actions/browserEnabled.gif"); | private final Icon AJBROWSER_ENABLED = makeIcon("actions/browserEnabled.gif"); | ||||
private final Icon AJBROWSER_DISABLED = makeIcon("actions/browserDisabled.gif"); | |||||
private final Icon STRUCTURE_VIEW = makeIcon("actions/structureView.gif"); | |||||
private final Icon AJBROWSER_DISABLED = makeIcon("actions/browserDisabled.gif"); | |||||
private final Icon STRUCTURE_VIEW = makeIcon("actions/structureView.gif"); | |||||
private final Icon HIDE_ASSOCIATIONS = makeIcon("actions/hideAssociations.gif"); | |||||
private final Icon HIDE_NON_AJ = makeIcon("actions/hideNonAJ.gif"); | |||||
private final Icon GRANULARITY = makeIcon("actions/granularity.gif"); | |||||
private final Icon AJDE_SMALL = makeIcon("actions/ajdeSmall.gif"); | |||||
private final Icon HIDE_ASSOCIATIONS = makeIcon("actions/hideAssociations.gif"); | |||||
private final Icon HIDE_NON_AJ = makeIcon("actions/hideNonAJ.gif"); | |||||
private final Icon GRANULARITY = makeIcon("actions/granularity.gif"); | |||||
private final Icon AJDE_SMALL = makeIcon("actions/ajdeSmall.gif"); | |||||
private final Icon ERROR = makeIcon("structure/error.gif"); | private final Icon ERROR = makeIcon("structure/error.gif"); | ||||
private final Icon WARNING = makeIcon("structure/warning.gif"); | private final Icon WARNING = makeIcon("structure/warning.gif"); | ||||
private final Icon INFO = makeIcon("structure/info.gif"); | |||||
private final Icon INFO = makeIcon("structure/info.gif"); | |||||
private final Icon POPUP = makeIcon("actions/popup.gif"); | private final Icon POPUP = makeIcon("actions/popup.gif"); | ||||
private final Icon FILTER = makeIcon("actions/filter.gif"); | private final Icon FILTER = makeIcon("actions/filter.gif"); | ||||
private final Icon RELATIONS = makeIcon("actions/relations.gif"); | private final Icon RELATIONS = makeIcon("actions/relations.gif"); | ||||
private final Icon ORDER = makeIcon("actions/order.gif"); | private final Icon ORDER = makeIcon("actions/order.gif"); | ||||
private final Icon ZOOM_STRUCTURE_TO_FILE_MODE = makeIcon("actions/zoomStructureToFileMode.gif"); | private final Icon ZOOM_STRUCTURE_TO_FILE_MODE = makeIcon("actions/zoomStructureToFileMode.gif"); | ||||
private final Icon ZOOM_STRUCTURE_TO_GLOBAL_MODE = makeIcon("actions/zoomStructureToGlobalMode.gif"); | private final Icon ZOOM_STRUCTURE_TO_GLOBAL_MODE = makeIcon("actions/zoomStructureToGlobalMode.gif"); | ||||
private final Icon SPLIT_STRUCTURE_VIEW = makeIcon("actions/splitStructureView.gif"); | private final Icon SPLIT_STRUCTURE_VIEW = makeIcon("actions/splitStructureView.gif"); | ||||
private final Icon MERGE_STRUCTURE_VIEW = makeIcon("actions/mergeStructureView.gif"); | private final Icon MERGE_STRUCTURE_VIEW = makeIcon("actions/mergeStructureView.gif"); | ||||
private final Icon BACK = makeIcon("actions/back.gif"); | private final Icon BACK = makeIcon("actions/back.gif"); | ||||
private final Icon FORWARD = makeIcon("actions/forward.gif"); | private final Icon FORWARD = makeIcon("actions/forward.gif"); | ||||
private final Icon SEARCH = makeIcon("actions/search.gif"); | private final Icon SEARCH = makeIcon("actions/search.gif"); | ||||
private final Icon SAVE = makeIcon("actions/save.gif"); | private final Icon SAVE = makeIcon("actions/save.gif"); | ||||
private final Icon SAVE_ALL = makeIcon("actions/saveAll.gif"); | private final Icon SAVE_ALL = makeIcon("actions/saveAll.gif"); | ||||
private final Icon BROWSER_OPTIONS = makeIcon("actions/browseroptions.gif"); | private final Icon BROWSER_OPTIONS = makeIcon("actions/browseroptions.gif"); | ||||
private final Icon ACCESSIBILITY_PUBLIC = makeIcon("structure/accessibility-public.gif"); | private final Icon ACCESSIBILITY_PUBLIC = makeIcon("structure/accessibility-public.gif"); | ||||
private final Icon ACCESSIBILITY_PACKAGE = makeIcon("structure/accessibility-package.gif"); | private final Icon ACCESSIBILITY_PACKAGE = makeIcon("structure/accessibility-package.gif"); | ||||
private final Icon ACCESSIBILITY_PROTECTED = makeIcon("structure/accessibility-protected.gif"); | private final Icon ACCESSIBILITY_PROTECTED = makeIcon("structure/accessibility-protected.gif"); | ||||
public Icon getStructureViewIcon() { return STRUCTURE_VIEW; } | public Icon getStructureViewIcon() { return STRUCTURE_VIEW; } | ||||
public Icon getAssociationSwingIcon(IRelationship.Kind relation) { | public Icon getAssociationSwingIcon(IRelationship.Kind relation) { | ||||
return convertToSwingIcon(getIcon(relation)); | |||||
return convertToSwingIcon(getIcon(relation)); | |||||
} | } | ||||
public AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { | public AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { | ||||
return getIcon(kind); | |||||
return getIcon(kind); | |||||
} | } | ||||
public Icon getStructureSwingIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { | |||||
return convertToSwingIcon(getStructureIcon(kind, accessibility)); | |||||
public Icon getStructureSwingIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility) { | |||||
return convertToSwingIcon(getStructureIcon(kind, accessibility)); | |||||
} | } | ||||
public Icon getStructureSwingIcon(IProgramElement.Kind kind) { | public Icon getStructureSwingIcon(IProgramElement.Kind kind) { | ||||
return convertToSwingIcon(getIcon(kind)); | return convertToSwingIcon(getIcon(kind)); | ||||
} | } | ||||
return (Icon)iconAdapter.getIconResource(); | return (Icon)iconAdapter.getIconResource(); | ||||
} else { | } else { | ||||
return null; | return null; | ||||
} | |||||
} | |||||
} | } | ||||
protected AbstractIcon createIcon(String path) { | protected AbstractIcon createIcon(String path) { | ||||
if (resource == null) { | if (resource == null) { | ||||
throw new IllegalStateException("Unable to find icon resource: "+path); | throw new IllegalStateException("Unable to find icon resource: "+path); | ||||
} | } | ||||
return new AbstractIcon(new ImageIcon(resource)); | |||||
// return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); | |||||
return new AbstractIcon(new ImageIcon(resource)); | |||||
// return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); | |||||
} | } | ||||
protected Icon makeIcon(String iconPath) { | protected Icon makeIcon(String iconPath) { |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.internal; | package org.aspectj.ajde.internal; |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.internal; | package org.aspectj.ajde.internal; | ||||
//import org.aspectj.ajde.compiler.AjdeCompiler; | //import org.aspectj.ajde.compiler.AjdeCompiler; | ||||
*/ | */ | ||||
// public static void dumpStructure(StructureNode node, String indent) { | // public static void dumpStructure(StructureNode node, String indent) { | ||||
// if (node == null) return; | // if (node == null) return; | ||||
// Syste.println(indent + node); | |||||
// Syste.println(indent + node); | |||||
// if (node.getChildren() != null) { | // if (node.getChildren() != null) { | ||||
// for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) { | // for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) { | ||||
// dumpStructure((StructureNode)it.next(), indent + " "); | // dumpStructure((StructureNode)it.next(), indent + " "); |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui; | package org.aspectj.ajde.ui; | ||||
/** | /** | ||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class AbstractIcon { | public class AbstractIcon { | ||||
private Object iconResource; | private Object iconResource; | ||||
public AbstractIcon(Object iconResource) { | public AbstractIcon(Object iconResource) { | ||||
this.iconResource = iconResource; | |||||
} | |||||
this.iconResource = iconResource; | |||||
} | |||||
public Object getIconResource() { | public Object getIconResource() { | ||||
return iconResource; | |||||
return iconResource; | |||||
} | } | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Uses the factory pattern. | * Uses the factory pattern. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public abstract class AbstractIconRegistry { | public abstract class AbstractIconRegistry { | ||||
protected final String RESOURCE_PATH = "org/aspectj/ajde/resources/"; | protected final String RESOURCE_PATH = "org/aspectj/ajde/resources/"; | ||||
protected final String STRUCTURE_PATH = RESOURCE_PATH + "structure/"; | protected final String STRUCTURE_PATH = RESOURCE_PATH + "structure/"; | ||||
protected final AbstractIcon DECLARE_SOFT = createIcon(STRUCTURE_PATH + "declareSoft.gif"); | protected final AbstractIcon DECLARE_SOFT = createIcon(STRUCTURE_PATH + "declareSoft.gif"); | ||||
protected final AbstractIcon CODE = createIcon(STRUCTURE_PATH + "code.gif"); | protected final AbstractIcon CODE = createIcon(STRUCTURE_PATH + "code.gif"); | ||||
protected final AbstractIcon ERROR = createIcon(STRUCTURE_PATH + "error.gif"); | protected final AbstractIcon ERROR = createIcon(STRUCTURE_PATH + "error.gif"); | ||||
protected final AbstractIcon FILE = createIcon(STRUCTURE_PATH + "file.gif"); | protected final AbstractIcon FILE = createIcon(STRUCTURE_PATH + "file.gif"); | ||||
protected final AbstractIcon FILE_JAVA = createIcon(STRUCTURE_PATH + "file-java.gif"); | protected final AbstractIcon FILE_JAVA = createIcon(STRUCTURE_PATH + "file-java.gif"); | ||||
protected final AbstractIcon FILE_ASPECTJ = createIcon(STRUCTURE_PATH + "file-aspectj.gif"); | protected final AbstractIcon FILE_ASPECTJ = createIcon(STRUCTURE_PATH + "file-aspectj.gif"); | ||||
protected final AbstractIcon FILE_LST = createIcon(STRUCTURE_PATH + "file-lst.gif"); | protected final AbstractIcon FILE_LST = createIcon(STRUCTURE_PATH + "file-lst.gif"); | ||||
protected final AbstractIcon METHOD = createIcon(STRUCTURE_PATH + "method.gif"); | protected final AbstractIcon METHOD = createIcon(STRUCTURE_PATH + "method.gif"); | ||||
protected final AbstractIcon FIELD = createIcon(STRUCTURE_PATH + "field.gif"); | protected final AbstractIcon FIELD = createIcon(STRUCTURE_PATH + "field.gif"); | ||||
protected final AbstractIcon ENUM_VALUE = createIcon(STRUCTURE_PATH + "field.gif"); // ??? should be enum value icon | protected final AbstractIcon ENUM_VALUE = createIcon(STRUCTURE_PATH + "field.gif"); // ??? should be enum value icon | ||||
* @return null if the kind could not be resolved | * @return null if the kind could not be resolved | ||||
*/ | */ | ||||
protected abstract AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility); | protected abstract AbstractIcon getStructureIcon(IProgramElement.Kind kind, IProgramElement.Accessibility accessibility); | ||||
/** | /** | ||||
* Assumes "public" visibility for the icon. | * Assumes "public" visibility for the icon. | ||||
* | |||||
* | |||||
* @return null if the kind could not be resolved | * @return null if the kind could not be resolved | ||||
*/ | */ | ||||
public AbstractIcon getIcon(IProgramElement.Kind kind) { | |||||
public AbstractIcon getIcon(IProgramElement.Kind kind) { | |||||
if (kind == IProgramElement.Kind.PROJECT) { | if (kind == IProgramElement.Kind.PROJECT) { | ||||
return PROJECT; | return PROJECT; | ||||
} else if (kind == IProgramElement.Kind.PACKAGE) { | } else if (kind == IProgramElement.Kind.PACKAGE) { | ||||
return null; | return null; | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Implement to create platform-specific icons. | * Implement to create platform-specific icons. | ||||
*/ | |||||
*/ | |||||
protected abstract AbstractIcon createIcon(String path); | protected abstract AbstractIcon createIcon(String path); | ||||
} | } | ||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui; | package org.aspectj.ajde.ui; | ||||
/** | /** | ||||
* @author Mik Kersten | * @author Mik Kersten | ||||
* | |||||
* | |||||
* TODO: clean-up after merging of org.aspectj.asm.StructureNode | * TODO: clean-up after merging of org.aspectj.asm.StructureNode | ||||
*/ | */ | ||||
public class BuildConfigNode { | public class BuildConfigNode { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Should only be created by the {@link StructureViewManager} or an | * Should only be created by the {@link StructureViewManager} or an | ||||
* equivalent factory. | * equivalent factory. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class FileStructureView extends StructureView { | public class FileStructureView extends StructureView { | ||||
private String sourceFilePath = null; | private String sourceFilePath = null; | ||||
public FileStructureView(StructureViewProperties viewProperties) { | public FileStructureView(StructureViewProperties viewProperties) { | ||||
super.viewProperties = viewProperties; | |||||
} | |||||
super.viewProperties = viewProperties; | |||||
} | |||||
public String getSourceFile() { | public String getSourceFile() { | ||||
return sourceFilePath; | return sourceFilePath; | ||||
} | } | ||||
super.setRootNode(rootNode); | super.setRootNode(rootNode); | ||||
notifyViewUpdated(); | notifyViewUpdated(); | ||||
} | } | ||||
public String getName() { | public String getName() { | ||||
return "File view for: " + sourceFilePath; | |||||
return "File view for: " + sourceFilePath; | |||||
} | } | ||||
} | } | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Should only be created by the {@link StructureViewManager} or an | * Should only be created by the {@link StructureViewManager} or an | ||||
* equivalent factory. | * equivalent factory. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class GlobalStructureView extends FileStructureView { | public class GlobalStructureView extends FileStructureView { | ||||
public GlobalStructureView(GlobalViewProperties viewProperties) { | public GlobalStructureView(GlobalViewProperties viewProperties) { | ||||
super(viewProperties); | super(viewProperties); | ||||
this.viewProperties = viewProperties; | |||||
} | |||||
this.viewProperties = viewProperties; | |||||
} | |||||
public GlobalViewProperties getGlobalViewProperties() { | public GlobalViewProperties getGlobalViewProperties() { | ||||
return viewProperties; | |||||
return viewProperties; | |||||
} | } | ||||
// public void setActiveNode(StructureViewNode activeNode) { | // public void setActiveNode(StructureViewNode activeNode) { | ||||
// StructureNode node = activeNode.getStructureNode(); | // StructureNode node = activeNode.getStructureNode(); | ||||
// | |||||
// | |||||
// activeNode = activeNode; | // activeNode = activeNode; | ||||
// if (renderer != null) renderer.setActiveNode(activeNode); | // if (renderer != null) renderer.setActiveNode(activeNode); | ||||
// } | // } | ||||
// | |||||
// | |||||
// public void setActiveNode(StructureViewNode activeNode, int sourceLine) { | // public void setActiveNode(StructureViewNode activeNode, int sourceLine) { | ||||
// activeNode = activeNode; | // activeNode = activeNode; | ||||
// if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); | // if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); | ||||
// } | // } | ||||
public String toString() { | public String toString() { | ||||
return viewProperties.getHierarchy().toString(); | |||||
return viewProperties.getHierarchy().toString(); | |||||
} | } | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
public class GlobalViewProperties extends StructureViewProperties { | public class GlobalViewProperties extends StructureViewProperties { | ||||
private StructureViewProperties.Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS; | private StructureViewProperties.Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS; | ||||
private StructureViewProperties.Hierarchy hierarchy = StructureViewProperties.Hierarchy.DECLARATION; | |||||
private StructureViewProperties.Hierarchy hierarchy = StructureViewProperties.Hierarchy.DECLARATION; | |||||
public GlobalViewProperties(StructureViewProperties.Hierarchy hierarchy) { | public GlobalViewProperties(StructureViewProperties.Hierarchy hierarchy) { | ||||
this.hierarchy = hierarchy; | this.hierarchy = hierarchy; | ||||
} | } | ||||
public void setGranularity(StructureViewProperties.Granularity granularity) { | public void setGranularity(StructureViewProperties.Granularity granularity) { | ||||
this.granularity = granularity; | this.granularity = granularity; | ||||
} | } | ||||
public StructureViewProperties.Granularity getGranularity() { | public StructureViewProperties.Granularity getGranularity() { | ||||
return granularity; | return granularity; | ||||
} | } | ||||
public void setHierarchy(StructureViewProperties.Hierarchy hierarchy) { | public void setHierarchy(StructureViewProperties.Hierarchy hierarchy) { | ||||
this.hierarchy = hierarchy; | |||||
this.hierarchy = hierarchy; | |||||
} | } | ||||
public StructureViewProperties.Hierarchy getHierarchy() { | public StructureViewProperties.Hierarchy getHierarchy() { | ||||
return hierarchy; | return hierarchy; | ||||
} | } | ||||
public String getName() { | public String getName() { | ||||
return hierarchy.toString(); | return hierarchy.toString(); | ||||
} | } |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
*/ | */ | ||||
public abstract class StructureView { | public abstract class StructureView { | ||||
private IStructureViewNode rootNode = null; | |||||
private IStructureViewNode activeNode = null; | |||||
private IStructureViewNode rootNode = null; | |||||
private IStructureViewNode activeNode = null; | |||||
protected StructureViewProperties viewProperties = null; | protected StructureViewProperties viewProperties = null; | ||||
protected StructureViewRenderer renderer = null; | protected StructureViewRenderer renderer = null; | ||||
public StructureViewProperties getViewProperties() { | public StructureViewProperties getViewProperties() { | ||||
return viewProperties; | |||||
} | |||||
return viewProperties; | |||||
} | |||||
public IStructureViewNode getRootNode() { | public IStructureViewNode getRootNode() { | ||||
return rootNode; | |||||
return rootNode; | |||||
} | } | ||||
public void setRootNode(IStructureViewNode rootNode) { | public void setRootNode(IStructureViewNode rootNode) { | ||||
* @return the view node corresponding to the active ProgramElementNode or null | * @return the view node corresponding to the active ProgramElementNode or null | ||||
*/ | */ | ||||
public IStructureViewNode getActiveNode() { | public IStructureViewNode getActiveNode() { | ||||
if (activeNode != null | |||||
if (activeNode != null | |||||
&& activeNode.getStructureNode()!=null) { | && activeNode.getStructureNode()!=null) { | ||||
return activeNode; | return activeNode; | ||||
} else { | } else { | ||||
/** | /** | ||||
* Searches from the root node of the view down in order to find matches. | * Searches from the root node of the view down in order to find matches. | ||||
* | |||||
* | |||||
* @return the first match | * @return the first match | ||||
*/ | */ | ||||
public IStructureViewNode findCorrespondingViewNode(IProgramElement node) { | public IStructureViewNode findCorrespondingViewNode(IProgramElement node) { | ||||
return findCorrespondingViewNodeHelper(rootNode, node); | return findCorrespondingViewNodeHelper(rootNode, node); | ||||
} | } | ||||
private IStructureViewNode findCorrespondingViewNodeHelper(IStructureViewNode node, IProgramElement pNode) { | |||||
private IStructureViewNode findCorrespondingViewNodeHelper(IStructureViewNode node, IProgramElement pNode) { | |||||
if (node != null | if (node != null | ||||
&& node.getStructureNode() != null | |||||
&& node.getStructureNode() != null | |||||
&& node.getStructureNode().equals(pNode) | && node.getStructureNode().equals(pNode) | ||||
&& node.getKind() == IStructureViewNode.Kind.DECLARATION) { | |||||
return node; | |||||
} | |||||
&& node.getKind() == IStructureViewNode.Kind.DECLARATION) { | |||||
return node; | |||||
} | |||||
if (node != null && node.getChildren() != null) { | if (node != null && node.getChildren() != null) { | ||||
for (Object o : node.getChildren()) { | for (Object o : node.getChildren()) { | ||||
IStructureViewNode foundNode = findCorrespondingViewNodeHelper((IStructureViewNode) o, pNode); | IStructureViewNode foundNode = findCorrespondingViewNodeHelper((IStructureViewNode) o, pNode); | ||||
if (foundNode != null) return foundNode; | if (foundNode != null) return foundNode; | ||||
} | } | ||||
} | } | ||||
return null; | return null; | ||||
} | |||||
} | |||||
public void setActiveNode(IStructureViewNode activeNode) { | public void setActiveNode(IStructureViewNode activeNode) { | ||||
this.activeNode = activeNode; | this.activeNode = activeNode; | ||||
if (renderer != null) renderer.setActiveNode(activeNode); | if (renderer != null) renderer.setActiveNode(activeNode); | ||||
} | } | ||||
public void setActiveNode(IStructureViewNode activeNode, int sourceLine) { | public void setActiveNode(IStructureViewNode activeNode, int sourceLine) { | ||||
this.activeNode = activeNode; | this.activeNode = activeNode; | ||||
if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); | if (renderer != null) renderer.setActiveNode(activeNode, sourceLine); | ||||
} | } | ||||
} | } | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui; | package org.aspectj.ajde.ui; | ||||
/** | /** | ||||
* Only navigations of the default view are registered with the history. | * Only navigations of the default view are registered with the history. | ||||
* | |||||
* | |||||
* @param newFilePath the canonicalized path to the new file | * @param newFilePath the canonicalized path to the new file | ||||
*/ | */ | ||||
public void fireNavigationAction(String newFilePath, int lineNumber) { | public void fireNavigationAction(String newFilePath, int lineNumber) { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui; | package org.aspectj.ajde.ui; | ||||
/** | /** | ||||
* Implementors must override this method in order to create new relationship nodes. | * Implementors must override this method in order to create new relationship nodes. | ||||
* | |||||
* | |||||
* If returned node is null it will not be added to the tree. | * If returned node is null it will not be added to the tree. | ||||
*/ | */ | ||||
protected abstract IStructureViewNode createRelationship(IRelationship relationship, AbstractIcon icon); | protected abstract IStructureViewNode createRelationship(IRelationship relationship, AbstractIcon icon); |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class NavigationHistoryModel { | public class NavigationHistoryModel { | ||||
private IProgramElement currNode = null; | private IProgramElement currNode = null; | ||||
private Stack backHistory = new Stack(); | private Stack backHistory = new Stack(); | ||||
private Stack forwardHistory = new Stack(); | private Stack forwardHistory = new Stack(); | ||||
/** | /** | ||||
* @return null if the history is empty | * @return null if the history is empty | ||||
*/ | */ | ||||
public IProgramElement navigateBack() { | public IProgramElement navigateBack() { | ||||
if (backHistory.isEmpty() || currNode == null) return null; | if (backHistory.isEmpty() || currNode == null) return null; | ||||
forwardHistory.push(currNode); | forwardHistory.push(currNode); | ||||
currNode = (IProgramElement)backHistory.pop(); | currNode = (IProgramElement)backHistory.pop(); | ||||
return currNode; | return currNode; | ||||
/** | /** | ||||
* @return null if the history is empty | * @return null if the history is empty | ||||
*/ | |||||
*/ | |||||
public IProgramElement navigateForward() { | public IProgramElement navigateForward() { | ||||
if (forwardHistory.isEmpty() || currNode == null) return null; | if (forwardHistory.isEmpty() || currNode == null) return null; | ||||
backHistory.push(currNode); | backHistory.push(currNode); | ||||
currNode = (IProgramElement)forwardHistory.pop(); | currNode = (IProgramElement)forwardHistory.pop(); | ||||
return currNode; | return currNode; | ||||
} | } | ||||
public void navigateToNode(IProgramElement toNode) { | public void navigateToNode(IProgramElement toNode) { | ||||
if (currNode != null) backHistory.push(currNode); | if (currNode != null) backHistory.push(currNode); | ||||
currNode = toNode; | |||||
currNode = toNode; | |||||
} | } | ||||
} | } |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.ui.javaoptions; | package org.aspectj.ajde.ui.javaoptions; |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.ui.javaoptions; | package org.aspectj.ajde.ui.javaoptions; | ||||
*/ | */ | ||||
public class JavaCompilerWarningsOptionsPanel extends OptionsPanel { | public class JavaCompilerWarningsOptionsPanel extends OptionsPanel { | ||||
private final String[] ignoreOrWarning = new String[] {JavaOptions.IGNORE,JavaOptions.WARNING}; | |||||
private final String[] ignoreOrWarning = new String[] {JavaOptions.IGNORE,JavaOptions.WARNING}; | |||||
private static final long serialVersionUID = 4491319302490183151L; | private static final long serialVersionUID = 4491319302490183151L; | ||||
private JPanel parentPanel; | private JPanel parentPanel; | ||||
private Border warningsEtchedBorder; | private Border warningsEtchedBorder; | ||||
private TitledBorder warningsTitleBorder; | private TitledBorder warningsTitleBorder; | ||||
private Border warningsCompoundBorder; | private Border warningsCompoundBorder; | ||||
private JPanel warningsPanel; | private JPanel warningsPanel; | ||||
private Box warningsBox = Box.createVerticalBox(); | private Box warningsBox = Box.createVerticalBox(); | ||||
private JavaBuildOptions javaBuildOptions; | private JavaBuildOptions javaBuildOptions; | ||||
private Map/*String --> JComboBox*/ warningComboBoxes = new HashMap(); | private Map/*String --> JComboBox*/ warningComboBoxes = new HashMap(); | ||||
public JavaCompilerWarningsOptionsPanel(JavaBuildOptions javaBuildOptions) { | public JavaCompilerWarningsOptionsPanel(JavaBuildOptions javaBuildOptions) { | ||||
this.javaBuildOptions = javaBuildOptions; | this.javaBuildOptions = javaBuildOptions; | ||||
try { | try { | ||||
public void loadOptions() throws IOException { | public void loadOptions() throws IOException { | ||||
createWarningContents(); | createWarningContents(); | ||||
} | } | ||||
public void saveOptions() throws IOException { | |||||
public void saveOptions() throws IOException { | |||||
Set s = warningComboBoxes.entrySet(); | Set s = warningComboBoxes.entrySet(); | ||||
for (Object o : s) { | for (Object o : s) { | ||||
Entry entry = (Entry) o; | Entry entry = (Entry) o; | ||||
String value = (String) combo.getSelectedItem(); | String value = (String) combo.getSelectedItem(); | ||||
javaBuildOptions.setOption(javaOption, value); | javaBuildOptions.setOption(javaOption, value); | ||||
} | } | ||||
} | |||||
} | |||||
private void jbInit() throws Exception { | private void jbInit() throws Exception { | ||||
this.setLayout(new BorderLayout()); | this.setLayout(new BorderLayout()); | ||||
createWarningsEntry("Non-externalized strings",JavaOptions.WARN_NON_NLS); | createWarningsEntry("Non-externalized strings",JavaOptions.WARN_NON_NLS); | ||||
warningsPanel.add(warningsBox,null); | warningsPanel.add(warningsBox,null); | ||||
} | } | ||||
private void createWarningsEntry(String labelText, String javaOptionToSet) { | private void createWarningsEntry(String labelText, String javaOptionToSet) { | ||||
JPanel panel = new JPanel(); | JPanel panel = new JPanel(); | ||||
panel.setLayout(new BorderLayout()); | panel.setLayout(new BorderLayout()); | ||||
JLabel label = new JLabel(); | JLabel label = new JLabel(); | ||||
label.setFont(new java.awt.Font("Dialog", 0, 11)); | label.setFont(new java.awt.Font("Dialog", 0, 11)); | ||||
label.setText(labelText); | label.setText(labelText); | ||||
panel.add(label,BorderLayout.WEST); | panel.add(label,BorderLayout.WEST); | ||||
JComboBox warnings = new JComboBox(ignoreOrWarning); | JComboBox warnings = new JComboBox(ignoreOrWarning); | ||||
String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet); | String value = (String) javaBuildOptions.getJavaBuildOptionsMap().get(javaOptionToSet); | ||||
if (value.equals(JavaOptions.IGNORE)) { | if (value.equals(JavaOptions.IGNORE)) { | ||||
warnings.setSelectedIndex(0); | warnings.setSelectedIndex(0); | ||||
} else { | } else { | ||||
warnings.setSelectedIndex(1); | |||||
warnings.setSelectedIndex(1); | |||||
} | } | ||||
panel.add(warnings,BorderLayout.EAST); | panel.add(warnings,BorderLayout.EAST); | ||||
warningsBox.add(panel,null); | warningsBox.add(panel,null); | ||||
warningComboBoxes.put(javaOptionToSet,warnings); | warningComboBoxes.put(javaOptionToSet,warnings); | ||||
} | } | ||||
private void createBorders() { | |||||
private void createBorders() { | |||||
warningsEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); | warningsEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); | ||||
warningsTitleBorder = new TitledBorder(warningsEtchedBorder, "Warning Options"); | warningsTitleBorder = new TitledBorder(warningsEtchedBorder, "Warning Options"); | ||||
warningsCompoundBorder = BorderFactory.createCompoundBorder(warningsTitleBorder, | warningsCompoundBorder = BorderFactory.createCompoundBorder(warningsTitleBorder, | ||||
BorderFactory.createEmptyBorder(5, 5, 5, 5)); | BorderFactory.createEmptyBorder(5, 5, 5, 5)); | ||||
warningsTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); | warningsTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); | ||||
} | } | ||||
private void addBordersToPanel() { | private void addBordersToPanel() { | ||||
parentPanel = new JPanel(); | parentPanel = new JPanel(); | ||||
parentPanel.setLayout(new BorderLayout()); | parentPanel.setLayout(new BorderLayout()); | ||||
warningsPanel = new JPanel(); | warningsPanel = new JPanel(); | ||||
warningsPanel.setBorder(warningsCompoundBorder); | warningsPanel.setBorder(warningsCompoundBorder); | ||||
parentPanel.add(warningsPanel,BorderLayout.CENTER); | parentPanel.add(warningsPanel,BorderLayout.CENTER); |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | * Copyright (c) 2007 Contributors. All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: IBM Corporation - initial API and implementation | * Contributors: IBM Corporation - initial API and implementation | ||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) |
/******************************************************************** | /******************************************************************** | ||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Copyright (c) 2007 Contributors. All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: IBM Corporation - initial API and implementation | |||||
* Helen Hawkins - initial version (bug 148190) | * Helen Hawkins - initial version (bug 148190) | ||||
*******************************************************************/ | *******************************************************************/ | ||||
package org.aspectj.ajde.ui.javaoptions; | package org.aspectj.ajde.ui.javaoptions; | ||||
public class JavaOtherOptionsPanel extends OptionsPanel { | public class JavaOtherOptionsPanel extends OptionsPanel { | ||||
private static final long serialVersionUID = 4491319302490183151L; | private static final long serialVersionUID = 4491319302490183151L; | ||||
private JPanel parentPanel; | private JPanel parentPanel; | ||||
private Border otherEtchedBorder; | private Border otherEtchedBorder; | ||||
private Border otherCompoundBorder; | private Border otherCompoundBorder; | ||||
private JPanel otherPanel; | private JPanel otherPanel; | ||||
private Box otherBox = Box.createVerticalBox(); | private Box otherBox = Box.createVerticalBox(); | ||||
private JavaBuildOptions javaBuildOptions; | private JavaBuildOptions javaBuildOptions; | ||||
private JTextField characterEncoding; | private JTextField characterEncoding; | ||||
public JavaOtherOptionsPanel(JavaBuildOptions javaBuildOptions) { | public JavaOtherOptionsPanel(JavaBuildOptions javaBuildOptions) { | ||||
this.javaBuildOptions = javaBuildOptions; | this.javaBuildOptions = javaBuildOptions; | ||||
try { | try { | ||||
public void loadOptions() throws IOException { | public void loadOptions() throws IOException { | ||||
createOtherContents(); | createOtherContents(); | ||||
} | } | ||||
public void saveOptions() throws IOException { | |||||
public void saveOptions() throws IOException { | |||||
String text = characterEncoding.getText(); | String text = characterEncoding.getText(); | ||||
if (text != null ) { | if (text != null ) { | ||||
javaBuildOptions.setCharacterEncoding(text); | javaBuildOptions.setCharacterEncoding(text); | ||||
} | |||||
} | |||||
} | |||||
} | |||||
private void jbInit() throws Exception { | private void jbInit() throws Exception { | ||||
this.setLayout(new BorderLayout()); | this.setLayout(new BorderLayout()); | ||||
createBorders(); | createBorders(); | ||||
label.setFont(new java.awt.Font("Dialog", 0, 11)); | label.setFont(new java.awt.Font("Dialog", 0, 11)); | ||||
label.setText("Character encoding (will default to platform encoding)"); | label.setText("Character encoding (will default to platform encoding)"); | ||||
panel.add(label,BorderLayout.WEST); | panel.add(label,BorderLayout.WEST); | ||||
characterEncoding = new JTextField(); | |||||
characterEncoding = new JTextField(); | |||||
characterEncoding.setFont(new java.awt.Font("SansSerif", 0, 11)); | characterEncoding.setFont(new java.awt.Font("SansSerif", 0, 11)); | ||||
characterEncoding.setMinimumSize(new Dimension(100, 21)); | characterEncoding.setMinimumSize(new Dimension(100, 21)); | ||||
characterEncoding.setPreferredSize(new Dimension(150, 21)); | characterEncoding.setPreferredSize(new Dimension(150, 21)); | ||||
panel.add(characterEncoding,BorderLayout.EAST); | panel.add(characterEncoding,BorderLayout.EAST); | ||||
String option = (String) javaBuildOptions.getJavaBuildOptionsMap().get( | String option = (String) javaBuildOptions.getJavaBuildOptionsMap().get( | ||||
JavaOptions.CHARACTER_ENCODING); | JavaOptions.CHARACTER_ENCODING); | ||||
if (option != null) { | if (option != null) { | ||||
characterEncoding.setText(option); | characterEncoding.setText(option); | ||||
} | } | ||||
otherBox.add(panel,null); | otherBox.add(panel,null); | ||||
otherPanel.add(otherBox); | otherPanel.add(otherBox); | ||||
} | } | ||||
private void createBorders() { | private void createBorders() { | ||||
otherEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); | otherEtchedBorder = BorderFactory.createEtchedBorder(Color.white, new Color(156, 156, 158)); | ||||
otherTitleBorder = new TitledBorder(otherEtchedBorder, "Other Options"); | otherTitleBorder = new TitledBorder(otherEtchedBorder, "Other Options"); | ||||
otherCompoundBorder = BorderFactory.createCompoundBorder(otherTitleBorder, | otherCompoundBorder = BorderFactory.createCompoundBorder(otherTitleBorder, | ||||
BorderFactory.createEmptyBorder(5, 5, 5, 5)); | |||||
BorderFactory.createEmptyBorder(5, 5, 5, 5)); | |||||
otherTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); | otherTitleBorder.setTitleFont(new java.awt.Font("Dialog", 0, 11)); | ||||
} | } | ||||
private void addBordersToPanel() { | private void addBordersToPanel() { | ||||
parentPanel = new JPanel(); | parentPanel = new JPanel(); | ||||
parentPanel.setLayout(new BorderLayout()); | parentPanel.setLayout(new BorderLayout()); | ||||
otherPanel = new JPanel(); | otherPanel = new JPanel(); | ||||
otherPanel.setBorder(otherCompoundBorder); | otherPanel.setBorder(otherCompoundBorder); | ||||
parentPanel.add(otherPanel,BorderLayout.CENTER); | parentPanel.add(otherPanel,BorderLayout.CENTER); |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
import org.aspectj.ajde.Ajde; | import org.aspectj.ajde.Ajde; | ||||
public class AJButtonMenuCombo extends JPanel { | public class AJButtonMenuCombo extends JPanel { | ||||
private static final long serialVersionUID = -4866207530403336160L; | private static final long serialVersionUID = -4866207530403336160L; | ||||
private JButton mainButton; | private JButton mainButton; | ||||
private JPopupMenu menu; | private JPopupMenu menu; | ||||
// private boolean depressable = false; | // private boolean depressable = false; | ||||
private boolean isPressed = false; | private boolean isPressed = false; | ||||
public AJButtonMenuCombo(String name, | |||||
String toolTipText, | |||||
Icon icon, | |||||
public AJButtonMenuCombo(String name, | |||||
String toolTipText, | |||||
Icon icon, | |||||
JPopupMenu menu, | JPopupMenu menu, | ||||
boolean depressable) { | boolean depressable) { | ||||
this.menu = menu; | this.menu = menu; | ||||
// this.depressable = depressable; | // this.depressable = depressable; | ||||
mainButton = new JButton(); | mainButton = new JButton(); | ||||
mainButton.setToolTipText(toolTipText); | mainButton.setToolTipText(toolTipText); | ||||
mainButton.setPreferredSize(new Dimension(22, 20)); | mainButton.setPreferredSize(new Dimension(22, 20)); | ||||
mainButton.setMinimumSize(new Dimension(22, 20)); | mainButton.setMinimumSize(new Dimension(22, 20)); | ||||
mainButton.setMaximumSize(new Dimension(22, 20)); | |||||
mainButton.setMaximumSize(new Dimension(22, 20)); | |||||
popupButton = new JButton(); | popupButton = new JButton(); | ||||
popupButton.setIcon(Ajde.getDefault().getIconRegistry().getPopupIcon()); | popupButton.setIcon(Ajde.getDefault().getIconRegistry().getPopupIcon()); | ||||
popupButton.setBorder(BorderFactory.createEmptyBorder()); | popupButton.setBorder(BorderFactory.createEmptyBorder()); | ||||
popupButton.setToolTipText(toolTipText); | popupButton.setToolTipText(toolTipText); | ||||
popupButton.setPreferredSize(new Dimension(13, 20)); | popupButton.setPreferredSize(new Dimension(13, 20)); | ||||
popupButton.setMinimumSize(new Dimension(13, 20)); | popupButton.setMinimumSize(new Dimension(13, 20)); | ||||
popupButton.setMaximumSize(new Dimension(13, 20)); | |||||
popupButton.setMaximumSize(new Dimension(13, 20)); | |||||
PopupListener popupListener = new PopupListener(mainButton); | PopupListener popupListener = new PopupListener(mainButton); | ||||
if (depressable) { | if (depressable) { | ||||
mainButton.addActionListener(new ButtonActionListener()); | mainButton.addActionListener(new ButtonActionListener()); | ||||
} else { | } else { | ||||
mainButton.addMouseListener(popupListener); | |||||
mainButton.addMouseListener(popupListener); | |||||
} | } | ||||
popupButton.addActionListener(new java.awt.event.ActionListener() { | popupButton.addActionListener(new java.awt.event.ActionListener() { | ||||
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { | ||||
popupButton.setBorder(null); | popupButton.setBorder(null); | ||||
BorderUpdateListener borderUpdateListner = new BorderUpdateListener(); | BorderUpdateListener borderUpdateListner = new BorderUpdateListener(); | ||||
mainButton.addMouseListener(borderUpdateListner); | mainButton.addMouseListener(borderUpdateListner); | ||||
popupButton.addMouseListener(borderUpdateListner); | popupButton.addMouseListener(borderUpdateListner); | ||||
popupButton.addMouseListener(popupListener); | popupButton.addMouseListener(popupListener); | ||||
this.setLayout(new BorderLayout()); | this.setLayout(new BorderLayout()); | ||||
this.add(mainButton, BorderLayout.CENTER); | this.add(mainButton, BorderLayout.CENTER); | ||||
this.add(popupButton, BorderLayout.EAST); | this.add(popupButton, BorderLayout.EAST); | ||||
this.setMinimumSize(new Dimension(35, 20)); | this.setMinimumSize(new Dimension(35, 20)); | ||||
this.setMaximumSize(new Dimension(35, 20)); | |||||
this.setMaximumSize(new Dimension(35, 20)); | |||||
} | } | ||||
class ButtonActionListener implements ActionListener { | class ButtonActionListener implements ActionListener { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
class BorderUpdateListener extends MouseAdapter { | class BorderUpdateListener extends MouseAdapter { | ||||
public void mouseEntered(MouseEvent e) { | public void mouseEntered(MouseEvent e) { | ||||
popupButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); | popupButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); | ||||
mainButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); | mainButton.setBorder(AjdeWidgetStyles.RAISED_BEVEL_BORDER); | ||||
} | } | ||||
public void mouseExited(MouseEvent e) { | public void mouseExited(MouseEvent e) { | ||||
popupButton.setBorder(AjdeWidgetStyles.DEFAULT_BORDER); | popupButton.setBorder(AjdeWidgetStyles.DEFAULT_BORDER); | ||||
if (isPressed) { | if (isPressed) { | ||||
menu.show(e.getComponent(), button.getX(), button.getY() + popupButton.getHeight()); | menu.show(e.getComponent(), button.getX(), button.getY() + popupButton.getHeight()); | ||||
} | } | ||||
} | } | ||||
public void setEnabled(boolean enabled) { | public void setEnabled(boolean enabled) { | ||||
mainButton.setEnabled(enabled); | mainButton.setEnabled(enabled); | ||||
popupButton.setEnabled(enabled); | popupButton.setEnabled(enabled); |
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | * All rights reserved. | ||||
* This program and the accompanying materials are made available | * This program and the accompanying materials are made available | ||||
* under the terms of the Eclipse Public License v1.0 | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | * which accompanies this distribution and is available at | ||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | * | ||||
* Contributors: | * Contributors: | ||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
configs_comboBox.setRenderer(new ConfigsCellRenderer()); | configs_comboBox.setRenderer(new ConfigsCellRenderer()); | ||||
// configs_comboBox.addItemListener(new ItemListener() { | // configs_comboBox.addItemListener(new ItemListener() { | ||||
// public void itemStateChanged(ItemEvent e) { | // public void itemStateChanged(ItemEvent e) { | ||||
// Ajde.getDefault().getConfigurationManager().setCurrConfigFile(lastSelectedConfig); | |||||
// Ajde.getDefault().getConfigurationManager().setCurrConfigFile(lastSelectedConfig); | |||||
// } | // } | ||||
// }); | // }); | ||||
if (Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().size() > 0) { | if (Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().size() > 0) { | ||||
Ajde.getDefault().getBuildConfigManager().setActiveConfigFile((String)Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().get(0)); | |||||
Ajde.getDefault().getBuildConfigManager().setActiveConfigFile((String)Ajde.getDefault().getBuildConfigManager().getAllBuildConfigFiles().get(0)); | |||||
} | } | ||||
jbInit(); | jbInit(); | ||||
fixButtonBorders(); | fixButtonBorders(); | ||||
views_splitPane.add(masterView, JSplitPane.TOP); | views_splitPane.add(masterView, JSplitPane.TOP); |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
// private boolean globalMode = true; | // private boolean globalMode = true; | ||||
// private boolean splitViewMode = false; | // private boolean splitViewMode = false; | ||||
// private IconRegistry icons; | // private IconRegistry icons; | ||||
// | |||||
// | |||||
// private Stack backHistory = new Stack(); | // private Stack backHistory = new Stack(); | ||||
// private Stack forwardHistory = new Stack(); | // private Stack forwardHistory = new Stack(); | ||||
// private IProgramElement currNode = null; | // private IProgramElement currNode = null; | ||||
pointcutWizard.setVisible(true); | pointcutWizard.setVisible(true); | ||||
pointcutWizard.setLocation(Ajde.getDefault().getRootFrame().getX()+100, Ajde.getDefault().getRootFrame().getY()+100); | pointcutWizard.setLocation(Ajde.getDefault().getRootFrame().getX()+100, Ajde.getDefault().getRootFrame().getY()+100); | ||||
} | } | ||||
{ | |||||
{ | |||||
DECLARATION_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.DECLARATION); | DECLARATION_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.DECLARATION); | ||||
CROSSCUTTING_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.CROSSCUTTING); | CROSSCUTTING_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.CROSSCUTTING); | ||||
INHERITANCE_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); | |||||
INHERITANCE_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); | |||||
// CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | ||||
// CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | ||||
// CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE); | ||||
// INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.IMPLEMENTS_RELATION); | // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.IMPLEMENTS_RELATION); | ||||
// INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_MEMBERS_RELATION); | // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_MEMBERS_RELATION); | ||||
// INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_RELATION); | // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_RELATION); | ||||
DECLARATION_VIEW_PROPERTIES.setRelations(Ajde.getDefault().getStructureViewManager().getAvailableRelations()); | DECLARATION_VIEW_PROPERTIES.setRelations(Ajde.getDefault().getStructureViewManager().getAvailableRelations()); | ||||
CROSSCUTTING_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(CROSSCUTTING_VIEW_PROPERTIES); | CROSSCUTTING_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(CROSSCUTTING_VIEW_PROPERTIES); |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui.swing; | package org.aspectj.ajde.ui.swing; | ||||
import java.awt.event.ActionEvent; | import java.awt.event.ActionEvent; | ||||
//if (AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { | //if (AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { | ||||
// AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView((ProgramElementNode)currNode); | // AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView((ProgramElementNode)currNode); | ||||
//} | //} | ||||
} | |||||
} | |||||
// else if (currNode instanceof LinkNode) { | // else if (currNode instanceof LinkNode) { | ||||
//if (!AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { | //if (!AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) { | ||||
// AjdeUIManager.getDefault().getViewManager().showNodeInMasterView((LinkNode)currNode); | // AjdeUIManager.getDefault().getViewManager().showNodeInMasterView((LinkNode)currNode); | ||||
&& e.getModifiers() != 4) { | && e.getModifiers() != 4) { | ||||
//AjdeUIManager.getDefault().getViewManager().showNodeInMasterView(((LinkNode)currNode).getProgramElementNode()); | //AjdeUIManager.getDefault().getViewManager().showNodeInMasterView(((LinkNode)currNode).getProgramElementNode()); | ||||
//AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView(((LinkNode)currNode).getProgramElementNode()); | //AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView(((LinkNode)currNode).getProgramElementNode()); | ||||
} | |||||
} | |||||
// else if (currNode instanceof LinkNode) { | // else if (currNode instanceof LinkNode) { | ||||
// if (clickCount == 1) { | // if (clickCount == 1) { | ||||
// //AjdeUIManager.getDefault().getViewManager().showLink((LinkNode)currNode); | // //AjdeUIManager.getDefault().getViewManager().showLink((LinkNode)currNode); | ||||
JMenuItem showSourcesItem = new JMenuItem("Display sources", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.CODE)); | JMenuItem showSourcesItem = new JMenuItem("Display sources", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.CODE)); | ||||
showSourcesItem.setFont(new java.awt.Font("Dialog", 0, 11)); | showSourcesItem.setFont(new java.awt.Font("Dialog", 0, 11)); | ||||
showSourcesItem.addActionListener(new AbstractAction() { | showSourcesItem.addActionListener(new AbstractAction() { | ||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { | ||||
JMenuItem generatePCD = new JMenuItem("Pointcut Wizard (alpha)...", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.POINTCUT)); | JMenuItem generatePCD = new JMenuItem("Pointcut Wizard (alpha)...", Ajde.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.POINTCUT)); | ||||
generatePCD.setFont(new java.awt.Font("Dialog", 0, 11)); | generatePCD.setFont(new java.awt.Font("Dialog", 0, 11)); | ||||
generatePCD.addActionListener(new AbstractAction() { | generatePCD.addActionListener(new AbstractAction() { | ||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
public void actionPerformed(ActionEvent e) { | public void actionPerformed(ActionEvent e) { |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/** | /** | ||||
* Creates a popup menu that displays all the available .lst files. When one | * Creates a popup menu that displays all the available .lst files. When one | ||||
* is selected it runs a full build of files within the selected .lst file | * is selected it runs a full build of files within the selected .lst file | ||||
* in a separate thread. | |||||
* in a separate thread. | |||||
*/ | */ | ||||
public class BuildConfigPopupMenu extends JPopupMenu { | public class BuildConfigPopupMenu extends JPopupMenu { | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui.swing; | package org.aspectj.ajde.ui.swing; | ||||
import java.awt.BorderLayout; | import java.awt.BorderLayout; | ||||
import java.awt.Dimension; | import java.awt.Dimension; | ||||
import java.awt.event.ActionEvent; | import java.awt.event.ActionEvent; | ||||
JProgressBar compile_progressBar = new JProgressBar(); | JProgressBar compile_progressBar = new JProgressBar(); | ||||
private boolean buildIsCancelled = false; | private boolean buildIsCancelled = false; | ||||
public BuildProgressPanel() { | public BuildProgressPanel() { | ||||
try { | try { | ||||
jbInit(); | jbInit(); | ||||
void cancel_button_actionPerformed(ActionEvent e) { | void cancel_button_actionPerformed(ActionEvent e) { | ||||
buildIsCancelled = true; | buildIsCancelled = true; | ||||
} | } | ||||
public boolean isCancelRequested() { | public boolean isCancelRequested() { | ||||
return buildIsCancelled; | return buildIsCancelled; | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui.swing; | package org.aspectj.ajde.ui.swing; | ||||
import java.awt.Component; | import java.awt.Component; | ||||
import javax.swing.JLabel; | import javax.swing.JLabel; |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
import org.aspectj.ajde.Ajde; | import org.aspectj.ajde.Ajde; | ||||
import org.aspectj.ajde.core.IBuildProgressMonitor; | import org.aspectj.ajde.core.IBuildProgressMonitor; | ||||
/** | /** | ||||
* This dialog box is open while ajc is compiling the system and displays | * This dialog box is open while ajc is compiling the system and displays | ||||
* a corresponding progress bar. | * a corresponding progress bar. | ||||
public class DefaultBuildProgressMonitor extends Thread implements IBuildProgressMonitor { | public class DefaultBuildProgressMonitor extends Thread implements IBuildProgressMonitor { | ||||
public static final String PROGRESS_HEADING = "AspectJ Build"; | public static final String PROGRESS_HEADING = "AspectJ Build"; | ||||
private BuildProgressPanel progressDialog = null; | private BuildProgressPanel progressDialog = null; | ||||
private JDialog dialog = null; | private JDialog dialog = null; | ||||
dialog.setContentPane(progressDialog); | dialog.setContentPane(progressDialog); | ||||
dialog.setSize(550, 120); | dialog.setSize(550, 120); | ||||
try { | try { | ||||
dialog.setLocationRelativeTo(parent); | |||||
dialog.setLocationRelativeTo(parent); | |||||
} catch (NoSuchMethodError nsme) { | } catch (NoSuchMethodError nsme) { | ||||
// running on 1.3 | // running on 1.3 | ||||
} | } | ||||
*/ | */ | ||||
public void finish(boolean wasFullBuild) { | public void finish(boolean wasFullBuild) { | ||||
progressDialog.finish(); | progressDialog.finish(); | ||||
dialog.dispose(); | |||||
dialog.dispose(); | |||||
} | } | ||||
public boolean isCancelRequested() { | public boolean isCancelRequested() { | ||||
} | } | ||||
public void setProgress(double percentDone) { | public void setProgress(double percentDone) { | ||||
progressDialog.setProgressBarVal((int) (percentDone*progressDialog.getProgressBarMax())); | |||||
progressDialog.setProgressBarVal((int) (percentDone*progressDialog.getProgressBarMax())); | |||||
} | } | ||||
} | } |
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
/* ******************************************************************* | /* ******************************************************************* | ||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* Copyright (c) 1999-2001 Xerox Corporation, | |||||
* 2002 Palo Alto Research Center, Incorporated (PARC). | * 2002 Palo Alto Research Center, Incorporated (PARC). | ||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v1.0 | |||||
* which accompanies this distribution and is available at | |||||
* http://www.eclipse.org/legal/epl-v10.html | |||||
* | |||||
* Contributors: | |||||
* All rights reserved. | |||||
* This program and the accompanying materials are made available | |||||
* under the terms of the Eclipse Public License v 2.0 | |||||
* which accompanies this distribution and is available at | |||||
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt | |||||
* | |||||
* Contributors: | |||||
* Xerox/PARC initial implementation | * Xerox/PARC initial implementation | ||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* Helen Hawkins Converted to new interface (bug 148190) | |||||
* ******************************************************************/ | * ******************************************************************/ | ||||
package org.aspectj.ajde.ui.swing; | package org.aspectj.ajde.ui.swing; | ||||
/** | /** | ||||
* Used to ensure that a source line has been seeked to. Will repeatedly attempt | * Used to ensure that a source line has been seeked to. Will repeatedly attempt | ||||
* to seek to the line until this has succeeded. | * to seek to the line until this has succeeded. | ||||
* | |||||
* | |||||
* @author Mik Kersten | * @author Mik Kersten | ||||
*/ | */ | ||||
public class GoToLineThread extends Thread { | public class GoToLineThread extends Thread { | ||||
private EditorAdapter editorAdapter = null; | private EditorAdapter editorAdapter = null; | ||||
private int lineNumber = 0; | private int lineNumber = 0; | ||||
private String fileToSeekTo = ""; | private String fileToSeekTo = ""; | ||||
private boolean finished = false; | private boolean finished = false; | ||||
editorAdapter.showSourceLine(lineNumber, true); | editorAdapter.showSourceLine(lineNumber, true); | ||||
} | } | ||||
}); | }); | ||||
} catch (Exception e) { | |||||
} catch (Exception e) { | |||||
Message msg = new Message("Could not seek to line.",IMessage.ERROR,e,null); | Message msg = new Message("Could not seek to line.",IMessage.ERROR,e,null); | ||||
Ajde.getDefault().getMessageHandler().handleMessage(msg); | Ajde.getDefault().getMessageHandler().handleMessage(msg); | ||||
} | } |