Compare commits
233 Commits
Author | SHA1 | Date | |
---|---|---|---|
e4de765da9 | |||
47120c66b7 | |||
35ccc71f10 | |||
688a6abd99 | |||
97693cd0c4 | |||
3e5ab7b0ac | |||
ad80671dd2 | |||
4ab3000b69 | |||
572e999a5b | |||
e5bcb25d24 | |||
19ea1f0b6d | |||
e88014ebba | |||
10a0608fd3 | |||
60abfb7afd | |||
6b9e3c0e70 | |||
19065cdbb7 | |||
a7afeb1f7c | |||
150c404cdb | |||
5fe8b261ec | |||
f8a177c9e0 | |||
077a6f8011 | |||
8b84f1341b | |||
20824e75c1 | |||
fb283ab668 | |||
dc3df60716 | |||
47b58ed770 | |||
1cebc2da0a | |||
414030cbd2 | |||
8011585113 | |||
270a004037 | |||
2aa4160400 | |||
c8e416966b | |||
20cb208719 | |||
e30aff82ee | |||
ad2937c332 | |||
0e8a757d6e | |||
220eaea73c | |||
24d6085ded | |||
8a66734279 | |||
f6e2224651 | |||
5d85c12bb8 | |||
2b1cb7856f | |||
f1d080983a | |||
767b083a22 | |||
348ffe20d6 | |||
f3494e7562 | |||
9b6908f193 | |||
0cfcc8c118 | |||
ec5cd209c6 | |||
5933bcd512 | |||
14ac6654b9 | |||
cea11743eb | |||
210d925987 | |||
ffbffd88f1 | |||
ec8d54dca3 | |||
e8682e446b | |||
e87e1791c3 | |||
f5a4e3c39e | |||
306e20d14f | |||
c76805d133 | |||
8ebb2dc3a6 | |||
669fd6a881 | |||
8e66e5fe0b | |||
674aa7d3ce | |||
2b7c9a240f | |||
18f2a110f0 | |||
27f1e8ca6a | |||
3565a6a05b | |||
aef4901b2b | |||
d77aaa3865 | |||
b398a07fd7 | |||
732bd82034 | |||
2ccc5274aa | |||
9f4f71046d | |||
d73b01f77d | |||
77302521b2 | |||
f89471e14b | |||
0634556256 | |||
4f097e7f59 | |||
f1abc645c3 | |||
2c8b7129e9 | |||
2f81529f93 | |||
8f76d816f1 | |||
594a71a9ba | |||
0fa0d4a5b8 | |||
97443c6cd8 | |||
c3486eb6c8 | |||
8a286a8eac | |||
e4329213fa | |||
857bbe17d7 | |||
091cb1cf7f | |||
0623b8de4a | |||
8b55548cca | |||
a0a4ea1f53 | |||
e034d1faad | |||
68660d0892 | |||
a0f0b55045 | |||
3d20b6961e | |||
ca02c92a18 | |||
347dbf134b | |||
44ac32359f | |||
48c7d81b8a | |||
e945a3acbe | |||
145dfbd74d | |||
b7646dc29e | |||
475181c8df | |||
3d043ce1b7 | |||
7e2869b7ee | |||
51d9d7e25c | |||
ed665ac032 | |||
689d7874f4 | |||
c7c1f97b0c | |||
7b2db09585 | |||
52f3f7b348 | |||
429ea37080 | |||
04f011e82f | |||
3a6ed3ce7e | |||
79eb8073d8 | |||
4ea841cc7b | |||
6bf642d2af | |||
15c24f0925 | |||
4d4a6579c6 | |||
b648dccfd8 | |||
f9425834a3 | |||
e0d00e6402 | |||
b1b7517759 | |||
a5b9c28007 | |||
b5e408595b | |||
f15930682e | |||
f8765518bc | |||
73e952faea | |||
111383bcba | |||
244f005ae6 | |||
701733e69d | |||
6b4a9c1e14 | |||
3abbc3e0e2 | |||
2a7b713ef2 | |||
593571ce10 | |||
979261432a | |||
e25f56a8a9 | |||
e8788e6ce0 | |||
8a8691a889 | |||
de15b84bef | |||
b78d8bea45 | |||
a49842a119 | |||
dbe5d603ed | |||
cde1835c74 | |||
b332eca891 | |||
75efd69b77 | |||
960610bab2 | |||
98029f8c7a | |||
9c09cf5f40 | |||
113d65cfc4 | |||
22e7bb04f0 | |||
d8c5b7d9c3 | |||
2e7ae5309f | |||
f81e830e93 | |||
47a285bf6d | |||
c080773878 | |||
bcf4e1a274 | |||
93fd192782 | |||
e687eef42c | |||
2a709113fe | |||
8d7acdb9cb | |||
77684d828c | |||
9f902057ba | |||
42660c7a2e | |||
97a806f9d9 | |||
60185fbaee | |||
5411a405d4 | |||
694dad1cf5 | |||
5fb9a7dcdf | |||
3faa7205ae | |||
3cbe5d56d9 | |||
5745ab4f2c | |||
4a17108ccc | |||
408138c27c | |||
3211db8743 | |||
0c81988d8c | |||
0107c423a3 | |||
5d41816eb6 | |||
e41b7e25ed | |||
dba8b2731d | |||
048fa93b53 | |||
6cc5597c25 | |||
694423be3b | |||
0634b9cfd5 | |||
c4b16338a8 | |||
bda2a84532 | |||
9d4c951e7f | |||
8a89b21d34 | |||
e02df858fa | |||
0fbe22e2e0 | |||
021c2bceff | |||
9862c14040 | |||
23131e7527 | |||
0833bca1bd | |||
1cf00ec882 | |||
6c0bbd5f1f | |||
f13b091664 | |||
dff41eceb2 | |||
d267e64907 | |||
792dcd55f3 | |||
2b33ea0c85 | |||
f69a6f2e89 | |||
0f133a3df6 | |||
549c522bf7 | |||
2f11d8ed7b | |||
7dd0a24df6 | |||
a052fe2324 | |||
4fc24453ae | |||
b468fba441 | |||
f80021059e | |||
7c0822b4d2 | |||
cdde384ed3 | |||
fce1bdb1e7 | |||
b68a7d3259 | |||
44b13c105d | |||
ed0558afdf | |||
d0be3b0ca2 | |||
a052c6aa3b | |||
8a30ba8dea | |||
0a7972c54d | |||
b1890eb5e1 | |||
1aaf5c837e | |||
c8a213e985 | |||
5f82700290 | |||
40a0137dfd | |||
4ec9a928b9 | |||
c82c41bbf0 | |||
79c49e6f1d | |||
96d628d322 | |||
b4d81d96b8 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,3 +3,8 @@
|
|||||||
/.recommenders/
|
/.recommenders/
|
||||||
/RemoteSystemsTempFiles/
|
/RemoteSystemsTempFiles/
|
||||||
/*.zip
|
/*.zip
|
||||||
|
SCViewer initiator_target.launch
|
||||||
|
SCViewer.xcf
|
||||||
|
SCViewer_1.png
|
||||||
|
*.launch
|
||||||
|
copyrightLog.txt
|
||||||
|
67
.project
Normal file
67
.project
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>scviewer.parent</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960924</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-features</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960932</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-plugins</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960936</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-com.minres.*</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960939</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-product</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960950</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-tests</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<id>1591076960954</id>
|
||||||
|
<name></name>
|
||||||
|
<type>10</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-p2repositories</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
|
</projectDescription>
|
203
LICENSE
Normal file
203
LICENSE
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
Eclipse Public License - v 1.0
|
||||||
|
|
||||||
|
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
|
||||||
|
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
|
||||||
|
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||||
|
|
||||||
|
1. DEFINITIONS
|
||||||
|
|
||||||
|
"Contribution" means:
|
||||||
|
|
||||||
|
a) in the case of the initial Contributor, the initial code and documentation
|
||||||
|
distributed under this Agreement, and
|
||||||
|
b) in the case of each subsequent Contributor:
|
||||||
|
i) changes to the Program, and
|
||||||
|
ii) additions to the Program;
|
||||||
|
|
||||||
|
where such changes and/or additions to the Program originate from and are
|
||||||
|
distributed by that particular Contributor. A Contribution 'originates'
|
||||||
|
from a Contributor if it was added to the Program by such Contributor
|
||||||
|
itself or anyone acting on such Contributor's behalf. Contributions do not
|
||||||
|
include additions to the Program which: (i) are separate modules of
|
||||||
|
software distributed in conjunction with the Program under their own
|
||||||
|
license agreement, and (ii) are not derivative works of the Program.
|
||||||
|
|
||||||
|
"Contributor" means any person or entity that distributes the Program.
|
||||||
|
|
||||||
|
"Licensed Patents" mean patent claims licensable by a Contributor which are
|
||||||
|
necessarily infringed by the use or sale of its Contribution alone or when
|
||||||
|
combined with the Program.
|
||||||
|
|
||||||
|
"Program" means the Contributions distributed in accordance with this
|
||||||
|
Agreement.
|
||||||
|
|
||||||
|
"Recipient" means anyone who receives the Program under this Agreement,
|
||||||
|
including all Contributors.
|
||||||
|
|
||||||
|
2. GRANT OF RIGHTS
|
||||||
|
a) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||||
|
Recipient a non-exclusive, worldwide, royalty-free copyright license to
|
||||||
|
reproduce, prepare derivative works of, publicly display, publicly
|
||||||
|
perform, distribute and sublicense the Contribution of such Contributor,
|
||||||
|
if any, and such derivative works, in source code and object code form.
|
||||||
|
b) Subject to the terms of this Agreement, each Contributor hereby grants
|
||||||
|
Recipient a non-exclusive, worldwide, royalty-free patent license under
|
||||||
|
Licensed Patents to make, use, sell, offer to sell, import and otherwise
|
||||||
|
transfer the Contribution of such Contributor, if any, in source code and
|
||||||
|
object code form. This patent license shall apply to the combination of
|
||||||
|
the Contribution and the Program if, at the time the Contribution is
|
||||||
|
added by the Contributor, such addition of the Contribution causes such
|
||||||
|
combination to be covered by the Licensed Patents. The patent license
|
||||||
|
shall not apply to any other combinations which include the Contribution.
|
||||||
|
No hardware per se is licensed hereunder.
|
||||||
|
c) Recipient understands that although each Contributor grants the licenses
|
||||||
|
to its Contributions set forth herein, no assurances are provided by any
|
||||||
|
Contributor that the Program does not infringe the patent or other
|
||||||
|
intellectual property rights of any other entity. Each Contributor
|
||||||
|
disclaims any liability to Recipient for claims brought by any other
|
||||||
|
entity based on infringement of intellectual property rights or
|
||||||
|
otherwise. As a condition to exercising the rights and licenses granted
|
||||||
|
hereunder, each Recipient hereby assumes sole responsibility to secure
|
||||||
|
any other intellectual property rights needed, if any. For example, if a
|
||||||
|
third party patent license is required to allow Recipient to distribute
|
||||||
|
the Program, it is Recipient's responsibility to acquire that license
|
||||||
|
before distributing the Program.
|
||||||
|
d) Each Contributor represents that to its knowledge it has sufficient
|
||||||
|
copyright rights in its Contribution, if any, to grant the copyright
|
||||||
|
license set forth in this Agreement.
|
||||||
|
|
||||||
|
3. REQUIREMENTS
|
||||||
|
|
||||||
|
A Contributor may choose to distribute the Program in object code form under
|
||||||
|
its own license agreement, provided that:
|
||||||
|
|
||||||
|
a) it complies with the terms and conditions of this Agreement; and
|
||||||
|
b) its license agreement:
|
||||||
|
i) effectively disclaims on behalf of all Contributors all warranties
|
||||||
|
and conditions, express and implied, including warranties or
|
||||||
|
conditions of title and non-infringement, and implied warranties or
|
||||||
|
conditions of merchantability and fitness for a particular purpose;
|
||||||
|
ii) effectively excludes on behalf of all Contributors all liability for
|
||||||
|
damages, including direct, indirect, special, incidental and
|
||||||
|
consequential damages, such as lost profits;
|
||||||
|
iii) states that any provisions which differ from this Agreement are
|
||||||
|
offered by that Contributor alone and not by any other party; and
|
||||||
|
iv) states that source code for the Program is available from such
|
||||||
|
Contributor, and informs licensees how to obtain it in a reasonable
|
||||||
|
manner on or through a medium customarily used for software exchange.
|
||||||
|
|
||||||
|
When the Program is made available in source code form:
|
||||||
|
|
||||||
|
a) it must be made available under this Agreement; and
|
||||||
|
b) a copy of this Agreement must be included with each copy of the Program.
|
||||||
|
Contributors may not remove or alter any copyright notices contained
|
||||||
|
within the Program.
|
||||||
|
|
||||||
|
Each Contributor must identify itself as the originator of its Contribution,
|
||||||
|
if
|
||||||
|
any, in a manner that reasonably allows subsequent Recipients to identify the
|
||||||
|
originator of the Contribution.
|
||||||
|
|
||||||
|
4. COMMERCIAL DISTRIBUTION
|
||||||
|
|
||||||
|
Commercial distributors of software may accept certain responsibilities with
|
||||||
|
respect to end users, business partners and the like. While this license is
|
||||||
|
intended to facilitate the commercial use of the Program, the Contributor who
|
||||||
|
includes the Program in a commercial product offering should do so in a manner
|
||||||
|
which does not create potential liability for other Contributors. Therefore,
|
||||||
|
if a Contributor includes the Program in a commercial product offering, such
|
||||||
|
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
|
||||||
|
every other Contributor ("Indemnified Contributor") against any losses,
|
||||||
|
damages and costs (collectively "Losses") arising from claims, lawsuits and
|
||||||
|
other legal actions brought by a third party against the Indemnified
|
||||||
|
Contributor to the extent caused by the acts or omissions of such Commercial
|
||||||
|
Contributor in connection with its distribution of the Program in a commercial
|
||||||
|
product offering. The obligations in this section do not apply to any claims
|
||||||
|
or Losses relating to any actual or alleged intellectual property
|
||||||
|
infringement. In order to qualify, an Indemnified Contributor must:
|
||||||
|
a) promptly notify the Commercial Contributor in writing of such claim, and
|
||||||
|
b) allow the Commercial Contributor to control, and cooperate with the
|
||||||
|
Commercial Contributor in, the defense and any related settlement
|
||||||
|
negotiations. The Indemnified Contributor may participate in any such claim at
|
||||||
|
its own expense.
|
||||||
|
|
||||||
|
For example, a Contributor might include the Program in a commercial product
|
||||||
|
offering, Product X. That Contributor is then a Commercial Contributor. If
|
||||||
|
that Commercial Contributor then makes performance claims, or offers
|
||||||
|
warranties related to Product X, those performance claims and warranties are
|
||||||
|
such Commercial Contributor's responsibility alone. Under this section, the
|
||||||
|
Commercial Contributor would have to defend claims against the other
|
||||||
|
Contributors related to those performance claims and warranties, and if a
|
||||||
|
court requires any other Contributor to pay any damages as a result, the
|
||||||
|
Commercial Contributor must pay those damages.
|
||||||
|
|
||||||
|
5. NO WARRANTY
|
||||||
|
|
||||||
|
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
|
||||||
|
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
|
||||||
|
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
|
||||||
|
Recipient is solely responsible for determining the appropriateness of using
|
||||||
|
and distributing the Program and assumes all risks associated with its
|
||||||
|
exercise of rights under this Agreement , including but not limited to the
|
||||||
|
risks and costs of program errors, compliance with applicable laws, damage to
|
||||||
|
or loss of data, programs or equipment, and unavailability or interruption of
|
||||||
|
operations.
|
||||||
|
|
||||||
|
6. DISCLAIMER OF LIABILITY
|
||||||
|
|
||||||
|
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
|
||||||
|
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
|
||||||
|
LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
|
||||||
|
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY
|
||||||
|
OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
7. GENERAL
|
||||||
|
|
||||||
|
If any provision of this Agreement is invalid or unenforceable under
|
||||||
|
applicable law, it shall not affect the validity or enforceability of the
|
||||||
|
remainder of the terms of this Agreement, and without further action by the
|
||||||
|
parties hereto, such provision shall be reformed to the minimum extent
|
||||||
|
necessary to make such provision valid and enforceable.
|
||||||
|
|
||||||
|
If Recipient institutes patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Program itself
|
||||||
|
(excluding combinations of the Program with other software or hardware)
|
||||||
|
infringes such Recipient's patent(s), then such Recipient's rights granted
|
||||||
|
under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
All Recipient's rights under this Agreement shall terminate if it fails to
|
||||||
|
comply with any of the material terms or conditions of this Agreement and does
|
||||||
|
not cure such failure in a reasonable period of time after becoming aware of
|
||||||
|
such noncompliance. If all Recipient's rights under this Agreement terminate,
|
||||||
|
Recipient agrees to cease use and distribution of the Program as soon as
|
||||||
|
reasonably practicable. However, Recipient's obligations under this Agreement
|
||||||
|
and any licenses granted by Recipient relating to the Program shall continue
|
||||||
|
and survive.
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute copies of this Agreement, but in
|
||||||
|
order to avoid inconsistency the Agreement is copyrighted and may only be
|
||||||
|
modified in the following manner. The Agreement Steward reserves the right to
|
||||||
|
publish new versions (including revisions) of this Agreement from time to
|
||||||
|
time. No one other than the Agreement Steward has the right to modify this
|
||||||
|
Agreement. The Eclipse Foundation is the initial Agreement Steward. The
|
||||||
|
Eclipse Foundation may assign the responsibility to serve as the Agreement
|
||||||
|
Steward to a suitable separate entity. Each new version of the Agreement will
|
||||||
|
be given a distinguishing version number. The Program (including
|
||||||
|
Contributions) may always be distributed subject to the version of the
|
||||||
|
Agreement under which it was received. In addition, after a new version of the
|
||||||
|
Agreement is published, Contributor may elect to distribute the Program
|
||||||
|
(including its Contributions) under the new version. Except as expressly
|
||||||
|
stated in Sections 2(a) and 2(b) above, Recipient receives no rights or
|
||||||
|
licenses to the intellectual property of any Contributor under this Agreement,
|
||||||
|
whether expressly, by implication, estoppel or otherwise. All rights in the
|
||||||
|
Program not expressly granted under this Agreement are reserved.
|
||||||
|
|
||||||
|
This Agreement is governed by the laws of the State of New York and the
|
||||||
|
intellectual property laws of the United States of America. No party to this
|
||||||
|
Agreement will bring a legal action under this Agreement more than one year
|
||||||
|
after the cause of action arose. Each party waives its rights to a jury trial in
|
||||||
|
any resulting litigation.
|
37
README.md
37
README.md
@ -6,30 +6,18 @@ created by the SystemC VCD trace implementation and the SystemC Verification Lib
|
|||||||
For further description of the SCV please refer to
|
For further description of the SCV please refer to
|
||||||
http://www.accellera.org/activities/committees/systemc-verification.
|
http://www.accellera.org/activities/committees/systemc-verification.
|
||||||
|
|
||||||
The viewer is in early alpha stage and not yet ready for production use!
|
> If you encounter issue when running on Linux please try running as `SWT_GTK3=0 scviewer` as there exist issues wiht GTK3.
|
||||||
|
|
||||||
|
The viewer has the following features
|
||||||
|
- support of VCD files (compressed and uncompressed)
|
||||||
|
- real numbers
|
||||||
|
- showing vectors and real numbers as analog (step-wise & continuous)
|
||||||
|
- various value representations of bit vectors
|
||||||
|
- support of SCV transaction recordings in various formats
|
||||||
|
- text log files (compressed and uncompressed)
|
||||||
|
- sqlite based
|
||||||
|
- visualization of transaction relations
|
||||||
|
|
||||||
The plugins are structured as follows:
|
|
||||||
- com.minres.scviewer.database
|
|
||||||
the interface defining the API to access the database and the implementation for VCD
|
|
||||||
- com.minres.scviewer.database.text
|
|
||||||
an implementation of the API to read the text files generated by the SCV
|
|
||||||
sc_tr_text database
|
|
||||||
- com.minres.scviewer.database.sqlite
|
|
||||||
an implementation of the API to read the files generated by implementation in the
|
|
||||||
sc_tr_sqlite project using a SQLite based database
|
|
||||||
- com.minres.scviewer.database.test
|
|
||||||
a some JUnit tests of the 3 back ends
|
|
||||||
- com.minres.scviewer.ui
|
|
||||||
the viewer it self to diplay the transactions and associated views like the
|
|
||||||
outline of the DB and the properties of the transaction
|
|
||||||
- com.minres.scviewer.feature
|
|
||||||
the feature combining the plugins above into a somhow usable form
|
|
||||||
- scv_tr_sqlite
|
|
||||||
a C++ project containing the SQLite based SCV database implementation and the scv4tlm
|
|
||||||
socket implementations.
|
|
||||||
A simple example (scv_tr_recording_example.cpp) for testig purposes of the database is
|
|
||||||
provided.
|
|
||||||
|
|
||||||
To build the plugins the Eclipse SDK or PDE can be used. In both cases the Groovy
|
To build the plugins the Eclipse SDK or PDE can be used. In both cases the Groovy
|
||||||
eclipse plugin (http://groovy.codehaus.org/Eclipse+Plugin or Market) has to be
|
eclipse plugin (http://groovy.codehaus.org/Eclipse+Plugin or Market) has to be
|
||||||
installed.
|
installed.
|
||||||
@ -39,4 +27,5 @@ TODO
|
|||||||
- add more tests
|
- add more tests
|
||||||
- move to feature based product to allow automatic updates
|
- move to feature based product to allow automatic updates
|
||||||
- improve graphics
|
- improve graphics
|
||||||
- catch-up e3 plugin to functionality of e4 product
|
- catch-up e3 plugin to functionality of e4 product
|
||||||
|
- add calculated traces
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,3 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding//src/com/minres/scviewer/database/test/DatabaseServicesTest.java=UTF-8
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,46 +1,104 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
|
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
|
||||||
<booleanAttribute key="append.args" value="true"/>
|
<booleanAttribute key="append.args" value="true"/>
|
||||||
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
|
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
|
||||||
<booleanAttribute key="askclear" value="false"/>
|
<booleanAttribute key="askclear" value="false"/>
|
||||||
<booleanAttribute key="automaticAdd" value="true"/>
|
<booleanAttribute key="automaticAdd" value="true"/>
|
||||||
<booleanAttribute key="automaticValidate" value="false"/>
|
<booleanAttribute key="automaticValidate" value="false"/>
|
||||||
<stringAttribute key="bootstrap" value=""/>
|
<stringAttribute key="bootstrap" value=""/>
|
||||||
<stringAttribute key="checked" value="[NONE]"/>
|
<stringAttribute key="checked" value="[NONE]"/>
|
||||||
<booleanAttribute key="clearConfig" value="true"/>
|
<booleanAttribute key="clearConfig" value="true"/>
|
||||||
<booleanAttribute key="clearws" value="true"/>
|
<booleanAttribute key="clearws" value="true"/>
|
||||||
<booleanAttribute key="clearwslog" value="false"/>
|
<booleanAttribute key="clearwslog" value="false"/>
|
||||||
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
|
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
|
||||||
<booleanAttribute key="default" value="false"/>
|
<booleanAttribute key="default" value="true"/>
|
||||||
<stringAttribute key="deselected_workspace_plugins" value="com.minres.scviewer.database.swt,com.minres.scviewer.e4.application,com.minres.scviewer.ui"/>
|
<setAttribute key="deselected_workspace_bundles">
|
||||||
<booleanAttribute key="includeOptional" value="true"/>
|
<setEntry value="com.minres.scviewer.e4.application"/>
|
||||||
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
|
<setEntry value="com.minres.scviewer.ui"/>
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
</setAttribute>
|
||||||
<listEntry value="/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java"/>
|
<booleanAttribute key="includeOptional" value="true"/>
|
||||||
</listAttribute>
|
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
<listEntry value="1"/>
|
<listEntry value="/com.minres.scviewer.database.test"/>
|
||||||
</listAttribute>
|
</listAttribute>
|
||||||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
<listEntry value="4"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
</listAttribute>
|
||||||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.minres.scviewer.database.test"/>
|
||||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.minres.scviewer.database.test.DatabaseServicesTest"/>
|
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
|
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/>
|
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
|
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
|
||||||
<stringAttribute key="pde.version" value="3.3"/>
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/>
|
||||||
<stringAttribute key="product" value="com.minres.scviewer.e4.product"/>
|
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||||
<booleanAttribute key="run_in_ui_thread" value="true"/>
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/>
|
||||||
<stringAttribute key="selected_target_plugins" value="com.google.guava*10.0.1.v201203051515@default:default,com.google.guava*15.0.0.v201403281430@default:default,com.ibm.icu@default:default,javax.annotation@default:default,javax.inject@default:default,javax.servlet*3.0.0.v201112011016@default:default,javax.servlet*3.1.0.v201410161800@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.codehaus.groovy*2.4.3.xx-201508121448-e45@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.java7@default:false,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt.cocoa@default:false,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.ui.cocoa@default:false,org.eclipse.ui.trace@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.mozilla.javascript@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
|
<stringAttribute key="pde.version" value="3.3"/>
|
||||||
<stringAttribute key="selected_workspace_plugins" value="com.minres.scviewer.database.sqlite@default:true,com.minres.scviewer.database.test@default:default,com.minres.scviewer.database.text@default:true,com.minres.scviewer.database.vcd@default:default,com.minres.scviewer.database@default:true"/>
|
<stringAttribute key="product" value="com.minres.scviewer.e4.product"/>
|
||||||
<booleanAttribute key="show_selected_only" value="false"/>
|
<booleanAttribute key="run_in_ui_thread" value="true"/>
|
||||||
<booleanAttribute key="tracing" value="false"/>
|
<setAttribute key="selected_target_bundles">
|
||||||
<booleanAttribute key="useCustomFeatures" value="false"/>
|
<setEntry value="com.google.guava@default:default"/>
|
||||||
<booleanAttribute key="useDefaultConfig" value="true"/>
|
<setEntry value="javax.annotation@default:default"/>
|
||||||
<booleanAttribute key="useDefaultConfigArea" value="false"/>
|
<setEntry value="javax.inject@default:default"/>
|
||||||
<booleanAttribute key="useProduct" value="false"/>
|
<setEntry value="javax.servlet@default:default"/>
|
||||||
|
<setEntry value="org.apache.ant@default:default"/>
|
||||||
|
<setEntry value="org.apache.commons.jxpath@default:default"/>
|
||||||
|
<setEntry value="org.apache.felix.gogo.command@default:default"/>
|
||||||
|
<setEntry value="org.apache.felix.gogo.runtime@default:default"/>
|
||||||
|
<setEntry value="org.codehaus.groovy@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.ant.core@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.commands@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.contenttype@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.expressions@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.filesystem.macosx@default:false"/>
|
||||||
|
<setEntry value="org.eclipse.core.filesystem@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.jobs@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.resources@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.core.runtime@default:true"/>
|
||||||
|
<setEntry value="org.eclipse.core.variables@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.core.contexts@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.core.di.annotations@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.core.di.extensions@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.core.di@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.core.services@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.emf.xpath@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.ui.di@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.ui.model.workbench@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.e4.ui.services@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.emf.common@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.emf.ecore@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.app@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.bidi@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.common@2:true"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.ds@1:true"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.preferences@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.registry@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.equinox.util@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.jface@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.osgi.compatibility.state@default:false"/>
|
||||||
|
<setEntry value="org.eclipse.osgi.services@default:default"/>
|
||||||
|
<setEntry value="org.eclipse.osgi@-1:true"/>
|
||||||
|
<setEntry value="org.eclipse.swt.cocoa.macosx.x86_64@default:false"/>
|
||||||
|
<setEntry value="org.eclipse.swt@default:default"/>
|
||||||
|
<setEntry value="org.hamcrest.core@default:default"/>
|
||||||
|
<setEntry value="org.junit@default:default"/>
|
||||||
|
</setAttribute>
|
||||||
|
<setAttribute key="selected_workspace_bundles">
|
||||||
|
<setEntry value="com.minres.scviewer.database.sqlite@default:true"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database.test@default:default"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database.text@default:true"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database.ui.swt@default:default"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database.ui@default:default"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database.vcd@default:default"/>
|
||||||
|
<setEntry value="com.minres.scviewer.database@default:true"/>
|
||||||
|
<setEntry value="com.opcoach.e4.preferences@default:default"/>
|
||||||
|
</setAttribute>
|
||||||
|
<booleanAttribute key="show_selected_only" value="false"/>
|
||||||
|
<booleanAttribute key="tracing" value="false"/>
|
||||||
|
<booleanAttribute key="useCustomFeatures" value="false"/>
|
||||||
|
<booleanAttribute key="useDefaultConfig" value="true"/>
|
||||||
|
<booleanAttribute key="useDefaultConfigArea" value="false"/>
|
||||||
|
<booleanAttribute key="useProduct" value="false"/>
|
||||||
</launchConfiguration>
|
</launchConfiguration>
|
||||||
|
@ -1,90 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database.test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
|
||||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
|
||||||
|
|
||||||
public class DatabaseServicesTest {
|
|
||||||
|
|
||||||
|
|
||||||
private static IWaveformDbFactory waveformDbFactory;
|
|
||||||
|
|
||||||
private IWaveformDb waveformDb;
|
|
||||||
|
|
||||||
public synchronized void setFactory(IWaveformDbFactory service) {
|
|
||||||
waveformDbFactory = service;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void unsetFactory(IWaveformDbFactory service) {
|
|
||||||
if (waveformDbFactory == service) {
|
|
||||||
waveformDbFactory = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
waveformDb=waveformDbFactory.getDatabase();
|
|
||||||
// Wait for OSGi dependencies
|
|
||||||
// for (int i = 0; i < 10; i++) {
|
|
||||||
// if (waveformDb.size() == 3) // Dependencies fulfilled
|
|
||||||
// return;
|
|
||||||
// Thread.sleep(1000);
|
|
||||||
// }
|
|
||||||
// assertEquals("OSGi dependencies unfulfilled", 3, WaveformDb.getLoaders().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() throws Exception {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testVCD() throws Exception {
|
|
||||||
File f = new File("inputs/my_db.vcd").getAbsoluteFile();
|
|
||||||
assertTrue(f.exists());
|
|
||||||
waveformDb.load(f);
|
|
||||||
assertNotNull(waveformDb);
|
|
||||||
assertEquals(14, waveformDb.getAllWaves().size());
|
|
||||||
assertEquals(2, waveformDb.getChildNodes().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTxSQLite() throws Exception {
|
|
||||||
File f = new File("inputs/my_db.txdb").getAbsoluteFile();
|
|
||||||
assertTrue(f.exists());
|
|
||||||
waveformDb.load(f);
|
|
||||||
assertNotNull(waveformDb);
|
|
||||||
assertEquals(3, waveformDb.getAllWaves().size());
|
|
||||||
assertEquals(1, waveformDb.getChildNodes().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTxText() throws Exception {
|
|
||||||
File f = new File("inputs/my_db.txlog").getAbsoluteFile();
|
|
||||||
assertTrue(f.exists());
|
|
||||||
waveformDb.load(f);
|
|
||||||
assertNotNull(waveformDb);
|
|
||||||
assertEquals(3, waveformDb.getAllWaves().size());
|
|
||||||
assertEquals(1, waveformDb.getChildNodes().size());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
groovy.compiler.level=23
|
|
@ -1,17 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Bundle-ManifestVersion: 2
|
|
||||||
Bundle-Name: Textual transaction database
|
|
||||||
Bundle-SymbolicName: com.minres.scviewer.database.text
|
|
||||||
Bundle-Version: 1.0.0.qualifier
|
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
|
||||||
Import-Package: com.minres.scviewer.database,
|
|
||||||
org.osgi.framework;version="1.3.0"
|
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
|
||||||
org.codehaus.groovy;bundle-version="1.8.6",
|
|
||||||
org.eclipse.equinox.util;bundle-version="1.0.500",
|
|
||||||
org.eclipse.equinox.ds;bundle-version="1.4.200",
|
|
||||||
org.eclipse.osgi.services;bundle-version="3.4.0",
|
|
||||||
com.google.guava;bundle-version="15.0.0"
|
|
||||||
Service-Component: OSGI-INF/component.xml
|
|
||||||
Bundle-ActivationPolicy: lazy
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,145 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database.swt.internal;
|
|
||||||
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.NavigableMap;
|
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
|
||||||
import org.eclipse.swt.graphics.Color;
|
|
||||||
import org.eclipse.swt.graphics.GC;
|
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.ISignal;
|
|
||||||
import com.minres.scviewer.database.ISignalChange;
|
|
||||||
import com.minres.scviewer.database.ISignalChangeMulti;
|
|
||||||
import com.minres.scviewer.database.ISignalChangeSingle;
|
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
|
||||||
|
|
||||||
public class SignalPainter extends TrackPainter {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private final WaveformCanvas waveCanvas;
|
|
||||||
private ISignal<? extends ISignalChange> signal;
|
|
||||||
|
|
||||||
public SignalPainter(WaveformCanvas txDisplay, boolean even, TrackEntry trackEntry) {
|
|
||||||
super(trackEntry, even);
|
|
||||||
this.waveCanvas = txDisplay;
|
|
||||||
this.signal=trackEntry.getSignal();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void paintArea(GC gc, Rectangle area) {
|
|
||||||
if(trackEntry.selected)
|
|
||||||
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
|
||||||
else
|
|
||||||
gc.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]);
|
|
||||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
|
||||||
gc.fillRectangle(area);
|
|
||||||
Entry<Long, ? extends ISignalChange> firstChange=signal.getEvents().floorEntry(area.x*this.waveCanvas.getScaleFactor());
|
|
||||||
Entry<Long, ? extends ISignalChange> lastTx=signal.getEvents().ceilingEntry((area.x+area.width)*this.waveCanvas.getScaleFactor());
|
|
||||||
if(firstChange==null){
|
|
||||||
if(lastTx==null) return;
|
|
||||||
firstChange = signal.getEvents().firstEntry();
|
|
||||||
} else if(lastTx==null){
|
|
||||||
lastTx=signal.getEvents().lastEntry();
|
|
||||||
}
|
|
||||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
|
||||||
gc.setLineStyle(SWT.LINE_SOLID);
|
|
||||||
gc.setLineWidth(1);
|
|
||||||
Entry<Long, ? extends ISignalChange> left=firstChange;
|
|
||||||
if(left.getValue() instanceof ISignalChangeSingle){
|
|
||||||
NavigableMap<Long, ? extends ISignalChange> entries=signal.getEvents().subMap(firstChange.getKey(), false, lastTx.getKey(), true);
|
|
||||||
for(Entry<Long, ? extends ISignalChange> right:entries.entrySet()){
|
|
||||||
int xEnd= (int)(right.getKey()/this.waveCanvas.getScaleFactor());
|
|
||||||
int xBegin= (int)(left.getKey()/this.waveCanvas.getScaleFactor());
|
|
||||||
if(xEnd>xBegin){
|
|
||||||
int yOffset = this.waveCanvas.getTrackHeight()/2;
|
|
||||||
Color color = this.waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
|
|
||||||
switch(((ISignalChangeSingle) left.getValue()).getValue()){
|
|
||||||
case '1':
|
|
||||||
color=this.waveCanvas.colors[WaveformColors.SIGNAL1.ordinal()];
|
|
||||||
yOffset = this.waveCanvas.getTrackHeight()/5;
|
|
||||||
break;
|
|
||||||
case '0':
|
|
||||||
color=this.waveCanvas.colors[WaveformColors.SIGNAL0.ordinal()];
|
|
||||||
yOffset = 4*this.waveCanvas.getTrackHeight()/5;
|
|
||||||
break;
|
|
||||||
case 'Z':
|
|
||||||
color=this.waveCanvas.colors[WaveformColors.SIGNALZ.ordinal()];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
yOffset+=area.y;
|
|
||||||
gc.setForeground(color);
|
|
||||||
gc.drawLine(xBegin, yOffset, xEnd, yOffset);
|
|
||||||
int yNext = this.waveCanvas.getTrackHeight()/2;
|
|
||||||
switch(((ISignalChangeSingle) right.getValue()).getValue()){
|
|
||||||
case '1':
|
|
||||||
yNext = this.waveCanvas.getTrackHeight()/5+area.y;
|
|
||||||
break;
|
|
||||||
case '0':
|
|
||||||
yNext = 4*this.waveCanvas.getTrackHeight()/5+area.y;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
gc.drawLine(xEnd, yOffset, xEnd, yNext);
|
|
||||||
}
|
|
||||||
left=right;
|
|
||||||
}
|
|
||||||
} else if(left.getValue() instanceof ISignalChangeMulti){
|
|
||||||
NavigableMap<Long,? extends ISignalChange> entries=signal.getEvents().subMap(firstChange.getKey(), false, lastTx.getKey(), true);
|
|
||||||
for(Entry<Long, ? extends ISignalChange> right:entries.entrySet()){
|
|
||||||
int yOffsetT = this.waveCanvas.getTrackHeight()/5+area.y;
|
|
||||||
int yOffsetM = this.waveCanvas.getTrackHeight()/2+area.y;
|
|
||||||
int yOffsetB = 4*this.waveCanvas.getTrackHeight()/5+area.y;
|
|
||||||
Color colorBorder = this.waveCanvas.colors[WaveformColors.SIGNAL0.ordinal()];
|
|
||||||
ISignalChangeMulti last = (ISignalChangeMulti) left.getValue();
|
|
||||||
if(last.getValue().toString().contains("X")){
|
|
||||||
colorBorder=this.waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
|
|
||||||
}else if(last.getValue().toString().contains("Z")){
|
|
||||||
colorBorder=this.waveCanvas.colors[WaveformColors.SIGNALZ.ordinal()];
|
|
||||||
}
|
|
||||||
int beginTime= (int)(left.getKey()/this.waveCanvas.getScaleFactor());
|
|
||||||
int endTime= (int)(right.getKey()/this.waveCanvas.getScaleFactor());
|
|
||||||
int[] points = {
|
|
||||||
beginTime,yOffsetM,
|
|
||||||
beginTime+1,yOffsetT,
|
|
||||||
endTime-1,yOffsetT,
|
|
||||||
endTime,yOffsetM,
|
|
||||||
endTime-1,yOffsetB,
|
|
||||||
beginTime+1,yOffsetB
|
|
||||||
};
|
|
||||||
gc.setForeground(colorBorder);
|
|
||||||
gc.drawPolygon(points);
|
|
||||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.SIGNAL_TEXT.ordinal()]);
|
|
||||||
int size = gc.getDevice().getDPI().y * gc.getFont().getFontData()[0].getHeight()/72;
|
|
||||||
if(beginTime<area.x) beginTime=area.x;
|
|
||||||
int width=endTime-beginTime;
|
|
||||||
if(width>6) {
|
|
||||||
Rectangle old = gc.getClipping();
|
|
||||||
gc.setClipping(beginTime+3, yOffsetT, endTime-beginTime-5, yOffsetB-yOffsetT);
|
|
||||||
gc.drawText("h'"+last.getValue().toHexString(), beginTime+3, yOffsetM-size/2-1);
|
|
||||||
gc.setClipping(old);
|
|
||||||
}
|
|
||||||
left=right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public ISignal<? extends ISignalChange> getSignal() {
|
|
||||||
return signal;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database.ui;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.ISignal;
|
|
||||||
import com.minres.scviewer.database.ISignalChange;
|
|
||||||
import com.minres.scviewer.database.ITxEvent;
|
|
||||||
import com.minres.scviewer.database.ITxStream;
|
|
||||||
import com.minres.scviewer.database.IWaveform;
|
|
||||||
import com.minres.scviewer.database.IWaveformEvent;
|
|
||||||
|
|
||||||
public class TrackEntry {
|
|
||||||
final public IWaveform<? extends IWaveformEvent> waveform;
|
|
||||||
|
|
||||||
public int vOffset;
|
|
||||||
|
|
||||||
public int height;
|
|
||||||
|
|
||||||
public boolean selected;
|
|
||||||
|
|
||||||
public TrackEntry(IWaveform<? extends IWaveformEvent> waveform) {
|
|
||||||
this.waveform = waveform;
|
|
||||||
vOffset=0;
|
|
||||||
height=0;
|
|
||||||
selected=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isStream(){
|
|
||||||
return waveform instanceof ITxStream<?>;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ITxStream<? extends ITxEvent> getStream(){
|
|
||||||
return (ITxStream<?>) waveform;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSignal(){
|
|
||||||
return waveform instanceof ISignal<?>;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISignal<? extends ISignalChange> getSignal(){
|
|
||||||
return (ISignal<?>) waveform;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if(obj instanceof TrackEntry){
|
|
||||||
TrackEntry o = (TrackEntry) obj;
|
|
||||||
return waveform==o.waveform && vOffset==o.vOffset;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,43 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database.vcd;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.BitVector;
|
|
||||||
import com.minres.scviewer.database.ISignalChangeMulti;
|
|
||||||
import com.minres.scviewer.database.SignalChange;
|
|
||||||
|
|
||||||
public class VCDSignalChangeMulti extends SignalChange implements ISignalChangeMulti, Cloneable {
|
|
||||||
|
|
||||||
private BitVector value;
|
|
||||||
|
|
||||||
public VCDSignalChangeMulti(Long time) {
|
|
||||||
super(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
public VCDSignalChangeMulti(Long time, BitVector decodedValues) {
|
|
||||||
super(time);
|
|
||||||
this.value=decodedValues;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BitVector getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(BitVector value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return value.toHexString()+"@"+getTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database.vcd;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.ISignalChangeSingle;
|
|
||||||
import com.minres.scviewer.database.SignalChange;
|
|
||||||
|
|
||||||
public class VCDSignalChangeSingle extends SignalChange implements ISignalChangeSingle, Cloneable {
|
|
||||||
|
|
||||||
private char value;
|
|
||||||
|
|
||||||
public VCDSignalChangeSingle(Long time, char value) {
|
|
||||||
super(time);
|
|
||||||
this.value=value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public char getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(char value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return value+"@"+getTime();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,66 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database;
|
|
||||||
|
|
||||||
public class BitVector {
|
|
||||||
|
|
||||||
public static final char VALUE_X = 'X';
|
|
||||||
public static final char VALUE_Z = 'Z';
|
|
||||||
public static final char VALUE_1 = '1';
|
|
||||||
public static final char VALUE_0 = '0';
|
|
||||||
|
|
||||||
private final int width;
|
|
||||||
|
|
||||||
private char[] value;
|
|
||||||
|
|
||||||
public BitVector(int netWidth) {
|
|
||||||
this.width=netWidth;
|
|
||||||
value = new char[netWidth];
|
|
||||||
for(int i=0; i<netWidth; i++) value[i]='0';
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(int i, char value) {
|
|
||||||
this.value[i]=value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public char[] getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(char[] value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getWidth() {
|
|
||||||
return width;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString(){
|
|
||||||
return new String(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toHexString(){
|
|
||||||
int resWidth=(width-1)/4+1;
|
|
||||||
char[] res = new char[resWidth];
|
|
||||||
for(int i=resWidth-1; i>=0; i--){
|
|
||||||
int digit=0;
|
|
||||||
for(int j=3; j>=0; j--){
|
|
||||||
if(value[4*i+j]==VALUE_X ||value[4*i+j]==VALUE_Z ){
|
|
||||||
res[i]=VALUE_X;
|
|
||||||
}
|
|
||||||
if(value[4*i+j]==VALUE_1)
|
|
||||||
digit+=1<<(3-j);
|
|
||||||
res[i]=Character.forDigit(digit, 16); //((digit < 10) ? '0' + digit : 'a' + digit -10)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new String(res);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database;
|
|
||||||
|
|
||||||
public interface ISignalChange extends IWaveformEvent {
|
|
||||||
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database;
|
|
||||||
|
|
||||||
|
|
||||||
public interface ISignalChangeMulti extends ISignalChange {
|
|
||||||
|
|
||||||
public BitVector getValue();
|
|
||||||
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.database;
|
|
||||||
|
|
||||||
public interface ISignalChangeSingle extends ISignalChange{
|
|
||||||
|
|
||||||
public char getValue();
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
|
||||||
<classpathentry kind="src" path="src"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
|
@ -1,57 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.e4.application.handlers;
|
|
||||||
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
|
||||||
import org.eclipse.e4.core.di.annotations.Execute;
|
|
||||||
import org.eclipse.e4.ui.model.application.MApplication;
|
|
||||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
|
||||||
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
|
||||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
|
||||||
import org.eclipse.swt.SWT;
|
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
|
|
||||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
|
||||||
public class LoadStoreSettingsHandler {
|
|
||||||
|
|
||||||
static final String PARAMETER_ID="com.minres.scviewer.e4.application.commandparameter.loadStore";
|
|
||||||
|
|
||||||
@CanExecute
|
|
||||||
public boolean canExecute(EPartService partService) {
|
|
||||||
MPart part = partService.getActivePart();
|
|
||||||
if(part==null) return false;
|
|
||||||
return (part.getObject() instanceof WaveformViewer);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Execute
|
|
||||||
public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService,
|
|
||||||
EPartService partService){
|
|
||||||
boolean load = "load".equals(param);
|
|
||||||
FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE);
|
|
||||||
dialog.setFilterExtensions (new String []{"*.scview"});
|
|
||||||
if(!load) dialog.setFileName("SCViewer.scview");
|
|
||||||
String res = dialog.open();
|
|
||||||
MPart part = partService.getActivePart();
|
|
||||||
if(res!=null && part!=null){
|
|
||||||
Object obj = part.getObject();
|
|
||||||
if(obj instanceof WaveformViewer){
|
|
||||||
if(load)
|
|
||||||
((WaveformViewer)obj).loadState(res);
|
|
||||||
else
|
|
||||||
((WaveformViewer)obj).saveState(res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
package com.minres.scviewer.e4.application.handlers;
|
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.Execute;
|
|
||||||
|
|
||||||
public class SelectAllHandler {
|
|
||||||
|
|
||||||
@Execute
|
|
||||||
public void execute() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,883 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.e4.application.parts;
|
|
||||||
|
|
||||||
import java.beans.PropertyChangeEvent;
|
|
||||||
import java.beans.PropertyChangeListener;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
|
||||||
import org.eclipse.core.runtime.Status;
|
|
||||||
import org.eclipse.core.runtime.SubMonitor;
|
|
||||||
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
|
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
|
||||||
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
|
|
||||||
import org.eclipse.e4.core.di.annotations.Optional;
|
|
||||||
import org.eclipse.e4.core.di.extensions.Preference;
|
|
||||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
|
||||||
import org.eclipse.e4.ui.di.Focus;
|
|
||||||
import org.eclipse.e4.ui.di.PersistState;
|
|
||||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
|
||||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
|
||||||
import org.eclipse.e4.ui.services.EMenuService;
|
|
||||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
|
||||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
|
||||||
import org.eclipse.jface.dialogs.MessageDialog;
|
|
||||||
import org.eclipse.jface.resource.StringConverter;
|
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
|
||||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
||||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
|
||||||
import org.eclipse.swt.graphics.RGB;
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
|
||||||
import org.eclipse.swt.widgets.Display;
|
|
||||||
|
|
||||||
import com.minres.scviewer.database.ITx;
|
|
||||||
import com.minres.scviewer.database.ITxRelation;
|
|
||||||
import com.minres.scviewer.database.IWaveform;
|
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
|
||||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
|
||||||
import com.minres.scviewer.database.IWaveformEvent;
|
|
||||||
import com.minres.scviewer.database.RelationType;
|
|
||||||
import com.minres.scviewer.database.swt.WaveformViewerFactory;
|
|
||||||
import com.minres.scviewer.database.ui.GotoDirection;
|
|
||||||
import com.minres.scviewer.database.ui.ICursor;
|
|
||||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
|
||||||
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
|
||||||
import com.minres.scviewer.e4.application.internal.util.FileMonitor;
|
|
||||||
import com.minres.scviewer.e4.application.internal.util.IFileChangeListener;
|
|
||||||
import com.minres.scviewer.e4.application.internal.util.IModificationChecker;
|
|
||||||
import com.minres.scviewer.e4.application.preferences.DefaultValuesInitializer;
|
|
||||||
import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The Class WaveformViewerPart.
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener {
|
|
||||||
|
|
||||||
/** The Constant ACTIVE_WAVEFORMVIEW. */
|
|
||||||
public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View";
|
|
||||||
|
|
||||||
/** The Constant ADD_WAVEFORM. */
|
|
||||||
public static final String ADD_WAVEFORM = "AddWaveform";
|
|
||||||
|
|
||||||
/** The Constant DATABASE_FILE. */
|
|
||||||
protected static final String DATABASE_FILE = "DATABASE_FILE";
|
|
||||||
|
|
||||||
/** The Constant SHOWN_WAVEFORM. */
|
|
||||||
protected static final String SHOWN_WAVEFORM = "SHOWN_WAVEFORM";
|
|
||||||
|
|
||||||
/** The Constant SHOWN_CURSOR. */
|
|
||||||
protected static final String SHOWN_CURSOR = "SHOWN_CURSOR";
|
|
||||||
|
|
||||||
/** The Constant ZOOM_LEVEL. */
|
|
||||||
protected static final String ZOOM_LEVEL = "ZOOM_LEVEL";
|
|
||||||
|
|
||||||
/** The Constant BASE_LINE_TIME. */
|
|
||||||
protected static final String BASE_LINE_TIME = "BASE_LINE_TIME";
|
|
||||||
|
|
||||||
/** The Constant FILE_CHECK_INTERVAL. */
|
|
||||||
protected static final long FILE_CHECK_INTERVAL = 60000;
|
|
||||||
|
|
||||||
/** The zoom level. */
|
|
||||||
private String[] zoomLevel;
|
|
||||||
|
|
||||||
/** The Constant ID. */
|
|
||||||
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
/** The Constant WAVE_ACTION_ID. */
|
|
||||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
|
||||||
|
|
||||||
/** The factory. */
|
|
||||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
|
||||||
|
|
||||||
/** The waveform pane. */
|
|
||||||
private IWaveformViewer waveformPane;
|
|
||||||
|
|
||||||
/** The event broker. */
|
|
||||||
@Inject
|
|
||||||
private IEventBroker eventBroker;
|
|
||||||
|
|
||||||
/** The menu service. */
|
|
||||||
@Inject
|
|
||||||
EMenuService menuService;
|
|
||||||
|
|
||||||
/** The selection service. */
|
|
||||||
@Inject
|
|
||||||
ESelectionService selectionService;
|
|
||||||
|
|
||||||
/** The e part service. */
|
|
||||||
@Inject
|
|
||||||
EPartService ePartService;
|
|
||||||
|
|
||||||
/** The prefs. */
|
|
||||||
@Inject
|
|
||||||
@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE)
|
|
||||||
IEclipsePreferences prefs;
|
|
||||||
|
|
||||||
/** The database. */
|
|
||||||
private IWaveformDb database;
|
|
||||||
|
|
||||||
/** The check for updates. */
|
|
||||||
private boolean checkForUpdates;
|
|
||||||
|
|
||||||
/** The my part. */
|
|
||||||
private MPart myPart;
|
|
||||||
|
|
||||||
/** The my parent. */
|
|
||||||
private Composite myParent;
|
|
||||||
|
|
||||||
/** The files to load. */
|
|
||||||
ArrayList<File> filesToLoad;
|
|
||||||
|
|
||||||
/** The persisted state. */
|
|
||||||
Map<String, String> persistedState;
|
|
||||||
|
|
||||||
/** The browser state. */
|
|
||||||
private Object browserState;
|
|
||||||
|
|
||||||
/** The details settings. */
|
|
||||||
private Object detailsSettings;
|
|
||||||
|
|
||||||
/** The navigation relation type. */
|
|
||||||
private RelationType navigationRelationType=IWaveformViewer.NEXT_PREV_IN_STREAM ;
|
|
||||||
|
|
||||||
/** The file monitor. */
|
|
||||||
FileMonitor fileMonitor = new FileMonitor();
|
|
||||||
|
|
||||||
/** The file checker. */
|
|
||||||
IModificationChecker fileChecker;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the composite.
|
|
||||||
*
|
|
||||||
* @param part the part
|
|
||||||
* @param parent the parent
|
|
||||||
* @param dbFactory the db factory
|
|
||||||
*/
|
|
||||||
@PostConstruct
|
|
||||||
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
|
|
||||||
myPart = part;
|
|
||||||
myParent = parent;
|
|
||||||
database = dbFactory.getDatabase();
|
|
||||||
database.addPropertyChangeListener(new PropertyChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
|
||||||
if ("WAVEFORMS".equals(evt.getPropertyName())) {
|
|
||||||
myParent.getDisplay().syncExec(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
waveformPane.setMaxTime(database.getMaxTime());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
waveformPane = factory.createPanel(parent);
|
|
||||||
waveformPane.setMaxTime(0);
|
|
||||||
waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
|
||||||
Long time = (Long) evt.getNewValue();
|
|
||||||
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getScaledTime(time));
|
|
||||||
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarkerId());
|
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(time - marker));
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
waveformPane.addPropertyChangeListener(IWaveformViewer.MARKER_PROPERTY, new PropertyChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
|
||||||
Long time = (Long) evt.getNewValue();
|
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getScaledTime(time));
|
|
||||||
long cursor = waveformPane.getCursorTime();
|
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
waveformPane.addSelectionChangedListener(new ISelectionChangedListener() {
|
|
||||||
@Override
|
|
||||||
public void selectionChanged(SelectionChangedEvent event) {
|
|
||||||
if (event.getSelection() instanceof IStructuredSelection)
|
|
||||||
selectionService.setSelection(event.getSelection());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
zoomLevel = waveformPane.getZoomLevels();
|
|
||||||
setupColors();
|
|
||||||
checkForUpdates = prefs.getBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
|
||||||
filesToLoad = new ArrayList<File>();
|
|
||||||
persistedState = part.getPersistedState();
|
|
||||||
Integer files = persistedState.containsKey(DATABASE_FILE + "S")
|
|
||||||
? Integer.parseInt(persistedState.get(DATABASE_FILE + "S")) : 0;
|
|
||||||
for (int i = 0; i < files; i++) {
|
|
||||||
filesToLoad.add(new File(persistedState.get(DATABASE_FILE + i)));
|
|
||||||
}
|
|
||||||
if (filesToLoad.size() > 0)
|
|
||||||
loadDatabase(persistedState);
|
|
||||||
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, zoomLevel[waveformPane.getZoomLevel()]);
|
|
||||||
menuService.registerContextMenu(waveformPane.getNameControl(),
|
|
||||||
"com.minres.scviewer.e4.application.popupmenu.namecontext");
|
|
||||||
menuService.registerContextMenu(waveformPane.getValueControl(),
|
|
||||||
"com.minres.scviewer.e4.application.popupmenu.namecontext");
|
|
||||||
menuService.registerContextMenu(waveformPane.getWaveformControl(),
|
|
||||||
"com.minres.scviewer.e4.application.popupmenu.wavecontext");
|
|
||||||
ePartService.addPartListener(new PartListener() {
|
|
||||||
@Override
|
|
||||||
public void partActivated(MPart part) {
|
|
||||||
if (part == myPart) {
|
|
||||||
if (fileChecker != null)
|
|
||||||
fileChecker.check();
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
prefs.addPreferenceChangeListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void preferenceChange(PreferenceChangeEvent event) {
|
|
||||||
if (PreferenceConstants.DATABASE_RELOAD.equals(event.getKey())) {
|
|
||||||
checkForUpdates = (Boolean) event.getNewValue();
|
|
||||||
fileChecker = null;
|
|
||||||
if (checkForUpdates)
|
|
||||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad,
|
|
||||||
FILE_CHECK_INTERVAL);
|
|
||||||
else
|
|
||||||
fileMonitor.removeFileChangeListener(this);
|
|
||||||
} else {
|
|
||||||
setupColors();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setup colors.
|
|
||||||
*/
|
|
||||||
protected void setupColors() {
|
|
||||||
DefaultValuesInitializer initializer = new DefaultValuesInitializer();
|
|
||||||
HashMap<WaveformColors, RGB> colorPref = new HashMap<>();
|
|
||||||
for (WaveformColors c : WaveformColors.values()) {
|
|
||||||
String prefValue = prefs.get(c.name() + "_COLOR",
|
|
||||||
StringConverter.asString(initializer.colors[c.ordinal()].getRGB()));
|
|
||||||
RGB rgb = StringConverter.asRGB(prefValue);
|
|
||||||
colorPref.put(c, rgb);
|
|
||||||
}
|
|
||||||
waveformPane.setColors(colorPref);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load database.
|
|
||||||
*
|
|
||||||
* @param state the state
|
|
||||||
*/
|
|
||||||
protected void loadDatabase(final Map<String, String> state) {
|
|
||||||
fileMonitor.removeFileChangeListener(this);
|
|
||||||
Job job = new Job("Database Load Job") {
|
|
||||||
@Override
|
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
|
||||||
// convert to SubMonitor and set total number of work units
|
|
||||||
SubMonitor subMonitor = SubMonitor.convert(monitor, filesToLoad.size()+1);
|
|
||||||
try {
|
|
||||||
subMonitor.worked(1);
|
|
||||||
for (File file : filesToLoad) {
|
|
||||||
subMonitor.setTaskName("Loading "+file.getName());
|
|
||||||
database.load(file);
|
|
||||||
database.addPropertyChangeListener(waveformPane);
|
|
||||||
subMonitor.worked(1);
|
|
||||||
if (monitor.isCanceled())
|
|
||||||
return Status.CANCEL_STATUS;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
database = null;
|
|
||||||
e.printStackTrace();
|
|
||||||
return Status.CANCEL_STATUS;
|
|
||||||
}
|
|
||||||
subMonitor.done();
|
|
||||||
monitor.done();
|
|
||||||
return Status.OK_STATUS;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
job.addJobChangeListener(new JobChangeAdapter() {
|
|
||||||
@Override
|
|
||||||
public void done(IJobChangeEvent event) {
|
|
||||||
if (event.getResult() == Status.OK_STATUS)
|
|
||||||
myParent.getDisplay().asyncExec(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
waveformPane.setMaxTime(database.getMaxTime());
|
|
||||||
if (state != null)
|
|
||||||
restoreWaveformViewerState(state);
|
|
||||||
fileChecker = null;
|
|
||||||
if (checkForUpdates)
|
|
||||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad,
|
|
||||||
FILE_CHECK_INTERVAL);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
job.schedule(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see com.minres.scviewer.e4.application.internal.util.IFileChangeListener#fileChanged(java.util.List)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void fileChanged(List<File> file) {
|
|
||||||
final Display display = myParent.getDisplay();
|
|
||||||
display.asyncExec(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (MessageDialog.openQuestion(display.getActiveShell(), "Database re-load",
|
|
||||||
"Would you like to reload the database?")) {
|
|
||||||
Map<String, String> state = new HashMap<>();
|
|
||||||
saveWaveformViewerState(state);
|
|
||||||
waveformPane.getStreamList().clear();
|
|
||||||
database.clear();
|
|
||||||
if (filesToLoad.size() > 0)
|
|
||||||
loadDatabase(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
fileMonitor.removeFileChangeListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the part input.
|
|
||||||
*
|
|
||||||
* @param partInput the new part input
|
|
||||||
*/
|
|
||||||
@Inject
|
|
||||||
@Optional
|
|
||||||
public void setPartInput(@Named("input") Object partInput) {
|
|
||||||
if (partInput instanceof File) {
|
|
||||||
filesToLoad = new ArrayList<File>();
|
|
||||||
File file = (File) partInput;
|
|
||||||
if (file.exists()) {
|
|
||||||
filesToLoad.add(file);
|
|
||||||
try {
|
|
||||||
String ext = getFileExtension(file.getName());
|
|
||||||
if ("vcd".equals(ext.toLowerCase())) {
|
|
||||||
if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txdb")))) {
|
|
||||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txdb")));
|
|
||||||
} else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "txlog")))) {
|
|
||||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "txlog")));
|
|
||||||
}
|
|
||||||
} else if ("txdb".equals(ext.toLowerCase()) || "txlog".equals(ext.toLowerCase())) {
|
|
||||||
if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), "vcd")))) {
|
|
||||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), "vcd")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e) { // silently ignore any error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (filesToLoad.size() > 0)
|
|
||||||
loadDatabase(persistedState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the focus.
|
|
||||||
*/
|
|
||||||
@Focus
|
|
||||||
public void setFocus() {
|
|
||||||
myParent.setFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save state.
|
|
||||||
*
|
|
||||||
* @param part the part
|
|
||||||
*/
|
|
||||||
@PersistState
|
|
||||||
public void saveState(MPart part) {
|
|
||||||
// save changes
|
|
||||||
Map<String, String> persistedState = part.getPersistedState();
|
|
||||||
persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size()));
|
|
||||||
Integer index = 0;
|
|
||||||
for (File file : filesToLoad) {
|
|
||||||
persistedState.put(DATABASE_FILE + index, file.getAbsolutePath());
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
saveWaveformViewerState(persistedState);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveState(String fileName){
|
|
||||||
Map<String, String> persistedState = new HashMap<>();
|
|
||||||
persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size()));
|
|
||||||
Integer index = 0;
|
|
||||||
for (File file : filesToLoad) {
|
|
||||||
persistedState.put(DATABASE_FILE + index, file.getAbsolutePath());
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
saveWaveformViewerState(persistedState);
|
|
||||||
Properties props = new Properties();
|
|
||||||
props.putAll(persistedState);
|
|
||||||
try {
|
|
||||||
FileOutputStream out = new FileOutputStream(fileName);
|
|
||||||
props.store(out, "Written by SCViewer");
|
|
||||||
out.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadState(String fileName){
|
|
||||||
Properties props = new Properties();
|
|
||||||
try {
|
|
||||||
FileInputStream in = new FileInputStream(fileName);
|
|
||||||
props.load(in);
|
|
||||||
in.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
||||||
HashMap<String, String> propMap = new HashMap<String, String>((Map) props);
|
|
||||||
restoreWaveformViewerState(propMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save waveform viewer state.
|
|
||||||
*
|
|
||||||
* @param persistedState the persisted state
|
|
||||||
*/
|
|
||||||
protected void saveWaveformViewerState(Map<String, String> persistedState) {
|
|
||||||
Integer index;
|
|
||||||
persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size()));
|
|
||||||
index = 0;
|
|
||||||
for (TrackEntry trackEntry : waveformPane.getStreamList()) {
|
|
||||||
persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName());
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
List<ICursor> cursors = waveformPane.getCursorList();
|
|
||||||
persistedState.put(SHOWN_CURSOR + "S", Integer.toString(cursors.size()));
|
|
||||||
index = 0;
|
|
||||||
for (ICursor cursor : cursors) {
|
|
||||||
persistedState.put(SHOWN_CURSOR + index, Long.toString(cursor.getTime()));
|
|
||||||
index++;
|
|
||||||
}
|
|
||||||
persistedState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
|
|
||||||
persistedState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Restore waveform viewer state.
|
|
||||||
*
|
|
||||||
* @param state the state
|
|
||||||
*/
|
|
||||||
protected void restoreWaveformViewerState(Map<String, String> state) {
|
|
||||||
Integer waves = state.containsKey(SHOWN_WAVEFORM+"S") ? Integer.parseInt(state.get(SHOWN_WAVEFORM + "S")):0;
|
|
||||||
List<TrackEntry> res = new LinkedList<>();
|
|
||||||
for (int i = 0; i < waves; i++) {
|
|
||||||
IWaveform<? extends IWaveformEvent> waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
|
|
||||||
if (waveform != null)
|
|
||||||
res.add(new TrackEntry(waveform));
|
|
||||||
}
|
|
||||||
if (res.size() > 0)
|
|
||||||
waveformPane.getStreamList().addAll(res);
|
|
||||||
Integer cursorLength = state.containsKey(SHOWN_CURSOR+"S")?Integer.parseInt(state.get(SHOWN_CURSOR + "S")):0;
|
|
||||||
List<ICursor> cursors = waveformPane.getCursorList();
|
|
||||||
if (cursorLength == cursors.size()) {
|
|
||||||
for (int i = 0; i < cursorLength; i++) {
|
|
||||||
Long time = Long.parseLong(state.get(SHOWN_CURSOR + i));
|
|
||||||
cursors.get(i).setTime(time);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (state.containsKey(ZOOM_LEVEL)) {
|
|
||||||
try {
|
|
||||||
Integer scale = Integer.parseInt(state.get(ZOOM_LEVEL));
|
|
||||||
waveformPane.setZoomLevel(scale);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (state.containsKey(BASE_LINE_TIME)) {
|
|
||||||
try {
|
|
||||||
Long scale = Long.parseLong(state.get(BASE_LINE_TIME));
|
|
||||||
waveformPane.setBaselineTime(scale);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update all status elements by posting respective events.
|
|
||||||
*/
|
|
||||||
private void updateAll() {
|
|
||||||
eventBroker.post(ACTIVE_WAVEFORMVIEW, this);
|
|
||||||
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, zoomLevel[waveformPane.getZoomLevel()]);
|
|
||||||
long cursor = waveformPane.getCursorTime();
|
|
||||||
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarkerId());
|
|
||||||
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getScaledTime(cursor));
|
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getScaledTime(marker));
|
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - marker));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the adds the waveform event.
|
|
||||||
*
|
|
||||||
* @param o the o
|
|
||||||
* @return the adds the waveform event
|
|
||||||
*/
|
|
||||||
@Inject
|
|
||||||
@Optional
|
|
||||||
public void getAddWaveformEvent(@UIEventTopic(WaveformViewer.ADD_WAVEFORM) Object o) {
|
|
||||||
Object sel = o == null ? selectionService.getSelection() : o;
|
|
||||||
if (sel instanceof IStructuredSelection)
|
|
||||||
for (Object el : ((IStructuredSelection) sel).toArray()) {
|
|
||||||
if (el instanceof IWaveform<?>)
|
|
||||||
addStreamToList((IWaveform<?>) el, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ask if to load.
|
|
||||||
*
|
|
||||||
* @param txFile the tx file
|
|
||||||
* @return true, if successful
|
|
||||||
*/
|
|
||||||
protected boolean askIfToLoad(File txFile) {
|
|
||||||
if (txFile.exists() && MessageDialog.openQuestion(myParent.getDisplay().getActiveShell(), "Database open",
|
|
||||||
"Would you like to open the adjacent database " + txFile.getName() + " as well?")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rename file extension.
|
|
||||||
*
|
|
||||||
* @param source the source
|
|
||||||
* @param newExt the new ext
|
|
||||||
* @return the string
|
|
||||||
*/
|
|
||||||
protected static String renameFileExtension(String source, String newExt) {
|
|
||||||
String target;
|
|
||||||
String currentExt = getFileExtension(source);
|
|
||||||
if (currentExt.equals("")) {
|
|
||||||
target = source + "." + newExt;
|
|
||||||
} else {
|
|
||||||
target = source.replaceFirst(Pattern.quote("." + currentExt) + "$", Matcher.quoteReplacement("." + newExt));
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the file extension.
|
|
||||||
*
|
|
||||||
* @param f the f
|
|
||||||
* @return the file extension
|
|
||||||
*/
|
|
||||||
protected static String getFileExtension(String f) {
|
|
||||||
String ext = "";
|
|
||||||
int i = f.lastIndexOf('.');
|
|
||||||
if (i > 0 && i < f.length() - 1) {
|
|
||||||
ext = f.substring(i + 1);
|
|
||||||
}
|
|
||||||
return ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the model.
|
|
||||||
*
|
|
||||||
* @return the model
|
|
||||||
*/
|
|
||||||
public IWaveformDb getModel() {
|
|
||||||
return database;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the database.
|
|
||||||
*
|
|
||||||
* @return the database
|
|
||||||
*/
|
|
||||||
public IWaveformDb getDatabase() {
|
|
||||||
return database;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the stream to list.
|
|
||||||
*
|
|
||||||
* @param obj the obj
|
|
||||||
* @param insert the insert
|
|
||||||
*/
|
|
||||||
public void addStreamToList(IWaveform<? extends IWaveformEvent> obj, boolean insert) {
|
|
||||||
addStreamsToList(new IWaveform<?>[] { obj }, insert);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds the streams to list.
|
|
||||||
*
|
|
||||||
* @param iWaveforms the i waveforms
|
|
||||||
* @param insert the insert
|
|
||||||
*/
|
|
||||||
public void addStreamsToList(IWaveform<? extends IWaveformEvent>[] iWaveforms, boolean insert) {
|
|
||||||
List<TrackEntry> streams = new LinkedList<>();
|
|
||||||
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms)
|
|
||||||
streams.add(new TrackEntry(stream));
|
|
||||||
IStructuredSelection selection = (IStructuredSelection) waveformPane.getSelection();
|
|
||||||
if (selection.size() == 0) {
|
|
||||||
waveformPane.getStreamList().addAll(streams);
|
|
||||||
} else {
|
|
||||||
Object first = selection.getFirstElement();
|
|
||||||
IWaveform<?> stream = (first instanceof ITx) ? ((ITx) first).getStream() : (IWaveform<?>) first;
|
|
||||||
TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
|
|
||||||
int index = waveformPane.getStreamList().indexOf(trackEntry);
|
|
||||||
if (!insert)
|
|
||||||
index++;
|
|
||||||
waveformPane.getStreamList().addAll(index, streams);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the stream from list.
|
|
||||||
*
|
|
||||||
* @param stream the stream
|
|
||||||
*/
|
|
||||||
public void removeStreamFromList(IWaveform<? extends IWaveformEvent> stream) {
|
|
||||||
TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
|
|
||||||
waveformPane.getStreamList().remove(trackEntry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the streams from list.
|
|
||||||
*
|
|
||||||
* @param iWaveforms the i waveforms
|
|
||||||
*/
|
|
||||||
public void removeStreamsFromList(IWaveform<? extends IWaveformEvent>[] iWaveforms) {
|
|
||||||
for (IWaveform<? extends IWaveformEvent> stream : iWaveforms)
|
|
||||||
removeStreamFromList(stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move selected.
|
|
||||||
*
|
|
||||||
* @param i the i
|
|
||||||
*/
|
|
||||||
public void moveSelected(int i) {
|
|
||||||
waveformPane.moveSelectedTrack(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move selection.
|
|
||||||
*
|
|
||||||
* @param direction the direction
|
|
||||||
*/
|
|
||||||
public void moveSelection(GotoDirection direction ) {
|
|
||||||
moveSelection(direction, navigationRelationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move selection.
|
|
||||||
*
|
|
||||||
* @param direction the direction
|
|
||||||
* @param relationType the relation type
|
|
||||||
*/
|
|
||||||
public void moveSelection(GotoDirection direction, RelationType relationType) {
|
|
||||||
waveformPane.moveSelection(direction, relationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move cursor.
|
|
||||||
*
|
|
||||||
* @param direction the direction
|
|
||||||
*/
|
|
||||||
public void moveCursor(GotoDirection direction) {
|
|
||||||
waveformPane.moveCursor(direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the zoom level.
|
|
||||||
*
|
|
||||||
* @param level the new zoom level
|
|
||||||
*/
|
|
||||||
public void setZoomLevel(Integer level) {
|
|
||||||
if (level < 0)
|
|
||||||
level = 0;
|
|
||||||
if (level > zoomLevel.length - 1)
|
|
||||||
level = zoomLevel.length - 1;
|
|
||||||
waveformPane.setZoomLevel(level);
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the zoom fit.
|
|
||||||
*/
|
|
||||||
public void setZoomFit() {
|
|
||||||
waveformPane.setZoomLevel(6);
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the zoom level.
|
|
||||||
*
|
|
||||||
* @return the zoom level
|
|
||||||
*/
|
|
||||||
public int getZoomLevel() {
|
|
||||||
return waveformPane.getZoomLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the selection.
|
|
||||||
*
|
|
||||||
* @return the selection
|
|
||||||
*/
|
|
||||||
public ISelection getSelection() {
|
|
||||||
return waveformPane.getSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the selection.
|
|
||||||
*
|
|
||||||
* @param structuredSelection the new selection
|
|
||||||
*/
|
|
||||||
public void setSelection(IStructuredSelection structuredSelection) {
|
|
||||||
waveformPane.setSelection(structuredSelection, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the scaled time.
|
|
||||||
*
|
|
||||||
* @param time the time
|
|
||||||
* @return the scaled time
|
|
||||||
*/
|
|
||||||
public String getScaledTime(Long time) {
|
|
||||||
return waveformPane.getScaledTime(time);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store design brower state.
|
|
||||||
*
|
|
||||||
* @param browserState the browser state
|
|
||||||
*/
|
|
||||||
public void storeDesignBrowerState(Object browserState) {
|
|
||||||
this.browserState=browserState;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve design brower state.
|
|
||||||
*
|
|
||||||
* @return the object
|
|
||||||
*/
|
|
||||||
public Object retrieveDesignBrowerState() {
|
|
||||||
return browserState;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store transaction details settings
|
|
||||||
*
|
|
||||||
* @param detailsSettings the details settings
|
|
||||||
*/
|
|
||||||
public void storeDetailsSettings(Object detailsSettings) {
|
|
||||||
this.detailsSettings=detailsSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve design details settings.
|
|
||||||
*
|
|
||||||
* @return the details settings
|
|
||||||
*/
|
|
||||||
public Object retrieveDetailsSettings() {
|
|
||||||
return detailsSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the all relation types.
|
|
||||||
*
|
|
||||||
* @return the all relation types
|
|
||||||
*/
|
|
||||||
public List<RelationType> getAllRelationTypes() {
|
|
||||||
List<RelationType> res =new ArrayList<>();
|
|
||||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
|
||||||
res.addAll(database.getAllRelationTypes());
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the selection relation types.
|
|
||||||
*
|
|
||||||
* @return the selection relation types
|
|
||||||
*/
|
|
||||||
public List<RelationType> getSelectionRelationTypes() {
|
|
||||||
List<RelationType> res =new ArrayList<>();
|
|
||||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
|
||||||
ISelection selection = waveformPane.getSelection();
|
|
||||||
if(selection instanceof IStructuredSelection && !selection.isEmpty()){
|
|
||||||
IStructuredSelection sel=(IStructuredSelection) selection;
|
|
||||||
if(sel.getFirstElement() instanceof ITx){
|
|
||||||
ITx tx = (ITx) sel.getFirstElement();
|
|
||||||
for(ITxRelation rel:tx.getIncomingRelations()){
|
|
||||||
if(!res.contains(rel.getRelationType()))
|
|
||||||
res.add(rel.getRelationType());
|
|
||||||
}
|
|
||||||
for(ITxRelation rel:tx.getOutgoingRelations()){
|
|
||||||
if(!res.contains(rel.getRelationType()))
|
|
||||||
res.add(rel.getRelationType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the relation type filter.
|
|
||||||
*
|
|
||||||
* @return the relation type filter
|
|
||||||
*/
|
|
||||||
public RelationType getRelationTypeFilter() {
|
|
||||||
return navigationRelationType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the navigation relation type.
|
|
||||||
*
|
|
||||||
* @param relationName the new navigation relation type
|
|
||||||
*/
|
|
||||||
public void setNavigationRelationType(String relationName) {
|
|
||||||
setNavigationRelationType(RelationType.create(relationName));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the navigation relation type.
|
|
||||||
*
|
|
||||||
* @param relationType the new navigation relation type
|
|
||||||
*/
|
|
||||||
public void setNavigationRelationType(RelationType relationType) {
|
|
||||||
if(navigationRelationType!=relationType) waveformPane.setHighliteRelation(relationType);
|
|
||||||
navigationRelationType=relationType;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
|
|
||||||
<booleanAttribute key="append.args" value="true"/>
|
|
||||||
<stringAttribute key="application" value="org.eclipse.e4.ui.workbench.swt.E4Application"/>
|
|
||||||
<booleanAttribute key="askclear" value="true"/>
|
|
||||||
<booleanAttribute key="automaticAdd" value="false"/>
|
|
||||||
<booleanAttribute key="automaticValidate" value="false"/>
|
|
||||||
<stringAttribute key="bootstrap" value=""/>
|
|
||||||
<stringAttribute key="checked" value="[NONE]"/>
|
|
||||||
<booleanAttribute key="clearConfig" value="false"/>
|
|
||||||
<booleanAttribute key="clearws" value="false"/>
|
|
||||||
<booleanAttribute key="clearwslog" value="false"/>
|
|
||||||
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/SCViewer (restart)"/>
|
|
||||||
<booleanAttribute key="default" value="false"/>
|
|
||||||
<booleanAttribute key="includeOptional" value="true"/>
|
|
||||||
<stringAttribute key="location" value="${workspace_loc}/../runtime-com.minres.scviewer.e4.application.product"/>
|
|
||||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts"/>
|
|
||||||
<stringAttribute key="pde.version" value="3.3"/>
|
|
||||||
<stringAttribute key="product" value="com.minres.scviewer.e4.application.product"/>
|
|
||||||
<stringAttribute key="productFile" value="/com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.product"/>
|
|
||||||
<stringAttribute key="selected_target_plugins" value="com.google.guava@default:default,com.ibm.icu@default:default,javax.annotation@default:default,javax.inject@default:default,javax.servlet@default:default,javax.xml@default:default,org.apache.ant@default:default,org.apache.batik.css@default:default,org.apache.batik.util.gui@default:default,org.apache.batik.util@default:default,org.apache.commons.jxpath@default:default,org.apache.commons.logging@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.codehaus.groovy@default:default,org.eclipse.ant.core@default:default,org.eclipse.compare.core@default:default,org.eclipse.core.commands@default:default,org.eclipse.core.contenttype@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.databinding.observable@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.core.databinding@default:default,org.eclipse.core.expressions@default:default,org.eclipse.core.filesystem.java7@default:false,org.eclipse.core.filesystem.macosx@default:false,org.eclipse.core.filesystem@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.resources@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.core.runtime@default:true,org.eclipse.core.variables@default:default,org.eclipse.e4.core.commands@default:default,org.eclipse.e4.core.contexts@default:default,org.eclipse.e4.core.di.annotations@default:default,org.eclipse.e4.core.di.extensions@default:default,org.eclipse.e4.core.di@default:default,org.eclipse.e4.core.services@default:default,org.eclipse.e4.emf.xpath@default:default,org.eclipse.e4.ui.bindings@default:default,org.eclipse.e4.ui.css.core@default:default,org.eclipse.e4.ui.css.swt.theme@default:default,org.eclipse.e4.ui.css.swt@default:default,org.eclipse.e4.ui.di@default:default,org.eclipse.e4.ui.model.workbench@default:default,org.eclipse.e4.ui.services@default:default,org.eclipse.e4.ui.widgets@default:default,org.eclipse.e4.ui.workbench.addons.swt@default:default,org.eclipse.e4.ui.workbench.renderers.swt.cocoa@default:false,org.eclipse.e4.ui.workbench.renderers.swt@default:default,org.eclipse.e4.ui.workbench.swt@default:default,org.eclipse.e4.ui.workbench3@default:default,org.eclipse.e4.ui.workbench@default:default,org.eclipse.emf.common@default:default,org.eclipse.emf.ecore.change@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.emf.ecore@default:default,org.eclipse.equinox.app@default:default,org.eclipse.equinox.bidi@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.concurrent@default:default,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.help@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jface.text@default:default,org.eclipse.jface@default:default,org.eclipse.osgi.compatibility.state@default:false,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.eclipse.swt.cocoa.macosx.x86_64@default:false,org.eclipse.swt@default:default,org.eclipse.team.core@default:default,org.eclipse.text@default:default,org.eclipse.ui.cocoa@default:false,org.eclipse.ui.console@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui@default:default,org.hamcrest.core@default:default,org.junit@default:default,org.w3c.css.sac@default:default,org.w3c.dom.events@default:default,org.w3c.dom.smil@default:default,org.w3c.dom.svg@default:default"/>
|
|
||||||
<stringAttribute key="selected_workspace_plugins" value="com.minres.scviewer.database.sqlite@default:default,com.minres.scviewer.database.text@default:default,com.minres.scviewer.database.ui.swt@default:default,com.minres.scviewer.database.ui@default:default,com.minres.scviewer.database.vcd@default:default,com.minres.scviewer.database@default:default,com.minres.scviewer.e4.application@default:default,com.opcoach.e4.preferences@default:default"/>
|
|
||||||
<booleanAttribute key="show_selected_only" value="false"/>
|
|
||||||
<booleanAttribute key="tracing" value="false"/>
|
|
||||||
<booleanAttribute key="useCustomFeatures" value="false"/>
|
|
||||||
<booleanAttribute key="useDefaultConfig" value="true"/>
|
|
||||||
<booleanAttribute key="useDefaultConfigArea" value="true"/>
|
|
||||||
<booleanAttribute key="useProduct" value="true"/>
|
|
||||||
<booleanAttribute key="usefeatures" value="false"/>
|
|
||||||
</launchConfiguration>
|
|
BIN
com.minres.scviewer.e4.product/icons/SCViewer.ico
Normal file
BIN
com.minres.scviewer.e4.product/icons/SCViewer.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 KiB |
11
com.minres.scviewer.e4.product/icons/convert2ico.sh
Normal file
11
com.minres.scviewer.e4.product/icons/convert2ico.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
convert $1.png -compress none \
|
||||||
|
\( -clone 0 -resize 16x16 -compress none \) \
|
||||||
|
\( -clone 0 -resize 24x24 -compress none \) \
|
||||||
|
\( -clone 0 -resize 32x32 -compress none \) \
|
||||||
|
\( -clone 0 -resize 48x48 -compress none \) \
|
||||||
|
\( -clone 0 -resize 16x16 -colors 256 -compress none \) \
|
||||||
|
\( -clone 0 -resize 24x24 -colors 256 -compress none \) \
|
||||||
|
\( -clone 0 -resize 32x32 -colors 256 -compress none \) \
|
||||||
|
\( -clone 0 -resize 48x48 -colors 256 -compress none \) \
|
||||||
|
\( -clone 0 -resize 256x256 -compress none \) \
|
||||||
|
-delete 0 $1.ico
|
@ -6,11 +6,11 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.6.0-SNAPSHOT</version>
|
||||||
<packaging>eclipse-repository</packaging>
|
<packaging>eclipse-repository</packaging>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<?pde version="3.5"?>
|
<?pde version="3.5"?>
|
||||||
|
|
||||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">
|
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.6.0.qualifier" useFeatures="false" includeLaunchers="true">
|
||||||
|
|
||||||
<configIni use="default">
|
<configIni use="default">
|
||||||
</configIni>
|
</configIni>
|
||||||
|
|
||||||
<launcherArgs>
|
<launcherArgs>
|
||||||
<programArgs>-clearPersistedState -data @none
|
<programArgs>-clearPersistedState</programArgs>
|
||||||
</programArgs>
|
<vmArgs>-Xmx2G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer</vmArgs>
|
||||||
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
|
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
|
||||||
</vmArgsMac>
|
|
||||||
</launcherArgs>
|
</launcherArgs>
|
||||||
|
|
||||||
<windowImages i16="/com.minres.scviewer.e4.application/icons/SCViewer_16x32.png" i32="/com.minres.scviewer.e4.application/icons/SCViewer_32x32.png" i48="/com.minres.scviewer.e4.application/icons/SCViewer_48x32.png" i64="/com.minres.scviewer.e4.application/icons/SCViewer_64x32.png" i128="/com.minres.scviewer.e4.application/icons/SCViewer_128x32.png" i256="/com.minres.scviewer.e4.application/icons/SCViewer_256x32.png"/>
|
<windowImages/>
|
||||||
|
|
||||||
<launcher name="scviewer">
|
<launcher name="scviewer">
|
||||||
<linux icon="icons/SCViewer_512x512.xpm"/>
|
<linux icon="icons/SCViewer_512x512.xpm"/>
|
||||||
<macosx icon="icons/SCViewer.icns"/>
|
<macosx icon="icons/SCViewer.icns"/>
|
||||||
<solaris/>
|
<win useIco="true">
|
||||||
<win useIco="false">
|
<ico path="icons/SCViewer.ico"/>
|
||||||
<bmp
|
<bmp
|
||||||
winSmallHigh="icons/SCViewer_16x16@32.bmp"
|
winSmallHigh="icons/SCViewer_16x16@32.bmp"
|
||||||
winSmallLow="icons/SCViewer_16x16@8.bmp"
|
winSmallLow="icons/SCViewer_16x16@8.bmp"
|
||||||
@ -32,9 +31,17 @@
|
|||||||
</launcher>
|
</launcher>
|
||||||
|
|
||||||
<vm>
|
<vm>
|
||||||
|
<linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</linux>
|
||||||
|
<macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</macos>
|
||||||
|
<windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</windows>
|
||||||
</vm>
|
</vm>
|
||||||
|
|
||||||
|
<license>
|
||||||
|
<url>http://www.eclipse.org/legal/epl-v10.html</url>
|
||||||
|
</license>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin id="com.google.guava"/>
|
||||||
<plugin id="com.ibm.icu"/>
|
<plugin id="com.ibm.icu"/>
|
||||||
<plugin id="com.minres.scviewer.database"/>
|
<plugin id="com.minres.scviewer.database"/>
|
||||||
<plugin id="com.minres.scviewer.database.sqlite"/>
|
<plugin id="com.minres.scviewer.database.sqlite"/>
|
||||||
@ -44,14 +51,19 @@
|
|||||||
<plugin id="com.minres.scviewer.database.vcd"/>
|
<plugin id="com.minres.scviewer.database.vcd"/>
|
||||||
<plugin id="com.minres.scviewer.e4.application"/>
|
<plugin id="com.minres.scviewer.e4.application"/>
|
||||||
<plugin id="com.opcoach.e4.preferences"/>
|
<plugin id="com.opcoach.e4.preferences"/>
|
||||||
|
<plugin id="com.opcoach.e4.preferences.mainmenu"/>
|
||||||
<plugin id="javax.annotation"/>
|
<plugin id="javax.annotation"/>
|
||||||
<plugin id="javax.inject"/>
|
<plugin id="javax.inject"/>
|
||||||
<plugin id="javax.xml"/>
|
<plugin id="org.apache.batik.constants"/>
|
||||||
<plugin id="org.apache.batik.css"/>
|
<plugin id="org.apache.batik.css"/>
|
||||||
|
<plugin id="org.apache.batik.i18n"/>
|
||||||
<plugin id="org.apache.batik.util"/>
|
<plugin id="org.apache.batik.util"/>
|
||||||
<plugin id="org.apache.batik.util.gui"/>
|
<plugin id="org.apache.commons.io"/>
|
||||||
<plugin id="org.apache.commons.jxpath"/>
|
<plugin id="org.apache.commons.jxpath"/>
|
||||||
<plugin id="org.apache.commons.logging"/>
|
<plugin id="org.apache.commons.logging"/>
|
||||||
|
<plugin id="org.apache.felix.scr"/>
|
||||||
|
<plugin id="org.apache.xmlgraphics"/>
|
||||||
|
<plugin id="org.codehaus.groovy"/>
|
||||||
<plugin id="org.eclipse.core.commands"/>
|
<plugin id="org.eclipse.core.commands"/>
|
||||||
<plugin id="org.eclipse.core.contenttype"/>
|
<plugin id="org.eclipse.core.contenttype"/>
|
||||||
<plugin id="org.eclipse.core.databinding"/>
|
<plugin id="org.eclipse.core.databinding"/>
|
||||||
@ -60,16 +72,18 @@
|
|||||||
<plugin id="org.eclipse.core.databinding.property"/>
|
<plugin id="org.eclipse.core.databinding.property"/>
|
||||||
<plugin id="org.eclipse.core.expressions"/>
|
<plugin id="org.eclipse.core.expressions"/>
|
||||||
<plugin id="org.eclipse.core.filesystem"/>
|
<plugin id="org.eclipse.core.filesystem"/>
|
||||||
<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
|
<plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
|
||||||
<plugin id="org.eclipse.core.jobs"/>
|
<plugin id="org.eclipse.core.jobs"/>
|
||||||
<plugin id="org.eclipse.core.resources"/>
|
<plugin id="org.eclipse.core.resources"/>
|
||||||
|
<plugin id="org.eclipse.core.resources.win32.x86_64" fragment="true"/>
|
||||||
<plugin id="org.eclipse.core.runtime"/>
|
<plugin id="org.eclipse.core.runtime"/>
|
||||||
<plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
|
|
||||||
<plugin id="org.eclipse.e4.core.commands"/>
|
<plugin id="org.eclipse.e4.core.commands"/>
|
||||||
<plugin id="org.eclipse.e4.core.contexts"/>
|
<plugin id="org.eclipse.e4.core.contexts"/>
|
||||||
<plugin id="org.eclipse.e4.core.di"/>
|
<plugin id="org.eclipse.e4.core.di"/>
|
||||||
<plugin id="org.eclipse.e4.core.di.annotations"/>
|
<plugin id="org.eclipse.e4.core.di.annotations"/>
|
||||||
<plugin id="org.eclipse.e4.core.di.extensions"/>
|
<plugin id="org.eclipse.e4.core.di.extensions"/>
|
||||||
|
<plugin id="org.eclipse.e4.core.di.extensions.supplier"/>
|
||||||
<plugin id="org.eclipse.e4.core.services"/>
|
<plugin id="org.eclipse.e4.core.services"/>
|
||||||
<plugin id="org.eclipse.e4.emf.xpath"/>
|
<plugin id="org.eclipse.e4.emf.xpath"/>
|
||||||
<plugin id="org.eclipse.e4.ui.bindings"/>
|
<plugin id="org.eclipse.e4.ui.bindings"/>
|
||||||
@ -77,12 +91,14 @@
|
|||||||
<plugin id="org.eclipse.e4.ui.css.swt"/>
|
<plugin id="org.eclipse.e4.ui.css.swt"/>
|
||||||
<plugin id="org.eclipse.e4.ui.css.swt.theme"/>
|
<plugin id="org.eclipse.e4.ui.css.swt.theme"/>
|
||||||
<plugin id="org.eclipse.e4.ui.di"/>
|
<plugin id="org.eclipse.e4.ui.di"/>
|
||||||
|
<plugin id="org.eclipse.e4.ui.dialogs"/>
|
||||||
<plugin id="org.eclipse.e4.ui.model.workbench"/>
|
<plugin id="org.eclipse.e4.ui.model.workbench"/>
|
||||||
<plugin id="org.eclipse.e4.ui.services"/>
|
<plugin id="org.eclipse.e4.ui.services"/>
|
||||||
|
<plugin id="org.eclipse.e4.ui.swt.gtk" fragment="true"/>
|
||||||
<plugin id="org.eclipse.e4.ui.widgets"/>
|
<plugin id="org.eclipse.e4.ui.widgets"/>
|
||||||
<plugin id="org.eclipse.e4.ui.workbench"/>
|
<plugin id="org.eclipse.e4.ui.workbench"/>
|
||||||
|
<plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
|
||||||
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
|
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
|
||||||
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
|
|
||||||
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
|
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
|
||||||
<plugin id="org.eclipse.e4.ui.workbench3"/>
|
<plugin id="org.eclipse.e4.ui.workbench3"/>
|
||||||
<plugin id="org.eclipse.emf.common"/>
|
<plugin id="org.eclipse.emf.common"/>
|
||||||
@ -92,18 +108,25 @@
|
|||||||
<plugin id="org.eclipse.equinox.app"/>
|
<plugin id="org.eclipse.equinox.app"/>
|
||||||
<plugin id="org.eclipse.equinox.common"/>
|
<plugin id="org.eclipse.equinox.common"/>
|
||||||
<plugin id="org.eclipse.equinox.concurrent"/>
|
<plugin id="org.eclipse.equinox.concurrent"/>
|
||||||
<plugin id="org.eclipse.equinox.ds"/>
|
|
||||||
<plugin id="org.eclipse.equinox.event"/>
|
<plugin id="org.eclipse.equinox.event"/>
|
||||||
<plugin id="org.eclipse.equinox.preferences"/>
|
<plugin id="org.eclipse.equinox.preferences"/>
|
||||||
|
<plugin id="org.eclipse.equinox.region" fragment="true"/>
|
||||||
<plugin id="org.eclipse.equinox.registry"/>
|
<plugin id="org.eclipse.equinox.registry"/>
|
||||||
<plugin id="org.eclipse.equinox.util"/>
|
<plugin id="org.eclipse.equinox.transforms.hook" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.equinox.weaving.hook" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.help"/>
|
||||||
<plugin id="org.eclipse.jface"/>
|
<plugin id="org.eclipse.jface"/>
|
||||||
<plugin id="org.eclipse.jface.databinding"/>
|
<plugin id="org.eclipse.jface.databinding"/>
|
||||||
<plugin id="org.eclipse.osgi"/>
|
<plugin id="org.eclipse.osgi"/>
|
||||||
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
|
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
|
||||||
<plugin id="org.eclipse.osgi.services"/>
|
<plugin id="org.eclipse.osgi.services"/>
|
||||||
|
<plugin id="org.eclipse.osgi.util"/>
|
||||||
|
<plugin id="org.eclipse.pde.ds.lib"/>
|
||||||
<plugin id="org.eclipse.swt"/>
|
<plugin id="org.eclipse.swt"/>
|
||||||
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
|
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
|
||||||
|
<plugin id="org.eclipse.ui.workbench"/>
|
||||||
<plugin id="org.w3c.css.sac"/>
|
<plugin id="org.w3c.css.sac"/>
|
||||||
<plugin id="org.w3c.dom.events"/>
|
<plugin id="org.w3c.dom.events"/>
|
||||||
<plugin id="org.w3c.dom.smil"/>
|
<plugin id="org.w3c.dom.smil"/>
|
||||||
@ -111,10 +134,19 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
<configurations>
|
<configurations>
|
||||||
|
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" />
|
||||||
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
|
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
|
||||||
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
|
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
|
||||||
<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
|
|
||||||
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
|
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
|
||||||
|
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
|
||||||
</configurations>
|
</configurations>
|
||||||
|
|
||||||
|
<preferencesInfo>
|
||||||
|
<targetfile overwrite="false"/>
|
||||||
|
</preferencesInfo>
|
||||||
|
|
||||||
|
<cssInfo>
|
||||||
|
<file path="/com.minres.scviewer.e4.application/css/default.css"/>
|
||||||
|
</cssInfo>
|
||||||
|
|
||||||
</product>
|
</product>
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
1
com.minres.scviewer.parent/.gitignore
vendored
1
com.minres.scviewer.parent/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
/workspace/
|
|
27
com.minres.scviewer.target/com.minres.scviewer.target.target
Normal file
27
com.minres.scviewer.target/com.minres.scviewer.target.target
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?pde version="3.8"?>
|
||||||
|
<target name="com.minres.scviewer.target" sequenceNumber="138">
|
||||||
|
<locations>
|
||||||
|
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
|
<repository location="http://download.eclipse.org/releases/2020-03/"/>
|
||||||
|
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
|
||||||
|
<unit id="org.eclipse.equinox.p2.sdk.feature.jar" version="0.0.0"/> <!-- needed by Linux exectable-->
|
||||||
|
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
|
||||||
|
<unit id="org.eclipse.platform.sdk" version="0.0.0"/>
|
||||||
|
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <!-- org.junit for testing -->
|
||||||
|
<unit id="org.eclipse.rcptt.core.feature.group" version="0.0.0"/><!-- com.google.guave-->
|
||||||
|
</location>
|
||||||
|
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
|
<repository location="https://www.opcoach.com/repository/2020-03/"/>
|
||||||
|
<unit id="com.opcoach.e4.preferences.feature.feature.group" version="0.0.0"/>
|
||||||
|
</location>
|
||||||
|
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||||
|
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.15/"/>
|
||||||
|
<unit id="org.codehaus.groovy25.feature.feature.group" version="0.0.0"/>
|
||||||
|
</location>
|
||||||
|
</locations>
|
||||||
|
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
|
<launcherArgs>
|
||||||
|
<vmArgs>-Xms40m -Xmx2G</vmArgs>
|
||||||
|
</launcherArgs>
|
||||||
|
</target>
|
@ -1,24 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<?pde version="3.8"?><target name="Mars Platform" sequenceNumber="130">
|
|
||||||
<locations>
|
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
|
||||||
<unit id="org.eclipse.rcp.sdk.id" version="4.5.1.M20150904-0015"/>
|
|
||||||
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.200.v20150602-1417"/>
|
|
||||||
<unit id="org.eclipse.rcptt.core.feature.group" version="2.0.1.201508201020"/>
|
|
||||||
<unit id="org.eclipse.platform.sdk" version="4.5.1.M20150904-0015"/>
|
|
||||||
<repository location="http://download.eclipse.org/releases/mars"/>
|
|
||||||
</location>
|
|
||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
|
||||||
<unit id="org.codehaus.groovy24.feature.feature.group" version="2.9.2.xx-201508121448-e45"/>
|
|
||||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.5"/>
|
|
||||||
</location>
|
|
||||||
</locations>
|
|
||||||
<environment>
|
|
||||||
<arch>x86_64</arch>
|
|
||||||
<nl>de_DE</nl>
|
|
||||||
</environment>
|
|
||||||
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/Java SE 7 [1.7.0_45]"/>
|
|
||||||
<launcherArgs>
|
|
||||||
<vmArgs>-Dosgi.requiredJavaVersion=1.6 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xms40m -Xmx512m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgs>
|
|
||||||
</launcherArgs>
|
|
||||||
</target>
|
|
@ -4,7 +4,7 @@
|
|||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>mars</artifactId>
|
<artifactId>com.minres.scviewer.target</artifactId>
|
||||||
|
|
||||||
<packaging>eclipse-target-definition</packaging>
|
<packaging>eclipse-target-definition</packaging>
|
||||||
<name>SCViewer Target Definition</name>
|
<name>SCViewer Target Definition</name>
|
||||||
@ -12,10 +12,8 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>com.minres.scviewer</groupId>
|
</project>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
|
||||||
</project>
|
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
groovy.compiler.level=23
|
|
@ -1,2 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
@ -1,4 +0,0 @@
|
|||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
version=1
|
|
@ -1,12 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,18 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Bundle-ManifestVersion: 2
|
|
||||||
Bundle-Name: Preferences
|
|
||||||
Bundle-SymbolicName: com.opcoach.e4.preferences;singleton:=true
|
|
||||||
Bundle-Version: 1.0.0.qualifier
|
|
||||||
Bundle-Vendor: OPCOACH
|
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
|
||||||
Require-Bundle: javax.inject,
|
|
||||||
org.eclipse.core.runtime;bundle-version="3.9.0",
|
|
||||||
org.eclipse.jface;bundle-version="3.9.0",
|
|
||||||
org.eclipse.e4.core.di;bundle-version="1.3.0",
|
|
||||||
org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0",
|
|
||||||
org.eclipse.e4.core.services;bundle-version="1.1.0",
|
|
||||||
org.eclipse.e4.core.contexts;bundle-version="1.3.0",
|
|
||||||
org.eclipse.e4.ui.services;bundle-version="1.0.0"
|
|
||||||
Export-Package: com.opcoach.e4.preferences,
|
|
||||||
com.opcoach.e4.preferences.handlers
|
|
||||||
Bundle-ActivationPolicy: lazy
|
|
@ -1,5 +0,0 @@
|
|||||||
source.. = src/
|
|
||||||
output.. = bin/
|
|
||||||
bin.includes = META-INF/,\
|
|
||||||
.,\
|
|
||||||
plugin.xml
|
|
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<?eclipse version="3.4"?>
|
|
||||||
<plugin>
|
|
||||||
<extension-point id="e4PreferencePages" name="e4PreferencePages" schema="schema/e4PreferencePages.exsd"/>
|
|
||||||
<extension-point id="e4PreferenceStoreProvider" name="e4PreferenceStoreProvider" schema="schema/e4PreferenceStoreProvider.exsd"/>
|
|
||||||
|
|
||||||
</plugin>
|
|
@ -1,163 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
|
||||||
<!-- Schema file written by PDE -->
|
|
||||||
<schema targetNamespace="com.opcoach.e4.preferences" xmlns="http://www.w3.org/2001/XMLSchema">
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.schema plugin="com.opcoach.e4.preferences" id="e4PreferencePages" name="e4PreferencePages"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter description of this extension point.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<element name="extension">
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.element />
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
<complexType>
|
|
||||||
<sequence>
|
|
||||||
<element ref="page" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</sequence>
|
|
||||||
<attribute name="point" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
a fully qualified identifier of the target extension point
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="id" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
an optional identifier of the extension instance
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="name" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
an optional name of the extension instance
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute translatable="true"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
</complexType>
|
|
||||||
</element>
|
|
||||||
|
|
||||||
<element name="page">
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.element labelAttribute="name"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
<complexType>
|
|
||||||
<sequence>
|
|
||||||
<element ref="keywordReference" minOccurs="0" maxOccurs="unbounded"/>
|
|
||||||
</sequence>
|
|
||||||
<attribute name="id" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
a unique name that will be used to identify this page.
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="name" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
a translatable name that will be used in the UI for this page.
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute translatable="true"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="class" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
a name of the fully qualified class that implements
|
|
||||||
<samp>org.eclipse.jface.preference.IPreferencePage</samp>.
|
|
||||||
|
|
||||||
IT IS EASYER to extend FieldEditorPreferencePage
|
|
||||||
|
|
||||||
If this class extends directly org.eclipse.jface.preference.FieldEditorPreferencePage preferenceStore is automatically set on it.
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute kind="java" basedOn="org.eclipse.jface.preference.FieldEditorPreferencePage:"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="category" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
a path indicating the location of the page in the preference tree. The path may either be a parent node ID or a sequence
|
|
||||||
of IDs separated by '/', representing the full path from the root node.
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute kind="identifier" basedOn="com.opcoach.e4.preferences.e4PreferencePages/page/@id"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
</complexType>
|
|
||||||
</element>
|
|
||||||
|
|
||||||
<element name="keywordReference">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
A reference by a preference page to a keyword. See the keywords extension point.
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
<complexType>
|
|
||||||
<attribute name="id" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
The id of the keyword being referred to.
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute kind="identifier" basedOn="org.eclipse.ui.keywords/keyword/@id"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
</complexType>
|
|
||||||
</element>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="since"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter the first release in which this extension point appears.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="examples"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter extension point usage example here.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="apiinfo"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter API information here.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="implementation"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter information about supplied implementation of this extension point.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
|
|
||||||
</schema>
|
|
@ -1,149 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
|
||||||
<!-- Schema file written by PDE -->
|
|
||||||
<schema targetNamespace="com.opcoach.e4.preferences" xmlns="http://www.w3.org/2001/XMLSchema">
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.schema plugin="com.opcoach.e4.preferences" id="e4PreferenceStoreProvider" name="e4PreferenceStoreProvider"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
This extension point is used to associate a preference store to a plugin.
|
|
||||||
You can choose either to implement the IPreferenceStoreProvider interface or to give the ID of the IPreferenceStore to use (stored in the workbench context of your E4 application).
|
|
||||||
If this extension point is not used, a default ScopedPreferenceStore will be used for the preference page.
|
|
||||||
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<element name="extension">
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.element />
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
<complexType>
|
|
||||||
<sequence>
|
|
||||||
<element ref="preferenceStoreProvider" minOccurs="1" maxOccurs="unbounded"/>
|
|
||||||
</sequence>
|
|
||||||
<attribute name="point" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="id" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="name" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute translatable="true"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
</complexType>
|
|
||||||
</element>
|
|
||||||
|
|
||||||
<element name="preferenceStoreProvider">
|
|
||||||
<complexType>
|
|
||||||
<attribute name="pluginId" type="string" use="required">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
Set here the plugin Id concerned by this extension.
|
|
||||||
Must be a valid plugin ID (control will be done at runtime)
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="class" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
Set a class to get the IPreferenceStore for the defined pluginID.
|
|
||||||
This parameter is optional if you use the contextId attribute.
|
|
||||||
</documentation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.attribute kind="java" basedOn=":com.opcoach.e4.preferences.IPreferenceStoreProvider"/>
|
|
||||||
</appinfo>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
<attribute name="idInWorkbenchContext" type="string">
|
|
||||||
<annotation>
|
|
||||||
<documentation>
|
|
||||||
If no class is defined, you can set here the ID of the IPreferenceStore available in the context.
|
|
||||||
This object must be set in the workbenchContext using an Addon for instance, with the following code (in addon):
|
|
||||||
|
|
||||||
@PostContextCreate
|
|
||||||
public void initMyAddon(IEclipseContext ctx)
|
|
||||||
{
|
|
||||||
IPreferenceStore ps = new ... . // The code to create your pref store
|
|
||||||
ctx.set(ID set in this extension, ps);
|
|
||||||
}
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
</attribute>
|
|
||||||
</complexType>
|
|
||||||
</element>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="since"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter the first release in which this extension point appears.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="examples"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
The definition could be like the following :
|
|
||||||
|
|
||||||
pluginId="yourPluginID"
|
|
||||||
provider="a class implementing IPreferenceStoreProvider"
|
|
||||||
|
|
||||||
|
|
||||||
Or using the key in context (usefull to share the same preference store between plugins) :
|
|
||||||
|
|
||||||
pluginId="yourPluginID"
|
|
||||||
keyInContext="the key of the IPreferenceStore stored in context"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="apiinfo"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter API information here.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="implementation"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
[Enter information about supplied implementation of this extension point.]
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
<annotation>
|
|
||||||
<appinfo>
|
|
||||||
<meta.section type="copyright"/>
|
|
||||||
</appinfo>
|
|
||||||
<documentation>
|
|
||||||
@OPCoach 2014
|
|
||||||
</documentation>
|
|
||||||
</annotation>
|
|
||||||
|
|
||||||
</schema>
|
|
@ -1,25 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2014 OPCoach.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* OPCoach - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.opcoach.e4.preferences;
|
|
||||||
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
|
||||||
|
|
||||||
/** This interface can be implemented to provide a PreferenceStore for a given plugin.
|
|
||||||
* This associatino must be done in the e4PreferenceStoreProvider extension point.
|
|
||||||
* @author olivier
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface IPreferenceStoreProvider
|
|
||||||
{
|
|
||||||
/** Must be implemented to return a preference store */
|
|
||||||
public IPreferenceStore getPreferenceStore();
|
|
||||||
|
|
||||||
}
|
|
@ -1,861 +0,0 @@
|
|||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2014 OPCoach.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Eclipse - copy of the implementation coming from jface
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
package com.opcoach.e4.preferences;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.eclipse.core.commands.common.EventManager;
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
import org.eclipse.core.runtime.Plugin;
|
|
||||||
import org.eclipse.core.runtime.SafeRunner;
|
|
||||||
import org.eclipse.core.runtime.preferences.DefaultScope;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
|
||||||
import org.eclipse.core.runtime.preferences.IScopeContext;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent;
|
|
||||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
|
|
||||||
import org.eclipse.jface.preference.IPersistentPreferenceStore;
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
|
||||||
import org.eclipse.jface.resource.JFaceResources;
|
|
||||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
|
||||||
import org.eclipse.jface.util.SafeRunnable;
|
|
||||||
import org.osgi.service.prefs.BackingStoreException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The ScopedPreferenceStore is an IPreferenceStore that uses the scopes
|
|
||||||
* provided in org.eclipse.core.runtime.preferences.
|
|
||||||
* <p>
|
|
||||||
* A ScopedPreferenceStore does the lookup of a preference based on it's search
|
|
||||||
* scopes and sets the value of the preference based on its store scope.
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* The default scope is always included in the search scopes when searching for
|
|
||||||
* preference values.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @see org.eclipse.core.runtime.preferences
|
|
||||||
* @since 3.1
|
|
||||||
*/
|
|
||||||
public class ScopedPreferenceStore extends EventManager implements
|
|
||||||
IPreferenceStore, IPersistentPreferenceStore {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The storeContext is the context where values will stored with the
|
|
||||||
* setValue methods. If there are no searchContexts this will be the search
|
|
||||||
* context. (along with the "default" context)
|
|
||||||
*/
|
|
||||||
private IScopeContext storeContext;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The searchContext is the array of contexts that will be used by the get
|
|
||||||
* methods for searching for values.
|
|
||||||
*/
|
|
||||||
private IScopeContext[] searchContexts;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A boolean to indicate the property changes should not be propagated.
|
|
||||||
*/
|
|
||||||
protected boolean silentRunning = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The listener on the IEclipsePreferences. This is used to forward updates
|
|
||||||
* to the property change listeners on the preference store.
|
|
||||||
*/
|
|
||||||
IEclipsePreferences.IPreferenceChangeListener preferencesListener;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The default context is the context where getDefault and setDefault
|
|
||||||
* methods will search. This context is also used in the search.
|
|
||||||
*/
|
|
||||||
private IScopeContext defaultContext = DefaultScope.INSTANCE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The nodeQualifer is the string used to look up the node in the contexts.
|
|
||||||
*/
|
|
||||||
String nodeQualifier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The defaultQualifier is the string used to look up the default node.
|
|
||||||
*/
|
|
||||||
String defaultQualifier;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Boolean value indicating whether or not this store has changes to be
|
|
||||||
* saved.
|
|
||||||
*/
|
|
||||||
private boolean dirty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new instance of the receiver. Store the values in context in the
|
|
||||||
* node looked up by qualifier. <strong>NOTE:</strong> Any instance of
|
|
||||||
* ScopedPreferenceStore should call
|
|
||||||
*
|
|
||||||
* @param context
|
|
||||||
* the scope to store to
|
|
||||||
* @param qualifier
|
|
||||||
* the qualifier used to look up the preference node
|
|
||||||
* @param defaultQualifierPath
|
|
||||||
* the qualifier used when looking up the defaults
|
|
||||||
*/
|
|
||||||
public ScopedPreferenceStore(IScopeContext context, String qualifier,
|
|
||||||
String defaultQualifierPath) {
|
|
||||||
this(context, qualifier);
|
|
||||||
this.defaultQualifier = defaultQualifierPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new instance of the receiver. Store the values in context in the
|
|
||||||
* node looked up by qualifier.
|
|
||||||
*
|
|
||||||
* @param context
|
|
||||||
* the scope to store to
|
|
||||||
* @param qualifier
|
|
||||||
* the qualifer used to look up the preference node
|
|
||||||
*/
|
|
||||||
public ScopedPreferenceStore(IScopeContext context, String qualifier) {
|
|
||||||
storeContext = context;
|
|
||||||
this.nodeQualifier = qualifier;
|
|
||||||
this.defaultQualifier = qualifier;
|
|
||||||
|
|
||||||
((IEclipsePreferences) getStorePreferences().parent())
|
|
||||||
.addNodeChangeListener(getNodeChangeListener());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a node change listener that adds a removes the receiver when nodes
|
|
||||||
* change.
|
|
||||||
*
|
|
||||||
* @return INodeChangeListener
|
|
||||||
*/
|
|
||||||
private INodeChangeListener getNodeChangeListener() {
|
|
||||||
return new IEclipsePreferences.INodeChangeListener() {
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#added(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
|
|
||||||
*/
|
|
||||||
public void added(NodeChangeEvent event) {
|
|
||||||
if (nodeQualifier.equals(event.getChild().name())
|
|
||||||
&& isListenerAttached()) {
|
|
||||||
getStorePreferences().addPreferenceChangeListener(
|
|
||||||
preferencesListener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener#removed(org.eclipse.core.runtime.preferences.IEclipsePreferences.NodeChangeEvent)
|
|
||||||
*/
|
|
||||||
public void removed(NodeChangeEvent event) {
|
|
||||||
// Do nothing as there are no events from removed node
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the preferences listener.
|
|
||||||
*/
|
|
||||||
private void initializePreferencesListener() {
|
|
||||||
if (preferencesListener == null) {
|
|
||||||
preferencesListener = new IEclipsePreferences.IPreferenceChangeListener() {
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
|
|
||||||
*/
|
|
||||||
public void preferenceChange(PreferenceChangeEvent event) {
|
|
||||||
|
|
||||||
if (silentRunning) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Object oldValue = event.getOldValue();
|
|
||||||
Object newValue = event.getNewValue();
|
|
||||||
String key = event.getKey();
|
|
||||||
if (newValue == null) {
|
|
||||||
newValue = getDefault(key, oldValue);
|
|
||||||
} else if (oldValue == null) {
|
|
||||||
oldValue = getDefault(key, newValue);
|
|
||||||
}
|
|
||||||
firePropertyChangeEvent(event.getKey(), oldValue, newValue);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
getStorePreferences().addPreferenceChangeListener(
|
|
||||||
preferencesListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Does its best at determining the default value for the given key. Checks
|
|
||||||
* the given object's type and then looks in the list of defaults to see if
|
|
||||||
* a value exists. If not or if there is a problem converting the value, the
|
|
||||||
* default default value for that type is returned.
|
|
||||||
*
|
|
||||||
* @param key
|
|
||||||
* the key to search
|
|
||||||
* @param obj
|
|
||||||
* the object who default we are looking for
|
|
||||||
* @return Object or <code>null</code>
|
|
||||||
*/
|
|
||||||
Object getDefault(String key, Object obj) {
|
|
||||||
IEclipsePreferences defaults = getDefaultPreferences();
|
|
||||||
if (obj instanceof String) {
|
|
||||||
return defaults.get(key, STRING_DEFAULT_DEFAULT);
|
|
||||||
} else if (obj instanceof Integer) {
|
|
||||||
return new Integer(defaults.getInt(key, INT_DEFAULT_DEFAULT));
|
|
||||||
} else if (obj instanceof Double) {
|
|
||||||
return new Double(defaults.getDouble(key, DOUBLE_DEFAULT_DEFAULT));
|
|
||||||
} else if (obj instanceof Float) {
|
|
||||||
return new Float(defaults.getFloat(key, FLOAT_DEFAULT_DEFAULT));
|
|
||||||
} else if (obj instanceof Long) {
|
|
||||||
return new Long(defaults.getLong(key, LONG_DEFAULT_DEFAULT));
|
|
||||||
} else if (obj instanceof Boolean) {
|
|
||||||
return defaults.getBoolean(key, BOOLEAN_DEFAULT_DEFAULT) ? Boolean.TRUE
|
|
||||||
: Boolean.FALSE;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the IEclipsePreferences node associated with this store.
|
|
||||||
*
|
|
||||||
* @return the preference node for this store
|
|
||||||
*/
|
|
||||||
IEclipsePreferences getStorePreferences() {
|
|
||||||
return storeContext.getNode(nodeQualifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the default IEclipsePreferences for this store.
|
|
||||||
*
|
|
||||||
* @return this store's default preference node
|
|
||||||
*/
|
|
||||||
private IEclipsePreferences getDefaultPreferences() {
|
|
||||||
return defaultContext.getNode(defaultQualifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
|
|
||||||
*/
|
|
||||||
public void addPropertyChangeListener(IPropertyChangeListener listener) {
|
|
||||||
initializePreferencesListener();// Create the preferences listener if it
|
|
||||||
// does not exist
|
|
||||||
addListenerObject(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the preference path to search preferences on. This is the list of
|
|
||||||
* preference nodes based on the scope contexts for this store. If there are
|
|
||||||
* no search contexts set, then return this store's context.
|
|
||||||
* <p>
|
|
||||||
* Whether or not the default context should be included in the resulting
|
|
||||||
* list is specified by the <code>includeDefault</code> parameter.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param includeDefault
|
|
||||||
* <code>true</code> if the default context should be included
|
|
||||||
* and <code>false</code> otherwise
|
|
||||||
* @return IEclipsePreferences[]
|
|
||||||
* @since 3.4 public, was added in 3.1 as private method
|
|
||||||
*/
|
|
||||||
public IEclipsePreferences[] getPreferenceNodes(boolean includeDefault) {
|
|
||||||
// if the user didn't specify a search order, then return the scope that
|
|
||||||
// this store was created on. (and optionally the default)
|
|
||||||
if (searchContexts == null) {
|
|
||||||
if (includeDefault) {
|
|
||||||
return new IEclipsePreferences[] { getStorePreferences(),
|
|
||||||
getDefaultPreferences() };
|
|
||||||
}
|
|
||||||
return new IEclipsePreferences[] { getStorePreferences() };
|
|
||||||
}
|
|
||||||
// otherwise the user specified a search order so return the appropriate
|
|
||||||
// nodes based on it
|
|
||||||
int length = searchContexts.length;
|
|
||||||
if (includeDefault) {
|
|
||||||
length++;
|
|
||||||
}
|
|
||||||
IEclipsePreferences[] preferences = new IEclipsePreferences[length];
|
|
||||||
for (int i = 0; i < searchContexts.length; i++) {
|
|
||||||
preferences[i] = searchContexts[i].getNode(nodeQualifier);
|
|
||||||
}
|
|
||||||
if (includeDefault) {
|
|
||||||
preferences[length - 1] = getDefaultPreferences();
|
|
||||||
}
|
|
||||||
return preferences;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the search contexts to scopes. When searching for a value the seach
|
|
||||||
* will be done in the order of scope contexts and will not search the
|
|
||||||
* storeContext unless it is in this list.
|
|
||||||
* <p>
|
|
||||||
* If the given list is <code>null</code>, then clear this store's search
|
|
||||||
* contexts. This means that only this store's scope context and default
|
|
||||||
* scope will be used during preference value searching.
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* The defaultContext will be added to the end of this list automatically
|
|
||||||
* and <em>MUST NOT</em> be included by the user.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param scopes
|
|
||||||
* a list of scope contexts to use when searching, or
|
|
||||||
* <code>null</code>
|
|
||||||
*/
|
|
||||||
public void setSearchContexts(IScopeContext[] scopes) {
|
|
||||||
this.searchContexts = scopes;
|
|
||||||
if (scopes == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert that the default was not included (we automatically add it to
|
|
||||||
// the end)
|
|
||||||
for (int i = 0; i < scopes.length; i++) {
|
|
||||||
if (scopes[i].equals(defaultContext)) {
|
|
||||||
Assert
|
|
||||||
.isTrue(
|
|
||||||
false,
|
|
||||||
"Do not add the default to the search contexts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#contains(java.lang.String)
|
|
||||||
*/
|
|
||||||
public boolean contains(String name) {
|
|
||||||
if (name == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (Platform.getPreferencesService().get(name, null,
|
|
||||||
getPreferenceNodes(true))) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#firePropertyChangeEvent(java.lang.String,
|
|
||||||
* java.lang.Object, java.lang.Object)
|
|
||||||
*/
|
|
||||||
public void firePropertyChangeEvent(String name, Object oldValue,
|
|
||||||
Object newValue) {
|
|
||||||
// important: create intermediate array to protect against listeners
|
|
||||||
// being added/removed during the notification
|
|
||||||
final Object[] list = getListeners();
|
|
||||||
if (list.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final PropertyChangeEvent event = new PropertyChangeEvent(this, name,
|
|
||||||
oldValue, newValue);
|
|
||||||
for (int i = 0; i < list.length; i++) {
|
|
||||||
final IPropertyChangeListener listener = (IPropertyChangeListener) list[i];
|
|
||||||
SafeRunner.run(new SafeRunnable(JFaceResources
|
|
||||||
.getString("PreferenceStore.changeError")) { //$NON-NLS-1$
|
|
||||||
public void run() {
|
|
||||||
listener.propertyChange(event);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(java.lang.String)
|
|
||||||
*/
|
|
||||||
public boolean getBoolean(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
return value == null ? BOOLEAN_DEFAULT_DEFAULT : Boolean.valueOf(value)
|
|
||||||
.booleanValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(java.lang.String)
|
|
||||||
*/
|
|
||||||
public boolean getDefaultBoolean(String name) {
|
|
||||||
return getDefaultPreferences()
|
|
||||||
.getBoolean(name, BOOLEAN_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(java.lang.String)
|
|
||||||
*/
|
|
||||||
public double getDefaultDouble(String name) {
|
|
||||||
return getDefaultPreferences().getDouble(name, DOUBLE_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(java.lang.String)
|
|
||||||
*/
|
|
||||||
public float getDefaultFloat(String name) {
|
|
||||||
return getDefaultPreferences().getFloat(name, FLOAT_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(java.lang.String)
|
|
||||||
*/
|
|
||||||
public int getDefaultInt(String name) {
|
|
||||||
return getDefaultPreferences().getInt(name, INT_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(java.lang.String)
|
|
||||||
*/
|
|
||||||
public long getDefaultLong(String name) {
|
|
||||||
return getDefaultPreferences().getLong(name, LONG_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(java.lang.String)
|
|
||||||
*/
|
|
||||||
public String getDefaultString(String name) {
|
|
||||||
return getDefaultPreferences().get(name, STRING_DEFAULT_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getDouble(java.lang.String)
|
|
||||||
*/
|
|
||||||
public double getDouble(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
if (value == null) {
|
|
||||||
return DOUBLE_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return Double.parseDouble(value);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return DOUBLE_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the string value for the specified key. Look in the nodes which
|
|
||||||
* are specified by this object's list of search scopes. If the value does
|
|
||||||
* not exist then return <code>null</code>.
|
|
||||||
*
|
|
||||||
* @param key
|
|
||||||
* the key to search with
|
|
||||||
* @return String or <code>null</code> if the value does not exist.
|
|
||||||
*/
|
|
||||||
private String internalGet(String key) {
|
|
||||||
return Platform.getPreferencesService().get(key, null,
|
|
||||||
getPreferenceNodes(true));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getFloat(java.lang.String)
|
|
||||||
*/
|
|
||||||
public float getFloat(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
if (value == null) {
|
|
||||||
return FLOAT_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return Float.parseFloat(value);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return FLOAT_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getInt(java.lang.String)
|
|
||||||
*/
|
|
||||||
public int getInt(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
if (value == null) {
|
|
||||||
return INT_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return Integer.parseInt(value);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return INT_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getLong(java.lang.String)
|
|
||||||
*/
|
|
||||||
public long getLong(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
if (value == null) {
|
|
||||||
return LONG_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
return Long.parseLong(value);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return LONG_DEFAULT_DEFAULT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#getString(java.lang.String)
|
|
||||||
*/
|
|
||||||
public String getString(String name) {
|
|
||||||
String value = internalGet(name);
|
|
||||||
return value == null ? STRING_DEFAULT_DEFAULT : value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#isDefault(java.lang.String)
|
|
||||||
*/
|
|
||||||
public boolean isDefault(String name) {
|
|
||||||
if (name == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (Platform.getPreferencesService().get(name, null,
|
|
||||||
getPreferenceNodes(false))) == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#needsSaving()
|
|
||||||
*/
|
|
||||||
public boolean needsSaving() {
|
|
||||||
return dirty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#putValue(java.lang.String,
|
|
||||||
* java.lang.String)
|
|
||||||
*/
|
|
||||||
public void putValue(String name, String value) {
|
|
||||||
try {
|
|
||||||
// Do not notify listeners
|
|
||||||
silentRunning = true;
|
|
||||||
getStorePreferences().put(name, value);
|
|
||||||
} finally {
|
|
||||||
// Be sure that an exception does not stop property updates
|
|
||||||
silentRunning = false;
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
|
|
||||||
*/
|
|
||||||
public void removePropertyChangeListener(IPropertyChangeListener listener) {
|
|
||||||
removeListenerObject(listener);
|
|
||||||
if (!isListenerAttached()) {
|
|
||||||
disposePreferenceStoreListener();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* double)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, double value) {
|
|
||||||
getDefaultPreferences().putDouble(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* float)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, float value) {
|
|
||||||
getDefaultPreferences().putFloat(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* int)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, int value) {
|
|
||||||
getDefaultPreferences().putInt(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* long)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, long value) {
|
|
||||||
getDefaultPreferences().putLong(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, String defaultObject) {
|
|
||||||
getDefaultPreferences().put(name, defaultObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String,
|
|
||||||
* boolean)
|
|
||||||
*/
|
|
||||||
public void setDefault(String name, boolean value) {
|
|
||||||
getDefaultPreferences().putBoolean(name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setToDefault(String name) {
|
|
||||||
|
|
||||||
String oldValue = getString(name);
|
|
||||||
String defaultValue = getDefaultString(name);
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
// removing a non-existing preference is a no-op so call the Core
|
|
||||||
// API directly
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
if (oldValue != defaultValue){
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, oldValue, defaultValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* double)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, double value) {
|
|
||||||
double oldValue = getDouble(name);
|
|
||||||
if (oldValue == value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
if (getDefaultDouble(name) == value) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().putDouble(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, new Double(oldValue), new Double(
|
|
||||||
value));
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* float)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, float value) {
|
|
||||||
float oldValue = getFloat(name);
|
|
||||||
if (oldValue == value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
if (getDefaultFloat(name) == value) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().putFloat(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, new Float(oldValue), new Float(value));
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* int)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, int value) {
|
|
||||||
int oldValue = getInt(name);
|
|
||||||
if (oldValue == value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
if (getDefaultInt(name) == value) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().putInt(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, new Integer(oldValue), new Integer(
|
|
||||||
value));
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* long)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, long value) {
|
|
||||||
long oldValue = getLong(name);
|
|
||||||
if (oldValue == value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
if (getDefaultLong(name) == value) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().putLong(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, new Long(oldValue), new Long(value));
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, String value) {
|
|
||||||
// Do not turn on silent running here as Strings are propagated
|
|
||||||
if (getDefaultString(name).equals(value)) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().put(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String,
|
|
||||||
* boolean)
|
|
||||||
*/
|
|
||||||
public void setValue(String name, boolean value) {
|
|
||||||
boolean oldValue = getBoolean(name);
|
|
||||||
if (oldValue == value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
silentRunning = true;// Turn off updates from the store
|
|
||||||
if (getDefaultBoolean(name) == value) {
|
|
||||||
getStorePreferences().remove(name);
|
|
||||||
} else {
|
|
||||||
getStorePreferences().putBoolean(name, value);
|
|
||||||
}
|
|
||||||
dirty = true;
|
|
||||||
firePropertyChangeEvent(name, oldValue ? Boolean.TRUE
|
|
||||||
: Boolean.FALSE, value ? Boolean.TRUE : Boolean.FALSE);
|
|
||||||
} finally {
|
|
||||||
silentRunning = false;// Restart listening to preferences
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.eclipse.jface.preference.IPersistentPreferenceStore#save()
|
|
||||||
*/
|
|
||||||
public void save() throws IOException {
|
|
||||||
try {
|
|
||||||
getStorePreferences().flush();
|
|
||||||
dirty = false;
|
|
||||||
} catch (BackingStoreException e) {
|
|
||||||
throw new IOException(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dispose the receiver.
|
|
||||||
*/
|
|
||||||
private void disposePreferenceStoreListener() {
|
|
||||||
|
|
||||||
IEclipsePreferences root = (IEclipsePreferences) Platform
|
|
||||||
.getPreferencesService().getRootNode().node(
|
|
||||||
Plugin.PLUGIN_PREFERENCE_SCOPE);
|
|
||||||
try {
|
|
||||||
if (!(root.nodeExists(nodeQualifier))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (BackingStoreException e) {
|
|
||||||
return;// No need to report here as the node won't have the
|
|
||||||
// listener
|
|
||||||
}
|
|
||||||
|
|
||||||
IEclipsePreferences preferences = getStorePreferences();
|
|
||||||
if (preferences == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (preferencesListener != null) {
|
|
||||||
preferences.removePreferenceChangeListener(preferencesListener);
|
|
||||||
preferencesListener = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2014 OPCoach.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* Manumitting Technologies : Brian de Alwis for initial API and implementation
|
|
||||||
* OPCoach : O.Prouvost fix bugs on hierarchy
|
|
||||||
*******************************************************************************//*
|
|
||||||
* Handler to open up a configured preferences dialog.
|
|
||||||
* Written by Brian de Alwis, Manumitting Technologies.
|
|
||||||
* Placed in the public domain.
|
|
||||||
* This code comes from : http://www.eclipse.org/forums/index.php/fa/4347/
|
|
||||||
* and was referenced in the thread : http://www.eclipse.org/forums/index.php/m/750139/
|
|
||||||
*/
|
|
||||||
package com.opcoach.e4.preferences.handlers;
|
|
||||||
|
|
||||||
import javax.inject.Named;
|
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
|
||||||
import org.eclipse.e4.core.di.annotations.Execute;
|
|
||||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
|
||||||
import org.eclipse.jface.preference.PreferenceDialog;
|
|
||||||
import org.eclipse.jface.preference.PreferenceManager;
|
|
||||||
import org.eclipse.jface.viewers.ViewerComparator;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
|
|
||||||
import com.opcoach.e4.preferences.internal.E4PreferenceRegistry;
|
|
||||||
|
|
||||||
|
|
||||||
public class E4PreferencesHandler
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
@CanExecute
|
|
||||||
public boolean canExecute()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Execute
|
|
||||||
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, E4PreferenceRegistry prefReg)
|
|
||||||
{
|
|
||||||
PreferenceManager pm = prefReg.getPreferenceManager();
|
|
||||||
PreferenceDialog dialog = new PreferenceDialog(shell, pm);
|
|
||||||
dialog.create();
|
|
||||||
dialog.getTreeViewer().setComparator(new ViewerComparator());
|
|
||||||
dialog.getTreeViewer().expandAll();
|
|
||||||
dialog.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,321 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2014 OPCoach.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* OPCoach - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.opcoach.e4.preferences.internal;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
|
||||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
|
||||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
|
||||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
|
||||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
|
||||||
import org.eclipse.e4.core.di.annotations.Creatable;
|
|
||||||
import org.eclipse.e4.core.services.contributions.IContributionFactory;
|
|
||||||
import org.eclipse.e4.core.services.log.Logger;
|
|
||||||
import org.eclipse.jface.preference.IPreferenceNode;
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
|
||||||
import org.eclipse.jface.preference.PreferenceManager;
|
|
||||||
import org.eclipse.jface.preference.PreferenceNode;
|
|
||||||
import org.eclipse.jface.preference.PreferencePage;
|
|
||||||
import org.eclipse.swt.SWT;
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
|
||||||
import org.eclipse.swt.widgets.Control;
|
|
||||||
import org.eclipse.swt.widgets.Label;
|
|
||||||
|
|
||||||
import com.opcoach.e4.preferences.IPreferenceStoreProvider;
|
|
||||||
import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
|
||||||
|
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
@Creatable
|
|
||||||
public class E4PreferenceRegistry
|
|
||||||
{
|
|
||||||
|
|
||||||
public static final String PREFS_PAGE_XP = "com.opcoach.e4.preferences.e4PreferencePages"; // $NON-NLS-1$
|
|
||||||
public static final String PREF_STORE_PROVIDER = "com.opcoach.e4.preferences.e4PreferenceStoreProvider"; // $NON-NLS-1$
|
|
||||||
protected static final String ELMT_PAGE = "page"; // $NON-NLS-1$
|
|
||||||
protected static final String ATTR_ID = "id"; // $NON-NLS-1$
|
|
||||||
protected static final String ATTR_CATEGORY = "category"; // $NON-NLS-1$
|
|
||||||
protected static final String ATTR_CLASS = "class"; // $NON-NLS-1$
|
|
||||||
protected static final String ATTR_NAME = "name"; // $NON-NLS-1$
|
|
||||||
|
|
||||||
protected static final String ATTR_PLUGIN_ID = "pluginId"; // $NON-NLS-1$
|
|
||||||
protected static final String ATTR_ID_IN_WBCONTEXT = "idInWorkbenchContext"; // $NON-NLS-1$
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
protected Logger logger;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
protected IEclipseContext context;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
protected IExtensionRegistry registry;
|
|
||||||
|
|
||||||
private PreferenceManager pm = null;
|
|
||||||
|
|
||||||
// A map of (pluginId, { IPreferenceStoreProvider, or key in wbcontext }
|
|
||||||
private Map<String, Object> psProviders;
|
|
||||||
|
|
||||||
public PreferenceManager getPreferenceManager()
|
|
||||||
{
|
|
||||||
|
|
||||||
// Remember of the unbounded nodes to order parent pages.
|
|
||||||
// Map<category, list of children> (all nodes except root nodes)
|
|
||||||
Map<String, Collection<IPreferenceNode>> childrenNodes = new HashMap<String, Collection<IPreferenceNode>>();
|
|
||||||
|
|
||||||
if (pm != null)
|
|
||||||
return pm;
|
|
||||||
|
|
||||||
pm = new PreferenceManager();
|
|
||||||
IContributionFactory factory = context.get(IContributionFactory.class);
|
|
||||||
|
|
||||||
for (IConfigurationElement elmt : registry.getConfigurationElementsFor(PREFS_PAGE_XP))
|
|
||||||
{
|
|
||||||
String bundleId = elmt.getNamespaceIdentifier();
|
|
||||||
if (!elmt.getName().equals(ELMT_PAGE))
|
|
||||||
{
|
|
||||||
logger.warn("unexpected element: {0}", elmt.getName());
|
|
||||||
continue;
|
|
||||||
} else if (isEmpty(elmt.getAttribute(ATTR_ID)) || isEmpty(elmt.getAttribute(ATTR_NAME)))
|
|
||||||
{
|
|
||||||
logger.warn("missing id and/or name: {}", bundleId);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
PreferenceNode pn = null;
|
|
||||||
if (elmt.getAttribute(ATTR_CLASS) != null)
|
|
||||||
{
|
|
||||||
PreferencePage page = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String prefPageURI = getClassURI(bundleId, elmt.getAttribute(ATTR_CLASS));
|
|
||||||
Object object = factory.create(prefPageURI, context);
|
|
||||||
if (!(object instanceof PreferencePage))
|
|
||||||
{
|
|
||||||
logger.error("Expected instance of PreferencePage: {0}", elmt.getAttribute(ATTR_CLASS));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
page = (PreferencePage) object;
|
|
||||||
setPreferenceStore(bundleId, page);
|
|
||||||
|
|
||||||
} catch (ClassNotFoundException e)
|
|
||||||
{
|
|
||||||
logger.error(e);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ContextInjectionFactory.inject(page, context);
|
|
||||||
if ((page.getTitle() == null || page.getTitle().isEmpty()) && elmt.getAttribute(ATTR_NAME) != null)
|
|
||||||
{
|
|
||||||
page.setTitle(elmt.getAttribute(ATTR_NAME));
|
|
||||||
}
|
|
||||||
|
|
||||||
pn = new PreferenceNode(elmt.getAttribute(ATTR_ID), page);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
pn = new PreferenceNode(elmt.getAttribute(ATTR_ID), new EmptyPreferencePage(elmt.getAttribute(ATTR_NAME)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue 2 : Fix bug on order (see :
|
|
||||||
// https://github.com/opcoach/e4Preferences/issues/2)
|
|
||||||
// Add only pages at root level and remember of child pages for
|
|
||||||
// categories
|
|
||||||
String category = elmt.getAttribute(ATTR_CATEGORY);
|
|
||||||
if (isEmpty(category))
|
|
||||||
{
|
|
||||||
pm.addToRoot(pn);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* IPreferenceNode parent = findNode(pm, category); if (parent
|
|
||||||
* == null) { // No parent found, but may be the extension has
|
|
||||||
* not been read yet. So remember of it unboundedNodes.put(pn,
|
|
||||||
* category); } else { parent.add(pn); }
|
|
||||||
*/
|
|
||||||
// Check if this category is already registered.
|
|
||||||
Collection<IPreferenceNode> children = childrenNodes.get(category);
|
|
||||||
if (children == null)
|
|
||||||
{
|
|
||||||
children = new ArrayList<IPreferenceNode>();
|
|
||||||
childrenNodes.put(category, children);
|
|
||||||
}
|
|
||||||
children.add(pn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must now bind pages that has not been added in nodes (depends on the
|
|
||||||
// preference page read order)
|
|
||||||
// Iterate on all possible categories
|
|
||||||
Collection<String> categoriesDone = new ArrayList<String>();
|
|
||||||
|
|
||||||
while (!childrenNodes.isEmpty())
|
|
||||||
{
|
|
||||||
for (String cat : Collections.unmodifiableSet(childrenNodes.keySet()))
|
|
||||||
{
|
|
||||||
// Is this category already in preference manager ? If not add
|
|
||||||
// it later...
|
|
||||||
IPreferenceNode parent = findNode(pm, cat);
|
|
||||||
if (parent != null)
|
|
||||||
{
|
|
||||||
// Can add the list of children to this parent page...
|
|
||||||
for (IPreferenceNode pn : childrenNodes.get(cat))
|
|
||||||
{
|
|
||||||
parent.add(pn);
|
|
||||||
}
|
|
||||||
// Ok This parent page is done. Can remove it from map
|
|
||||||
// outside of this loop
|
|
||||||
categoriesDone.add(cat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String keyToRemove : categoriesDone)
|
|
||||||
childrenNodes.remove(keyToRemove);
|
|
||||||
categoriesDone.clear();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return pm;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPreferenceStore(String bundleId, PreferencePage page)
|
|
||||||
{
|
|
||||||
// Affect preference store to this page if this is a
|
|
||||||
// PreferencePage, else, must manage it internally
|
|
||||||
// Set the issue#1 on github :
|
|
||||||
// https://github.com/opcoach/e4Preferences/issues/1
|
|
||||||
// And manage the extensions of IP
|
|
||||||
initialisePreferenceStoreProviders();
|
|
||||||
|
|
||||||
IPreferenceStore store = null;
|
|
||||||
|
|
||||||
// Get the preference store according to policy.
|
|
||||||
Object data = psProviders.get(bundleId);
|
|
||||||
if (data != null)
|
|
||||||
{
|
|
||||||
if (data instanceof IPreferenceStore)
|
|
||||||
store = (IPreferenceStore) data;
|
|
||||||
else if (data instanceof IPreferenceStoreProvider)
|
|
||||||
store = ((IPreferenceStoreProvider) data).getPreferenceStore();
|
|
||||||
else if (data instanceof String)
|
|
||||||
store = (IPreferenceStore) context.get((String) data);
|
|
||||||
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
// Default behavior : create a preference store for this bundle and remember of it
|
|
||||||
store = new ScopedPreferenceStore(InstanceScope.INSTANCE, bundleId);
|
|
||||||
psProviders.put(bundleId, store);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (store != null)
|
|
||||||
page.setPreferenceStore(store);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
logger.warn("Unable to set the preferenceStore for page " + page.getTitle() + " defined in bundle " + bundleId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Read the e4PreferenceStoreProvider extension point */
|
|
||||||
private void initialisePreferenceStoreProviders()
|
|
||||||
{
|
|
||||||
if (psProviders == null)
|
|
||||||
{
|
|
||||||
IContributionFactory factory = context.get(IContributionFactory.class);
|
|
||||||
|
|
||||||
psProviders = new HashMap<String, Object>();
|
|
||||||
|
|
||||||
// Read extensions and fill the map...
|
|
||||||
for (IConfigurationElement elmt : registry.getConfigurationElementsFor(PREF_STORE_PROVIDER))
|
|
||||||
{
|
|
||||||
String declaringBundle = elmt.getNamespaceIdentifier();
|
|
||||||
String pluginId = elmt.getAttribute(ATTR_PLUGIN_ID);
|
|
||||||
if (isEmpty(pluginId))
|
|
||||||
{
|
|
||||||
logger.warn("missing plugin Id in extension " + PREF_STORE_PROVIDER + " check the plugin " + declaringBundle);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String classname = elmt.getAttribute(ATTR_CLASS);
|
|
||||||
String objectId = elmt.getAttribute(ATTR_ID_IN_WBCONTEXT);
|
|
||||||
|
|
||||||
if ((isEmpty(classname) && isEmpty(objectId)) || (((classname != null) && classname.length() > 0) && ((objectId != null) && objectId.length() > 0)))
|
|
||||||
{
|
|
||||||
logger.warn("In extension " + PREF_STORE_PROVIDER + " only one of the two attributes (pluginId or idInWorkbenchContext) must be set. Check the plugin "
|
|
||||||
+ declaringBundle);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ok can now work with data...
|
|
||||||
Object data = objectId;
|
|
||||||
if (classname != null)
|
|
||||||
{
|
|
||||||
data = factory.create(classname, context);
|
|
||||||
if (!(data instanceof IPreferenceStoreProvider))
|
|
||||||
{
|
|
||||||
logger.warn("In extension " + PREF_STORE_PROVIDER + " the class must implements IPreferenceStoreProvider. Check the plugin " + declaringBundle);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
psProviders.put(pluginId, data);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IPreferenceNode findNode(PreferenceManager pm, String categoryId)
|
|
||||||
{
|
|
||||||
for (Object o : pm.getElements(PreferenceManager.POST_ORDER))
|
|
||||||
{
|
|
||||||
if (o instanceof IPreferenceNode && ((IPreferenceNode) o).getId().equals(categoryId))
|
|
||||||
{
|
|
||||||
return (IPreferenceNode) o;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getClassURI(String definingBundleId, String spec) throws ClassNotFoundException
|
|
||||||
{
|
|
||||||
if (spec.startsWith("platform:"))
|
|
||||||
{
|
|
||||||
return spec;
|
|
||||||
} // $NON-NLS-1$
|
|
||||||
return "bundleclass://" + definingBundleId + '/' + spec;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isEmpty(String value)
|
|
||||||
{
|
|
||||||
return value == null || value.trim().isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class EmptyPreferencePage extends PreferencePage
|
|
||||||
{
|
|
||||||
|
|
||||||
public EmptyPreferencePage(String title)
|
|
||||||
{
|
|
||||||
setTitle(title);
|
|
||||||
noDefaultAndApplyButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Control createContents(Composite parent)
|
|
||||||
{
|
|
||||||
return new Label(parent, SWT.NONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
23
features/com.minres.scviewer.database.feature/.project
Normal file
23
features/com.minres.scviewer.database.feature/.project
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>com.minres.scviewer.database.feature</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
102
features/com.minres.scviewer.database.feature/feature.properties
Normal file
102
features/com.minres.scviewer.database.feature/feature.properties
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
featureName=SystemC simulation results viewer
|
||||||
|
providerName=MINRES Technologies GmbH
|
||||||
|
updateSiteName=SC Viewer Database Updates
|
||||||
|
description=A viewer for SystemC Verification Library transactions and VCD signals.
|
||||||
|
licenseURL=license.html
|
||||||
|
license=\
|
||||||
|
ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
|
||||||
|
March 17, 2005\n\
|
||||||
|
\n\
|
||||||
|
Usage Of Content\n\
|
||||||
|
\n\
|
||||||
|
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
|
||||||
|
OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
|
||||||
|
USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
|
||||||
|
AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
|
||||||
|
NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
|
||||||
|
AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
|
||||||
|
AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
|
||||||
|
OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
|
||||||
|
TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
|
||||||
|
OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
|
||||||
|
BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
|
||||||
|
\n\
|
||||||
|
Applicable Licenses\n\
|
||||||
|
\n\
|
||||||
|
Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
|
||||||
|
is provided to you under the terms and conditions of the Eclipse Public\n\
|
||||||
|
License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
|
||||||
|
Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
|
||||||
|
For purposes of the EPL, "Program" will mean the Content.\n\
|
||||||
|
\n\
|
||||||
|
Content includes, but is not limited to, source code, object code,\n\
|
||||||
|
documentation and other files maintained in the Eclipse.org CVS\n\
|
||||||
|
repository ("Repository") in CVS modules ("Modules") and made available\n\
|
||||||
|
as downloadable archives ("Downloads").\n\
|
||||||
|
\n\
|
||||||
|
- Content may be structured and packaged into modules to facilitate delivering,\n\
|
||||||
|
extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
|
||||||
|
plug-in fragments ("Fragments"), and features ("Features").\n\
|
||||||
|
- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
|
||||||
|
in a directory named "plugins".\n\
|
||||||
|
- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
|
||||||
|
Each Feature may be packaged as a sub-directory in a directory named "features".\n\
|
||||||
|
Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
|
||||||
|
numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
|
||||||
|
- Features may also include other Features ("Included Features"). Within a Feature, files\n\
|
||||||
|
named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
|
||||||
|
\n\
|
||||||
|
Features may also include other Features ("Included Features"). Files named\n\
|
||||||
|
"feature.xml" may contain a list of the names and version numbers of\n\
|
||||||
|
Included Features.\n\
|
||||||
|
\n\
|
||||||
|
The terms and conditions governing Plug-ins and Fragments should be\n\
|
||||||
|
contained in files named "about.html" ("Abouts"). The terms and\n\
|
||||||
|
conditions governing Features and Included Features should be contained\n\
|
||||||
|
in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
|
||||||
|
Licenses may be located in any directory of a Download or Module\n\
|
||||||
|
including, but not limited to the following locations:\n\
|
||||||
|
\n\
|
||||||
|
- The top-level (root) directory\n\
|
||||||
|
- Plug-in and Fragment directories\n\
|
||||||
|
- Inside Plug-ins and Fragments packaged as JARs\n\
|
||||||
|
- Sub-directories of the directory named "src" of certain Plug-ins\n\
|
||||||
|
- Feature directories\n\
|
||||||
|
\n\
|
||||||
|
Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
|
||||||
|
Eclipse Update Manager, you must agree to a license ("Feature Update\n\
|
||||||
|
License") during the installation process. If the Feature contains\n\
|
||||||
|
Included Features, the Feature Update License should either provide you\n\
|
||||||
|
with the terms and conditions governing the Included Features or inform\n\
|
||||||
|
you where you can locate them. Feature Update Licenses may be found in\n\
|
||||||
|
the "license" property of files named "feature.properties". Such Abouts,\n\
|
||||||
|
Feature Licenses and Feature Update Licenses contain the terms and\n\
|
||||||
|
conditions (or references to such terms and conditions) that govern your\n\
|
||||||
|
use of the associated Content in that directory.\n\
|
||||||
|
\n\
|
||||||
|
THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
|
||||||
|
TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
|
||||||
|
SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
|
||||||
|
\n\
|
||||||
|
- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
|
||||||
|
- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
|
||||||
|
- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
|
||||||
|
- IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
|
||||||
|
- Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
|
||||||
|
- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
|
||||||
|
\n\
|
||||||
|
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
|
||||||
|
TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
|
||||||
|
is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
|
||||||
|
govern that particular Content.\n\
|
||||||
|
\n\
|
||||||
|
Cryptography\n\
|
||||||
|
\n\
|
||||||
|
Content may contain encryption software. The country in which you are\n\
|
||||||
|
currently may have restrictions on the import, possession, and use,\n\
|
||||||
|
and/or re-export to another country, of encryption software. BEFORE\n\
|
||||||
|
using any encryption software, please check the country's laws,\n\
|
||||||
|
regulations and policies concerning the import, possession, or use,\n\
|
||||||
|
and re-export of encryption software, to see if this is permitted.\n\
|
||||||
|
\n\
|
||||||
|
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<feature
|
<feature
|
||||||
id="com.minres.scviewer.feature"
|
id="com.minres.scviewer.database.feature"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="1.0.0.qualifier"
|
version="1.0.0.qualifier"
|
||||||
provider-name="%providerName">
|
provider-name="%providerName">
|
||||||
@ -29,12 +29,12 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
</url>
|
</url>
|
||||||
|
|
||||||
<requires>
|
<requires>
|
||||||
<import plugin="org.eclipse.equinox.ds" version="1.4.200" match="greaterOrEqual"/>
|
|
||||||
<import plugin="org.eclipse.equinox.util" version="1.0.500" match="greaterOrEqual"/>
|
|
||||||
<import plugin="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/>
|
<import plugin="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/>
|
||||||
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.codehaus.groovy" version="1.8.6" match="greaterOrEqual"/>
|
|
||||||
<import plugin="org.eclipse.osgi"/>
|
<import plugin="org.eclipse.osgi"/>
|
||||||
|
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.core.runtime"/>
|
<import plugin="org.eclipse.core.runtime"/>
|
||||||
<import plugin="org.eclipse.core.resources"/>
|
<import plugin="org.eclipse.core.resources"/>
|
||||||
<import plugin="org.eclipse.jface.text"/>
|
<import plugin="org.eclipse.jface.text"/>
|
||||||
@ -43,15 +43,12 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
<import plugin="org.eclipse.ui.ide"/>
|
<import plugin="org.eclipse.ui.ide"/>
|
||||||
<import plugin="org.eclipse.ui.views.properties.tabbed"/>
|
<import plugin="org.eclipse.ui.views.properties.tabbed"/>
|
||||||
<import plugin="org.eclipse.swt"/>
|
<import plugin="org.eclipse.swt"/>
|
||||||
<import plugin="org.apache.ant"/>
|
|
||||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
|
||||||
<import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/>
|
|
||||||
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
|
||||||
<import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
<import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.jface"/>
|
<import plugin="org.eclipse.jface"/>
|
||||||
<import plugin="org.junit"/>
|
|
||||||
<import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/>
|
<import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.equinox.registry"/>
|
<import plugin="org.eclipse.equinox.registry"/>
|
||||||
|
<import plugin="org.codehaus.groovy" version="2.5.8" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
||||||
</requires>
|
</requires>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
@ -68,13 +65,6 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
version="0.0.0"
|
version="0.0.0"
|
||||||
unpack="false"/>
|
unpack="false"/>
|
||||||
|
|
||||||
<plugin
|
|
||||||
id="com.minres.scviewer.ui"
|
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="com.minres.scviewer.database.sqlite"
|
id="com.minres.scviewer.database.sqlite"
|
||||||
download-size="0"
|
download-size="0"
|
||||||
@ -88,20 +78,6 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
install-size="0"
|
install-size="0"
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
||||||
<plugin
|
|
||||||
id="com.minres.scviewer.database.ui"
|
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
<plugin
|
|
||||||
id="com.minres.scviewer.database.ui.swt"
|
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
id="com.minres.scviewer.database.vcd"
|
id="com.minres.scviewer.database.vcd"
|
||||||
download-size="0"
|
download-size="0"
|
||||||
@ -109,17 +85,4 @@ http://www.eclipse.org/legal/epl-v10.html
|
|||||||
version="0.0.0"
|
version="0.0.0"
|
||||||
unpack="false"/>
|
unpack="false"/>
|
||||||
|
|
||||||
<plugin
|
|
||||||
id="org.junit"
|
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"/>
|
|
||||||
|
|
||||||
<plugin
|
|
||||||
id="org.hamcrest.core"
|
|
||||||
download-size="0"
|
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
|
||||||
unpack="false"/>
|
|
||||||
|
|
||||||
</feature>
|
</feature>
|
@ -1,13 +1,12 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>com.opcoach.e4.preferences</artifactId>
|
<artifactId>com.minres.scviewer.database.feature</artifactId>
|
||||||
|
<packaging>eclipse-feature</packaging>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
</project>
|
||||||
</project>
|
|
@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>sqlite-jdbc.osgi</name>
|
<name>com.minres.scviewer.e4.feature</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
1
features/com.minres.scviewer.e4.feature/build.properties
Normal file
1
features/com.minres.scviewer.e4.feature/build.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
bin.includes = feature.xml
|
74
features/com.minres.scviewer.e4.feature/feature.xml
Normal file
74
features/com.minres.scviewer.e4.feature/feature.xml
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feature
|
||||||
|
id="com.minres.scviewer.e4.feature"
|
||||||
|
label="SCViewer Feature"
|
||||||
|
version="1.0.0.qualifier"
|
||||||
|
provider-name="MINRES Technologies GmbH">
|
||||||
|
|
||||||
|
<description url="http://www.example.com/description">
|
||||||
|
[Enter Feature Description here.]
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<copyright url="http://www.example.com/copyright">
|
||||||
|
[Enter Copyright Description here.]
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<license url="http://www.example.com/license">
|
||||||
|
[Enter License Description here.]
|
||||||
|
</license>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<update label="SC Viewer Updates" url="http://www.minres.com/scviewer/update"/>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<includes
|
||||||
|
id="com.minres.scviewer.database.feature"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<includes
|
||||||
|
id="com.minres.scviewer.ui.feature"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<requires>
|
||||||
|
<import plugin="javax.inject" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.core.runtime" version="3.11.1" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.swt" version="3.104.1" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.model.workbench" version="1.1.100" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.jface" version="3.11.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.services" version="1.2.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.workbench" version="1.3.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.core.di" version="1.5.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.di" version="1.1.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.core.contexts" version="1.4.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui"/>
|
||||||
|
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.osgi.services" version="3.5.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.core.services" version="2.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.core.jobs"/>
|
||||||
|
<import plugin="org.eclipse.osgi"/>
|
||||||
|
<import plugin="com.google.guava"/>
|
||||||
|
<import plugin="org.eclipse.equinox.preferences"/>
|
||||||
|
<import plugin="org.eclipse.core.expressions"/>
|
||||||
|
<import plugin="org.eclipse.e4.core.commands" version="0.11.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.workbench.addons.swt"/>
|
||||||
|
<import plugin="com.opcoach.e4.preferences"/>
|
||||||
|
<import plugin="org.eclipse.e4.core.di.extensions"/>
|
||||||
|
<import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.10.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.core.resources" version="3.13.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.opcoach.e4.preferences.mainmenu" version="1.2.0" match="greaterOrEqual"/>
|
||||||
|
<import feature="com.opcoach.e4.preferences.feature" version="1.3.0.202004072127"/>
|
||||||
|
<import feature="org.eclipse.equinox.executable" version="3.8.700.v20200207-2156"/>
|
||||||
|
<import feature="org.eclipse.equinox.sdk" version="3.20.100.v20200303-1901"/>
|
||||||
|
<import feature="org.eclipse.sdk" version="4.15.0.v20200305-0155"/>
|
||||||
|
<import feature="org.eclipse.rcptt.core" version="2.5.1.M3"/>
|
||||||
|
</requires>
|
||||||
|
|
||||||
|
<plugin
|
||||||
|
id="com.minres.scviewer.e4.application"
|
||||||
|
download-size="0"
|
||||||
|
install-size="0"
|
||||||
|
version="0.0.0"
|
||||||
|
unpack="false"/>
|
||||||
|
|
||||||
|
</feature>
|
12
features/com.minres.scviewer.e4.feature/pom.xml
Normal file
12
features/com.minres.scviewer.e4.feature/pom.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>com.minres.scviewer.e4.feature</artifactId>
|
||||||
|
<packaging>eclipse-feature</packaging>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.minres.scviewer</groupId>
|
||||||
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</project>
|
@ -1,2 +1 @@
|
|||||||
/target/
|
/target/
|
||||||
/bin/
|
|
2
features/com.minres.scviewer.feature/build.properties
Normal file
2
features/com.minres.scviewer.feature/build.properties
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bin.includes = feature.xml,\
|
||||||
|
feature.properties
|
78
features/com.minres.scviewer.feature/feature.xml
Normal file
78
features/com.minres.scviewer.feature/feature.xml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feature
|
||||||
|
id="com.minres.scviewer.feature"
|
||||||
|
label="%featureName"
|
||||||
|
version="1.0.0.qualifier"
|
||||||
|
provider-name="%providerName">
|
||||||
|
|
||||||
|
<description>
|
||||||
|
A viewer for SystemC Verification Library transactions and VCD
|
||||||
|
signals. It supports a SQLite based recording as well as the built-in
|
||||||
|
text base recording.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<copyright>
|
||||||
|
Copyright (c) 2015 MINRES Technologies GmbH.
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are made available under the terms of the Eclipse Public License
|
||||||
|
v1.0 which accompanies this distribution, and is available at
|
||||||
|
http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<license url="%licenseURL">
|
||||||
|
%license
|
||||||
|
</license>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<update label="%updateSiteName" url="http://www.minres.com/scviewer/update"/>
|
||||||
|
<discovery label="MINRES Website" url="http://www.minres.com"/>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<includes
|
||||||
|
id="com.minres.scviewer.database.feature"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<includes
|
||||||
|
id="com.minres.scviewer.ui.feature"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<requires>
|
||||||
|
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.core.runtime"/>
|
||||||
|
<import plugin="org.eclipse.core.resources"/>
|
||||||
|
<import plugin="org.eclipse.jface.text"/>
|
||||||
|
<import plugin="org.eclipse.ui"/>
|
||||||
|
<import plugin="org.eclipse.ui.editors"/>
|
||||||
|
<import plugin="org.eclipse.ui.ide"/>
|
||||||
|
<import plugin="org.eclipse.ui.views.properties.tabbed"/>
|
||||||
|
<import plugin="org.eclipse.swt"/>
|
||||||
|
<import plugin="org.eclipse.osgi"/>
|
||||||
|
<import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.eclipse.jface"/>
|
||||||
|
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||||
|
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
||||||
|
</requires>
|
||||||
|
|
||||||
|
<plugin
|
||||||
|
id="org.junit"
|
||||||
|
download-size="0"
|
||||||
|
install-size="0"
|
||||||
|
version="0.0.0"/>
|
||||||
|
|
||||||
|
<plugin
|
||||||
|
id="org.hamcrest.core"
|
||||||
|
download-size="0"
|
||||||
|
install-size="0"
|
||||||
|
version="0.0.0"
|
||||||
|
unpack="false"/>
|
||||||
|
|
||||||
|
<plugin
|
||||||
|
id="com.minres.scviewer.ui"
|
||||||
|
download-size="0"
|
||||||
|
install-size="0"
|
||||||
|
version="0.0.0"
|
||||||
|
unpack="false"/>
|
||||||
|
|
||||||
|
</feature>
|
@ -5,9 +5,8 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</project>
|
</project>
|
1
features/com.minres.scviewer.ui.feature/.gitignore
vendored
Normal file
1
features/com.minres.scviewer.ui.feature/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/target/
|
@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>com.minres.scviewer.parent</name>
|
<name>com.minres.scviewer.ui.feature</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
1
features/com.minres.scviewer.ui.feature/build.properties
Normal file
1
features/com.minres.scviewer.ui.feature/build.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
bin.includes = feature.xml
|
20
features/com.minres.scviewer.ui.feature/feature.xml
Normal file
20
features/com.minres.scviewer.ui.feature/feature.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feature
|
||||||
|
id="com.minres.scviewer.ui.feature"
|
||||||
|
label="SCViewer UI"
|
||||||
|
version="1.0.0.qualifier"
|
||||||
|
provider-name="MINRES Technologies GmbH">
|
||||||
|
|
||||||
|
<description url="http://www.example.com/description">
|
||||||
|
[Enter Feature Description here.]
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<copyright url="http://www.example.com/copyright">
|
||||||
|
[Enter Copyright Description here.]
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<license url="http://www.example.com/license">
|
||||||
|
[Enter License Description here.]
|
||||||
|
</license>
|
||||||
|
|
||||||
|
</feature>
|
12
features/com.minres.scviewer.ui.feature/pom.xml
Normal file
12
features/com.minres.scviewer.ui.feature/pom.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>com.minres.scviewer.ui.feature</artifactId>
|
||||||
|
<packaging>eclipse-feature</packaging>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.minres.scviewer</groupId>
|
||||||
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</project>
|
@ -3,6 +3,9 @@
|
|||||||
<feature url="features/com.minres.scviewer.feature_1.0.0.qualifier.jar" id="com.minres.scviewer.feature" version="1.0.0.qualifier">
|
<feature url="features/com.minres.scviewer.feature_1.0.0.qualifier.jar" id="com.minres.scviewer.feature" version="1.0.0.qualifier">
|
||||||
<category name="com.minres.scviewer"/>
|
<category name="com.minres.scviewer"/>
|
||||||
</feature>
|
</feature>
|
||||||
|
<feature url="features/com.minres.scviewer.feature.source_1.0.0.qualifier.jar" id="com.minres.scviewer.feature.source" version="1.0.0.qualifier">
|
||||||
|
<category name="com.minres.scviewer"/>
|
||||||
|
</feature>
|
||||||
<category-def name="com.minres.scviewer" label="SCViewer">
|
<category-def name="com.minres.scviewer" label="SCViewer">
|
||||||
<description>
|
<description>
|
||||||
Viewer for SystemC Verification (SCV) library's transaction recording
|
Viewer for SystemC Verification (SCV) library's transaction recording
|
@ -6,8 +6,8 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../com.minres.scviewer.parent</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<!-- <build>
|
<!-- <build>
|
||||||
<finalName>resources</finalName>
|
<finalName>resources</finalName>
|
@ -1,7 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
|
<classpathentry exported="true" kind="lib" path="json-20180813.jar" sourcepath="json-20180813-sources.jar"/>
|
||||||
|
<classpathentry exported="true" kind="lib" path="leveldb-0.11-SNAPSHOT-uber.jar" sourcepath="leveldb-0.11-SNAPSHOT-sources.jar"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
4
plugins/com.minres.scviewer.database.leveldb/.gitignore
vendored
Normal file
4
plugins/com.minres.scviewer.database.leveldb/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/json-20180813-sources.jar
|
||||||
|
/leveldb-0.11-SNAPSHOT-sources.jar
|
||||||
|
/bin/
|
||||||
|
/target/
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>com.opcoach.e4.preferences</name>
|
<name>com.minres.scviewer.database.leveldb</name>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
@ -20,6 +20,11 @@
|
|||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ds.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.pde.PluginNature</nature>
|
<nature>org.eclipse.pde.PluginNature</nature>
|
@ -1,7 +1,7 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.8
|
@ -0,0 +1,4 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
pluginProject.equinox=false
|
||||||
|
pluginProject.extensions=false
|
||||||
|
resolve.requirebundle=false
|
@ -0,0 +1,5 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
enabled=true
|
||||||
|
path=OSGI-INF
|
||||||
|
validationErrorLevel=error
|
||||||
|
validationErrorLevel.missingImplicitUnbindMethod=error
|
@ -0,0 +1,16 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: Leveldb
|
||||||
|
Bundle-SymbolicName: com.minres.scviewer.database.leveldb
|
||||||
|
Bundle-Version: 1.0.0.qualifier
|
||||||
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
|
Import-Package: org.osgi.framework;version="1.3.0"
|
||||||
|
Automatic-Module-Name: com.minres.scviewer.database.leveldb
|
||||||
|
Service-Component: OSGI-INF/*.xml
|
||||||
|
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
||||||
|
org.eclipse.osgi.services;bundle-version="3.4.0"
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
Bundle-ClassPath: leveldb-0.11-SNAPSHOT-uber.jar,
|
||||||
|
.,
|
||||||
|
json-20180813.jar
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="LevelDbLoader">
|
||||||
|
<implementation class="com.minres.scviewer.database.leveldb.LevelDBLoader"/>
|
||||||
|
<service>
|
||||||
|
<provide interface="com.minres.scviewer.database.IWaveformDbLoader"/>
|
||||||
|
</service>
|
||||||
|
</scr:component>
|
@ -0,0 +1,7 @@
|
|||||||
|
source.. = src/
|
||||||
|
output.. = bin/
|
||||||
|
bin.includes = META-INF/,\
|
||||||
|
.,\
|
||||||
|
OSGI-INF/,\
|
||||||
|
leveldb-0.11-SNAPSHOT-uber.jar,\
|
||||||
|
json-20180813.jar
|
Binary file not shown.
BIN
plugins/com.minres.scviewer.database.leveldb/json-20180813.jar
Normal file
BIN
plugins/com.minres.scviewer.database.leveldb/json-20180813.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
plugins/com.minres.scviewer.database.leveldb/pom.xml
Normal file
13
plugins/com.minres.scviewer.database.leveldb/pom.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>com.minres.scviewer.database.leveldb</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.minres.scviewer</groupId>
|
||||||
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../..</relativePath>
|
||||||
|
</parent>
|
||||||
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
</project>
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.iq80.leveldb.Options;
|
||||||
|
import org.iq80.leveldb.impl.SeekingIterator;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.IWaveform;
|
||||||
|
import com.minres.scviewer.database.IWaveformDb;
|
||||||
|
import com.minres.scviewer.database.IWaveformDbLoader;
|
||||||
|
import com.minres.scviewer.database.RelationType;
|
||||||
|
|
||||||
|
public class LevelDBLoader implements IWaveformDbLoader {
|
||||||
|
|
||||||
|
static byte[] toByteArray(String value) {
|
||||||
|
return value.getBytes(UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
private TxDBWrapper levelDb;
|
||||||
|
private IWaveformDb db;
|
||||||
|
private Long maxTime=null;
|
||||||
|
private List<RelationType> usedRelationsList = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean load(IWaveformDb db, File inp) throws Exception {
|
||||||
|
try {
|
||||||
|
this.db=db;
|
||||||
|
levelDb = new TxDBWrapper(new Options(), inp);
|
||||||
|
JSONObject configVal = new JSONObject(levelDb.get("__config"));
|
||||||
|
if(!configVal.isEmpty())
|
||||||
|
levelDb.setTimeResolution(configVal.getLong("resolution"));
|
||||||
|
} catch(Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getMaxTime() {
|
||||||
|
if(maxTime==null) {
|
||||||
|
SeekingIterator<String, String> it = levelDb.iterator();
|
||||||
|
it.seek("st~");
|
||||||
|
Entry<String, String> val = null;
|
||||||
|
while(it.hasNext()) {
|
||||||
|
Entry<String, String> v = it.next();
|
||||||
|
if(!v.getKey().startsWith("st~")) continue;
|
||||||
|
val=v;
|
||||||
|
}
|
||||||
|
if(val==null)
|
||||||
|
maxTime = 0L;
|
||||||
|
else {
|
||||||
|
String[] token = val.getKey().split("~");
|
||||||
|
maxTime = Long.parseLong(token[2], 16)*levelDb.getTimeResolution();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maxTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<IWaveform> getAllWaves() {
|
||||||
|
List<IWaveform> streams=new ArrayList<IWaveform>();
|
||||||
|
SeekingIterator<String, String> it = levelDb.iterator();
|
||||||
|
it.seek("s~");
|
||||||
|
while(it.hasNext()) {
|
||||||
|
Entry<String, String> val = it.next();
|
||||||
|
if(!val.getKey().startsWith("s~")) break;
|
||||||
|
TxStream stream = new TxStream(levelDb, db, new JSONObject(val.getValue()));
|
||||||
|
stream.setRelationTypeList(usedRelationsList);
|
||||||
|
streams.add(stream);
|
||||||
|
}
|
||||||
|
return streams;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<RelationType> getAllRelationTypes() {
|
||||||
|
// return Collections.emptyList();
|
||||||
|
return usedRelationsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
import static org.iq80.leveldb.shaded.guava.collect.Maps.immutableEntry;
|
||||||
|
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.iq80.leveldb.DBIterator;
|
||||||
|
import org.iq80.leveldb.impl.SeekingIterator;
|
||||||
|
|
||||||
|
class StringDbIterator implements SeekingIterator<String, String> {
|
||||||
|
private final DBIterator iterator;
|
||||||
|
|
||||||
|
StringDbIterator(DBIterator iterator) {
|
||||||
|
this.iterator = iterator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasNext() {
|
||||||
|
return iterator.hasNext();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void seekToFirst() {
|
||||||
|
iterator.seekToFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void seek(String targetKey) {
|
||||||
|
iterator.seek(targetKey.getBytes(UTF_8));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Entry<String, String> peek() {
|
||||||
|
return adapt(iterator.peekNext());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Entry<String, String> next() {
|
||||||
|
return adapt(iterator.next());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Entry<String, String> adapt(Entry<byte[], byte[]> next) {
|
||||||
|
return immutableEntry(new String(next.getKey(), UTF_8), new String(next.getValue(), UTF_8));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,172 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* MINRES Technologies GmbH - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import org.iq80.leveldb.impl.SeekingIterator;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.ITx;
|
||||||
|
import com.minres.scviewer.database.ITxAttribute;
|
||||||
|
import com.minres.scviewer.database.ITxEvent;
|
||||||
|
import com.minres.scviewer.database.ITxGenerator;
|
||||||
|
import com.minres.scviewer.database.ITxRelation;
|
||||||
|
import com.minres.scviewer.database.ITxStream;
|
||||||
|
|
||||||
|
public class Tx implements ITx {
|
||||||
|
|
||||||
|
private TxDBWrapper levelDb;
|
||||||
|
private TxStream trStream;
|
||||||
|
private TxGenerator trGenerator;
|
||||||
|
private long id;
|
||||||
|
private long start_time=0;
|
||||||
|
private long end_time=0;
|
||||||
|
private int concurency_index;
|
||||||
|
private boolean initialized=false;
|
||||||
|
private List<ITxAttribute> attributes;
|
||||||
|
private List<ITxRelation> incoming, outgoing;
|
||||||
|
|
||||||
|
public Tx(TxDBWrapper levelDb, TxStream trStream, TxGenerator trGenerator, long id) {
|
||||||
|
this.levelDb=levelDb;
|
||||||
|
this.trStream=trStream;
|
||||||
|
this.trGenerator=trGenerator;
|
||||||
|
this.id=id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITxStream<ITxEvent> getStream() {
|
||||||
|
return trStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITxGenerator getGenerator() {
|
||||||
|
return trGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getConcurrencyIndex() {
|
||||||
|
if(!initialized) loadFromDb();
|
||||||
|
return concurency_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getBeginTime() {
|
||||||
|
if(!initialized) loadFromDb();
|
||||||
|
return start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getEndTime() {
|
||||||
|
loadFromDb();
|
||||||
|
return end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ITxAttribute> getAttributes() {
|
||||||
|
if(attributes==null) {
|
||||||
|
loadFromDb();
|
||||||
|
}
|
||||||
|
return attributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ITxRelation> getIncomingRelations() {
|
||||||
|
if(incoming==null) {
|
||||||
|
incoming = new ArrayList<ITxRelation>();
|
||||||
|
SeekingIterator<String, String> it = levelDb.iterator();
|
||||||
|
String key = "ri~"+String.format("%016x", id);
|
||||||
|
it.seek(key);
|
||||||
|
while(it.hasNext()) {
|
||||||
|
String val = it.next().getKey();
|
||||||
|
if(!val.startsWith(key)) break;;
|
||||||
|
String[] token = val.split("~");
|
||||||
|
long otherId = Long.parseLong(token[2], 16);
|
||||||
|
incoming.add(createRelation(otherId, token[3], false));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return incoming;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Collection<ITxRelation> getOutgoingRelations() {
|
||||||
|
if(outgoing==null) {
|
||||||
|
outgoing = new ArrayList<ITxRelation>();
|
||||||
|
SeekingIterator<String, String> it = levelDb.iterator();
|
||||||
|
String key="ro~"+String.format("%016x", id);
|
||||||
|
it.seek(key);
|
||||||
|
while(it.hasNext()) {
|
||||||
|
String val = it.next().getKey();
|
||||||
|
if(!val.startsWith(key)) break;
|
||||||
|
String[] token = val.split("~");
|
||||||
|
long otherId = Long.parseLong(token[2], 16);
|
||||||
|
outgoing.add(createRelation(otherId, token[3], true));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return outgoing;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(ITx o) {
|
||||||
|
int res = this.getBeginTime().compareTo(o.getBeginTime());
|
||||||
|
if(res!=0)
|
||||||
|
return res;
|
||||||
|
else
|
||||||
|
return this.getId().compareTo(o.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "tx#"+getId()+"["+getBeginTime()/1000000+"ns - "+getEndTime()/1000000+"ns]";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadFromDb() throws JSONException {
|
||||||
|
JSONObject dbVal = new JSONObject(levelDb.get("x~"+ String.format("%016x", id)));
|
||||||
|
start_time=dbVal.getLong("START_TIME") * levelDb.getTimeResolution();
|
||||||
|
end_time=dbVal.getLong("END_TIME") * levelDb.getTimeResolution();
|
||||||
|
concurency_index=dbVal.getInt("conc");
|
||||||
|
attributes=new ArrayList<>();
|
||||||
|
JSONArray arr = dbVal.getJSONArray("attr");
|
||||||
|
arr.forEach(entry -> {
|
||||||
|
TxAttribute attr = new TxAttribute(this, (JSONObject) entry);
|
||||||
|
attributes.add(attr);
|
||||||
|
});
|
||||||
|
initialized=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ITxRelation createRelation(long otherId, String name, boolean outgoing) {
|
||||||
|
try {
|
||||||
|
JSONObject otherTxVal = new JSONObject(levelDb.get("x~"+ String.format("%016x", otherId)));
|
||||||
|
if(otherTxVal.isEmpty()) return null;
|
||||||
|
JSONObject otherStreamVal = new JSONObject(levelDb.get("s~"+ String.format("%016x", otherTxVal.getLong("s"))));
|
||||||
|
if(otherStreamVal.isEmpty()) return null;
|
||||||
|
TxStream tgtStream = (TxStream) trStream.getDb().getStreamByName(otherStreamVal.getString("name"));
|
||||||
|
Tx that = (Tx) tgtStream.getTransactions().get(otherId);
|
||||||
|
return outgoing?
|
||||||
|
new TxRelation(trStream.getRelationType(name), this, that):
|
||||||
|
new TxRelation(trStream.getRelationType(name), that, this);
|
||||||
|
} catch (SecurityException | IllegalArgumentException | JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* MINRES Technologies GmbH - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.AssociationType;
|
||||||
|
import com.minres.scviewer.database.DataType;
|
||||||
|
import com.minres.scviewer.database.ITxAttribute;
|
||||||
|
|
||||||
|
public class TxAttribute implements ITxAttribute{
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private DataType dataType;
|
||||||
|
|
||||||
|
private AssociationType associationType;
|
||||||
|
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
public TxAttribute(Tx trTransaction, JSONObject attribute) {
|
||||||
|
this.name=attribute.getString("name");
|
||||||
|
this.dataType=DataType.values()[attribute.getInt("type")];
|
||||||
|
this.associationType=AssociationType.values()[attribute.getInt("assoc")];
|
||||||
|
this.value=attribute.get("value");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataType getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AssociationType getType() {
|
||||||
|
return associationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.iq80.leveldb.Options;
|
||||||
|
import org.iq80.leveldb.Range;
|
||||||
|
import org.iq80.leveldb.ReadOptions;
|
||||||
|
import org.iq80.leveldb.Snapshot;
|
||||||
|
import org.iq80.leveldb.impl.DbImpl;
|
||||||
|
import org.iq80.leveldb.impl.SeekingIterator;
|
||||||
|
|
||||||
|
class TxDBWrapper {
|
||||||
|
private final Options options;
|
||||||
|
private final ReadOptions ro = new ReadOptions();
|
||||||
|
private final File databaseDir;
|
||||||
|
private DbImpl db;
|
||||||
|
private long timeResolution=1L;;
|
||||||
|
|
||||||
|
TxDBWrapper(Options options, File databaseDir) throws IOException {
|
||||||
|
this.options = options.verifyChecksums(true).createIfMissing(false).errorIfExists(false).cacheSize(64*1024*1024);
|
||||||
|
this.databaseDir = databaseDir;
|
||||||
|
this.db = new DbImpl(options, databaseDir);
|
||||||
|
ro.snapshot(db.getSnapshot());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String get(String key) {
|
||||||
|
byte[] slice = db.get(LevelDBLoader.toByteArray(key));
|
||||||
|
if (slice == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new String(slice, UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String get(String key, Snapshot snapshot) {
|
||||||
|
byte[] slice = db.get(LevelDBLoader.toByteArray(key), ro);
|
||||||
|
return slice == null? null : new String(slice, UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String key, String value) {
|
||||||
|
db.put(LevelDBLoader.toByteArray(key), LevelDBLoader.toByteArray(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void delete(String key) {
|
||||||
|
db.delete(LevelDBLoader.toByteArray(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SeekingIterator<String, String> iterator() {
|
||||||
|
return new StringDbIterator(db.iterator());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Snapshot getSnapshot() {
|
||||||
|
return db.getSnapshot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
try {
|
||||||
|
ro.snapshot().close();
|
||||||
|
db.close();
|
||||||
|
} catch (IOException e) {} // ignore any error
|
||||||
|
}
|
||||||
|
|
||||||
|
public long size(String start, String limit) {
|
||||||
|
return db.getApproximateSizes(new Range(LevelDBLoader.toByteArray(start), LevelDBLoader.toByteArray(limit)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMaxNextLevelOverlappingBytes() {
|
||||||
|
return db.getMaxNextLevelOverlappingBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reopen() throws IOException {
|
||||||
|
reopen(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reopen(Options options) throws IOException {
|
||||||
|
this.close();
|
||||||
|
db = new DbImpl(options.verifyChecksums(true).createIfMissing(false).errorIfExists(false), databaseDir);
|
||||||
|
ro.snapshot(db.getSnapshot());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTimeResolution() {
|
||||||
|
return timeResolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeResolution(long resolution) {
|
||||||
|
this.timeResolution = resolution;
|
||||||
|
}
|
||||||
|
}
|
@ -8,39 +8,50 @@
|
|||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* MINRES Technologies GmbH - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package com.minres.scviewer.database;
|
package com.minres.scviewer.database.leveldb;
|
||||||
|
|
||||||
public class SignalChange implements IWaveformEvent {
|
import com.minres.scviewer.database.ITx;
|
||||||
|
import com.minres.scviewer.database.ITxEvent;
|
||||||
Long time;
|
import com.minres.scviewer.database.IWaveformEvent;
|
||||||
|
|
||||||
|
|
||||||
public SignalChange() {
|
|
||||||
time=0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SignalChange(Long time) {
|
public class TxEvent implements ITxEvent {
|
||||||
|
|
||||||
|
private final Type type;
|
||||||
|
private ITx tx;
|
||||||
|
|
||||||
|
public TxEvent(Type type, ITx tx) {
|
||||||
super();
|
super();
|
||||||
this.time = time;
|
this.type = type;
|
||||||
}
|
this.tx = tx;
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(IWaveformEvent o) {
|
|
||||||
return time.compareTo(o.getTime());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long getTime() {
|
public Long getTime() {
|
||||||
return time;
|
return type==Type.BEGIN?tx.getBeginTime():tx.getEndTime();
|
||||||
}
|
|
||||||
|
|
||||||
public void setTime(Long time) {
|
|
||||||
this.time = time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IWaveformEvent duplicate() throws CloneNotSupportedException {
|
public IWaveformEvent duplicate() throws CloneNotSupportedException {
|
||||||
return (IWaveformEvent) this.clone();
|
return new TxEvent(type, tx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(IWaveformEvent o) {
|
||||||
|
return getTime().compareTo(o.getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ITx getTransaction() {
|
||||||
|
return tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return type.toString()+"@"+getTime()+" of tx #"+tx.getId();
|
||||||
|
}
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user