• R/O
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscapheguic翻訳omegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

OmegaT プロジェクト単位で稼働時間を記録します。


コミットメタ情報

リビジョン1 (tree)
日時2013-10-26 21:54:56
作者yu-tang

ログメッセージ

initial commit.

変更サマリ

差分

--- License.txt (nonexistent)
+++ License.txt (revision 1)
@@ -0,0 +1,674 @@
1+ GNU GENERAL PUBLIC LICENSE
2+ Version 3, 29 June 2007
3+
4+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5+ Everyone is permitted to copy and distribute verbatim copies
6+ of this license document, but changing it is not allowed.
7+
8+ Preamble
9+
10+ The GNU General Public License is a free, copyleft license for
11+software and other kinds of works.
12+
13+ The licenses for most software and other practical works are designed
14+to take away your freedom to share and change the works. By contrast,
15+the GNU General Public License is intended to guarantee your freedom to
16+share and change all versions of a program--to make sure it remains free
17+software for all its users. We, the Free Software Foundation, use the
18+GNU General Public License for most of our software; it applies also to
19+any other work released this way by its authors. You can apply it to
20+your programs, too.
21+
22+ When we speak of free software, we are referring to freedom, not
23+price. Our General Public Licenses are designed to make sure that you
24+have the freedom to distribute copies of free software (and charge for
25+them if you wish), that you receive source code or can get it if you
26+want it, that you can change the software or use pieces of it in new
27+free programs, and that you know you can do these things.
28+
29+ To protect your rights, we need to prevent others from denying you
30+these rights or asking you to surrender the rights. Therefore, you have
31+certain responsibilities if you distribute copies of the software, or if
32+you modify it: responsibilities to respect the freedom of others.
33+
34+ For example, if you distribute copies of such a program, whether
35+gratis or for a fee, you must pass on to the recipients the same
36+freedoms that you received. You must make sure that they, too, receive
37+or can get the source code. And you must show them these terms so they
38+know their rights.
39+
40+ Developers that use the GNU GPL protect your rights with two steps:
41+(1) assert copyright on the software, and (2) offer you this License
42+giving you legal permission to copy, distribute and/or modify it.
43+
44+ For the developers' and authors' protection, the GPL clearly explains
45+that there is no warranty for this free software. For both users' and
46+authors' sake, the GPL requires that modified versions be marked as
47+changed, so that their problems will not be attributed erroneously to
48+authors of previous versions.
49+
50+ Some devices are designed to deny users access to install or run
51+modified versions of the software inside them, although the manufacturer
52+can do so. This is fundamentally incompatible with the aim of
53+protecting users' freedom to change the software. The systematic
54+pattern of such abuse occurs in the area of products for individuals to
55+use, which is precisely where it is most unacceptable. Therefore, we
56+have designed this version of the GPL to prohibit the practice for those
57+products. If such problems arise substantially in other domains, we
58+stand ready to extend this provision to those domains in future versions
59+of the GPL, as needed to protect the freedom of users.
60+
61+ Finally, every program is threatened constantly by software patents.
62+States should not allow patents to restrict development and use of
63+software on general-purpose computers, but in those that do, we wish to
64+avoid the special danger that patents applied to a free program could
65+make it effectively proprietary. To prevent this, the GPL assures that
66+patents cannot be used to render the program non-free.
67+
68+ The precise terms and conditions for copying, distribution and
69+modification follow.
70+
71+ TERMS AND CONDITIONS
72+
73+ 0. Definitions.
74+
75+ "This License" refers to version 3 of the GNU General Public License.
76+
77+ "Copyright" also means copyright-like laws that apply to other kinds of
78+works, such as semiconductor masks.
79+
80+ "The Program" refers to any copyrightable work licensed under this
81+License. Each licensee is addressed as "you". "Licensees" and
82+"recipients" may be individuals or organizations.
83+
84+ To "modify" a work means to copy from or adapt all or part of the work
85+in a fashion requiring copyright permission, other than the making of an
86+exact copy. The resulting work is called a "modified version" of the
87+earlier work or a work "based on" the earlier work.
88+
89+ A "covered work" means either the unmodified Program or a work based
90+on the Program.
91+
92+ To "propagate" a work means to do anything with it that, without
93+permission, would make you directly or secondarily liable for
94+infringement under applicable copyright law, except executing it on a
95+computer or modifying a private copy. Propagation includes copying,
96+distribution (with or without modification), making available to the
97+public, and in some countries other activities as well.
98+
99+ To "convey" a work means any kind of propagation that enables other
100+parties to make or receive copies. Mere interaction with a user through
101+a computer network, with no transfer of a copy, is not conveying.
102+
103+ An interactive user interface displays "Appropriate Legal Notices"
104+to the extent that it includes a convenient and prominently visible
105+feature that (1) displays an appropriate copyright notice, and (2)
106+tells the user that there is no warranty for the work (except to the
107+extent that warranties are provided), that licensees may convey the
108+work under this License, and how to view a copy of this License. If
109+the interface presents a list of user commands or options, such as a
110+menu, a prominent item in the list meets this criterion.
111+
112+ 1. Source Code.
113+
114+ The "source code" for a work means the preferred form of the work
115+for making modifications to it. "Object code" means any non-source
116+form of a work.
117+
118+ A "Standard Interface" means an interface that either is an official
119+standard defined by a recognized standards body, or, in the case of
120+interfaces specified for a particular programming language, one that
121+is widely used among developers working in that language.
122+
123+ The "System Libraries" of an executable work include anything, other
124+than the work as a whole, that (a) is included in the normal form of
125+packaging a Major Component, but which is not part of that Major
126+Component, and (b) serves only to enable use of the work with that
127+Major Component, or to implement a Standard Interface for which an
128+implementation is available to the public in source code form. A
129+"Major Component", in this context, means a major essential component
130+(kernel, window system, and so on) of the specific operating system
131+(if any) on which the executable work runs, or a compiler used to
132+produce the work, or an object code interpreter used to run it.
133+
134+ The "Corresponding Source" for a work in object code form means all
135+the source code needed to generate, install, and (for an executable
136+work) run the object code and to modify the work, including scripts to
137+control those activities. However, it does not include the work's
138+System Libraries, or general-purpose tools or generally available free
139+programs which are used unmodified in performing those activities but
140+which are not part of the work. For example, Corresponding Source
141+includes interface definition files associated with source files for
142+the work, and the source code for shared libraries and dynamically
143+linked subprograms that the work is specifically designed to require,
144+such as by intimate data communication or control flow between those
145+subprograms and other parts of the work.
146+
147+ The Corresponding Source need not include anything that users
148+can regenerate automatically from other parts of the Corresponding
149+Source.
150+
151+ The Corresponding Source for a work in source code form is that
152+same work.
153+
154+ 2. Basic Permissions.
155+
156+ All rights granted under this License are granted for the term of
157+copyright on the Program, and are irrevocable provided the stated
158+conditions are met. This License explicitly affirms your unlimited
159+permission to run the unmodified Program. The output from running a
160+covered work is covered by this License only if the output, given its
161+content, constitutes a covered work. This License acknowledges your
162+rights of fair use or other equivalent, as provided by copyright law.
163+
164+ You may make, run and propagate covered works that you do not
165+convey, without conditions so long as your license otherwise remains
166+in force. You may convey covered works to others for the sole purpose
167+of having them make modifications exclusively for you, or provide you
168+with facilities for running those works, provided that you comply with
169+the terms of this License in conveying all material for which you do
170+not control copyright. Those thus making or running the covered works
171+for you must do so exclusively on your behalf, under your direction
172+and control, on terms that prohibit them from making any copies of
173+your copyrighted material outside their relationship with you.
174+
175+ Conveying under any other circumstances is permitted solely under
176+the conditions stated below. Sublicensing is not allowed; section 10
177+makes it unnecessary.
178+
179+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180+
181+ No covered work shall be deemed part of an effective technological
182+measure under any applicable law fulfilling obligations under article
183+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184+similar laws prohibiting or restricting circumvention of such
185+measures.
186+
187+ When you convey a covered work, you waive any legal power to forbid
188+circumvention of technological measures to the extent such circumvention
189+is effected by exercising rights under this License with respect to
190+the covered work, and you disclaim any intention to limit operation or
191+modification of the work as a means of enforcing, against the work's
192+users, your or third parties' legal rights to forbid circumvention of
193+technological measures.
194+
195+ 4. Conveying Verbatim Copies.
196+
197+ You may convey verbatim copies of the Program's source code as you
198+receive it, in any medium, provided that you conspicuously and
199+appropriately publish on each copy an appropriate copyright notice;
200+keep intact all notices stating that this License and any
201+non-permissive terms added in accord with section 7 apply to the code;
202+keep intact all notices of the absence of any warranty; and give all
203+recipients a copy of this License along with the Program.
204+
205+ You may charge any price or no price for each copy that you convey,
206+and you may offer support or warranty protection for a fee.
207+
208+ 5. Conveying Modified Source Versions.
209+
210+ You may convey a work based on the Program, or the modifications to
211+produce it from the Program, in the form of source code under the
212+terms of section 4, provided that you also meet all of these conditions:
213+
214+ a) The work must carry prominent notices stating that you modified
215+ it, and giving a relevant date.
216+
217+ b) The work must carry prominent notices stating that it is
218+ released under this License and any conditions added under section
219+ 7. This requirement modifies the requirement in section 4 to
220+ "keep intact all notices".
221+
222+ c) You must license the entire work, as a whole, under this
223+ License to anyone who comes into possession of a copy. This
224+ License will therefore apply, along with any applicable section 7
225+ additional terms, to the whole of the work, and all its parts,
226+ regardless of how they are packaged. This License gives no
227+ permission to license the work in any other way, but it does not
228+ invalidate such permission if you have separately received it.
229+
230+ d) If the work has interactive user interfaces, each must display
231+ Appropriate Legal Notices; however, if the Program has interactive
232+ interfaces that do not display Appropriate Legal Notices, your
233+ work need not make them do so.
234+
235+ A compilation of a covered work with other separate and independent
236+works, which are not by their nature extensions of the covered work,
237+and which are not combined with it such as to form a larger program,
238+in or on a volume of a storage or distribution medium, is called an
239+"aggregate" if the compilation and its resulting copyright are not
240+used to limit the access or legal rights of the compilation's users
241+beyond what the individual works permit. Inclusion of a covered work
242+in an aggregate does not cause this License to apply to the other
243+parts of the aggregate.
244+
245+ 6. Conveying Non-Source Forms.
246+
247+ You may convey a covered work in object code form under the terms
248+of sections 4 and 5, provided that you also convey the
249+machine-readable Corresponding Source under the terms of this License,
250+in one of these ways:
251+
252+ a) Convey the object code in, or embodied in, a physical product
253+ (including a physical distribution medium), accompanied by the
254+ Corresponding Source fixed on a durable physical medium
255+ customarily used for software interchange.
256+
257+ b) Convey the object code in, or embodied in, a physical product
258+ (including a physical distribution medium), accompanied by a
259+ written offer, valid for at least three years and valid for as
260+ long as you offer spare parts or customer support for that product
261+ model, to give anyone who possesses the object code either (1) a
262+ copy of the Corresponding Source for all the software in the
263+ product that is covered by this License, on a durable physical
264+ medium customarily used for software interchange, for a price no
265+ more than your reasonable cost of physically performing this
266+ conveying of source, or (2) access to copy the
267+ Corresponding Source from a network server at no charge.
268+
269+ c) Convey individual copies of the object code with a copy of the
270+ written offer to provide the Corresponding Source. This
271+ alternative is allowed only occasionally and noncommercially, and
272+ only if you received the object code with such an offer, in accord
273+ with subsection 6b.
274+
275+ d) Convey the object code by offering access from a designated
276+ place (gratis or for a charge), and offer equivalent access to the
277+ Corresponding Source in the same way through the same place at no
278+ further charge. You need not require recipients to copy the
279+ Corresponding Source along with the object code. If the place to
280+ copy the object code is a network server, the Corresponding Source
281+ may be on a different server (operated by you or a third party)
282+ that supports equivalent copying facilities, provided you maintain
283+ clear directions next to the object code saying where to find the
284+ Corresponding Source. Regardless of what server hosts the
285+ Corresponding Source, you remain obligated to ensure that it is
286+ available for as long as needed to satisfy these requirements.
287+
288+ e) Convey the object code using peer-to-peer transmission, provided
289+ you inform other peers where the object code and Corresponding
290+ Source of the work are being offered to the general public at no
291+ charge under subsection 6d.
292+
293+ A separable portion of the object code, whose source code is excluded
294+from the Corresponding Source as a System Library, need not be
295+included in conveying the object code work.
296+
297+ A "User Product" is either (1) a "consumer product", which means any
298+tangible personal property which is normally used for personal, family,
299+or household purposes, or (2) anything designed or sold for incorporation
300+into a dwelling. In determining whether a product is a consumer product,
301+doubtful cases shall be resolved in favor of coverage. For a particular
302+product received by a particular user, "normally used" refers to a
303+typical or common use of that class of product, regardless of the status
304+of the particular user or of the way in which the particular user
305+actually uses, or expects or is expected to use, the product. A product
306+is a consumer product regardless of whether the product has substantial
307+commercial, industrial or non-consumer uses, unless such uses represent
308+the only significant mode of use of the product.
309+
310+ "Installation Information" for a User Product means any methods,
311+procedures, authorization keys, or other information required to install
312+and execute modified versions of a covered work in that User Product from
313+a modified version of its Corresponding Source. The information must
314+suffice to ensure that the continued functioning of the modified object
315+code is in no case prevented or interfered with solely because
316+modification has been made.
317+
318+ If you convey an object code work under this section in, or with, or
319+specifically for use in, a User Product, and the conveying occurs as
320+part of a transaction in which the right of possession and use of the
321+User Product is transferred to the recipient in perpetuity or for a
322+fixed term (regardless of how the transaction is characterized), the
323+Corresponding Source conveyed under this section must be accompanied
324+by the Installation Information. But this requirement does not apply
325+if neither you nor any third party retains the ability to install
326+modified object code on the User Product (for example, the work has
327+been installed in ROM).
328+
329+ The requirement to provide Installation Information does not include a
330+requirement to continue to provide support service, warranty, or updates
331+for a work that has been modified or installed by the recipient, or for
332+the User Product in which it has been modified or installed. Access to a
333+network may be denied when the modification itself materially and
334+adversely affects the operation of the network or violates the rules and
335+protocols for communication across the network.
336+
337+ Corresponding Source conveyed, and Installation Information provided,
338+in accord with this section must be in a format that is publicly
339+documented (and with an implementation available to the public in
340+source code form), and must require no special password or key for
341+unpacking, reading or copying.
342+
343+ 7. Additional Terms.
344+
345+ "Additional permissions" are terms that supplement the terms of this
346+License by making exceptions from one or more of its conditions.
347+Additional permissions that are applicable to the entire Program shall
348+be treated as though they were included in this License, to the extent
349+that they are valid under applicable law. If additional permissions
350+apply only to part of the Program, that part may be used separately
351+under those permissions, but the entire Program remains governed by
352+this License without regard to the additional permissions.
353+
354+ When you convey a copy of a covered work, you may at your option
355+remove any additional permissions from that copy, or from any part of
356+it. (Additional permissions may be written to require their own
357+removal in certain cases when you modify the work.) You may place
358+additional permissions on material, added by you to a covered work,
359+for which you have or can give appropriate copyright permission.
360+
361+ Notwithstanding any other provision of this License, for material you
362+add to a covered work, you may (if authorized by the copyright holders of
363+that material) supplement the terms of this License with terms:
364+
365+ a) Disclaiming warranty or limiting liability differently from the
366+ terms of sections 15 and 16 of this License; or
367+
368+ b) Requiring preservation of specified reasonable legal notices or
369+ author attributions in that material or in the Appropriate Legal
370+ Notices displayed by works containing it; or
371+
372+ c) Prohibiting misrepresentation of the origin of that material, or
373+ requiring that modified versions of such material be marked in
374+ reasonable ways as different from the original version; or
375+
376+ d) Limiting the use for publicity purposes of names of licensors or
377+ authors of the material; or
378+
379+ e) Declining to grant rights under trademark law for use of some
380+ trade names, trademarks, or service marks; or
381+
382+ f) Requiring indemnification of licensors and authors of that
383+ material by anyone who conveys the material (or modified versions of
384+ it) with contractual assumptions of liability to the recipient, for
385+ any liability that these contractual assumptions directly impose on
386+ those licensors and authors.
387+
388+ All other non-permissive additional terms are considered "further
389+restrictions" within the meaning of section 10. If the Program as you
390+received it, or any part of it, contains a notice stating that it is
391+governed by this License along with a term that is a further
392+restriction, you may remove that term. If a license document contains
393+a further restriction but permits relicensing or conveying under this
394+License, you may add to a covered work material governed by the terms
395+of that license document, provided that the further restriction does
396+not survive such relicensing or conveying.
397+
398+ If you add terms to a covered work in accord with this section, you
399+must place, in the relevant source files, a statement of the
400+additional terms that apply to those files, or a notice indicating
401+where to find the applicable terms.
402+
403+ Additional terms, permissive or non-permissive, may be stated in the
404+form of a separately written license, or stated as exceptions;
405+the above requirements apply either way.
406+
407+ 8. Termination.
408+
409+ You may not propagate or modify a covered work except as expressly
410+provided under this License. Any attempt otherwise to propagate or
411+modify it is void, and will automatically terminate your rights under
412+this License (including any patent licenses granted under the third
413+paragraph of section 11).
414+
415+ However, if you cease all violation of this License, then your
416+license from a particular copyright holder is reinstated (a)
417+provisionally, unless and until the copyright holder explicitly and
418+finally terminates your license, and (b) permanently, if the copyright
419+holder fails to notify you of the violation by some reasonable means
420+prior to 60 days after the cessation.
421+
422+ Moreover, your license from a particular copyright holder is
423+reinstated permanently if the copyright holder notifies you of the
424+violation by some reasonable means, this is the first time you have
425+received notice of violation of this License (for any work) from that
426+copyright holder, and you cure the violation prior to 30 days after
427+your receipt of the notice.
428+
429+ Termination of your rights under this section does not terminate the
430+licenses of parties who have received copies or rights from you under
431+this License. If your rights have been terminated and not permanently
432+reinstated, you do not qualify to receive new licenses for the same
433+material under section 10.
434+
435+ 9. Acceptance Not Required for Having Copies.
436+
437+ You are not required to accept this License in order to receive or
438+run a copy of the Program. Ancillary propagation of a covered work
439+occurring solely as a consequence of using peer-to-peer transmission
440+to receive a copy likewise does not require acceptance. However,
441+nothing other than this License grants you permission to propagate or
442+modify any covered work. These actions infringe copyright if you do
443+not accept this License. Therefore, by modifying or propagating a
444+covered work, you indicate your acceptance of this License to do so.
445+
446+ 10. Automatic Licensing of Downstream Recipients.
447+
448+ Each time you convey a covered work, the recipient automatically
449+receives a license from the original licensors, to run, modify and
450+propagate that work, subject to this License. You are not responsible
451+for enforcing compliance by third parties with this License.
452+
453+ An "entity transaction" is a transaction transferring control of an
454+organization, or substantially all assets of one, or subdividing an
455+organization, or merging organizations. If propagation of a covered
456+work results from an entity transaction, each party to that
457+transaction who receives a copy of the work also receives whatever
458+licenses to the work the party's predecessor in interest had or could
459+give under the previous paragraph, plus a right to possession of the
460+Corresponding Source of the work from the predecessor in interest, if
461+the predecessor has it or can get it with reasonable efforts.
462+
463+ You may not impose any further restrictions on the exercise of the
464+rights granted or affirmed under this License. For example, you may
465+not impose a license fee, royalty, or other charge for exercise of
466+rights granted under this License, and you may not initiate litigation
467+(including a cross-claim or counterclaim in a lawsuit) alleging that
468+any patent claim is infringed by making, using, selling, offering for
469+sale, or importing the Program or any portion of it.
470+
471+ 11. Patents.
472+
473+ A "contributor" is a copyright holder who authorizes use under this
474+License of the Program or a work on which the Program is based. The
475+work thus licensed is called the contributor's "contributor version".
476+
477+ A contributor's "essential patent claims" are all patent claims
478+owned or controlled by the contributor, whether already acquired or
479+hereafter acquired, that would be infringed by some manner, permitted
480+by this License, of making, using, or selling its contributor version,
481+but do not include claims that would be infringed only as a
482+consequence of further modification of the contributor version. For
483+purposes of this definition, "control" includes the right to grant
484+patent sublicenses in a manner consistent with the requirements of
485+this License.
486+
487+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488+patent license under the contributor's essential patent claims, to
489+make, use, sell, offer for sale, import and otherwise run, modify and
490+propagate the contents of its contributor version.
491+
492+ In the following three paragraphs, a "patent license" is any express
493+agreement or commitment, however denominated, not to enforce a patent
494+(such as an express permission to practice a patent or covenant not to
495+sue for patent infringement). To "grant" such a patent license to a
496+party means to make such an agreement or commitment not to enforce a
497+patent against the party.
498+
499+ If you convey a covered work, knowingly relying on a patent license,
500+and the Corresponding Source of the work is not available for anyone
501+to copy, free of charge and under the terms of this License, through a
502+publicly available network server or other readily accessible means,
503+then you must either (1) cause the Corresponding Source to be so
504+available, or (2) arrange to deprive yourself of the benefit of the
505+patent license for this particular work, or (3) arrange, in a manner
506+consistent with the requirements of this License, to extend the patent
507+license to downstream recipients. "Knowingly relying" means you have
508+actual knowledge that, but for the patent license, your conveying the
509+covered work in a country, or your recipient's use of the covered work
510+in a country, would infringe one or more identifiable patents in that
511+country that you have reason to believe are valid.
512+
513+ If, pursuant to or in connection with a single transaction or
514+arrangement, you convey, or propagate by procuring conveyance of, a
515+covered work, and grant a patent license to some of the parties
516+receiving the covered work authorizing them to use, propagate, modify
517+or convey a specific copy of the covered work, then the patent license
518+you grant is automatically extended to all recipients of the covered
519+work and works based on it.
520+
521+ A patent license is "discriminatory" if it does not include within
522+the scope of its coverage, prohibits the exercise of, or is
523+conditioned on the non-exercise of one or more of the rights that are
524+specifically granted under this License. You may not convey a covered
525+work if you are a party to an arrangement with a third party that is
526+in the business of distributing software, under which you make payment
527+to the third party based on the extent of your activity of conveying
528+the work, and under which the third party grants, to any of the
529+parties who would receive the covered work from you, a discriminatory
530+patent license (a) in connection with copies of the covered work
531+conveyed by you (or copies made from those copies), or (b) primarily
532+for and in connection with specific products or compilations that
533+contain the covered work, unless you entered into that arrangement,
534+or that patent license was granted, prior to 28 March 2007.
535+
536+ Nothing in this License shall be construed as excluding or limiting
537+any implied license or other defenses to infringement that may
538+otherwise be available to you under applicable patent law.
539+
540+ 12. No Surrender of Others' Freedom.
541+
542+ If conditions are imposed on you (whether by court order, agreement or
543+otherwise) that contradict the conditions of this License, they do not
544+excuse you from the conditions of this License. If you cannot convey a
545+covered work so as to satisfy simultaneously your obligations under this
546+License and any other pertinent obligations, then as a consequence you may
547+not convey it at all. For example, if you agree to terms that obligate you
548+to collect a royalty for further conveying from those to whom you convey
549+the Program, the only way you could satisfy both those terms and this
550+License would be to refrain entirely from conveying the Program.
551+
552+ 13. Use with the GNU Affero General Public License.
553+
554+ Notwithstanding any other provision of this License, you have
555+permission to link or combine any covered work with a work licensed
556+under version 3 of the GNU Affero General Public License into a single
557+combined work, and to convey the resulting work. The terms of this
558+License will continue to apply to the part which is the covered work,
559+but the special requirements of the GNU Affero General Public License,
560+section 13, concerning interaction through a network will apply to the
561+combination as such.
562+
563+ 14. Revised Versions of this License.
564+
565+ The Free Software Foundation may publish revised and/or new versions of
566+the GNU General Public License from time to time. Such new versions will
567+be similar in spirit to the present version, but may differ in detail to
568+address new problems or concerns.
569+
570+ Each version is given a distinguishing version number. If the
571+Program specifies that a certain numbered version of the GNU General
572+Public License "or any later version" applies to it, you have the
573+option of following the terms and conditions either of that numbered
574+version or of any later version published by the Free Software
575+Foundation. If the Program does not specify a version number of the
576+GNU General Public License, you may choose any version ever published
577+by the Free Software Foundation.
578+
579+ If the Program specifies that a proxy can decide which future
580+versions of the GNU General Public License can be used, that proxy's
581+public statement of acceptance of a version permanently authorizes you
582+to choose that version for the Program.
583+
584+ Later license versions may give you additional or different
585+permissions. However, no additional obligations are imposed on any
586+author or copyright holder as a result of your choosing to follow a
587+later version.
588+
589+ 15. Disclaimer of Warranty.
590+
591+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599+
600+ 16. Limitation of Liability.
601+
602+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610+SUCH DAMAGES.
611+
612+ 17. Interpretation of Sections 15 and 16.
613+
614+ If the disclaimer of warranty and limitation of liability provided
615+above cannot be given local legal effect according to their terms,
616+reviewing courts shall apply local law that most closely approximates
617+an absolute waiver of all civil liability in connection with the
618+Program, unless a warranty or assumption of liability accompanies a
619+copy of the Program in return for a fee.
620+
621+ END OF TERMS AND CONDITIONS
622+
623+ How to Apply These Terms to Your New Programs
624+
625+ If you develop a new program, and you want it to be of the greatest
626+possible use to the public, the best way to achieve this is to make it
627+free software which everyone can redistribute and change under these terms.
628+
629+ To do so, attach the following notices to the program. It is safest
630+to attach them to the start of each source file to most effectively
631+state the exclusion of warranty; and each file should have at least
632+the "copyright" line and a pointer to where the full notice is found.
633+
634+ <one line to give the program's name and a brief idea of what it does.>
635+ Copyright (C) <year> <name of author>
636+
637+ This program is free software: you can redistribute it and/or modify
638+ it under the terms of the GNU General Public License as published by
639+ the Free Software Foundation, either version 3 of the License, or
640+ (at your option) any later version.
641+
642+ This program is distributed in the hope that it will be useful,
643+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645+ GNU General Public License for more details.
646+
647+ You should have received a copy of the GNU General Public License
648+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649+
650+Also add information on how to contact you by electronic and paper mail.
651+
652+ If the program does terminal interaction, make it output a short
653+notice like this when it starts in an interactive mode:
654+
655+ <program> Copyright (C) <year> <name of author>
656+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657+ This is free software, and you are welcome to redistribute it
658+ under certain conditions; type `show c' for details.
659+
660+The hypothetical commands `show w' and `show c' should show the appropriate
661+parts of the General Public License. Of course, your program's commands
662+might be different; for a GUI interface, you would use an "about box".
663+
664+ You should also get your employer (if you work as a programmer) or school,
665+if any, to sign a "copyright disclaimer" for the program, if necessary.
666+For more information on this, and how to apply and follow the GNU GPL, see
667+<http://www.gnu.org/licenses/>.
668+
669+ The GNU General Public License does not permit incorporating your program
670+into proprietary programs. If your program is a subroutine library, you
671+may consider it more useful to permit linking proprietary applications with
672+the library. If this is what you want to do, use the GNU Lesser General
673+Public License instead of this License. But first, please read
674+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
--- src-stubs/org/omegat/gui/main/IMainMenu.java (nonexistent)
+++ src-stubs/org/omegat/gui/main/IMainMenu.java (revision 1)
@@ -0,0 +1,26 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+
6+package org.omegat.gui.main;
7+
8+import javax.swing.JMenu;
9+
10+/**
11+ * Main menu interface.
12+ *
13+ * @author Alex Buloichik (alex73mail@gmail.com)
14+ * @author Didier Briel
15+ */
16+public interface IMainMenu {
17+ JMenu getMachineTranslationMenu();
18+
19+ JMenu getOptionsMenu();
20+
21+ JMenu getToolsMenu();
22+
23+ JMenu getGlossaryMenu();
24+
25+ JMenu getProjectMenu();
26+}
--- src-stubs/org/omegat/gui/main/IMainWindow.java (nonexistent)
+++ src-stubs/org/omegat/gui/main/IMainWindow.java (revision 1)
@@ -0,0 +1,46 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+
6+package org.omegat.gui.main;
7+
8+import java.awt.Font;
9+import java.awt.HeadlessException;
10+
11+/**
12+ * Interface for access to main window functionality.
13+ *
14+ * @author Alex Buloichik (alex73mail@gmail.com)
15+ */
16+public interface IMainWindow {
17+ /**
18+ * Get main application font.
19+ */
20+ Font getApplicationFont();
21+
22+ /**
23+ * Retrieve main manu instance.
24+ */
25+ IMainMenu getMainMenu();
26+
27+ /**
28+ * shows a confirm dialog. For a GUI main window, this can be implemented as JOptionPane.showConfirmDialog
29+ *
30+ * @param message the Object to display
31+ * @param title the title string for the dialog (can be null)
32+ * @param optionType an integer designating the JOptionPane options available on the dialog: YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION
33+ * @param messageType an integer designating the kind of message this is; primarily used to determine the icon from the pluggable Look and Feel: (JOptionPane ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
34+ * @return an integer indicating the option selected by the user
35+ * @throws HeadlessException if GraphicsEnvironment.isHeadless returns true
36+ */
37+ int showConfirmDialog(Object message, String title, int optionType, int messageType) throws HeadlessException;
38+
39+ /**
40+ * Shows message to user
41+ *
42+ * @param message the message to show
43+ */
44+ void showMessageDialog(String message);
45+
46+}
--- src-stubs/org/omegat/core/events/IEntryEventListener.java (nonexistent)
+++ src-stubs/org/omegat/core/events/IEntryEventListener.java (revision 1)
@@ -0,0 +1,31 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core.events;
6+
7+import org.omegat.core.data.SourceTextEntry;
8+
9+/**
10+ * Listener interface for entry change events.
11+ *
12+ * @author Alex Buloichik (alex73mail@gmail.com)
13+ */
14+public interface IEntryEventListener {
15+ /**
16+ * Called on new file displayed.
17+ *
18+ * @param activeFileName
19+ * new active file name
20+ */
21+ void onNewFile(String activeFileName);
22+
23+ /**
24+ * Called on new entry activated or current entry deactivated.
25+ *
26+ * @param newEntry
27+ * new entry instance which activated, or null if entry
28+ * deactivated
29+ */
30+ void onEntryActivated(SourceTextEntry newEntry);
31+}
--- src-stubs/org/omegat/core/events/IApplicationEventListener.java (nonexistent)
+++ src-stubs/org/omegat/core/events/IApplicationEventListener.java (revision 1)
@@ -0,0 +1,25 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core.events;
6+
7+/**
8+ * Listener interface for application event, like startup and shutdown.
9+ *
10+ * @author Alex Buloichik (alex73mail@gmail.com)
11+ */
12+public interface IApplicationEventListener {
13+ /**
14+ * Called on application startup after all components created and registered
15+ * in Core.
16+ */
17+ void onApplicationStartup();
18+
19+ /**
20+ * Called on application shutdown.
21+ *
22+ * CAN BE EXECUTED IN ANY THREAD !
23+ */
24+ void onApplicationShutdown();
25+}
--- src-stubs/org/omegat/core/events/IProjectEventListener.java (nonexistent)
+++ src-stubs/org/omegat/core/events/IProjectEventListener.java (revision 1)
@@ -0,0 +1,23 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core.events;
6+
7+/**
8+ * Listener interface for project status change events.
9+ *
10+ * @author Alex Buloichik (alex73mail@gmail.com)
11+ */
12+public interface IProjectEventListener {
13+ /** Event type which happen for project. */
14+ enum PROJECT_CHANGE_TYPE {
15+ CLOSE, COMPILE, CREATE, LOAD, SAVE
16+ }
17+
18+ /**
19+ * This method called when project status changed, i.e.
20+ * new/open/save/close/compile.
21+ */
22+ void onProjectChanged(PROJECT_CHANGE_TYPE eventType);
23+}
--- src-stubs/org/omegat/core/Core.java (nonexistent)
+++ src-stubs/org/omegat/core/Core.java (revision 1)
@@ -0,0 +1,35 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core;
6+
7+import org.omegat.core.data.IProject;
8+import org.omegat.gui.main.IMainWindow;
9+
10+/**
11+ * Class which contains all components instances.
12+ *
13+ * Note about threads synchronization: each component must have only local
14+ * synchronization. It mustn't synchronize around other components or some other
15+ * objects.
16+ *
17+ * Components which works in Swing UI thread can have other synchronization
18+ * idea: it can not be synchronized to access to some data which changed only in
19+ * UI thread.
20+ *
21+ * @author Alex Buloichik (alex73mail@gmail.com)
22+ * @author Wildrich Fourie
23+ */
24+public class Core {
25+ /** Get project instance. */
26+ public static IProject getProject() {
27+ return null;
28+ }
29+
30+ /** Get main window instance. */
31+ public static IMainWindow getMainWindow() {
32+ return null;
33+ }
34+
35+}
--- src-stubs/org/omegat/core/data/IProject.java (nonexistent)
+++ src-stubs/org/omegat/core/data/IProject.java (revision 1)
@@ -0,0 +1,61 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+
6+package org.omegat.core.data;
7+
8+import java.util.ArrayList;
9+import java.util.List;
10+
11+/**
12+ * Interface for access to loaded project. Each loaded project will be new instance of IProject.
13+ *
14+ * @author Alex Buloichik (alex73mail@gmail.com)
15+ * @author Didier Briel
16+ */
17+public interface IProject {
18+
19+ /**
20+ * Get project properties.
21+ *
22+ * @return project properties
23+ */
24+ ProjectProperties getProjectProperties();
25+
26+ /**
27+ * Get project loaded status.
28+ *
29+ * @return true if project loaded
30+ */
31+ boolean isProjectLoaded();
32+
33+ /**
34+ * Is project modified ?
35+ */
36+ boolean isProjectModified();
37+
38+ /**
39+ * Get info about each source file in project. It's unmodifiable list, so, there is no need
40+ * synchronization to read it.
41+ */
42+ List<FileInfo> getProjectFiles();
43+
44+ public static class FileInfo {
45+ public String filePath;
46+ /**
47+ * IFilter implementing Class that was used to parse the file
48+ */
49+ public Class<?> filterClass;
50+ /**
51+ * Human readable name of the file format as defined by the filter.
52+ */
53+ public String filterFileFormatName;
54+ /**
55+ * Characterset name used for parsing the source file.
56+ */
57+ public String fileEncoding;
58+ public List<SourceTextEntry> entries = new ArrayList<SourceTextEntry>();
59+ }
60+
61+}
--- src-stubs/org/omegat/core/data/ProjectProperties.java (nonexistent)
+++ src-stubs/org/omegat/core/data/ProjectProperties.java (revision 1)
@@ -0,0 +1,87 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core.data;
6+
7+
8+/**
9+ * Storage for project properties. May read and write project from/to disk.
10+ *
11+ * @author Keith Godfrey
12+ * @author Maxym Mykhalchuk
13+ * @author Guido Leenders
14+ * @author Didier Briel
15+ * @author Aaron Madlon-Kay
16+ */
17+public class ProjectProperties {
18+
19+ /** Returns The Target (Compiled) Files Directory */
20+ public String getTargetRoot() { return null; }
21+
22+ /** Returns The Glossary Files Directory */
23+ public String getGlossaryRoot() { return null; }
24+
25+ /** Returns The Glossary File Location */
26+ public String getWriteableGlossary() { return null; }
27+
28+ /** Returns The Glossary File Directory */
29+ public String getWriteableGlossaryDir() { return null; }
30+
31+ /** Returns The Translation Memory (TMX) Files Directory */
32+ public String getTMRoot() { return null; }
33+
34+ /** Returns The Translation Memory (TMX) with translations to other languages Files Directory */
35+ public String getTMOtherLangRoot() { return null; }
36+
37+ /** Returns The Translation Memory (TMX) Files Directory for automatically applied files. */
38+ public String getTMAutoRoot() { return null; }
39+
40+ /** Returns The Dictionaries Files Directory */
41+ public String getDictRoot() { return null; }
42+
43+ /** Returns the name of the Project */
44+ public String getProjectName() { return null; }
45+
46+ /** Returns The Project Root Directory */
47+ public String getProjectRoot() { return null; }
48+
49+ /** Returns The Project's Translation Memory (TMX) File */
50+ public String getProjectInternal() { return null; }
51+
52+ /** Returns The Source (to be translated) Files Directory */
53+ public String getSourceRoot() { return null; }
54+
55+ /**
56+ * Returns the class name of the source language tokenizer for the Project.
57+ */
58+ public Class<?> getSourceTokenizer() { return null; }
59+
60+ /**
61+ * Returns the class name of the target language tokenizer for the Project.
62+ */
63+ public Class<?> getTargetTokenizer() { return null; }
64+
65+ public String getExternalCommand() { return null; }
66+
67+ public boolean isProjectValid() { return true; }
68+
69+ /**
70+ * Verify the correctness of a language or country code
71+ *
72+ * @param code
73+ * A string containing a language or country code
74+ * @return <code>true</code> or <code>false</code>
75+ */
76+ private static boolean verifyLangCode(String code) {
77+ return false;
78+ }
79+
80+ /**
81+ * Verifies whether the language code is OK.
82+ */
83+ public static boolean verifySingleLangCode(String code) {
84+ return false;
85+ }
86+
87+}
--- src-stubs/org/omegat/core/data/SourceTextEntry.java (nonexistent)
+++ src-stubs/org/omegat/core/data/SourceTextEntry.java (revision 1)
@@ -0,0 +1,16 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core.data;
6+
7+/**
8+ * Source text entry represents an individual segment for translation pulled
9+ * directly from the input files. There can be many SourceTextEntries having
10+ * identical source language strings
11+ *
12+ * @author Keith Godfrey
13+ * @author Alex Buloichik (alex73mail@gmail.com)
14+ */
15+public class SourceTextEntry {
16+}
--- src-stubs/org/omegat/core/CoreEvents.java (nonexistent)
+++ src-stubs/org/omegat/core/CoreEvents.java (revision 1)
@@ -0,0 +1,39 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.core;
6+
7+import org.omegat.core.events.IApplicationEventListener;
8+import org.omegat.core.events.IEntryEventListener;
9+import org.omegat.core.events.IProjectEventListener;
10+
11+/**
12+ * Class for distribute main application events.
13+ *
14+ * All events can be fired in any threads, but will be delivered to listeners
15+ * only in the UI thread. It's required for better threads synchronization.
16+ *
17+ * @author Alex Buloichik (alex73mail@gmail.com)
18+ */
19+public class CoreEvents {
20+
21+ /** Register listener. */
22+ public static void registerApplicationEventListener(final IApplicationEventListener listener) {}
23+
24+ /** Unregister listener. */
25+ public static void unregisterApplicationEventListener(final IApplicationEventListener listener) {}
26+
27+ /** Register listener. */
28+ public static void registerProjectChangeListener(final IProjectEventListener listener) {}
29+
30+ /** Unregister listener. */
31+ public static void unregisterProjectChangeListener(final IProjectEventListener listener) {}
32+
33+ /** Register listener. */
34+ public static void registerEntryEventListener(final IEntryEventListener listener) {}
35+
36+ /** Unregister listener. */
37+ public static void unregisterEntryEventListener(final IEntryEventListener listener) {}
38+
39+}
--- src-stubs/org/omegat/util/Log.java (nonexistent)
+++ src-stubs/org/omegat/util/Log.java (revision 1)
@@ -0,0 +1,290 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.util;
6+
7+import java.io.ByteArrayInputStream;
8+import java.io.ByteArrayOutputStream;
9+import java.io.File;
10+import java.io.FileInputStream;
11+import java.io.IOException;
12+import java.io.InputStream;
13+import java.util.Properties;
14+import java.util.logging.Formatter;
15+import java.util.logging.Handler;
16+import java.util.logging.Level;
17+import java.util.logging.LogManager;
18+import java.util.logging.LogRecord;
19+import java.util.logging.Logger;
20+//import org.omegat.util.logging.OmegaTFileHandler;
21+
22+/**
23+ * A collection of methods to make logging things easier.
24+ *
25+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
26+ * @author Alex Buloichik (alex73mail@gmail.com)
27+ */
28+public class Log {
29+
30+ private static Logger LOGGER;
31+
32+ static {
33+ LOGGER = Logger.getLogger("global");
34+
35+ boolean loaded = false;
36+// File usersLogSettings = new File(StaticUtils.getConfigDir(), "logger.properties");
37+ File usersLogSettings = new File("logger.properties");
38+ if (usersLogSettings.exists()) {
39+ // try to load logger settings from user home dir
40+ try {
41+ InputStream in = new FileInputStream(usersLogSettings);
42+ try {
43+ init(in);
44+ loaded = true;
45+ } finally {
46+ in.close();
47+ }
48+ } catch (Exception e) {
49+ }
50+ }
51+ if (!loaded) {
52+ // load built-in logger settings
53+ try {
54+ InputStream in = Log.class.getResourceAsStream("/org/omegat/logger.properties");
55+ try {
56+ init(in);
57+ } finally {
58+ in.close();
59+ }
60+ } catch (IOException ex) {
61+ LOGGER.log(Level.SEVERE, "Can't open file for logging", ex);
62+ }
63+ }
64+ }
65+
66+ /**
67+ * Initialize handlers manually. Required for WebStart.
68+ *
69+ * @param in
70+ * settings
71+ */
72+ protected static void init(InputStream in) throws IOException {
73+ Properties props = new Properties();
74+ props.load(in);
75+ String handlers = props.getProperty("handlers");
76+ if (handlers != null) {
77+ props.remove("handlers");
78+
79+ ByteArrayOutputStream b = new ByteArrayOutputStream();
80+ props.store(b, null);
81+ LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(b.toByteArray()));
82+
83+ Logger rootLogger = LogManager.getLogManager().getLogger("");
84+
85+ // remove initialized handlers
86+ for (Handler h : rootLogger.getHandlers()) {
87+ rootLogger.removeHandler(h);
88+ }
89+
90+ String[] hs = handlers.split(",");
91+ for (String hn : hs) {
92+ String word = hn.trim();
93+ try {
94+ Class clz = Log.class.getClassLoader().loadClass(word);
95+ Handler h = (Handler) clz.newInstance();
96+ String fname = props.getProperty(word + ".formatter");
97+ if (fname != null) {
98+ Class clzF = Log.class.getClassLoader().loadClass(fname.trim());
99+ h.setFormatter((Formatter) clzF.newInstance());
100+ }
101+ String level = props.getProperty(word + ".level");
102+ if (level != null) {
103+ h.setLevel(Level.parse(level));
104+ }
105+ rootLogger.addHandler(h);
106+ } catch (Exception ex) {
107+ System.err.println("Error in logger init: " + ex);
108+ ex.printStackTrace();
109+ }
110+ }
111+ }
112+ }
113+
114+ /**
115+ * Returns the path to the log file.
116+ */
117+ public static String getLogLocation() {
118+// return StaticUtils.getConfigDir() + "/logs";
119+ return "";
120+ }
121+
122+ /**
123+ * Compute the filename of the log file
124+ * @return the filename of the log, or an empty string
125+ */
126+ public static String getLogFileName() {
127+// Handler[] hand = LOGGER.getParent().getHandlers();
128+// if (hand[1] instanceof OmegaTFileHandler) {
129+// OmegaTFileHandler omegatLog = (OmegaTFileHandler) hand[1];
130+// return omegatLog.getOmegaTLogFileName()+ ".log";
131+// } else {
132+ return "";
133+// }
134+
135+ }
136+
137+ /**
138+ * Compute the full path of the log file
139+ * @return the full path of the log file
140+ */
141+ public static String getLogFilePath() {
142+ return getLogLocation() + "/" + getLogFileName();
143+ }
144+
145+ /**
146+ * Logs what otherwise would go to System.out
147+ */
148+ public static void log(String s) {
149+// LOGGER.info(s);
150+ }
151+
152+ /**
153+ * Logs a message, retrieved from the resource bundle.
154+ *
155+ * @param key
156+ * The key of the message in the resource bundle.
157+ * @param parameters
158+ * Parameters for the message. These are inserted by using
159+ * StaticUtils.format.
160+ *
161+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
162+ */
163+ public static void logRB(String key, Object... parameters) {
164+// if (LOGGER.isLoggable(Level.INFO)) {
165+// LogRecord rec = new LogRecord(Level.INFO, key);
166+// rec.setResourceBundle(OStrings.getResourceBundle());
167+// rec.setParameters(parameters);
168+// rec.setLoggerName(LOGGER.getName());
169+// LOGGER.log(rec);
170+// }
171+ }
172+
173+ /**
174+ * Logs an Exception or Error.
175+ *
176+ * To the log are written: - The class name of the Exception or Error - The
177+ * message, if any - The stack trace
178+ *
179+ * @param throwable
180+ * The exception or error to log
181+ *
182+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
183+ */
184+ public static void log(Throwable throwable) {
185+// LOGGER.log(Level.SEVERE, "", throwable);
186+ }
187+
188+ /**
189+ * Writes a warning message to the log (to be retrieved from the resource
190+ * bundle)
191+ *
192+ * @param key
193+ * The key of the error message in the resource bundle
194+ * @param parameters
195+ * Parameters for the error message. These are inserted by using
196+ * StaticUtils.format.
197+ *
198+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
199+ * @internal While the warning message can be localized, the warning key is also
200+ * logged, so developers can determine what warning was given by looking at the
201+ * error key, instead of trying to interpret localized messages.
202+ */
203+ public static void logWarningRB(String key, Object... parameters) {
204+// if (LOGGER.isLoggable(Level.WARNING)) {
205+// LogRecord rec = new LogRecord(Level.WARNING, key);
206+// rec.setResourceBundle(OStrings.getResourceBundle());
207+// rec.setParameters(parameters);
208+// rec.setLoggerName(LOGGER.getName());
209+// LOGGER.log(rec);
210+// }
211+ }
212+
213+ /**
214+ * Writes an info message to the log (to be retrieved from the resource
215+ * bundle)
216+ *
217+ * @param key
218+ * The key of the error message in the resource bundle
219+ * @param parameters
220+ * Parameters for the error message. These are inserted by using
221+ * StaticUtils.format.
222+ *
223+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
224+ * @author Alex Buloichik (alex73mail@gmail.com)
225+ * @internal While the info message can be localized, the info key is also
226+ * logged, so developers can determine what info was given by looking at the
227+ * error key, instead of trying to interpret localized messages.
228+ */
229+ public static void logInfoRB(String id, Object... parameters) {
230+// if (LOGGER.isLoggable(Level.INFO)) {
231+// LogRecord rec = new LogRecord(Level.INFO, id);
232+// rec.setResourceBundle(OStrings.getResourceBundle());
233+// rec.setParameters(parameters);
234+// rec.setLoggerName(LOGGER.getName());
235+// LOGGER.log(rec);
236+// }
237+ }
238+
239+ /**
240+ * Writes an error message to the log (to be retrieved from the resource
241+ * bundle)
242+ *
243+ * @param key
244+ * The key of the error message in the resource bundle
245+ * @param parameters
246+ * Parameters for the error message. These are inserted by using
247+ * StaticUtils.format.
248+ *
249+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
250+ * @internal While the error message can be localized, the error key is also
251+ * logged, so developers can determine what error was given by looking at the
252+ * error key, instead of trying to interpret localized messages.
253+ */
254+ public static void logErrorRB(String key, Object... parameters) {
255+// if (LOGGER.isLoggable(Level.SEVERE)) {
256+// LogRecord rec = new LogRecord(Level.SEVERE, key);
257+// rec.setResourceBundle(OStrings.getResourceBundle());
258+// rec.setParameters(parameters);
259+// rec.setLoggerName(LOGGER.getName());
260+// LOGGER.log(rec);
261+// }
262+ }
263+
264+ /**
265+ * Writes an error message to the log (to be retrieved from the resource
266+ * bundle)
267+ *
268+ * @param ex The error that was thrown
269+ * @param key
270+ * The key of the error message in the resource bundle
271+ * @param parameters
272+ * Parameters for the error message. These are inserted by using
273+ * StaticUtils.format.
274+ *
275+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
276+ * @internal While the error message can be localized, the error key is also
277+ * logged, so developers can determine what error was given by looking at the
278+ * error key, instead of trying to interpret localized messages.
279+ */
280+ public static void logErrorRB(Throwable ex, String key, Object... parameters) {
281+// if (LOGGER.isLoggable(Level.SEVERE)) {
282+// LogRecord rec = new LogRecord(Level.SEVERE, key);
283+// rec.setResourceBundle(OStrings.getResourceBundle());
284+// rec.setParameters(parameters);
285+// rec.setLoggerName(LOGGER.getName());
286+// rec.setThrown(ex);
287+// LOGGER.log(rec);
288+// }
289+ }
290+}
--- src-stubs/org/omegat/util/Platform.java (nonexistent)
+++ src-stubs/org/omegat/util/Platform.java (revision 1)
@@ -0,0 +1,58 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+
6+package org.omegat.util;
7+
8+/**
9+ * A class to retrieve some platform information.
10+ *
11+ * @author: Zoltan Bartko bartkozoltan@bartkozoltan.com
12+ * @author Alex Buloichik (alex73mail@gmail.com)
13+ */
14+public final class Platform {
15+ public enum OsType {
16+ // os.arch=amd64, os.name=Linux, os.version=3.0.0-12-generic
17+ LINUX64,
18+ // os.arch=i386, os.name=Linux, os.version=3.0.0-12-generic
19+ LINUX32,
20+ // os.arch=x86_64, os.name=Mac OS X, os.version=10.6.8
21+ MAC64,
22+ // os.arch=i386, os.name=Mac OS X, os.version=10.6.8
23+ MAC32,
24+ // os.arch=amd64, os.name=Windows 7, os.version=6.1
25+ WIN64,
26+ // os.arch=x86, os.name=Windows 7, os.version=6.1
27+ WIN32,
28+ // unknown system
29+ OTHER
30+ }
31+
32+ private static OsType osType = OsType.OTHER;
33+
34+ static {
35+ String osName = System.getProperty("os.name");
36+ String osArch = System.getProperty("os.arch");
37+ if (osName != null && osArch != null) {
38+ if (osName.startsWith("Linux")) {
39+ osType = osArch.contains("64") ? OsType.LINUX64 : OsType.LINUX32;
40+ } else if (osName.startsWith("Mac")) {
41+ osType = osArch.contains("64") ? OsType.MAC64 : OsType.MAC32;
42+ } else if (osName.startsWith("Windows")) {
43+ osType = osArch.contains("64") ? OsType.WIN64 : OsType.WIN32;
44+ }
45+ }
46+ }
47+
48+ private Platform() {
49+ }
50+
51+ public static OsType getOsType() {
52+ return osType;
53+ }
54+
55+ public static final boolean isWebStart() {
56+ return System.getProperty("javawebstart.version") != null;
57+ }
58+}
--- src-stubs/org/omegat/util/gui/UIThreadsUtil.java (nonexistent)
+++ src-stubs/org/omegat/util/gui/UIThreadsUtil.java (revision 1)
@@ -0,0 +1,70 @@
1+/**************************************************************************
2+ OmegaT - Computer Assisted Translation (CAT) tool
3+ with fuzzy matching, translation memory, keyword search,
4+ glossaries, and translation leveraging into updated projects.
5+
6+ Copyright (C) 2008 Alex Buloichik
7+ Home page: http://www.omegat.org/
8+ Support center: http://groups.yahoo.com/group/OmegaT/
9+
10+ This file is part of OmegaT.
11+
12+ OmegaT is free software: you can redistribute it and/or modify
13+ it under the terms of the GNU General Public License as published by
14+ the Free Software Foundation, either version 3 of the License, or
15+ (at your option) any later version.
16+
17+ OmegaT is distributed in the hope that it will be useful,
18+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+ GNU General Public License for more details.
21+
22+ You should have received a copy of the GNU General Public License
23+ along with this program. If not, see <http://www.gnu.org/licenses/>.
24+ **************************************************************************/
25+
26+package org.omegat.util.gui;
27+
28+import javax.swing.SwingUtilities;
29+
30+import org.omegat.util.Log;
31+
32+/**
33+ * Utils for check UI threads and run specific code in UI threads only.
34+ *
35+ * @author Alex Buloichik (alex73mail@gmail.com)
36+ */
37+public class UIThreadsUtil {
38+ /**
39+ * Execute code in swing thread only.
40+ */
41+ public static void executeInSwingThread(final Runnable code) {
42+ if (SwingUtilities.isEventDispatchThread()) {
43+ code.run();
44+ } else {
45+ SwingUtilities.invokeLater(code);
46+ }
47+ }
48+
49+ /**
50+ * Check if current thread is swing thread, and report error in log if it's
51+ * not true.
52+ */
53+ public static void mustBeSwingThread() {
54+ if (!SwingUtilities.isEventDispatchThread()) {
55+ Log.logErrorRB("LOG_ERROR_MUST_BE_SWING_THREAD");
56+ Log.log(new Exception());
57+ }
58+ }
59+
60+ /**
61+ * Check if current thread is NOT swing thread, and report error in log if
62+ * it's not true.
63+ */
64+ public static void mustNotBeSwingThread() {
65+ if (SwingUtilities.isEventDispatchThread()) {
66+ Log.logErrorRB("LOG_ERROR_MUSTNOT_BE_SWING_THREAD");
67+ Log.log(new Exception());
68+ }
69+ }
70+}
--- src-stubs/org/omegat/util/LFileCopy.java (nonexistent)
+++ src-stubs/org/omegat/util/LFileCopy.java (revision 1)
@@ -0,0 +1,49 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.util;
6+
7+import java.io.File;
8+import java.io.IOException;
9+import java.io.InputStream;
10+import java.io.OutputStream;
11+import java.io.Reader;
12+import java.io.Writer;
13+
14+/**
15+ * Utility class for copying untranslatable files.
16+ *
17+ * @author Keith Godfrey
18+ * @author Kim Bruning
19+ * @author Maxym Mykhalchuk
20+ */
21+public class LFileCopy {
22+
23+ /** Copies one file. Creates directories on the path to dest if necessary. */
24+ public static void copy(String src, String dest) throws IOException {}
25+
26+ /** Copies one file. Creates directories on the path to dest if necessary. */
27+ public static void copy(File src, File dest) throws IOException {}
28+
29+ /** Stores a file from input stream. Input stream is not closed. */
30+ public static void copy(InputStream src, File dest) throws IOException {}
31+
32+ /**
33+ * Transfers all the input stream to the output stream. Input and output
34+ * streams are not closed.
35+ */
36+ public static void copy(InputStream src, OutputStream dest) throws IOException {}
37+
38+ /**
39+ * Transfers all data from reader to writer. Reader and writer are not
40+ * closed.
41+ */
42+ public static void copy(Reader src, Writer dest) throws IOException {}
43+
44+ /**
45+ * Loads contents of a file into output stream. Output stream is not closed.
46+ */
47+ public static void copy(File src, OutputStream dest) throws IOException {}
48+
49+}
--- src-stubs/org/omegat/util/OConsts.java (nonexistent)
+++ src-stubs/org/omegat/util/OConsts.java (revision 1)
@@ -0,0 +1,10 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.util;
6+
7+public class OConsts {
8+ /** Encoding: "UTF-8". */
9+ public static final String UTF8 = "UTF-8";
10+}
--- src-stubs/org/omegat/util/StaticUtils.java (nonexistent)
+++ src-stubs/org/omegat/util/StaticUtils.java (revision 1)
@@ -0,0 +1,774 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+
6+package org.omegat.util;
7+
8+import java.awt.GraphicsEnvironment;
9+import java.awt.event.KeyEvent;
10+import java.io.BufferedOutputStream;
11+import java.io.ByteArrayOutputStream;
12+import java.io.File;
13+import java.io.FileOutputStream;
14+import java.io.IOException;
15+import java.io.InputStream;
16+import java.io.OutputStream;
17+import java.net.MalformedURLException;
18+import java.net.URL;
19+import java.net.URLConnection;
20+import java.text.MessageFormat;
21+import java.util.ArrayList;
22+import java.util.Collections;
23+import java.util.Comparator;
24+import java.util.Enumeration;
25+import java.util.List;
26+import java.util.jar.JarEntry;
27+import java.util.jar.JarFile;
28+import java.util.regex.Matcher;
29+import java.util.regex.Pattern;
30+
31+import org.omegat.core.data.SourceTextEntry;
32+
33+/**
34+ * Static functions taken from CommandThread to reduce file size.
35+ *
36+ * @author Keith Godfrey
37+ * @author Maxym Mykhalchuk
38+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
39+ * @author Didier Briel
40+ * @author Zoltan Bartko - bartkozoltan@bartkozoltan.com
41+ * @author Alex Buloichik
42+ * @author Martin Fleurke
43+ * @author Aaron Madlon-Kay
44+ */
45+public class StaticUtils {
46+ /**
47+ * Configuration directory on Windows platforms
48+ */
49+ private final static String WINDOWS_CONFIG_DIR = "\\OmegaT\\";
50+
51+ /**
52+ * Configuration directory on UNIX platforms
53+ */
54+ private final static String UNIX_CONFIG_DIR = "/.omegat/";
55+
56+ /**
57+ * Configuration directory on Mac OS X
58+ */
59+ private final static String OSX_CONFIG_DIR = "/Library/Preferences/OmegaT/";
60+
61+ /**
62+ * Script directory
63+ */
64+ private final static String SCRIPT_DIR = "script";
65+
66+ /**
67+ * Char which should be used instead protected parts. It should be
68+ * non-letter char, to be able to have correct words counter.
69+ */
70+ public static final char TAG_REPLACEMENT = '\b';
71+
72+ /**
73+ * Contains the location of the directory containing the configuration
74+ * files.
75+ */
76+ private static String m_configDir = null;
77+
78+ /**
79+ * Contains the location of the script dir containing the exported text
80+ * files.
81+ */
82+ private static String m_scriptDir = null;
83+
84+ /**
85+ * Check if specified key pressed.
86+ *
87+ * @param e
88+ * pressed key event
89+ * @param code
90+ * required key code
91+ * @param modifiers
92+ * required modifiers
93+ * @return true if checked key pressed
94+ */
95+ public static boolean isKey(KeyEvent e, int code, int modifiers) {
96+ return e.getKeyCode() == code && e.getModifiers() == modifiers;
97+ }
98+
99+ /**
100+ * Returns a list of all files under the root directory by absolute path.
101+ */
102+ public static void buildFileList(List<String> lst, File rootDir, boolean recursive) {
103+ // read all files in current directory, recurse into subdirs
104+ // append files to supplied list
105+ File flist[] = null;
106+ try {
107+ flist = rootDir.listFiles();
108+ } catch (Exception e) {
109+ // don't care what exception is there.
110+ // by contract, only a SecurityException is possible, but who
111+ // knows...
112+ }
113+ // if IOException occured, flist is null
114+ // and we simply return
115+ if (flist == null)
116+ return;
117+
118+ for (File file : flist) {
119+ if (file.isDirectory()) {
120+ continue; // recurse into directories later
121+ }
122+ lst.add(file.getAbsolutePath());
123+ }
124+ if (recursive) {
125+ for (File file : flist) {
126+ if (isProperDirectory(file)) // Ignores some directories
127+ {
128+ // now recurse into subdirectories
129+ buildFileList(lst, file, true);
130+ }
131+ }
132+ }
133+ }
134+
135+ // returns a list of all files under the root directory
136+ // by absolute path
137+ public static void buildDirList(List<String> lst, File rootDir) {
138+ // read all files in current directory, recurse into subdirs
139+ // append files to supplied list
140+ File[] flist = rootDir.listFiles();
141+ for (File file : flist) {
142+ if (isProperDirectory(file)) // Ignores some directories
143+ {
144+ // now recurse into subdirectories
145+ lst.add(file.getAbsolutePath());
146+ buildDirList(lst, file);
147+ }
148+ }
149+ }
150+
151+ /**
152+ * Returns the names of all font families available.
153+ */
154+ public static String[] getFontNames() {
155+ GraphicsEnvironment graphics;
156+ graphics = GraphicsEnvironment.getLocalGraphicsEnvironment();
157+ return graphics.getAvailableFontFamilyNames();
158+ }
159+
160+ // List of CVS or SVN folders
161+ private static final String CVS_SVN_FOLDERS = "(CVS)|(.svn)|(_svn)";
162+
163+ private static final Pattern IGNORED_FOLDERS = Pattern.compile(CVS_SVN_FOLDERS);
164+
165+ /**
166+ * Tests whether a directory has to be used
167+ *
168+ * @return <code>true</code> or <code>false</code>
169+ */
170+ private static boolean isProperDirectory(File file) {
171+ if (file.isDirectory()) {
172+ Matcher directoryMatch = IGNORED_FOLDERS.matcher(file.getName());
173+ if (directoryMatch.matches())
174+ return false;
175+ else
176+ return true;
177+ } else
178+ return false;
179+ }
180+
181+ /**
182+ * Converts a single char into valid XML. Output stream must convert stream
183+ * to UTF-8 when saving to disk.
184+ */
185+ public static String makeValidXML(char c) {
186+ switch (c) {
187+ // case '\'':
188+ // return "&apos;";
189+ case '&':
190+ return "&amp;";
191+ case '>':
192+ return "&gt;";
193+ case '<':
194+ return "&lt;";
195+ case '"':
196+ return "&quot;";
197+ default:
198+ return String.valueOf(c);
199+ }
200+ }
201+
202+ /**
203+ * Converts XML entities to characters.
204+ */
205+ public static String entitiesToCharacters(String text) {
206+
207+ if (text.indexOf("&gt;") >= 0) {
208+ text = text.replaceAll("&gt;", ">");
209+ }
210+ if (text.indexOf("&lt;") >= 0) {
211+ text = text.replaceAll("&lt;", "<");
212+ }
213+ if (text.indexOf("&quot;") >= 0) {
214+ text = text.replaceAll("&quot;", "\"");
215+ }
216+ // If makeValidXML converts ' to apos;, the following lines should be uncommented
217+ /* if (text.indexOf("&apos;") >= 0) {
218+ text = text.replaceAll("&apos;", "'");
219+ }*/
220+ if (text.indexOf("&amp;") >= 0) {
221+ text = text.replaceAll("&amp;", "&");
222+ }
223+ return text;
224+ }
225+
226+ /**
227+ * Converts a stream of plaintext into valid XML. Output stream must convert
228+ * stream to UTF-8 when saving to disk.
229+ */
230+ public static String makeValidXML(String plaintext) {
231+ char c;
232+ StringBuffer out = new StringBuffer();
233+ String text = fixChars(plaintext);
234+ for (int i = 0; i < text.length(); i++) {
235+ c = text.charAt(i);
236+ out.append(makeValidXML(c));
237+ }
238+ return out.toString();
239+ }
240+
241+ /** Compresses spaces in case of non-preformatting paragraph. */
242+ public static String compressSpaces(String str) {
243+ int strlen = str.length();
244+ StringBuffer res = new StringBuffer(strlen);
245+ boolean wasspace = true;
246+ for (int i = 0; i < strlen; i++) {
247+ char ch = str.charAt(i);
248+ boolean space = Character.isWhitespace(ch);
249+ if (space) {
250+ if (!wasspace)
251+ wasspace = true;
252+ } else {
253+ if (wasspace && res.length() > 0)
254+ res.append(' ');
255+ res.append(ch);
256+ wasspace = false;
257+ }
258+ }
259+ return res.toString();
260+ }
261+
262+ /**
263+ * Extracts an element of a class path.
264+ *
265+ * @param fullcp
266+ * the classpath
267+ * @param posInsideElement
268+ * position inside a class path string, that fits inside some
269+ * classpath element.
270+ */
271+ private static String classPathElement(String fullcp, int posInsideElement) {
272+ // semicolon before the path to the Jar
273+ int semicolon1 = fullcp.lastIndexOf(File.pathSeparatorChar, posInsideElement);
274+ // semicolon after the path to the Jar
275+ int semicolon2 = fullcp.indexOf(File.pathSeparatorChar, posInsideElement);
276+ if (semicolon1 < 0)
277+ semicolon1 = -1;
278+ if (semicolon2 < 0)
279+ semicolon2 = fullcp.length();
280+ return fullcp.substring(semicolon1 + 1, semicolon2);
281+ }
282+
283+ /** Trying to see if this ending is inside the classpath */
284+ private static String tryThisClasspathElement(String cp, String ending) {
285+ try {
286+ int pos = cp.indexOf(ending);
287+ if (pos >= 0) {
288+ String path = classPathElement(cp, pos);
289+ path = path.substring(0, path.indexOf(ending));
290+ return path;
291+ }
292+ } catch (Exception e) {
293+ // should never happen, but just in case ;-)
294+ }
295+ return null;
296+ }
297+
298+ /** Caching install dir */
299+ private static String INSTALLDIR = null;
300+
301+ /**
302+ * Returns OmegaT installation directory. The code uses this method to look
303+ * up for OmegaT documentation.
304+ */
305+ public static String installDir() {
306+ return "";
307+ }
308+
309+ /**
310+ * Returns the location of the configuration directory, depending on the
311+ * user's platform. Also creates the configuration directory, if necessary.
312+ * If any problems occur while the location of the configuration directory
313+ * is being determined, an empty string will be returned, resulting in the
314+ * current working directory being used.
315+ *
316+ * Windows XP : &lt;Documents and Settings&gt;>\&lt;User name&gt;\Application Data\OmegaT
317+ * Windows Vista : User\&lt;User name&gt;\AppData\Roaming
318+ * Linux: &lt;User Home&gt;/.omegat
319+ * Solaris/SunOS: &lt;User Home&gt;/.omegat
320+ * FreeBSD: &lt;User Home&gt;/.omegat
321+ * Mac OS X: &lt;User Home&gt;/Library/Preferences/OmegaT
322+ * Other: User home directory
323+ *
324+ * @return The full path of the directory containing the OmegaT
325+ * configuration files, including trailing path separator.
326+ *
327+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
328+ */
329+ public static String getConfigDir() {
330+ return m_configDir;
331+ }
332+
333+ public static String getScriptDir() {
334+ // If the script directory has already been determined, return it
335+ if (m_scriptDir != null)
336+ return m_scriptDir;
337+
338+ m_scriptDir = getConfigDir() + SCRIPT_DIR + File.separator;
339+
340+ try {
341+ // Check if the directory exists
342+ File dir = new File(m_scriptDir);
343+ if (!dir.exists()) {
344+ // Create the directory
345+ boolean created = dir.mkdirs();
346+
347+ // If the directory could not be created,
348+ // set the script directory to config directory
349+ if (!created) {
350+ Log.logErrorRB("SU_SCRIPT_DIR_CREATE_ERROR");
351+ m_scriptDir = getConfigDir();
352+ }
353+ }
354+ } catch (SecurityException e) {
355+ // The system doesn't want us to write where we want to write
356+ // reset the script dir to the current config dir
357+ m_scriptDir = getConfigDir();
358+
359+ // log the exception, but only after the script dir has been reset
360+ Log.logErrorRB("SU_SCRIPT_DIR_CREATE_ERROR");
361+ Log.log(e.toString());
362+ }
363+ return m_scriptDir;
364+ }
365+
366+ /**
367+ * Returns true if running on Mac OS X
368+ */
369+ public static boolean onMacOSX() {
370+ // get os property
371+ String os; // name of operating system
372+ try {
373+ // get the name of the operating system
374+ os = System.getProperty("os.name");
375+ } catch (SecurityException e) {
376+ // access to the os property is restricted,
377+ // assume we're not on a Mac
378+ return false;
379+ }
380+
381+ return os.equals("Mac OS X");
382+ }
383+
384+ /**
385+ * Strips all protected parts.
386+ *
387+ * @param str
388+ * source string
389+ * @param ste
390+ * info about protected parts
391+ * @param changeToReplacement
392+ * true if should be replaced by special char, false if should be
393+ * just removed
394+ */
395+ public static String stripProtectedParts(String str, SourceTextEntry ste) {
396+ return "";
397+ }
398+
399+ /**
400+ * Strips all XML tags (converts to plain text). Tags detected only by
401+ * pattern. Protected parts are not used.
402+ */
403+ public static String stripXmlTags(String xml) {
404+ return "";
405+ }
406+
407+ /**
408+ * Compares two strings for equality. Handles nulls: if both strings are
409+ * nulls they are considered equal.
410+ */
411+ public static boolean equal(String one, String two) {
412+ return (one == null && two == null) || (one != null && one.equals(two));
413+ }
414+
415+ /**
416+ * Encodes the array of bytes to store them in a plain text file.
417+ */
418+ public static String uuencode(byte[] buf) {
419+ if (buf.length <= 0)
420+ return new String();
421+
422+ StringBuffer res = new StringBuffer();
423+ res.append(buf[0]);
424+ for (int i = 1; i < buf.length; i++) {
425+ res.append('#');
426+ res.append(buf[i]);
427+ }
428+ return res.toString();
429+ }
430+
431+ /**
432+ * Decodes the array of bytes that was stored in a plain text file as a
433+ * string, back to array of bytes.
434+ */
435+ public static byte[] uudecode(String buf) {
436+ String[] bytes = buf.split("#");
437+ byte[] res = new byte[bytes.length];
438+ for (int i = 0; i < bytes.length; i++) {
439+ try {
440+ res[i] = Byte.parseByte(bytes[i]);
441+ } catch (NumberFormatException e) {
442+ res[i] = 0;
443+ }
444+ }
445+ return res;
446+ }
447+
448+ /**
449+ * Makes the file name relative to the given path.
450+ */
451+ public static String makeFilenameRelative(String filename, String path) {
452+ if (filename.toLowerCase().startsWith(path.toLowerCase()))
453+ return filename.substring(path.length());
454+ else
455+ return filename;
456+ }
457+
458+ /**
459+ * Escapes the passed string for use in regex matching, so special regex
460+ * characters are interpreted as normal characters during regex searches.
461+ *
462+ * This is done by prepending a backslash before each occurrence of the
463+ * following characters: \^.*+[]{}()&|-:=?!<>
464+ *
465+ * @param text
466+ * The text to escape
467+ *
468+ * @return The escaped text
469+ *
470+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
471+ */
472+ public static String escapeNonRegex(String text) {
473+ return escapeNonRegex(text, true);
474+ }
475+
476+ /**
477+ * Escapes the passed string for use in regex matching, so special regex
478+ * characters are interpreted as normal characters during regex searches.
479+ *
480+ * This is done by prepending a backslash before each occurrence of the
481+ * following characters: \^.+[]{}()&|-:=!<>
482+ *
483+ * If the parameter escapeWildcards is true, asterisks (*) and questions
484+ * marks (?) will also be escaped. If false, these will be converted to
485+ * regex tokens (* ->
486+ *
487+ * @param text
488+ * The text to escape
489+ * @param escapeWildcards
490+ * If true, asterisks and question marks are also escaped. If
491+ * false, these are converted to there regex equivalents.
492+ *
493+ * @return The escaped text
494+ *
495+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
496+ */
497+ public static String escapeNonRegex(String text, boolean escapeWildcards) {
498+ // handle backslash
499+ text = text.replaceAll("\\\\", "\\\\\\\\"); // yes, that's the correct
500+ // nr of backslashes
501+
502+ // [3021915] Search window - search items containing $ behave strangely
503+ // If $ is included in "escape" below, it creates a
504+ // java.lang.StringIndexOutOfBoundsException: String index out of range:
505+ // 3
506+ // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5024613
507+ text = text.replace("$", "\\" + "$");
508+
509+ // handle rest of characters to be escaped
510+ // String escape = "^.*+[]{}()&|-:=?!<>";
511+ String escape = "^.+[]{}()&|-:=!<>";
512+ for (int i = 0; i < escape.length(); i++)
513+ text = text.replaceAll("\\" + escape.charAt(i), "\\\\" + escape.charAt(i));
514+
515+ // handle "wildcard characters" ? and * (only if requested)
516+ // do this last, or the additional period (.) will cause trouble
517+ if (escapeWildcards) {
518+ // simply escape * and ?
519+ text = text.replaceAll("\\?", "\\\\?");
520+ text = text.replaceAll("\\*", "\\\\*");
521+ } else {
522+ // convert * (0 or more characters) and ? (1 character)
523+ // to their regex equivalents (\S* and \S? respectively)
524+ // text = text.replaceAll("\\?", "\\S?"); // do ? first, or * will
525+ // be converted twice
526+ // text = text.replaceAll("\\*", "\\S*");
527+ // The above lines were not working:
528+ // [ 1680081 ] Search: simple wilcards do not work
529+ // The following correction was contributed by Tiago Saboga
530+ text = text.replaceAll("\\?", "\\\\S"); // do ? first, or * will be
531+ // converted twice
532+ text = text.replaceAll("\\*", "\\\\S*");
533+ }
534+
535+ return text;
536+ }
537+
538+ /**
539+ * Formats UI strings.
540+ *
541+ * Note: This is only a first attempt at putting right what goes wrong in
542+ * MessageFormat. Currently it only duplicates single quotes, but it doesn't
543+ * even test if the string contains parameters (numbers in curly braces),
544+ * and it doesn't allow for string containg already escaped quotes.
545+ *
546+ * @param str
547+ * The string to format
548+ * @param arguments
549+ * Arguments to use in formatting the string
550+ *
551+ * @return The formatted string
552+ *
553+ * @author Henry Pijffers (henry.pijffers@saxnot.com)
554+ */
555+ public static String format(String str, Object... arguments) {
556+ // MessageFormat.format expects single quotes to be escaped
557+ // by duplicating them, otherwise the string will not be formatted
558+ str = str.replaceAll("'", "''");
559+ return MessageFormat.format(str, arguments);
560+ }
561+
562+ /**
563+ * dowload a file from the internet
564+ */
565+ public static String downloadFileToString(String urlString) throws IOException {
566+ URLConnection urlConn = null;
567+ InputStream in = null;
568+
569+ URL url = new URL(urlString);
570+ urlConn = url.openConnection();
571+ //don't wait forever. 10 seconds should be enough.
572+ urlConn.setConnectTimeout(10000);
573+ in = urlConn.getInputStream();
574+
575+ ByteArrayOutputStream out = new ByteArrayOutputStream();
576+// try {
577+// LFileCopy.copy(in, out);
578+// } finally {
579+// try {
580+// in.close();
581+// } catch (IOException ex) {
582+// // munch this
583+// }
584+// }
585+ return new String(out.toByteArray(), "UTF-8");
586+ }
587+
588+ /**
589+ * Download a file to the disk
590+ */
591+ public static void downloadFileToDisk(String address, String filename) throws MalformedURLException {
592+ URLConnection urlConn = null;
593+ InputStream in = null;
594+ OutputStream out = null;
595+ try {
596+ URL url = new URL(address);
597+ urlConn = url.openConnection();
598+ in = urlConn.getInputStream();
599+ out = new BufferedOutputStream(new FileOutputStream(filename));
600+
601+ byte[] byteBuffer = new byte[1024];
602+
603+ int numRead;
604+ while ((numRead = in.read(byteBuffer)) != -1) {
605+ out.write(byteBuffer, 0, numRead);
606+ }
607+ } catch (IOException ex) {
608+ Log.logErrorRB("IO exception");
609+ Log.log(ex);
610+ } finally {
611+ try {
612+ if (in != null) {
613+ in.close();
614+ }
615+
616+ if (out != null) {
617+ out.close();
618+ }
619+ } catch (IOException ex) {
620+ // munch this
621+ }
622+ }
623+ }
624+
625+ public static void extractFileFromJar(String archive, List<String> filenames, String destination)
626+ throws IOException {
627+ // open the jar (zip) file
628+ JarFile jar = new JarFile(archive);
629+
630+ // parse the entries
631+ Enumeration<JarEntry> entryEnum = jar.entries();
632+ while (entryEnum.hasMoreElements()) {
633+ JarEntry file = entryEnum.nextElement();
634+ if (filenames.contains(file.getName())) {
635+ // match found
636+ File f = new File(destination + File.separator + file.getName());
637+ InputStream in = jar.getInputStream(file);
638+ BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(f));
639+
640+ byte[] byteBuffer = new byte[1024];
641+
642+ int numRead = 0;
643+ while ((numRead = in.read(byteBuffer)) != -1) {
644+ out.write(byteBuffer, 0, numRead);
645+ }
646+
647+ in.close();
648+ out.close();
649+ }
650+ }
651+ jar.close();
652+ }
653+
654+ /**
655+ * Replace invalid XML chars by spaces. See supported chars at
656+ * http://www.w3.org/TR/2006/REC-xml-20060816/#charsets.
657+ *
658+ * @param str
659+ * input stream
660+ * @return result stream
661+ */
662+ public static String fixChars(String str) {
663+ char[] result = new char[str.length()];
664+ for (int i = 0; i < str.length(); i++) {
665+ char c = str.charAt(i);
666+ if (c < 0x20) {
667+ if (c != 0x09 && c != 0x0A && c != 0x0D) {
668+ c = ' ';
669+ }
670+ } else if (c >= 0x20 && c <= 0xD7FF) {
671+ } else if (c >= 0xE000 && c <= 0xFFFD) {
672+ } else if (c >= 0x10000 && c <= 0x10FFFF) {
673+ } else {
674+ c = ' ';
675+ }
676+ result[i] = c;
677+ }
678+ return new String(result);
679+ }
680+
681+ /**
682+ * Sort tags by order of their appearance in a reference string.
683+ */
684+ public static class TagComparator implements Comparator<String> {
685+
686+ private final String source;
687+
688+ public TagComparator(String source) {
689+ super();
690+ this.source = source;
691+ }
692+
693+ public int compare(String tag1, String tag2) {
694+ // Check for equality
695+ if (tag1.equals(tag2)) {
696+ return 0;
697+ }
698+ // Check to see if one tag encompases the other
699+ if (tag1.startsWith(tag2)) {
700+ return -1;
701+ } else if (tag2.startsWith(tag1)) {
702+ return 1;
703+ }
704+ // Check which tag comes first
705+ int index1 = source.indexOf(tag1);
706+ int index2 = source.indexOf(tag2);
707+ if (index1 == index2) {
708+ int len1 = tag1.length();
709+ int len2 = tag2.length();
710+ if (len1 > len2) {
711+ return -1;
712+ } else if (len2 > len1) {
713+ return 1;
714+ } else {
715+ return tag1.compareTo(tag2);
716+ }
717+ }
718+ return index1 > index2 ? 1 : -1;
719+ }
720+ }
721+
722+ /**
723+ * Parse a command line string into arguments, interpreting
724+ * double and single quotes as Bash does.
725+ * @param cmd Command string
726+ * @return Array of arguments
727+ */
728+ public static String[] parseCLICommand(String cmd) {
729+ cmd = cmd.trim();
730+ if (cmd.length() == 0) return new String[] { "" };
731+
732+ StringBuilder arg = new StringBuilder();
733+ List<String> result = new ArrayList<String>();
734+
735+ final char noQuote = '\0';
736+ char currentQuote = noQuote;
737+ for (int i = 0; i < cmd.length(); i++) {
738+ char c = cmd.charAt(i);
739+ if (c == currentQuote) {
740+ currentQuote = noQuote;
741+ } else if (c == '"' && currentQuote == noQuote) {
742+ currentQuote = '"';
743+ } else if (c == '\'' && currentQuote == noQuote) {
744+ currentQuote = '\'';
745+ } else if (c == '\\' && i + 1 < cmd.length()) {
746+ char next = cmd.charAt(i + 1);
747+ if ((currentQuote == noQuote && Character.isWhitespace(next))
748+ || (currentQuote == '"' && next == '"')) {
749+ arg.append(next);
750+ i++;
751+ } else {
752+ arg.append(c);
753+ }
754+ } else {
755+ if (Character.isWhitespace(c) && currentQuote == noQuote) {
756+ if (arg.length() > 0) {
757+ result.add(arg.toString());
758+ arg = new StringBuilder();
759+ } else {
760+ // Discard
761+ }
762+ } else {
763+ arg.append(c);
764+ }
765+ }
766+ }
767+ // Catch last arg
768+ if (arg.length() > 0) {
769+ result.add(arg.toString());
770+ }
771+ return result.toArray(new String[0]);
772+ }
773+
774+} // StaticUtils
--- src-stubs/org/omegat/util/FileUtil.java (nonexistent)
+++ src-stubs/org/omegat/util/FileUtil.java (revision 1)
@@ -0,0 +1,246 @@
1+/**************************************************************************
2+ This code is only a stub.
3+ **************************************************************************/
4+
5+package org.omegat.util;
6+
7+import java.io.BufferedReader;
8+import java.io.BufferedWriter;
9+import java.io.File;
10+import java.io.FileFilter;
11+import java.io.FileInputStream;
12+import java.io.FileOutputStream;
13+import java.io.IOException;
14+import java.io.InputStreamReader;
15+import java.io.OutputStreamWriter;
16+import java.io.StringWriter;
17+import java.io.Writer;
18+import java.net.URL;
19+import java.text.SimpleDateFormat;
20+import java.util.ArrayList;
21+import java.util.Arrays;
22+import java.util.Comparator;
23+import java.util.Date;
24+import java.util.List;
25+//import org.omegat.gui.help.HelpFrame;
26+
27+/**
28+ * Files processing utilities.
29+ *
30+ * @author Alex Buloichik (alex73mail@gmail.com)
31+ * @author Didier Briel
32+ */
33+public class FileUtil {
34+ private static final int MAX_BACKUPS = 11;
35+ public static String LINE_SEPARATOR = System.getProperty("line.separator");
36+
37+ /**
38+ * Removes old backups so that only 10 last are there.
39+ */
40+ public static void removeOldBackups(final File originalFile) {
41+ try {
42+ File[] bakFiles = originalFile.getParentFile().listFiles(new FileFilter() {
43+ public boolean accept(File f) {
44+ return !f.isDirectory() && f.getName().startsWith(originalFile.getName())
45+ && f.getName().endsWith(".bak");
46+ }
47+ });
48+
49+ if (bakFiles != null && bakFiles.length > MAX_BACKUPS) {
50+ Arrays.sort(bakFiles, new Comparator<File>() {
51+ public int compare(File f1, File f2) {
52+ return f2.getName().compareTo(f1.getName());
53+ }
54+ });
55+ for (int i = MAX_BACKUPS; i < bakFiles.length; i++) {
56+ bakFiles[i].delete();
57+ }
58+ }
59+ } catch (Exception e) {
60+ // we don't care
61+ }
62+ }
63+
64+ /**
65+ * Create file backup with datetime suffix.
66+ */
67+ public static void backupFile(File f) throws IOException {
68+ long fileMillis = f.lastModified();
69+ String str = new SimpleDateFormat("yyyyMMddHHmm").format(new Date(fileMillis));
70+ LFileCopy.copy(f, new File(f.getPath() + "." + str + ".bak"));
71+ }
72+
73+ /**
74+ * Writes a text into a UTF-8 text file in the script directory.
75+ *
76+ * @param textToWrite
77+ * The text to write in the file
78+ * @param fileName
79+ * The file name without path
80+ */
81+ public static File writeScriptFile(String textToWrite, String fileName) {
82+
83+ File outFile = new File(StaticUtils.getScriptDir(), fileName);
84+ File outFileTemp = new File(StaticUtils.getScriptDir(), fileName + ".temp");
85+ outFile.delete();
86+ BufferedWriter bw = null;
87+ try {
88+ textToWrite = textToWrite.replaceAll("\n", System.getProperty("line.separator"));
89+ bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFileTemp), OConsts.UTF8));
90+ bw.write(textToWrite);
91+ } catch (Exception ex) {
92+ // Eat exception silently
93+ } finally {
94+ try {
95+ if (bw != null)
96+ bw.close();
97+ } catch (IOException ex) {
98+ ex.printStackTrace();
99+ }
100+ }
101+ outFileTemp.renameTo(outFile);
102+ return outFile;
103+ }
104+
105+ public static String readScriptFile(File file) {
106+ try {
107+ BufferedReader rd = new BufferedReader(new InputStreamReader(new FileInputStream(file), OConsts.UTF8));
108+
109+ try {
110+ StringWriter out = new StringWriter();
111+ LFileCopy.copy(rd, out);
112+ return out.toString().replace(System.getProperty("line.separator"), "\n");
113+ } finally {
114+ rd.close();
115+ }
116+ } catch (Exception ex) {
117+ ex.printStackTrace();
118+ return null;
119+ }
120+ }
121+
122+ /**
123+ * Read file as UTF-8 text.
124+ */
125+ public static String readTextFile(File file) throws IOException {
126+ BufferedReader rd = new BufferedReader(new InputStreamReader(new FileInputStream(file), OConsts.UTF8));
127+
128+ try {
129+ StringWriter out = new StringWriter();
130+ LFileCopy.copy(rd, out);
131+ return out.toString();
132+ } finally {
133+ rd.close();
134+ }
135+ }
136+
137+ /**
138+ * Write text in file using UTF-8.
139+ */
140+ public static void writeTextFile(File file, String text) throws IOException {
141+ Writer wr = new OutputStreamWriter(new FileOutputStream(file), OConsts.UTF8);
142+ try {
143+ wr.write(text);
144+ } finally {
145+ wr.close();
146+ }
147+ }
148+
149+ /**
150+ * Find files in subdirectories.
151+ *
152+ * @param dir
153+ * directory to start find
154+ * @param filter
155+ * filter for found files
156+ * @return list of filtered found files
157+ */
158+ public static List<File> findFiles(final File dir, final FileFilter filter) {
159+ final List<File> result = new ArrayList<File>();
160+ findFiles(dir, filter, result);
161+ return result;
162+ }
163+
164+ /**
165+ * Internal find method, which calls himself recursively.
166+ *
167+ * @param dir
168+ * directory to start find
169+ * @param filter
170+ * filter for found files
171+ * @param result
172+ * list of filtered found files
173+ */
174+ private static void findFiles(final File dir, final FileFilter filter, final List<File> result) {
175+ File[] list = dir.listFiles();
176+ if (list != null) {
177+ for (File f : list) {
178+ if (f.isDirectory()) {
179+ findFiles(f, filter, result);
180+ } else {
181+ if (filter.accept(f)) {
182+ result.add(f);
183+ }
184+ }
185+ }
186+ }
187+ }
188+
189+ /**
190+ * Compute relative path of file.
191+ *
192+ * @param rootDir
193+ * root directory
194+ * @param filePath
195+ * file path
196+ * @return
197+ */
198+ public static String computeRelativePath(File rootDir, File file) throws IOException {
199+ String rootAbs = rootDir.getAbsolutePath().replace('\\', '/') + '/';
200+ String fileAbs = file.getAbsolutePath().replace('\\', '/');
201+
202+ switch (Platform.getOsType()) {
203+ case WIN32:
204+ case WIN64:
205+ if (!fileAbs.toUpperCase().startsWith(rootAbs.toUpperCase())) {
206+ throw new IOException("File '" + file + "' is not under dir '" + rootDir + "'");
207+ }
208+ break;
209+ default:
210+ if (!fileAbs.startsWith(rootAbs)) {
211+ throw new IOException("File '" + file + "' is not under dir '" + rootDir + "'");
212+ }
213+ break;
214+ }
215+ return fileAbs.substring(rootAbs.length());
216+ }
217+
218+ /**
219+ * Load a text file from the root of help.
220+ * @param The name of the text file
221+ * @return The content of the text file
222+ */
223+ public static String loadTextFileFromDoc(String textFile) {
224+/*
225+ // Get the license
226+ URL url = HelpFrame.getHelpFileURL(null, textFile);
227+ if (url == null) {
228+ return HelpFrame.errorHaiku();
229+ }
230+
231+ try {
232+ BufferedReader rd = new BufferedReader(new InputStreamReader(url.openStream(), OConsts.UTF8));
233+ try {
234+ StringWriter out = new StringWriter();
235+ LFileCopy.copy(rd, out);
236+ return out.toString();
237+ } finally {
238+ rd.close();
239+ }
240+ } catch (IOException ex) {
241+ return HelpFrame.errorHaiku();
242+ }
243+*/
244+ return null;
245+ }
246+}
--- nbproject/build-impl.xml (nonexistent)
+++ nbproject/build-impl.xml (revision 1)
@@ -0,0 +1,1445 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!--
3+*** GENERATED FROM project.xml - DO NOT EDIT ***
4+*** EDIT ../build.xml INSTEAD ***
5+
6+For the purpose of easier reading the script
7+is divided into following sections:
8+
9+ - initialization
10+ - compilation
11+ - jar
12+ - execution
13+ - debugging
14+ - javadoc
15+ - test compilation
16+ - test execution
17+ - test debugging
18+ - applet
19+ - cleanup
20+
21+ -->
22+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="TimeTracker-impl">
23+ <fail message="Please build using Ant 1.8.0 or higher.">
24+ <condition>
25+ <not>
26+ <antversion atleast="1.8.0"/>
27+ </not>
28+ </condition>
29+ </fail>
30+ <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
31+ <!--
32+ ======================
33+ INITIALIZATION SECTION
34+ ======================
35+ -->
36+ <target name="-pre-init">
37+ <!-- Empty placeholder for easier customization. -->
38+ <!-- You can override this target in the ../build.xml file. -->
39+ </target>
40+ <target depends="-pre-init" name="-init-private">
41+ <property file="nbproject/private/config.properties"/>
42+ <property file="nbproject/private/configs/${config}.properties"/>
43+ <property file="nbproject/private/private.properties"/>
44+ </target>
45+ <target name="-pre-init-libraries">
46+ <property location=".\lib\nblibraries.properties" name="libraries.path"/>
47+ <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
48+ <pathconvert dirsep="/" property="libraries.dir">
49+ <path path="${libraries.dir.nativedirsep}"/>
50+ </pathconvert>
51+ <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
52+ <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
53+ </target>
54+ <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
55+ <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
56+ <filterchain>
57+ <replacestring from="$${base}" to="${libraries.dir}"/>
58+ <escapeunicode/>
59+ </filterchain>
60+ </loadproperties>
61+ </target>
62+ <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
63+ <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
64+ <filterchain>
65+ <replacestring from="$${base}" to="${libraries.dir}"/>
66+ <escapeunicode/>
67+ </filterchain>
68+ </loadproperties>
69+ </target>
70+ <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
71+ <property file="${user.properties.file}"/>
72+ <!-- The two properties below are usually overridden -->
73+ <!-- by the active platform. Just a fallback. -->
74+ <property name="default.javac.source" value="1.4"/>
75+ <property name="default.javac.target" value="1.4"/>
76+ </target>
77+ <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
78+ <property file="nbproject/configs/${config}.properties"/>
79+ <property file="nbproject/project.properties"/>
80+ </target>
81+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
82+ <available file="${manifest.file}" property="manifest.available"/>
83+ <condition property="splashscreen.available">
84+ <and>
85+ <not>
86+ <equals arg1="${application.splash}" arg2="" trim="true"/>
87+ </not>
88+ <available file="${application.splash}"/>
89+ </and>
90+ </condition>
91+ <condition property="main.class.available">
92+ <and>
93+ <isset property="main.class"/>
94+ <not>
95+ <equals arg1="${main.class}" arg2="" trim="true"/>
96+ </not>
97+ </and>
98+ </condition>
99+ <condition property="manifest.available+main.class">
100+ <and>
101+ <isset property="manifest.available"/>
102+ <isset property="main.class.available"/>
103+ </and>
104+ </condition>
105+ <condition property="do.archive">
106+ <not>
107+ <istrue value="${jar.archive.disabled}"/>
108+ </not>
109+ </condition>
110+ <condition property="do.mkdist">
111+ <and>
112+ <isset property="do.archive"/>
113+ <isset property="libs.CopyLibs.classpath"/>
114+ <not>
115+ <istrue value="${mkdist.disabled}"/>
116+ </not>
117+ </and>
118+ </condition>
119+ <condition property="manifest.available+main.class+mkdist.available">
120+ <and>
121+ <istrue value="${manifest.available+main.class}"/>
122+ <isset property="do.mkdist"/>
123+ </and>
124+ </condition>
125+ <condition property="do.archive+manifest.available">
126+ <and>
127+ <isset property="manifest.available"/>
128+ <istrue value="${do.archive}"/>
129+ </and>
130+ </condition>
131+ <condition property="do.archive+main.class.available">
132+ <and>
133+ <isset property="main.class.available"/>
134+ <istrue value="${do.archive}"/>
135+ </and>
136+ </condition>
137+ <condition property="do.archive+splashscreen.available">
138+ <and>
139+ <isset property="splashscreen.available"/>
140+ <istrue value="${do.archive}"/>
141+ </and>
142+ </condition>
143+ <condition property="do.archive+manifest.available+main.class">
144+ <and>
145+ <istrue value="${manifest.available+main.class}"/>
146+ <istrue value="${do.archive}"/>
147+ </and>
148+ </condition>
149+ <condition property="manifest.available-mkdist.available">
150+ <or>
151+ <istrue value="${manifest.available}"/>
152+ <isset property="do.mkdist"/>
153+ </or>
154+ </condition>
155+ <condition property="manifest.available+main.class-mkdist.available">
156+ <or>
157+ <istrue value="${manifest.available+main.class}"/>
158+ <isset property="do.mkdist"/>
159+ </or>
160+ </condition>
161+ <condition property="have.tests">
162+ <or>
163+ <available file="${test.src.dir}"/>
164+ </or>
165+ </condition>
166+ <condition property="have.sources">
167+ <or>
168+ <available file="${src.src-stubs.dir}"/>
169+ <available file="${src.dir}"/>
170+ </or>
171+ </condition>
172+ <condition property="netbeans.home+have.tests">
173+ <and>
174+ <isset property="netbeans.home"/>
175+ <isset property="have.tests"/>
176+ </and>
177+ </condition>
178+ <condition property="no.javadoc.preview">
179+ <and>
180+ <isset property="javadoc.preview"/>
181+ <isfalse value="${javadoc.preview}"/>
182+ </and>
183+ </condition>
184+ <property name="run.jvmargs" value=""/>
185+ <property name="run.jvmargs.ide" value=""/>
186+ <property name="javac.compilerargs" value=""/>
187+ <property name="work.dir" value="${basedir}"/>
188+ <condition property="no.deps">
189+ <and>
190+ <istrue value="${no.dependencies}"/>
191+ </and>
192+ </condition>
193+ <property name="javac.debug" value="true"/>
194+ <property name="javadoc.preview" value="true"/>
195+ <property name="application.args" value=""/>
196+ <property name="source.encoding" value="${file.encoding}"/>
197+ <property name="runtime.encoding" value="${source.encoding}"/>
198+ <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
199+ <and>
200+ <isset property="javadoc.encoding"/>
201+ <not>
202+ <equals arg1="${javadoc.encoding}" arg2=""/>
203+ </not>
204+ </and>
205+ </condition>
206+ <property name="javadoc.encoding.used" value="${source.encoding}"/>
207+ <property name="includes" value="**"/>
208+ <property name="excludes" value=""/>
209+ <property name="do.depend" value="false"/>
210+ <condition property="do.depend.true">
211+ <istrue value="${do.depend}"/>
212+ </condition>
213+ <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
214+ <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
215+ <length length="0" string="${endorsed.classpath}" when="greater"/>
216+ </condition>
217+ <condition else="false" property="jdkBug6558476">
218+ <and>
219+ <matches pattern="1\.[56]" string="${java.specification.version}"/>
220+ <not>
221+ <os family="unix"/>
222+ </not>
223+ </and>
224+ </condition>
225+ <property name="javac.fork" value="${jdkBug6558476}"/>
226+ <property name="jar.index" value="false"/>
227+ <property name="jar.index.metainf" value="${jar.index}"/>
228+ <property name="copylibs.rebase" value="true"/>
229+ <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
230+ <condition property="junit.available">
231+ <or>
232+ <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
233+ <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
234+ </or>
235+ </condition>
236+ <condition property="testng.available">
237+ <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
238+ </condition>
239+ <condition property="junit+testng.available">
240+ <and>
241+ <istrue value="${junit.available}"/>
242+ <istrue value="${testng.available}"/>
243+ </and>
244+ </condition>
245+ <condition else="testng" property="testng.mode" value="mixed">
246+ <istrue value="${junit+testng.available}"/>
247+ </condition>
248+ <condition else="" property="testng.debug.mode" value="-mixed">
249+ <istrue value="${junit+testng.available}"/>
250+ </condition>
251+ </target>
252+ <target name="-post-init">
253+ <!-- Empty placeholder for easier customization. -->
254+ <!-- You can override this target in the ../build.xml file. -->
255+ </target>
256+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
257+ <fail unless="src.src-stubs.dir">Must set src.src-stubs.dir</fail>
258+ <fail unless="src.dir">Must set src.dir</fail>
259+ <fail unless="test.src.dir">Must set test.src.dir</fail>
260+ <fail unless="build.dir">Must set build.dir</fail>
261+ <fail unless="dist.dir">Must set dist.dir</fail>
262+ <fail unless="build.classes.dir">Must set build.classes.dir</fail>
263+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
264+ <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
265+ <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
266+ <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
267+ <fail unless="dist.jar">Must set dist.jar</fail>
268+ </target>
269+ <target name="-init-macrodef-property">
270+ <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
271+ <attribute name="name"/>
272+ <attribute name="value"/>
273+ <sequential>
274+ <property name="@{name}" value="${@{value}}"/>
275+ </sequential>
276+ </macrodef>
277+ </target>
278+ <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
279+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
280+ <attribute default="${src.src-stubs.dir}:${src.dir}" name="srcdir"/>
281+ <attribute default="${build.classes.dir}" name="destdir"/>
282+ <attribute default="${javac.classpath}" name="classpath"/>
283+ <attribute default="${javac.processorpath}" name="processorpath"/>
284+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
285+ <attribute default="${includes}" name="includes"/>
286+ <attribute default="${excludes}" name="excludes"/>
287+ <attribute default="${javac.debug}" name="debug"/>
288+ <attribute default="${empty.dir}" name="sourcepath"/>
289+ <attribute default="${empty.dir}" name="gensrcdir"/>
290+ <element name="customize" optional="true"/>
291+ <sequential>
292+ <property location="${build.dir}/empty" name="empty.dir"/>
293+ <mkdir dir="${empty.dir}"/>
294+ <mkdir dir="@{apgeneratedsrcdir}"/>
295+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
296+ <src>
297+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
298+ <include name="*"/>
299+ </dirset>
300+ </src>
301+ <classpath>
302+ <path path="@{classpath}"/>
303+ </classpath>
304+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
305+ <compilerarg line="${javac.compilerargs}"/>
306+ <compilerarg value="-processorpath"/>
307+ <compilerarg path="@{processorpath}:${empty.dir}"/>
308+ <compilerarg line="${ap.processors.internal}"/>
309+ <compilerarg line="${annotation.processing.processor.options}"/>
310+ <compilerarg value="-s"/>
311+ <compilerarg path="@{apgeneratedsrcdir}"/>
312+ <compilerarg line="${ap.proc.none.internal}"/>
313+ <customize/>
314+ </javac>
315+ </sequential>
316+ </macrodef>
317+ </target>
318+ <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
319+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
320+ <attribute default="${src.src-stubs.dir}:${src.dir}" name="srcdir"/>
321+ <attribute default="${build.classes.dir}" name="destdir"/>
322+ <attribute default="${javac.classpath}" name="classpath"/>
323+ <attribute default="${javac.processorpath}" name="processorpath"/>
324+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
325+ <attribute default="${includes}" name="includes"/>
326+ <attribute default="${excludes}" name="excludes"/>
327+ <attribute default="${javac.debug}" name="debug"/>
328+ <attribute default="${empty.dir}" name="sourcepath"/>
329+ <attribute default="${empty.dir}" name="gensrcdir"/>
330+ <element name="customize" optional="true"/>
331+ <sequential>
332+ <property location="${build.dir}/empty" name="empty.dir"/>
333+ <mkdir dir="${empty.dir}"/>
334+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
335+ <src>
336+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
337+ <include name="*"/>
338+ </dirset>
339+ </src>
340+ <classpath>
341+ <path path="@{classpath}"/>
342+ </classpath>
343+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
344+ <compilerarg line="${javac.compilerargs}"/>
345+ <customize/>
346+ </javac>
347+ </sequential>
348+ </macrodef>
349+ </target>
350+ <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
351+ <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
352+ <attribute default="${src.src-stubs.dir}:${src.dir}" name="srcdir"/>
353+ <attribute default="${build.classes.dir}" name="destdir"/>
354+ <attribute default="${javac.classpath}" name="classpath"/>
355+ <sequential>
356+ <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
357+ <classpath>
358+ <path path="@{classpath}"/>
359+ </classpath>
360+ </depend>
361+ </sequential>
362+ </macrodef>
363+ <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
364+ <attribute default="${build.classes.dir}" name="destdir"/>
365+ <sequential>
366+ <fail unless="javac.includes">Must set javac.includes</fail>
367+ <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
368+ <path>
369+ <filelist dir="@{destdir}" files="${javac.includes}"/>
370+ </path>
371+ <globmapper from="*.java" to="*.class"/>
372+ </pathconvert>
373+ <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
374+ <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
375+ <delete>
376+ <files includesfile="${javac.includesfile.binary}"/>
377+ </delete>
378+ <delete>
379+ <fileset file="${javac.includesfile.binary}"/>
380+ </delete>
381+ </sequential>
382+ </macrodef>
383+ </target>
384+ <target if="${junit.available}" name="-init-macrodef-junit-init">
385+ <condition else="false" property="nb.junit.batch" value="true">
386+ <and>
387+ <istrue value="${junit.available}"/>
388+ <not>
389+ <isset property="test.method"/>
390+ </not>
391+ </and>
392+ </condition>
393+ <condition else="false" property="nb.junit.single" value="true">
394+ <and>
395+ <istrue value="${junit.available}"/>
396+ <isset property="test.method"/>
397+ </and>
398+ </condition>
399+ </target>
400+ <target name="-init-test-properties">
401+ <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
402+ <property name="test.binarytestincludes" value=""/>
403+ <property name="test.binaryexcludes" value=""/>
404+ </target>
405+ <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
406+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
407+ <attribute default="${includes}" name="includes"/>
408+ <attribute default="${excludes}" name="excludes"/>
409+ <attribute default="**" name="testincludes"/>
410+ <attribute default="" name="testmethods"/>
411+ <element name="customize" optional="true"/>
412+ <sequential>
413+ <property name="junit.forkmode" value="perTest"/>
414+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
415+ <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
416+ <syspropertyset>
417+ <propertyref prefix="test-sys-prop."/>
418+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
419+ </syspropertyset>
420+ <formatter type="brief" usefile="false"/>
421+ <formatter type="xml"/>
422+ <jvmarg value="-ea"/>
423+ <customize/>
424+ </junit>
425+ </sequential>
426+ </macrodef>
427+ </target>
428+ <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
429+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
430+ <attribute default="${includes}" name="includes"/>
431+ <attribute default="${excludes}" name="excludes"/>
432+ <attribute default="**" name="testincludes"/>
433+ <attribute default="" name="testmethods"/>
434+ <element name="customize" optional="true"/>
435+ <sequential>
436+ <property name="junit.forkmode" value="perTest"/>
437+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
438+ <batchtest todir="${build.test.results.dir}">
439+ <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
440+ <filename name="@{testincludes}"/>
441+ </fileset>
442+ <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
443+ <filename name="${test.binarytestincludes}"/>
444+ </fileset>
445+ </batchtest>
446+ <syspropertyset>
447+ <propertyref prefix="test-sys-prop."/>
448+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
449+ </syspropertyset>
450+ <formatter type="brief" usefile="false"/>
451+ <formatter type="xml"/>
452+ <jvmarg value="-ea"/>
453+ <customize/>
454+ </junit>
455+ </sequential>
456+ </macrodef>
457+ </target>
458+ <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
459+ <target if="${testng.available}" name="-init-macrodef-testng">
460+ <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
461+ <attribute default="${includes}" name="includes"/>
462+ <attribute default="${excludes}" name="excludes"/>
463+ <attribute default="**" name="testincludes"/>
464+ <attribute default="" name="testmethods"/>
465+ <element name="customize" optional="true"/>
466+ <sequential>
467+ <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
468+ <isset property="test.method"/>
469+ </condition>
470+ <union id="test.set">
471+ <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
472+ <filename name="@{testincludes}"/>
473+ </fileset>
474+ </union>
475+ <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
476+ <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="TimeTracker" testname="TestNG tests" workingDir="${work.dir}">
477+ <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
478+ <propertyset>
479+ <propertyref prefix="test-sys-prop."/>
480+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
481+ </propertyset>
482+ <customize/>
483+ </testng>
484+ </sequential>
485+ </macrodef>
486+ </target>
487+ <target name="-init-macrodef-test-impl">
488+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
489+ <attribute default="${includes}" name="includes"/>
490+ <attribute default="${excludes}" name="excludes"/>
491+ <attribute default="**" name="testincludes"/>
492+ <attribute default="" name="testmethods"/>
493+ <element implicit="true" name="customize" optional="true"/>
494+ <sequential>
495+ <echo>No tests executed.</echo>
496+ </sequential>
497+ </macrodef>
498+ </target>
499+ <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
500+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
501+ <attribute default="${includes}" name="includes"/>
502+ <attribute default="${excludes}" name="excludes"/>
503+ <attribute default="**" name="testincludes"/>
504+ <attribute default="" name="testmethods"/>
505+ <element implicit="true" name="customize" optional="true"/>
506+ <sequential>
507+ <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
508+ <customize/>
509+ </j2seproject3:junit>
510+ </sequential>
511+ </macrodef>
512+ </target>
513+ <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
514+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
515+ <attribute default="${includes}" name="includes"/>
516+ <attribute default="${excludes}" name="excludes"/>
517+ <attribute default="**" name="testincludes"/>
518+ <attribute default="" name="testmethods"/>
519+ <element implicit="true" name="customize" optional="true"/>
520+ <sequential>
521+ <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
522+ <customize/>
523+ </j2seproject3:testng>
524+ </sequential>
525+ </macrodef>
526+ </target>
527+ <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
528+ <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
529+ <attribute default="${includes}" name="includes"/>
530+ <attribute default="${excludes}" name="excludes"/>
531+ <attribute default="**" name="testincludes"/>
532+ <attribute default="" name="testmethods"/>
533+ <sequential>
534+ <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
535+ <customize>
536+ <classpath>
537+ <path path="${run.test.classpath}"/>
538+ </classpath>
539+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
540+ <jvmarg line="${run.jvmargs}"/>
541+ <jvmarg line="${run.jvmargs.ide}"/>
542+ </customize>
543+ </j2seproject3:test-impl>
544+ </sequential>
545+ </macrodef>
546+ </target>
547+ <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
548+ <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
549+ <attribute default="${includes}" name="includes"/>
550+ <attribute default="${excludes}" name="excludes"/>
551+ <attribute default="**" name="testincludes"/>
552+ <attribute default="" name="testmethods"/>
553+ <element name="customize" optional="true"/>
554+ <sequential>
555+ <property name="junit.forkmode" value="perTest"/>
556+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
557+ <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
558+ <syspropertyset>
559+ <propertyref prefix="test-sys-prop."/>
560+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
561+ </syspropertyset>
562+ <formatter type="brief" usefile="false"/>
563+ <formatter type="xml"/>
564+ <jvmarg value="-ea"/>
565+ <jvmarg line="${debug-args-line}"/>
566+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
567+ <customize/>
568+ </junit>
569+ </sequential>
570+ </macrodef>
571+ </target>
572+ <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
573+ <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
574+ <attribute default="${includes}" name="includes"/>
575+ <attribute default="${excludes}" name="excludes"/>
576+ <attribute default="**" name="testincludes"/>
577+ <attribute default="" name="testmethods"/>
578+ <element name="customize" optional="true"/>
579+ <sequential>
580+ <property name="junit.forkmode" value="perTest"/>
581+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
582+ <batchtest todir="${build.test.results.dir}">
583+ <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
584+ <filename name="@{testincludes}"/>
585+ </fileset>
586+ <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
587+ <filename name="${test.binarytestincludes}"/>
588+ </fileset>
589+ </batchtest>
590+ <syspropertyset>
591+ <propertyref prefix="test-sys-prop."/>
592+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
593+ </syspropertyset>
594+ <formatter type="brief" usefile="false"/>
595+ <formatter type="xml"/>
596+ <jvmarg value="-ea"/>
597+ <jvmarg line="${debug-args-line}"/>
598+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
599+ <customize/>
600+ </junit>
601+ </sequential>
602+ </macrodef>
603+ </target>
604+ <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
605+ <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
606+ <attribute default="${includes}" name="includes"/>
607+ <attribute default="${excludes}" name="excludes"/>
608+ <attribute default="**" name="testincludes"/>
609+ <attribute default="" name="testmethods"/>
610+ <element implicit="true" name="customize" optional="true"/>
611+ <sequential>
612+ <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
613+ <customize/>
614+ </j2seproject3:junit-debug>
615+ </sequential>
616+ </macrodef>
617+ </target>
618+ <target if="${testng.available}" name="-init-macrodef-testng-debug">
619+ <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
620+ <attribute default="${main.class}" name="testClass"/>
621+ <attribute default="" name="testMethod"/>
622+ <element name="customize2" optional="true"/>
623+ <sequential>
624+ <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
625+ <isset property="test.method"/>
626+ </condition>
627+ <condition else="-suitename TimeTracker -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
628+ <matches pattern=".*\.xml" string="@{testClass}"/>
629+ </condition>
630+ <delete dir="${build.test.results.dir}" quiet="true"/>
631+ <mkdir dir="${build.test.results.dir}"/>
632+ <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
633+ <customize>
634+ <customize2/>
635+ <jvmarg value="-ea"/>
636+ <arg line="${testng.debug.mode}"/>
637+ <arg line="-d ${build.test.results.dir}"/>
638+ <arg line="-listener org.testng.reporters.VerboseReporter"/>
639+ <arg line="${testng.cmd.args}"/>
640+ </customize>
641+ </j2seproject3:debug>
642+ </sequential>
643+ </macrodef>
644+ </target>
645+ <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
646+ <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
647+ <attribute default="${main.class}" name="testClass"/>
648+ <attribute default="" name="testMethod"/>
649+ <element implicit="true" name="customize2" optional="true"/>
650+ <sequential>
651+ <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
652+ <customize2/>
653+ </j2seproject3:testng-debug>
654+ </sequential>
655+ </macrodef>
656+ </target>
657+ <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
658+ <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
659+ <attribute default="${includes}" name="includes"/>
660+ <attribute default="${excludes}" name="excludes"/>
661+ <attribute default="**" name="testincludes"/>
662+ <attribute default="" name="testmethods"/>
663+ <attribute default="${main.class}" name="testClass"/>
664+ <attribute default="" name="testMethod"/>
665+ <sequential>
666+ <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
667+ <customize>
668+ <classpath>
669+ <path path="${run.test.classpath}"/>
670+ </classpath>
671+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
672+ <jvmarg line="${run.jvmargs}"/>
673+ <jvmarg line="${run.jvmargs.ide}"/>
674+ </customize>
675+ </j2seproject3:test-debug-impl>
676+ </sequential>
677+ </macrodef>
678+ </target>
679+ <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
680+ <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
681+ <attribute default="${includes}" name="includes"/>
682+ <attribute default="${excludes}" name="excludes"/>
683+ <attribute default="**" name="testincludes"/>
684+ <attribute default="" name="testmethods"/>
685+ <attribute default="${main.class}" name="testClass"/>
686+ <attribute default="" name="testMethod"/>
687+ <sequential>
688+ <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
689+ <customize2>
690+ <syspropertyset>
691+ <propertyref prefix="test-sys-prop."/>
692+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
693+ </syspropertyset>
694+ </customize2>
695+ </j2seproject3:testng-debug-impl>
696+ </sequential>
697+ </macrodef>
698+ </target>
699+ <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
700+ <!--
701+ pre NB7.2 profiling section; consider it deprecated
702+ -->
703+ <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
704+ <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
705+ <!-- Empty placeholder for easier customization. -->
706+ <!-- You can override this target in the ../build.xml file. -->
707+ </target>
708+ <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
709+ <!-- Empty placeholder for easier customization. -->
710+ <!-- You can override this target in the ../build.xml file. -->
711+ </target>
712+ <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
713+ <macrodef name="resolve">
714+ <attribute name="name"/>
715+ <attribute name="value"/>
716+ <sequential>
717+ <property name="@{name}" value="${env.@{value}}"/>
718+ </sequential>
719+ </macrodef>
720+ <macrodef name="profile">
721+ <attribute default="${main.class}" name="classname"/>
722+ <element name="customize" optional="true"/>
723+ <sequential>
724+ <property environment="env"/>
725+ <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
726+ <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
727+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
728+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
729+ <jvmarg line="${profiler.info.jvmargs}"/>
730+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
731+ <arg line="${application.args}"/>
732+ <classpath>
733+ <path path="${run.classpath}"/>
734+ </classpath>
735+ <syspropertyset>
736+ <propertyref prefix="run-sys-prop."/>
737+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
738+ </syspropertyset>
739+ <customize/>
740+ </java>
741+ </sequential>
742+ </macrodef>
743+ </target>
744+ <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
745+ <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
746+ <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
747+ </target>
748+ <!--
749+ end of pre NB7.2 profiling section
750+ -->
751+ <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
752+ <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
753+ <attribute default="${main.class}" name="name"/>
754+ <attribute default="${debug.classpath}" name="classpath"/>
755+ <attribute default="" name="stopclassname"/>
756+ <sequential>
757+ <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
758+ <classpath>
759+ <path path="@{classpath}"/>
760+ </classpath>
761+ </nbjpdastart>
762+ </sequential>
763+ </macrodef>
764+ <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
765+ <attribute default="${build.classes.dir}" name="dir"/>
766+ <sequential>
767+ <nbjpdareload>
768+ <fileset dir="@{dir}" includes="${fix.classes}">
769+ <include name="${fix.includes}*.class"/>
770+ </fileset>
771+ </nbjpdareload>
772+ </sequential>
773+ </macrodef>
774+ </target>
775+ <target name="-init-debug-args">
776+ <property name="version-output" value="java version &quot;${ant.java.version}"/>
777+ <condition property="have-jdk-older-than-1.4">
778+ <or>
779+ <contains string="${version-output}" substring="java version &quot;1.0"/>
780+ <contains string="${version-output}" substring="java version &quot;1.1"/>
781+ <contains string="${version-output}" substring="java version &quot;1.2"/>
782+ <contains string="${version-output}" substring="java version &quot;1.3"/>
783+ </or>
784+ </condition>
785+ <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
786+ <istrue value="${have-jdk-older-than-1.4}"/>
787+ </condition>
788+ <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
789+ <os family="windows"/>
790+ </condition>
791+ <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
792+ <isset property="debug.transport"/>
793+ </condition>
794+ </target>
795+ <target depends="-init-debug-args" name="-init-macrodef-debug">
796+ <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
797+ <attribute default="${main.class}" name="classname"/>
798+ <attribute default="${debug.classpath}" name="classpath"/>
799+ <element name="customize" optional="true"/>
800+ <sequential>
801+ <java classname="@{classname}" dir="${work.dir}" fork="true">
802+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
803+ <jvmarg line="${debug-args-line}"/>
804+ <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
805+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
806+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
807+ <jvmarg line="${run.jvmargs}"/>
808+ <jvmarg line="${run.jvmargs.ide}"/>
809+ <classpath>
810+ <path path="@{classpath}"/>
811+ </classpath>
812+ <syspropertyset>
813+ <propertyref prefix="run-sys-prop."/>
814+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
815+ </syspropertyset>
816+ <customize/>
817+ </java>
818+ </sequential>
819+ </macrodef>
820+ </target>
821+ <target name="-init-macrodef-java">
822+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
823+ <attribute default="${main.class}" name="classname"/>
824+ <attribute default="${run.classpath}" name="classpath"/>
825+ <attribute default="jvm" name="jvm"/>
826+ <element name="customize" optional="true"/>
827+ <sequential>
828+ <java classname="@{classname}" dir="${work.dir}" fork="true">
829+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
830+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
831+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
832+ <jvmarg line="${run.jvmargs}"/>
833+ <jvmarg line="${run.jvmargs.ide}"/>
834+ <classpath>
835+ <path path="@{classpath}"/>
836+ </classpath>
837+ <syspropertyset>
838+ <propertyref prefix="run-sys-prop."/>
839+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
840+ </syspropertyset>
841+ <customize/>
842+ </java>
843+ </sequential>
844+ </macrodef>
845+ </target>
846+ <target name="-init-macrodef-copylibs">
847+ <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
848+ <attribute default="${manifest.file}" name="manifest"/>
849+ <element name="customize" optional="true"/>
850+ <sequential>
851+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
852+ <pathconvert property="run.classpath.without.build.classes.dir">
853+ <path path="${run.classpath}"/>
854+ <map from="${build.classes.dir.resolved}" to=""/>
855+ </pathconvert>
856+ <pathconvert pathsep=" " property="jar.classpath">
857+ <path path="${run.classpath.without.build.classes.dir}"/>
858+ <chainedmapper>
859+ <flattenmapper/>
860+ <filtermapper>
861+ <replacestring from=" " to="%20"/>
862+ </filtermapper>
863+ <globmapper from="*" to="lib/*"/>
864+ </chainedmapper>
865+ </pathconvert>
866+ <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
867+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
868+ <fileset dir="${build.classes.dir}"/>
869+ <manifest>
870+ <attribute name="Class-Path" value="${jar.classpath}"/>
871+ <customize/>
872+ </manifest>
873+ </copylibs>
874+ </sequential>
875+ </macrodef>
876+ </target>
877+ <target name="-init-presetdef-jar">
878+ <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
879+ <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
880+ <j2seproject1:fileset dir="${build.classes.dir}"/>
881+ </jar>
882+ </presetdef>
883+ </target>
884+ <target name="-init-ap-cmdline-properties">
885+ <property name="annotation.processing.enabled" value="true"/>
886+ <property name="annotation.processing.processors.list" value=""/>
887+ <property name="annotation.processing.processor.options" value=""/>
888+ <property name="annotation.processing.run.all.processors" value="true"/>
889+ <property name="javac.processorpath" value="${javac.classpath}"/>
890+ <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
891+ <condition property="ap.supported.internal" value="true">
892+ <not>
893+ <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
894+ </not>
895+ </condition>
896+ </target>
897+ <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
898+ <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
899+ <isfalse value="${annotation.processing.run.all.processors}"/>
900+ </condition>
901+ <condition else="" property="ap.proc.none.internal" value="-proc:none">
902+ <isfalse value="${annotation.processing.enabled}"/>
903+ </condition>
904+ </target>
905+ <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
906+ <property name="ap.cmd.line.internal" value=""/>
907+ </target>
908+ <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
909+ <!--
910+ ===================
911+ COMPILATION SECTION
912+ ===================
913+ -->
914+ <target name="-deps-jar-init" unless="built-jar.properties">
915+ <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
916+ <delete file="${built-jar.properties}" quiet="true"/>
917+ </target>
918+ <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
919+ <echo level="warn" message="Cycle detected: TimeTracker was already built"/>
920+ </target>
921+ <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
922+ <mkdir dir="${build.dir}"/>
923+ <touch file="${built-jar.properties}" verbose="false"/>
924+ <property file="${built-jar.properties}" prefix="already.built.jar."/>
925+ <antcall target="-warn-already-built-jar"/>
926+ <propertyfile file="${built-jar.properties}">
927+ <entry key="${basedir}" value=""/>
928+ </propertyfile>
929+ </target>
930+ <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
931+ <target depends="init" name="-check-automatic-build">
932+ <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
933+ </target>
934+ <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
935+ <antcall target="clean"/>
936+ </target>
937+ <target depends="init,deps-jar" name="-pre-pre-compile">
938+ <mkdir dir="${build.classes.dir}"/>
939+ </target>
940+ <target name="-pre-compile">
941+ <!-- Empty placeholder for easier customization. -->
942+ <!-- You can override this target in the ../build.xml file. -->
943+ </target>
944+ <target if="do.depend.true" name="-compile-depend">
945+ <pathconvert property="build.generated.subdirs">
946+ <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
947+ <include name="*"/>
948+ </dirset>
949+ </pathconvert>
950+ <j2seproject3:depend srcdir="${src.src-stubs.dir}:${src.dir}:${build.generated.subdirs}"/>
951+ </target>
952+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
953+ <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
954+ <copy todir="${build.classes.dir}">
955+ <fileset dir="${src.src-stubs.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
956+ <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
957+ </copy>
958+ </target>
959+ <target if="has.persistence.xml" name="-copy-persistence-xml">
960+ <mkdir dir="${build.classes.dir}/META-INF"/>
961+ <copy todir="${build.classes.dir}/META-INF">
962+ <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
963+ </copy>
964+ </target>
965+ <target name="-post-compile">
966+ <!-- Empty placeholder for easier customization. -->
967+ <!-- You can override this target in the ../build.xml file. -->
968+ </target>
969+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
970+ <target name="-pre-compile-single">
971+ <!-- Empty placeholder for easier customization. -->
972+ <!-- You can override this target in the ../build.xml file. -->
973+ </target>
974+ <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
975+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
976+ <j2seproject3:force-recompile/>
977+ <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.src-stubs.dir}:${src.dir}"/>
978+ </target>
979+ <target name="-post-compile-single">
980+ <!-- Empty placeholder for easier customization. -->
981+ <!-- You can override this target in the ../build.xml file. -->
982+ </target>
983+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
984+ <!--
985+ ====================
986+ JAR BUILDING SECTION
987+ ====================
988+ -->
989+ <target depends="init" name="-pre-pre-jar">
990+ <dirname file="${dist.jar}" property="dist.jar.dir"/>
991+ <mkdir dir="${dist.jar.dir}"/>
992+ </target>
993+ <target name="-pre-jar">
994+ <!-- Empty placeholder for easier customization. -->
995+ <!-- You can override this target in the ../build.xml file. -->
996+ </target>
997+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
998+ <j2seproject1:jar/>
999+ </target>
1000+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
1001+ <j2seproject1:jar manifest="${manifest.file}"/>
1002+ </target>
1003+ <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
1004+ <j2seproject1:jar manifest="${manifest.file}">
1005+ <j2seproject1:manifest>
1006+ <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
1007+ </j2seproject1:manifest>
1008+ </j2seproject1:jar>
1009+ <echo level="info">To run this application from the command line without Ant, try:</echo>
1010+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
1011+ <property location="${dist.jar}" name="dist.jar.resolved"/>
1012+ <pathconvert property="run.classpath.with.dist.jar">
1013+ <path path="${run.classpath}"/>
1014+ <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
1015+ </pathconvert>
1016+ <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
1017+ </target>
1018+ <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
1019+ <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
1020+ <touch file="${tmp.manifest.file}" verbose="false"/>
1021+ </target>
1022+ <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
1023+ <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
1024+ <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
1025+ </target>
1026+ <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
1027+ <manifest file="${tmp.manifest.file}" mode="update">
1028+ <attribute name="Main-Class" value="${main.class}"/>
1029+ </manifest>
1030+ </target>
1031+ <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
1032+ <basename file="${application.splash}" property="splashscreen.basename"/>
1033+ <mkdir dir="${build.classes.dir}/META-INF"/>
1034+ <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
1035+ <manifest file="${tmp.manifest.file}" mode="update">
1036+ <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
1037+ </manifest>
1038+ </target>
1039+ <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
1040+ <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
1041+ <echo level="info">To run this application from the command line without Ant, try:</echo>
1042+ <property location="${dist.jar}" name="dist.jar.resolved"/>
1043+ <echo level="info">java -jar "${dist.jar.resolved}"</echo>
1044+ </target>
1045+ <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
1046+ <delete>
1047+ <fileset file="${tmp.manifest.file}"/>
1048+ </delete>
1049+ </target>
1050+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
1051+ <target name="-post-jar">
1052+ <!-- Empty placeholder for easier customization. -->
1053+ <!-- You can override this target in the ../build.xml file. -->
1054+ </target>
1055+ <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
1056+ <!--
1057+ =================
1058+ EXECUTION SECTION
1059+ =================
1060+ -->
1061+ <target depends="init,compile" description="Run a main class." name="run">
1062+ <j2seproject1:java>
1063+ <customize>
1064+ <arg line="${application.args}"/>
1065+ </customize>
1066+ </j2seproject1:java>
1067+ </target>
1068+ <target name="-do-not-recompile">
1069+ <property name="javac.includes.binary" value=""/>
1070+ </target>
1071+ <target depends="init,compile-single" name="run-single">
1072+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1073+ <j2seproject1:java classname="${run.class}"/>
1074+ </target>
1075+ <target depends="init,compile-test-single" name="run-test-with-main">
1076+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1077+ <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
1078+ </target>
1079+ <!--
1080+ =================
1081+ DEBUGGING SECTION
1082+ =================
1083+ -->
1084+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
1085+ <j2seproject1:nbjpdastart name="${debug.class}"/>
1086+ </target>
1087+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
1088+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
1089+ </target>
1090+ <target depends="init,compile" name="-debug-start-debuggee">
1091+ <j2seproject3:debug>
1092+ <customize>
1093+ <arg line="${application.args}"/>
1094+ </customize>
1095+ </j2seproject3:debug>
1096+ </target>
1097+ <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
1098+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
1099+ <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
1100+ </target>
1101+ <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
1102+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
1103+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1104+ <j2seproject3:debug classname="${debug.class}"/>
1105+ </target>
1106+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
1107+ <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
1108+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
1109+ <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
1110+ </target>
1111+ <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
1112+ <target depends="init" name="-pre-debug-fix">
1113+ <fail unless="fix.includes">Must set fix.includes</fail>
1114+ <property name="javac.includes" value="${fix.includes}.java"/>
1115+ </target>
1116+ <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
1117+ <j2seproject1:nbjpdareload/>
1118+ </target>
1119+ <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
1120+ <!--
1121+ =================
1122+ PROFILING SECTION
1123+ =================
1124+ -->
1125+ <!--
1126+ pre NB7.2 profiler integration
1127+ -->
1128+ <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
1129+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1130+ <nbprofiledirect>
1131+ <classpath>
1132+ <path path="${run.classpath}"/>
1133+ </classpath>
1134+ </nbprofiledirect>
1135+ <profile/>
1136+ </target>
1137+ <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
1138+ <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
1139+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1140+ <nbprofiledirect>
1141+ <classpath>
1142+ <path path="${run.classpath}"/>
1143+ </classpath>
1144+ </nbprofiledirect>
1145+ <profile classname="${profile.class}"/>
1146+ </target>
1147+ <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
1148+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1149+ <nbprofiledirect>
1150+ <classpath>
1151+ <path path="${run.classpath}"/>
1152+ </classpath>
1153+ </nbprofiledirect>
1154+ <profile classname="sun.applet.AppletViewer">
1155+ <customize>
1156+ <arg value="${applet.url}"/>
1157+ </customize>
1158+ </profile>
1159+ </target>
1160+ <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
1161+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
1162+ <nbprofiledirect>
1163+ <classpath>
1164+ <path path="${run.test.classpath}"/>
1165+ </classpath>
1166+ </nbprofiledirect>
1167+ <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
1168+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
1169+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
1170+ <jvmarg line="${profiler.info.jvmargs}"/>
1171+ <test name="${profile.class}"/>
1172+ <classpath>
1173+ <path path="${run.test.classpath}"/>
1174+ </classpath>
1175+ <syspropertyset>
1176+ <propertyref prefix="test-sys-prop."/>
1177+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
1178+ </syspropertyset>
1179+ <formatter type="brief" usefile="false"/>
1180+ <formatter type="xml"/>
1181+ </junit>
1182+ </target>
1183+ <!--
1184+ end of pre NB72 profiling section
1185+ -->
1186+ <target if="netbeans.home" name="-profile-check">
1187+ <condition property="profiler.configured">
1188+ <or>
1189+ <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
1190+ <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
1191+ </or>
1192+ </condition>
1193+ </target>
1194+ <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
1195+ <startprofiler/>
1196+ <antcall target="run"/>
1197+ </target>
1198+ <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
1199+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1200+ <startprofiler/>
1201+ <antcall target="run-single"/>
1202+ </target>
1203+ <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
1204+ <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
1205+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1206+ <startprofiler/>
1207+ <antcall target="test-single"/>
1208+ </target>
1209+ <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
1210+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
1211+ <startprofiler/>
1212+ <antcal target="run-test-with-main"/>
1213+ </target>
1214+ <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
1215+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1216+ <startprofiler/>
1217+ <antcall target="run-applet"/>
1218+ </target>
1219+ <!--
1220+ ===============
1221+ JAVADOC SECTION
1222+ ===============
1223+ -->
1224+ <target depends="init" if="have.sources" name="-javadoc-build">
1225+ <mkdir dir="${dist.javadoc.dir}"/>
1226+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
1227+ <and>
1228+ <isset property="endorsed.classpath.cmd.line.arg"/>
1229+ <not>
1230+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
1231+ </not>
1232+ </and>
1233+ </condition>
1234+ <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
1235+ <classpath>
1236+ <path path="${javac.classpath}"/>
1237+ </classpath>
1238+ <fileset dir="${src.src-stubs.dir}" excludes="*.java,${excludes}" includes="${includes}">
1239+ <filename name="**/*.java"/>
1240+ </fileset>
1241+ <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
1242+ <filename name="**/*.java"/>
1243+ </fileset>
1244+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1245+ <include name="**/*.java"/>
1246+ <exclude name="*.java"/>
1247+ </fileset>
1248+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
1249+ </javadoc>
1250+ <copy todir="${dist.javadoc.dir}">
1251+ <fileset dir="${src.src-stubs.dir}" excludes="${excludes}" includes="${includes}">
1252+ <filename name="**/doc-files/**"/>
1253+ </fileset>
1254+ <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
1255+ <filename name="**/doc-files/**"/>
1256+ </fileset>
1257+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
1258+ <include name="**/doc-files/**"/>
1259+ </fileset>
1260+ </copy>
1261+ </target>
1262+ <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
1263+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
1264+ </target>
1265+ <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
1266+ <!--
1267+ =========================
1268+ TEST COMPILATION SECTION
1269+ =========================
1270+ -->
1271+ <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
1272+ <mkdir dir="${build.test.classes.dir}"/>
1273+ </target>
1274+ <target name="-pre-compile-test">
1275+ <!-- Empty placeholder for easier customization. -->
1276+ <!-- You can override this target in the ../build.xml file. -->
1277+ </target>
1278+ <target if="do.depend.true" name="-compile-test-depend">
1279+ <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
1280+ </target>
1281+ <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
1282+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
1283+ <copy todir="${build.test.classes.dir}">
1284+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1285+ </copy>
1286+ </target>
1287+ <target name="-post-compile-test">
1288+ <!-- Empty placeholder for easier customization. -->
1289+ <!-- You can override this target in the ../build.xml file. -->
1290+ </target>
1291+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
1292+ <target name="-pre-compile-test-single">
1293+ <!-- Empty placeholder for easier customization. -->
1294+ <!-- You can override this target in the ../build.xml file. -->
1295+ </target>
1296+ <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
1297+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
1298+ <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
1299+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
1300+ <copy todir="${build.test.classes.dir}">
1301+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
1302+ </copy>
1303+ </target>
1304+ <target name="-post-compile-test-single">
1305+ <!-- Empty placeholder for easier customization. -->
1306+ <!-- You can override this target in the ../build.xml file. -->
1307+ </target>
1308+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
1309+ <!--
1310+ =======================
1311+ TEST EXECUTION SECTION
1312+ =======================
1313+ -->
1314+ <target depends="init" if="have.tests" name="-pre-test-run">
1315+ <mkdir dir="${build.test.results.dir}"/>
1316+ </target>
1317+ <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
1318+ <j2seproject3:test testincludes="**/*Test.java"/>
1319+ </target>
1320+ <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
1321+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1322+ </target>
1323+ <target depends="init" if="have.tests" name="test-report"/>
1324+ <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
1325+ <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
1326+ <target depends="init" if="have.tests" name="-pre-test-run-single">
1327+ <mkdir dir="${build.test.results.dir}"/>
1328+ </target>
1329+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
1330+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
1331+ <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
1332+ </target>
1333+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
1334+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1335+ </target>
1336+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
1337+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
1338+ <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
1339+ <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1340+ <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
1341+ </target>
1342+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
1343+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
1344+ </target>
1345+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
1346+ <!--
1347+ =======================
1348+ TEST DEBUGGING SECTION
1349+ =======================
1350+ -->
1351+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
1352+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1353+ <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
1354+ </target>
1355+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
1356+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
1357+ <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
1358+ <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
1359+ </target>
1360+ <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
1361+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
1362+ </target>
1363+ <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
1364+ <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
1365+ <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
1366+ <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
1367+ </target>
1368+ <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
1369+ <!--
1370+ =========================
1371+ APPLET EXECUTION SECTION
1372+ =========================
1373+ -->
1374+ <target depends="init,compile-single" name="run-applet">
1375+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1376+ <j2seproject1:java classname="sun.applet.AppletViewer">
1377+ <customize>
1378+ <arg value="${applet.url}"/>
1379+ </customize>
1380+ </j2seproject1:java>
1381+ </target>
1382+ <!--
1383+ =========================
1384+ APPLET DEBUGGING SECTION
1385+ =========================
1386+ -->
1387+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
1388+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
1389+ <j2seproject3:debug classname="sun.applet.AppletViewer">
1390+ <customize>
1391+ <arg value="${applet.url}"/>
1392+ </customize>
1393+ </j2seproject3:debug>
1394+ </target>
1395+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
1396+ <!--
1397+ ===============
1398+ CLEANUP SECTION
1399+ ===============
1400+ -->
1401+ <target name="-deps-clean-init" unless="built-clean.properties">
1402+ <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
1403+ <delete file="${built-clean.properties}" quiet="true"/>
1404+ </target>
1405+ <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
1406+ <echo level="warn" message="Cycle detected: TimeTracker was already built"/>
1407+ </target>
1408+ <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
1409+ <mkdir dir="${build.dir}"/>
1410+ <touch file="${built-clean.properties}" verbose="false"/>
1411+ <property file="${built-clean.properties}" prefix="already.built.clean."/>
1412+ <antcall target="-warn-already-built-clean"/>
1413+ <propertyfile file="${built-clean.properties}">
1414+ <entry key="${basedir}" value=""/>
1415+ </propertyfile>
1416+ </target>
1417+ <target depends="init" name="-do-clean">
1418+ <delete dir="${build.dir}"/>
1419+ <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
1420+ </target>
1421+ <target name="-post-clean">
1422+ <!-- Empty placeholder for easier customization. -->
1423+ <!-- You can override this target in the ../build.xml file. -->
1424+ </target>
1425+ <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
1426+ <target name="-check-call-dep">
1427+ <property file="${call.built.properties}" prefix="already.built."/>
1428+ <condition property="should.call.dep">
1429+ <and>
1430+ <not>
1431+ <isset property="already.built.${call.subproject}"/>
1432+ </not>
1433+ <available file="${call.script}"/>
1434+ </and>
1435+ </condition>
1436+ </target>
1437+ <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
1438+ <ant antfile="${call.script}" inheritall="false" target="${call.target}">
1439+ <propertyset>
1440+ <propertyref prefix="transfer."/>
1441+ <mapper from="transfer.*" to="*" type="glob"/>
1442+ </propertyset>
1443+ </ant>
1444+ </target>
1445+</project>
--- manifest.mf (nonexistent)
+++ manifest.mf (revision 1)
@@ -0,0 +1,5 @@
1+Manifest-Version: 1.0
2+OmegaT-Plugin: true
3+
4+Name: org.omegat.plugin.timetracker.TimeTracker
5+OmegaT-Plugin: base
\ No newline at end of file
--- src/org/omegat/plugin/timetracker/VersionInfo.java (nonexistent)
+++ src/org/omegat/plugin/timetracker/VersionInfo.java (revision 1)
@@ -0,0 +1,36 @@
1+/**************************************************************************
2+ TimeTracker - allow project basis time tracking.
3+
4+ Copyright (C) 2013 Yu Tang
5+ Home page: http://sourceforge.jp/users/yu-tang/
6+ Support center: http://sourceforge.jp/users/yu-tang/
7+
8+ This file is part of plugin for OmegaT.
9+ http://www.omegat.org/
10+
11+ License: GNU GPL version 3 or (at your option) any later version.
12+
13+ You should have received a copy of the GNU General Public License
14+ along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ **************************************************************************/
16+
17+package org.omegat.plugin.timetracker;
18+
19+import javax.swing.JOptionPane;
20+
21+/**
22+ *
23+ * @author Yu-Tang
24+ */
25+public class VersionInfo {
26+
27+ private static final String APP_NAME = "TimeTracker";
28+ private static final String APP_VERSION = "0.0";
29+ private static final String APP_BUILD = "20131026";
30+ private static final String APP_AUTHOR = "Yu-Tang";
31+
32+ public static void main(String[] args) {
33+ JOptionPane.showMessageDialog(null,
34+ APP_NAME + " ver." + APP_VERSION + "." + APP_BUILD + "\nby " + APP_AUTHOR);
35+ }
36+}
--- src/org/omegat/plugin/timetracker/TimeTracker.java (nonexistent)
+++ src/org/omegat/plugin/timetracker/TimeTracker.java (revision 1)
@@ -0,0 +1,58 @@
1+/**************************************************************************
2+ TimeTracker - allow project basis time tracking.
3+
4+ Copyright (C) 2013 Yu Tang
5+ Home page: http://sourceforge.jp/users/yu-tang/
6+ Support center: http://sourceforge.jp/users/yu-tang/pf/
7+
8+ This file is part of plugin for OmegaT.
9+ http://www.omegat.org/
10+
11+ License: GNU GPL version 3 or (at your option) any later version.
12+
13+ You should have received a copy of the GNU General Public License
14+ along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ **************************************************************************/
16+
17+package org.omegat.plugin.timetracker;
18+
19+import org.omegat.core.CoreEvents;
20+import org.omegat.core.events.IApplicationEventListener;
21+import org.omegat.core.events.IProjectEventListener;
22+import org.omegat.core.events.IProjectEventListener.PROJECT_CHANGE_TYPE.*;
23+
24+/**
25+ * allow project basis time tracking
26+ *
27+ * @author Yu Tang
28+ */
29+public class TimeTracker implements IApplicationEventListener, IProjectEventListener {
30+
31+ @SuppressWarnings("LeakingThisInConstructor")
32+ public TimeTracker() {
33+ CoreEvents.registerApplicationEventListener(this);
34+ CoreEvents.registerProjectChangeListener(this);
35+ }
36+
37+ @Override
38+ public void onApplicationStartup() {
39+ // do some stuff
40+ }
41+
42+ @Override
43+ public void onApplicationShutdown() { /* do nothing */ }
44+
45+ @Override
46+ public void onProjectChanged(PROJECT_CHANGE_TYPE eventType) {
47+ switch (eventType) {
48+ case CREATE:
49+ case LOAD:
50+ // do some stuff
51+ break;
52+ case CLOSE:
53+ // do some stuff
54+ break;
55+ }
56+ }
57+
58+}
\ No newline at end of file
--- build.xml (nonexistent)
+++ build.xml (revision 1)
@@ -0,0 +1,74 @@
1+<?xml version="1.0" encoding="UTF-8"?>
2+<!-- You may freely edit this file. See commented blocks below for -->
3+<!-- some examples of how to customize the build. -->
4+<!-- (If you delete it and reopen the project it will be recreated.) -->
5+<!-- By default, only the Clean and Build commands use this build script. -->
6+<!-- Commands such as Run, Debug, and Test only use this build script if -->
7+<!-- the Compile on Save feature is turned off for the project. -->
8+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
9+<!-- in the project's Project Properties dialog box.-->
10+<project name="TimeTracker" default="default" basedir=".">
11+ <description>Builds, tests, and runs the project TimeTracker.</description>
12+ <import file="nbproject/build-impl.xml"/>
13+ <!--
14+
15+ There exist several targets which are by default empty and which can be
16+ used for execution of your tasks. These targets are usually executed
17+ before and after some main targets. They are:
18+
19+ -pre-init: called before initialization of project properties
20+ -post-init: called after initialization of project properties
21+ -pre-compile: called before javac compilation
22+ -post-compile: called after javac compilation
23+ -pre-compile-single: called before javac compilation of single file
24+ -post-compile-single: called after javac compilation of single file
25+ -pre-compile-test: called before javac compilation of JUnit tests
26+ -post-compile-test: called after javac compilation of JUnit tests
27+ -pre-compile-test-single: called before javac compilation of single JUnit test
28+ -post-compile-test-single: called after javac compilation of single JUunit test
29+ -pre-jar: called before JAR building
30+ -post-jar: called after JAR building
31+ -post-clean: called after cleaning build products
32+
33+ (Targets beginning with '-' are not intended to be called on their own.)
34+
35+ Example of inserting an obfuscator after compilation could look like this:
36+
37+ <target name="-post-compile">
38+ <obfuscate>
39+ <fileset dir="${build.classes.dir}"/>
40+ </obfuscate>
41+ </target>
42+
43+ For list of available properties check the imported
44+ nbproject/build-impl.xml file.
45+
46+
47+ Another way to customize the build is by overriding existing main targets.
48+ The targets of interest are:
49+
50+ -init-macrodef-javac: defines macro for javac compilation
51+ -init-macrodef-junit: defines macro for junit execution
52+ -init-macrodef-debug: defines macro for class debugging
53+ -init-macrodef-java: defines macro for class execution
54+ -do-jar-with-manifest: JAR building (if you are using a manifest)
55+ -do-jar-without-manifest: JAR building (if you are not using a manifest)
56+ run: execution of project
57+ -javadoc-build: Javadoc generation
58+ test-report: JUnit report generation
59+
60+ An example of overriding the target for project execution could look like this:
61+
62+ <target name="run" depends="OmegaT-plugins-TimeTracker-impl.jar">
63+ <exec dir="bin" executable="launcher.exe">
64+ <arg file="${dist.jar}"/>
65+ </exec>
66+ </target>
67+
68+ Notice that the overridden target depends on the jar target and not only on
69+ the compile target as the regular run target does. Again, for a list of available
70+ properties which you can use, check the target you are overriding in the
71+ nbproject/build-impl.xml file.
72+
73+ -->
74+</project>