[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qsos-commits] qsos/apps/JQEditor LICENSE lib/LibQSOS.jar lib/...
From: |
Goneri Le Bouder |
Subject: |
[Qsos-commits] qsos/apps/JQEditor LICENSE lib/LibQSOS.jar lib/... |
Date: |
Fri, 16 Jun 2006 14:16:48 -0000 |
CVSROOT: /sources/qsos
Module name: qsos
Changes by: Goneri Le Bouder <goneri> 06/06/16 14:16:35
Added files:
apps/JQEditor : LICENSE
apps/JQEditor/lib: LibQSOS.jar gnujaxp.jar jcommon-1.0.0.jar
jdom.jar jfreechart-1.0.1.jar junit.jar
org.eclipse.core.runtime_3.1.2.jar
org.eclipse.jface.text_3.1.2.jar
org.eclipse.jface_3.1.1.jar
org.eclipse.osgi_3.1.2.jar
org.eclipse.swt.win32.win32.x86_3.1.2.jar
org.eclipse.swt_3.1.0.jar
org.eclipse.text_3.1.1.jar
org.eclipse.ui.workbench_3.1.2.jar
apps/JQEditor/share: Image_QSOS_200.png
apps/JQEditor/share/icons: Thumbs.db open_folder_24.ico
penguin_alone.bmp
penguin_alone_QSOS_16.png printer.png
reinitialize.png save.png
special_display.png
apps/JQEditor/share/radar: radar4.png radar5.png radar6.png
radar7.png
apps/JQEditor/src/org/qsos/action: OpenSheetAction.java
PrintAction.java
RadarAction.java
ReinitializeFieldsAction.java
SaveSheetAction.java
apps/JQEditor/src/org/qsos/data: ImageRegistryQSOS.java
JQConst.java Messages.java
messages.properties
messagesESP.properties
messagesFR.properties
apps/JQEditor/src/org/qsos/interfaces: RadarDialog.java
ReInitializeDialog.java
SheetCTabItem.java
SheetCellModifier.java
SheetTableTreeContentProvider.java
SheetTableTreeLabelProvider.java
SheetTreeContentProvider.java
SheetTreeLabelProvider.java
apps/JQEditor/src/org/qsos/main: JQ.java
apps/JQEditor/src/org/qsos/radar: GenerateRadar.java
MyFilter.java
SheetCheckContentProvider.java
SheetCheckLabelProvider.java
Log message:
import of the project form JQEditor
A QSOS editor from the ESME SUDRIA ( www.esme.fr ) based on the QSOS
java lib
Authors:
BOUCHER Nicolas <address@hidden>
MODELIN Maxence <address@hidden>
MULOT Louis <address@hidden>
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/LICENSE?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/LibQSOS.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/gnujaxp.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/jcommon-1.0.0.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/jdom.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/jfreechart-1.0.1.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/junit.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.core.runtime_3.1.2.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.jface.text_3.1.2.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.jface_3.1.1.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.osgi_3.1.2.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.swt.win32.win32.x86_3.1.2.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.swt_3.1.0.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.text_3.1.1.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/lib/org.eclipse.ui.workbench_3.1.2.jar?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/Image_QSOS_200.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/Thumbs.db?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/open_folder_24.ico?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/penguin_alone.bmp?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/penguin_alone_QSOS_16.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/printer.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/reinitialize.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/save.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/icons/special_display.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/radar/radar4.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/radar/radar5.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/radar/radar6.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/share/radar/radar7.png?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/action/OpenSheetAction.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/action/PrintAction.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/action/RadarAction.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/action/ReinitializeFieldsAction.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/action/SaveSheetAction.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/ImageRegistryQSOS.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/JQConst.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/Messages.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/messages.properties?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/messagesESP.properties?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/data/messagesFR.properties?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/RadarDialog.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/ReInitializeDialog.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetCTabItem.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetCellModifier.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetTableTreeContentProvider.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetTableTreeLabelProvider.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetTreeContentProvider.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/interfaces/SheetTreeLabelProvider.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/main/JQ.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/radar/GenerateRadar.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/radar/MyFilter.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/radar/SheetCheckContentProvider.java?cvsroot=qsos&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/JQEditor/src/org/qsos/radar/SheetCheckLabelProvider.java?cvsroot=qsos&rev=1.1
Patches:
Index: LICENSE
===================================================================
RCS file: LICENSE
diff -N LICENSE
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LICENSE 16 Jun 2006 14:16:34 -0000 1.1
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: lib/LibQSOS.jar
===================================================================
RCS file: lib/LibQSOS.jar
diff -N lib/LibQSOS.jar
Binary files /dev/null and /tmp/cvsIlRfgS differ
Index: lib/gnujaxp.jar
===================================================================
RCS file: lib/gnujaxp.jar
diff -N lib/gnujaxp.jar
Binary files /dev/null and /tmp/cvsTTpiOS differ
Index: lib/jcommon-1.0.0.jar
===================================================================
RCS file: lib/jcommon-1.0.0.jar
diff -N lib/jcommon-1.0.0.jar
Binary files /dev/null and /tmp/cvs4FYJpR differ
Index: lib/jdom.jar
===================================================================
RCS file: lib/jdom.jar
diff -N lib/jdom.jar
Binary files /dev/null and /tmp/cvsvwLUSU differ
Index: lib/jfreechart-1.0.1.jar
===================================================================
RCS file: lib/jfreechart-1.0.1.jar
diff -N lib/jfreechart-1.0.1.jar
Binary files /dev/null and /tmp/cvsf0DWFV differ
Index: lib/junit.jar
===================================================================
RCS file: lib/junit.jar
diff -N lib/junit.jar
Binary files /dev/null and /tmp/cvsScrPYX differ
Index: lib/org.eclipse.core.runtime_3.1.2.jar
===================================================================
RCS file: lib/org.eclipse.core.runtime_3.1.2.jar
diff -N lib/org.eclipse.core.runtime_3.1.2.jar
Binary files /dev/null and /tmp/cvsf2SnFW differ
Index: lib/org.eclipse.jface.text_3.1.2.jar
===================================================================
RCS file: lib/org.eclipse.jface.text_3.1.2.jar
diff -N lib/org.eclipse.jface.text_3.1.2.jar
Binary files /dev/null and /tmp/cvs0xXig0 differ
Index: lib/org.eclipse.jface_3.1.1.jar
===================================================================
RCS file: lib/org.eclipse.jface_3.1.1.jar
diff -N lib/org.eclipse.jface_3.1.1.jar
Binary files /dev/null and /tmp/cvsbV21k2 differ
Index: lib/org.eclipse.osgi_3.1.2.jar
===================================================================
RCS file: lib/org.eclipse.osgi_3.1.2.jar
diff -N lib/org.eclipse.osgi_3.1.2.jar
Binary files /dev/null and /tmp/cvs6eeqO1 differ
Index: lib/org.eclipse.swt.win32.win32.x86_3.1.2.jar
===================================================================
RCS file: lib/org.eclipse.swt.win32.win32.x86_3.1.2.jar
diff -N lib/org.eclipse.swt.win32.win32.x86_3.1.2.jar
Binary files /dev/null and /tmp/cvsDlr6G3 differ
Index: lib/org.eclipse.swt_3.1.0.jar
===================================================================
RCS file: lib/org.eclipse.swt_3.1.0.jar
diff -N lib/org.eclipse.swt_3.1.0.jar
Binary files /dev/null and /tmp/cvscuRBG6 differ
Index: lib/org.eclipse.text_3.1.1.jar
===================================================================
RCS file: lib/org.eclipse.text_3.1.1.jar
diff -N lib/org.eclipse.text_3.1.1.jar
Binary files /dev/null and /tmp/cvsR1IoL9 differ
Index: lib/org.eclipse.ui.workbench_3.1.2.jar
===================================================================
RCS file: lib/org.eclipse.ui.workbench_3.1.2.jar
diff -N lib/org.eclipse.ui.workbench_3.1.2.jar
Binary files /dev/null and /tmp/cvsyk8Ci8 differ
Index: share/Image_QSOS_200.png
===================================================================
RCS file: share/Image_QSOS_200.png
diff -N share/Image_QSOS_200.png
Binary files /dev/null and /tmp/cvsxMNpif differ
Index: share/icons/Thumbs.db
===================================================================
RCS file: share/icons/Thumbs.db
diff -N share/icons/Thumbs.db
Binary files /dev/null and /tmp/cvsNOFrTd differ
Index: share/icons/open_folder_24.ico
===================================================================
RCS file: share/icons/open_folder_24.ico
diff -N share/icons/open_folder_24.ico
Binary files /dev/null and /tmp/cvsoL8YYg differ
Index: share/icons/penguin_alone.bmp
===================================================================
RCS file: share/icons/penguin_alone.bmp
diff -N share/icons/penguin_alone.bmp
Binary files /dev/null and /tmp/cvsZYoNJh differ
Index: share/icons/penguin_alone_QSOS_16.png
===================================================================
RCS file: share/icons/penguin_alone_QSOS_16.png
diff -N share/icons/penguin_alone_QSOS_16.png
Binary files /dev/null and /tmp/cvsKkAkjg differ
Index: share/icons/printer.png
===================================================================
RCS file: share/icons/printer.png
diff -N share/icons/printer.png
Binary files /dev/null and /tmp/cvsQCD5qj differ
Index: share/icons/reinitialize.png
===================================================================
RCS file: share/icons/reinitialize.png
diff -N share/icons/reinitialize.png
Binary files /dev/null and /tmp/cvsKEUIQa differ
Index: share/icons/save.png
===================================================================
RCS file: share/icons/save.png
diff -N share/icons/save.png
Binary files /dev/null and /tmp/cvsDYyVBb differ
Index: share/icons/special_display.png
===================================================================
RCS file: share/icons/special_display.png
diff -N share/icons/special_display.png
Binary files /dev/null and /tmp/cvswiO729 differ
Index: share/radar/radar4.png
===================================================================
RCS file: share/radar/radar4.png
diff -N share/radar/radar4.png
Binary files /dev/null and /tmp/cvsRG3WMa differ
Index: share/radar/radar5.png
===================================================================
RCS file: share/radar/radar5.png
diff -N share/radar/radar5.png
Binary files /dev/null and /tmp/cvsgRSQ5d differ
Index: share/radar/radar6.png
===================================================================
RCS file: share/radar/radar6.png
diff -N share/radar/radar6.png
Binary files /dev/null and /tmp/cvsRhOhxc differ
Index: share/radar/radar7.png
===================================================================
RCS file: share/radar/radar7.png
diff -N share/radar/radar7.png
Binary files /dev/null and /tmp/cvskmDEPf differ
Index: src/org/qsos/action/OpenSheetAction.java
===================================================================
RCS file: src/org/qsos/action/OpenSheetAction.java
diff -N src/org/qsos/action/OpenSheetAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/action/OpenSheetAction.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,131 @@
+/*
+** $Id: OpenSheetAction.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+/**
+ * This class represents the Action for open a new sheet
+ *
+ * <br>
+ * <br>
+ * first step:
+ * <br>open filedialog to choose the file to open
+ *
+ * <br><br>second step:
+ * <br>Find the os of the machine
+ *
+ * <br><br>Third step:
+ * <br>Set the root of the file dialog box
+ */
+package org.qsos.action;
+
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.qsos.data.Messages;
+import org.qsos.main.JQ;
+
+
+/**
+ * This class represents the Action for open a new sheet
+ *
+ * <br>
+ * <br>
+ * first step:
+ * <br>open filedialog to choose the file to open
+ *
+ * <br><br>second step:
+ * <br>Find the os of the machine
+ *
+ * <br><br>Third step:
+ * <br>Set the root of the file dialog box
+ */
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class OpenSheetAction extends Action
+{
+
+
+ JQ window;
+
+ /**
+ * @param w
+ */
+ public OpenSheetAction(JQ w)
+ {
+ /**
+ * @param : window
+ *
+ */
+ window = w;
+ setText("address@hidden"); //$NON-NLS-1$
+
setToolTipText(Messages.getString("OpenSheetAction.toolTipTextOpen"));
//$NON-NLS-1$
+ setImageDescriptor(
ImageDescriptor.createFromFile(null,"images/icons/open_folder_24.ico"));
//$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run()
+ {
+
+ FileDialog filedialog;
+ Shell shell = new Shell();
+ filedialog = new FileDialog( shell , SWT.OPEN);
+ filedialog.setFilterExtensions(new
String[]{"*.qsos","*.xml","*.*"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String adress = filedialog.open();
+
+ if ( adress != null)
+ {
+ String os =
System.getProperties().getProperty("os.name"); //$NON-NLS-1$
+
+ if(os.startsWith("Windows")) //$NON-NLS-1$
+ {
+ adress = "file:///" + adress; //$NON-NLS-1$
+ }
+ else if(os.startsWith("Linux")) //$NON-NLS-1$
+ {
+ adress = "file://" + adress; //$NON-NLS-1$
+ }
+ else
+ {
+ //others OS like Mac
+ // We must determine the adress mode of URL
+ }
+ }
+ if (adress != null)
+ {
+ window.openSheet(adress);
+ }
+
+ }
+}
Index: src/org/qsos/action/PrintAction.java
===================================================================
RCS file: src/org/qsos/action/PrintAction.java
diff -N src/org/qsos/action/PrintAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/action/PrintAction.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,290 @@
+/*
+** $Id: PrintAction.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.action;
+
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.printing.PrintDialog;
+import org.eclipse.swt.printing.Printer;
+import org.eclipse.swt.printing.PrinterData;
+import org.qsos.data.IElement;
+import org.qsos.data.Messages;
+import org.qsos.interfaces.SheetCTabItem;
+import org.qsos.main.JQ;
+
+/**
+ * This class represents the Action to print a Qsos sheet on a paper
+ *
+ *
+ * <br>
+ * first step:
+ * <br>open print dialog box to choose the printer
+ *
+ * <br><br>second step:
+ * <br>Start the printing job
+ *
+ * <br><br>Third step:
+ * <br>find the better render
+ */
+
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class PrintAction extends Action
+{
+ JQ window;
+
+ /**
+ * @param w
+ */
+ public PrintAction(JQ w)
+ {
+
+ window = w;
+
+ setText("address@hidden"); //$NON-NLS-1$
+
setToolTipText(Messages.getString("PrintAction.toolTipTextPrint"));
//$NON-NLS-1$
+ setImageDescriptor(
ImageDescriptor.createFromFile(null,"images/icons/printer.png")); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run()
+ {
+
+ final PrintDialog print_dialog = new
PrintDialog(window.getShell());
+
+ window.getCTabFolder().getItemCount();
+
+ if(window.getCTabFolder().getItemCount() != 0)
+ {
+ // Open the printer dialog box
+ PrinterData printerData = print_dialog.open();
+
+ if (printerData != null)
+ {
+ // Get the characters of the sheet to print
+ String
text=((IElement)((SheetCTabItem)window.getCTabFolder().getSelection()).getSaveLibQSOS().getSheet().getRoot()).tree();
+
+ if (print_dialog != null)
+ {
+ // Create the printer
+ Printer printer = new
Printer(printerData);
+ String fileName="Qsos report";
//$NON-NLS-1$
+
+ // Print the contents of the file
+ new WrappingPrinter(printer, fileName,
text).print();
+
+ // Dispose the printer
+ printer.dispose();
+ }
+ }
+ }
+ else
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("PrintAction.error"),Messages.getString("PrintAction.errorMessage"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+}
+
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+class WrappingPrinter
+{
+ private Printer printer; // The printer
+ private String fileName; // The name of the file to print
+ private GC gc; // The GC to print on
+ private String contents; // The contents of the file to print
+ private int xPos, yPos; // The current x and y locations for print
+ private Rectangle bounds; // The boundaries for the print
+ private StringBuffer buf; // Holds a word at a time
+ private int lineHeight; // The height of a line of text
+
+ /**
+ * WrappingPrinter constructor
+ * @param printer the printer
+ * @param fileName the fileName
+ * @param text the contents
+ */
+
+ // Constructor of the class
+ WrappingPrinter(Printer printer, String fileName, String text)
+ {
+ this.printer = printer;
+ this.fileName = fileName;
+ this.contents = text;
+ }
+
+ /**
+ * Method print()
+ *
+ * Start the print job and perform the format
+ *
+ */
+ void print()
+ {
+ // Start the print job
+ if (printer.startJob(fileName))
+ {
+ // Determine print area, with margins
+ bounds = computePrintArea(printer);
+ xPos = bounds.x;
+ yPos = bounds.y;
+
+ // Create the GC
+ gc = new GC(printer);
+
+ // Determine line height
+ lineHeight = gc.getFontMetrics().getHeight();
+
+ // Determine tab width--use three spaces for tabs
+ int tabWidth = gc.stringExtent(" ").x; //$NON-NLS-1$
+
+ // Print the text
+ printer.startPage();
+ buf = new StringBuffer();
+ char c;
+ for (int i = 0, n = contents.length(); i < n; i++)
+ {
+ // Get the next character
+ c = contents.charAt(i);
+
+ // Check for newline
+ if (c == '\n')
+ {
+ printBuffer();
+ printNewline();
+ }
+ // Check for tab
+ else if (c == '\t')
+ {
+ xPos += tabWidth;
+ }
+ else
+ {
+ buf.append(c);
+ // Check for space
+ if (Character.isWhitespace(c))
+ {
+ printBuffer();
+ }
+ }
+ }
+ printer.endPage();
+ printer.endJob();
+ gc.dispose();
+ }
+ }
+
+ /**
+ * Method printBuffer()
+ *
+ * Buffer allow good presentation of the final render
+ *
+ */
+ void printBuffer()
+ {
+ // Get the width of the rendered buffer
+ int width = gc.stringExtent(buf.toString()).x;
+
+ // Determine if it fits
+ if (xPos + width > bounds.x + bounds.width)
+ {
+ // Doesn't fit--wrap
+ printNewline();
+ }
+ // Print the buffer
+ gc.drawString(buf.toString(), xPos, yPos, false);
+ xPos += width;
+ buf.setLength(0);
+ }
+
+ /**
+ * Method printNewliner()
+ *
+ * Prints a newline
+ */
+ void printNewline()
+ {
+ // Reset x and y locations to next line
+ xPos = bounds.x;
+ yPos += lineHeight;
+
+ // Have we gone to the next page?
+ if (yPos > bounds.y + bounds.height)
+ {
+ yPos = bounds.y;
+ printer.endPage();
+ printer.startPage();
+ }
+ }
+
+ /**
+ * @param printer
+ * @return rectangle
+ */
+ Rectangle computePrintArea(Printer printer)
+ {
+ // Get the printable area
+ Rectangle rect = printer.getClientArea();
+
+ // Compute the trim
+ Rectangle trim = printer.computeTrim(0, 0, 0, 0);
+
+ // Get the printer's DPI
+ Point dpi = printer.getDPI();
+
+ // Calculate the printable area, using 1 inch margins
+ int left = trim.x + dpi.x;
+ if (left < rect.x) left = rect.x;
+
+ int right = (rect.width + trim.x + trim.width) - dpi.x;
+ if (right > rect.width) right = rect.width;
+
+ int top = trim.y + dpi.y;
+ if (top < rect.y) top = rect.y;
+
+ int bottom = (rect.height + trim.y + trim.height) - dpi.y;
+ if (bottom > rect.height) bottom = rect.height;
+
+ return new Rectangle(left, top, right - left, bottom - top);
+ }
+};
Index: src/org/qsos/action/RadarAction.java
===================================================================
RCS file: src/org/qsos/action/RadarAction.java
diff -N src/org/qsos/action/RadarAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/action/RadarAction.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,76 @@
+/*
+** $Id: RadarAction.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.action;
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.qsos.data.Messages;
+import org.qsos.interfaces.RadarDialog;
+import org.qsos.main.JQ;
+
+/**
+ * @author MODELIN
+ *
+ * This class represents the Action to open the radar dialog box
+ *
+ */
+public class RadarAction extends Action
+{
+ JQ window;
+
+ /**
+ * @param w
+ */
+ public RadarAction(JQ w)
+ {
+ window = w;
+
+ setText("address@hidden"); //$NON-NLS-1$
+
setToolTipText(Messages.getString("RadarAction.toolTipTextRadar"));
//$NON-NLS-1$
+ setImageDescriptor(
ImageDescriptor.createFromFile(null,"images/icons/special_display.png"));
//$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run()
+ {
+ if ( window.getCTabFolder().getItemCount() > 0)
+ {
+ RadarDialog radar = new
RadarDialog(window.getShell(),window);
+ radar.run();
+ }
+ else
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("RadarAction.errorRadar"),Messages.getString("RadarAction.errorMessageRadar"));
//$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+ }
+}
+
Index: src/org/qsos/action/ReinitializeFieldsAction.java
===================================================================
RCS file: src/org/qsos/action/ReinitializeFieldsAction.java
diff -N src/org/qsos/action/ReinitializeFieldsAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/action/ReinitializeFieldsAction.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,129 @@
+/*
+** $Id: ReinitializeFieldsAction.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.action;
+
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+import org.qsos.data.Messages;
+import org.qsos.interfaces.ReInitializeDialog;
+import org.qsos.interfaces.SheetCTabItem;
+import org.qsos.main.JQ;
+
+/**
+ * This class represents the Action to reinitialize a Qsos sheet
+ *
+ *
+ * <br>
+ * first step:
+ * <br>check the fields to reinitialize
+ *
+ * <br><br>second step:
+ * <br>each line of the sheet is test to be reinitialize
+ *
+ */
+
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class ReinitializeFieldsAction extends Action
+{
+ JQ window;
+
+ /**
+ * @param w
+ */
+ public ReinitializeFieldsAction(JQ w)
+ {
+
+ window = w;
+
+ setText("address@hidden"); //$NON-NLS-1$
+
setToolTipText(Messages.getString("ReinitializeFieldsAction.toolTipTextReInitialize"));
//$NON-NLS-1$
+
+ setImageDescriptor(
ImageDescriptor.createFromFile(null,"images/icons/reinitialize.png"));
//$NON-NLS-1$
+ //setImageDescriptor(
ImageDescriptor.createFromURL(getClass().getResource("/images/icons/reinitialize.png")));
+
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run()
+ {
+
+ if (window.getCTabFolder().getItemCount() > 0)
+ {
+
+
+ ReInitializeDialog reInitializeDialog = new
ReInitializeDialog(window.getShell());
+
+
+ boolean[] answer = reInitializeDialog.run();
+
+ if (answer[0]||answer[1]||answer[2])
+ {
+ String answerUser =
Messages.getString("ReinitializeFieldsAction.confirmationQuestion");
//$NON-NLS-1$
+ if (answer[0])
+ {
+ answerUser = answerUser +"\n\t> Score";
+ }
+ if (answer[1])
+ {
+ answerUser = answerUser + "\n\t>
Comment";
+ }
+ if (answer[2])
+ {
+ answerUser = answerUser + "\n\t>
Header";
+ }
+
+ boolean areYouSure =
MessageDialog.openQuestion(window.getShell(),Messages.getString("ReinitializeFieldsAction.confirmation"),answerUser);
//$NON-NLS-1$
+ if (areYouSure)
+ {
+
((SheetCTabItem)window.getCTabFolder().getSelection()).reInitialized(answer);
+ }
+ }
+ else if (answer[3])
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("ReinitializeFieldsAction.error"),Messages.getString("ReinitializeFieldsAction.errorMessageSelectNothing"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ else
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("ReinitializeFieldsAction.error"),Messages.getString("ReinitializeFieldsAction.errorMessageNotOpenDoc"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+}
+
Index: src/org/qsos/action/SaveSheetAction.java
===================================================================
RCS file: src/org/qsos/action/SaveSheetAction.java
diff -N src/org/qsos/action/SaveSheetAction.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/action/SaveSheetAction.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,108 @@
+/*
+** $Id: SaveSheetAction.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.action;
+
+
+
+
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.qsos.data.Messages;
+import org.qsos.main.JQ;
+
+/**
+ * This class represents the Action to save a Qsos sheet
+ *
+ *
+ * <br>
+ * first step:
+ * <br>open new dialog box to choose the directory and the name of the save
file
+ *
+ * <br><br>second step:
+ * <br>the user confirm the directory and the name of the sheet
+ *
+ * * <br><br>third step:
+ * <br>the sheet is saved in the new directory
+ *
+ */
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class SaveSheetAction extends Action
+{
+ JQ window;
+
+ /**
+ * @param w
+ */
+ public SaveSheetAction(JQ w)
+ {
+
super("&address@hidden",ImageDescriptor.createFromFile(SaveSheetAction.class,"/images/icons/save.png"));
//$NON-NLS-1$ //$NON-NLS-2$
+
+ setImageDescriptor(
ImageDescriptor.createFromFile(null,"images/icons/save.png")); //$NON-NLS-1$
+
//setDisabledImageDescriptor(ImageDescriptor.createFromFile(SaveSheetAction.class,"images/icons/save.png"));
+
+
setToolTipText(Messages.getString("SaveSheetAction.toolTipTextSave"));
//$NON-NLS-1$
+
+ window = w;
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run()
+ {
+
+ if (window.getCTabFolder().getItemCount() > 0)
+ {
+ final FileDialog saveDialog = new FileDialog (
window.getShell() , SWT.SAVE);
+ saveDialog.setFilterExtensions(new String[]{"*.qsos"});
//$NON-NLS-1$
+ String adressSaveFile = saveDialog.open();
+
+
+ if ( adressSaveFile != null )
+ {
+ window.saveSheet(adressSaveFile);
+ }
+ }
+ else
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("SaveSheetAction.error"),Messages.getString("SaveSheetAction.errorMessageNotOpenDoc"));
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ }
+}
+
Index: src/org/qsos/data/ImageRegistryQSOS.java
===================================================================
RCS file: src/org/qsos/data/ImageRegistryQSOS.java
diff -N src/org/qsos/data/ImageRegistryQSOS.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/ImageRegistryQSOS.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,99 @@
+/*
+** $Id: ImageRegistryQSOS.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+/**
+ *
+ */
+package org.qsos.data;
+
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+
+
+
+/**
+ * @author MULOT_L
+ *
+ * This class must gather the image of the JQ application.
+ * Some problem exist again.
+ *
+ * TODO fix error on this class
+ */
+public class ImageRegistryQSOS extends ImageRegistry
+{
+
+ /**
+ *
+ */
+ public ImageRegistryQSOS ()
+ {
+
+ super();
+ createImageRegistryQSOS(this);
+ }
+
+ /**
+ * @param iR
+ */
+ protected void createImageRegistryQSOS(ImageRegistryQSOS iR)
+ {
+ Image image_qsos = null;
+ Image icon_penguin_alone_QSOS_16 = null;
+
+ try
+ {
+ image_qsos = new Image( null, new
FileInputStream("images/image_QSOS_200.png"));
+ } catch (FileNotFoundException e)
+ {
+ System.out.println("Error loading: images/qsos.gif");
+ }
+
+
+ try
+ {
+ icon_penguin_alone_QSOS_16 = new Image( null, new
FileInputStream("images/icons/penguin_alone.bmp"));
+ } catch (FileNotFoundException e)
+ {
+ System.out.println("Error loading:
src/images/icons/penguin_alone.bmp");
+ }
+
+
+
+ iR.put("image_qsos",image_qsos);
+ iR.put("icon_penguin_alone_QSOS_16",icon_penguin_alone_QSOS_16);
+
+
+ }
+
+
+}
+
+
+
Index: src/org/qsos/data/JQConst.java
===================================================================
RCS file: src/org/qsos/data/JQConst.java
diff -N src/org/qsos/data/JQConst.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/JQConst.java 16 Jun 2006 14:16:35 -0000 1.1
@@ -0,0 +1,105 @@
+/*
+** $Id: JQConst.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.data;
+
+import org.eclipse.swt.graphics.Color;
+
+
+/**
+ * @author MULOT_L
+ *
+ * This class is gather the constants of the JQ application.
+ */
+public class JQConst
+{
+ /**
+ * This class contains constants for the JQ application
+ */
+
+
+ public static final String SCORE_0 = "0";
+ public static final String SCORE_1 = "1";
+ public static final String SCORE_2 = "2";
+
+
+
+ // Column constants
+ public static final int COLUMN_TITLE = 0;
+ public static final int COLUMN_DESC = 1;
+ public static final int COLUMN_COMMENT = 2;
+ public static final int COLUMN_SCORE = 3;
+ public static final int MAX_COLUMN_NUMBER = 4;
+
+
+ public static final int DENOMINATOR_WIDTH_COLUMN_TITLE = 4;
+ public static final int DENOMINATOR_WIDTH_COLUMN_DESC = 3;
+ public static final int DENOMINATOR_WIDTH_COLUMN_COMMENT = 3;
+ public static final int DENOMINATOR_WIDTH_COLUMN_SCORE = 16;
+
+
+ // Set color
+ public static final Color backGround_JQEditor = new Color(null, 196,
202, 218);
+ public static final Color backGround_JQEditor2 = new Color(null, 188,
208, 235);
+ public static final Color backGround_JQEditor3 = new Color(null, 148,
182, 231);
+ public static final Color otherColor = new Color(null, 50, 50, 50);
+
+
+ public static final int headerGroupNumber = 0;
+
+
+
+ // KeyCode for KeyListener
+ public static final int TAB_KEYCODE = 9;
+ public static final int ENTER_KEYCODE = 13;
+ public static final int SPACE_KEYCODE = 32;
+ public static final int UP_KEYCODE = 16777217;
+ public static final int DOWN_KEYCODE = 16777218;
+ public static final int LEFT_KEYCODE = 16777219;
+ public static final int RIGHT_KEYCODE = 16777220;
+ public static final int KEYCODE_0 = 224;
+ public static final int KEYCODE_0_BIS = 16777264;
+ public static final int KEYCODE_1 = 38;
+ public static final int KEYCODE_1_BIS = 16777265;
+ public static final int KEYCODE_2 = 233;
+ public static final int KEYCODE_2_BIS = 16777266;
+ public static final int ENTER_KEYCODE2 = 16777296;
+ public static final int KEYCODE_ESCAPE = 27;
+
+
+ // Constants used to generate the Radar-like chart
+
+ public static final java.awt.Color RADAR_SERIES_PAINT = new
java.awt.Color(255,132,0);
+ public static final double RADAR_MAX_VALUE = 2.0;
+ public static final double RADAR_AXIS_LABEL_GAP = 0.05;
+ public static final double RADAR_HEAD_PERCENT = 0.03;
+ public static final double RADAR_INTERIOR_GAP = 0.25;
+ public static final String RADAR_SPIDERWEB_4 =
"images/Radar/radar4.png";
+ public static final String RADAR_SPIDERWEB_5 =
"images/Radar/radar5.png";
+ public static final String RADAR_SPIDERWEB_6 =
"images/Radar/radar6.png";
+ public static final String RADAR_SPIDERWEB_7 =
"images/Radar/radar7.png";
+
+}
Index: src/org/qsos/data/Messages.java
===================================================================
RCS file: src/org/qsos/data/Messages.java
diff -N src/org/qsos/data/Messages.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/Messages.java 16 Jun 2006 14:16:35 -0000 1.1
@@ -0,0 +1,68 @@
+/*
+** $Id: Messages.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.data;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME
= "org.qsos.data.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+
.getBundle(BUNDLE_NAME);
+
+
+ private Messages()
+ {
+ }
+
+ /**
+ * Method automatic of Eclipse for externalize string.
+ *
+ * @param key
+ * @return textReturn
+ */
+ public static String getString(String key)
+ {
+ // TODO Auto-generated method stub
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e)
+ {
+ String textReturn = '!' + key + '!';
+ return textReturn;
+ }
+ }
+}
Index: src/org/qsos/data/messages.properties
===================================================================
RCS file: src/org/qsos/data/messages.properties
diff -N src/org/qsos/data/messages.properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/messages.properties 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,49 @@
+JQ.nameEditor=JQEditor
+JQ.TitleColumn=Title
+JQ.DescColumn=Desc
+JQ.ScoreColumn=Score
+JQ.iconApplication=icon_penguin_alone_QSOS_16
+JQ.header=Header
+SheetCTabItem.error=Error
+SheetCTabItem.errorLoading=An error occured: error loading
+SheetCTabItem.header=Header
+SheetCTabItem.applicationLabel=Application:
+SheetCTabItem.ReleaseLabel=Release
+SheetCTabItem.languageLabel=language:
+SheetCTabItem.licenseLabel=License:
+SheetCTabItem.urlLLabel=URL:
+SheetCTabItem.descriptionLabel=Description:
+SheetCTabItem.authorLabel=Author:
+SheetCTabItem.emailLabel=Email:
+SheetCTabItem.imageQSOSLabel=image_qsos
+SheetCTabItem.commentLabel=Comment:
+SheetCTabItem.scoreLabel=Score:
+SheetCTabItem.ErrorInitializeScoreComment=Problem for initialize the score and
the comment
+OpenSheetAction.toolTipTextOpen=Open a new QSOS sheet
+PrintAction.toolTipTextPrint=Print the QSOS sheet
+PrintAction.error=Error
+PrintAction.errorMessage=Sorry, you can't print if you've not open a QSOS
document
+RadarAction.toolTipTextRadar=Creation of the radar
+RadarAction.errorRadar=Error
+RadarAction.errorMessageRadar=Sorry, you can't draw a radar if you've not open
a QSOS document
+RadarDialog.SelectFields4to7=Select 4 to 7 fields to show on the radar.
+RadarDialog.buttonCreateRadar=Create a radar
+ReinitializeFieldsAction.toolTipTextReInitialize=Reinitialize fields of the
QSOS sheet
+ReinitializeFieldsAction.confirmationQuestion=Are you sure to reinitialize?
+ReinitializeFieldsAction.confirmation=Confirmation
+ReinitializeFieldsAction.error=Error
+ReinitializeFieldsAction.errorMessageSelectNothing=You don't have select
anything
+ReinitializeFieldsAction.errorMessageNotOpenDoc=Sorry, you can't reinitialize
if you've not open a QSOS document
+SaveSheetAction.toolTipTextSave=Save sheet
+SaveSheetAction.error=Error
+SaveSheetAction.errorMessageNotOpenDoc=Sorry, you can't save if you've not
open a QSOS document
+ReInitializeDialog.reInitializeTitle=Reinitialize fields
+ReInitializeDialog.reInitialiseQuestion=What do you want to reinitialize?
+ReInitializeDialog.score=Scores
+ReInitializeDialog.comments=Comments
+ReInitializeDialog.header=Header
+GenerateRadar.warning=Warning
+GenerateRadar.warningMessage=Sorry but you must select 4 to 7 fields for
create a radar.
+MyFilter.header=Header
+RadarDialog.close=close
+JQ.CommentColumn=Comment
Index: src/org/qsos/data/messagesESP.properties
===================================================================
RCS file: src/org/qsos/data/messagesESP.properties
diff -N src/org/qsos/data/messagesESP.properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/messagesESP.properties 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,49 @@
+JQ.nameEditor=JQEditor
+JQ.TitleColumn=Tìtulo
+JQ.DescColumn=Descripcion
+JQ.ScoreColumn=Nota
+JQ.iconApplication=icon_penguin_alone_QSOS_16
+JQ.header=Header
+SheetCTabItem.error=Error
+SheetCTabItem.errorLoading=Un error a aparecido: Error durante el cargamiento !
+SheetCTabItem.header=Header
+SheetCTabItem.applicationLabel=Dominio:
+SheetCTabItem.ReleaseLabel=Version:
+SheetCTabItem.languageLabel=lengua:
+SheetCTabItem.licenseLabel=Licencia:
+SheetCTabItem.urlLLabel=URL:
+SheetCTabItem.descriptionLabel=Descripcion:
+SheetCTabItem.authorLabel=Autor:
+SheetCTabItem.emailLabel=Email:
+SheetCTabItem.imageQSOSLabel=image_qsos
+SheetCTabItem.commentLabel=Commentario:
+SheetCTabItem.scoreLabel=Nota:
+SheetCTabItem.ErrorInitializeScoreComment=Problema durante la inicialisacion
de los comentarios y de las notas!
+OpenSheetAction.toolTipTextOpen=Abrir una nueva ficha QSOS
+PrintAction.toolTipTextPrint=Imprimir una ficha QSOS
+PrintAction.error=Error
+PrintAction.errorMessage=No se puede imprimir si ninguna ficha esta abierta!
+RadarAction.toolTipTextRadar=Creacion del grafico
+RadarAction.errorRadar=Error
+RadarAction.errorMessageRadar=No se pude crear un grafico si ninguna ficha
QSOS esta abierta!
+RadarDialog.SelectFields4to7=Elija 4 a 7 campos para generar el grafico!
+RadarDialog.buttonCreateRadar=Crear un grafico
+ReinitializeFieldsAction.toolTipTextReInitialize=Reinicialisar los campos de
la ficha QSOS
+ReinitializeFieldsAction.confirmationQuestion=Quiere reinicialisar los campos?
+ReinitializeFieldsAction.confirmation=Confirmaciòn
+ReinitializeFieldsAction.error=Error
+ReinitializeFieldsAction.errorMessageSelectNothing=No ha selecionnado ninguna
opciòn
+ReinitializeFieldsAction.errorMessageNotOpenDoc= No se puede reinicialisar los
campos si ninguna ficha esta abierta!
+SaveSheetAction.toolTipTextSave=Grabar una ficha
+SaveSheetAction.error=Error
+SaveSheetAction.errorMessageNotOpenDoc=No se puede grabar si ninguna ficha
esta abierta!
+ReInitializeDialog.reInitializeTitle=Reinicialisar los campos de la ficha
+ReInitializeDialog.reInitialiseQuestion=Que tipo de campos quiere reinicialisar
+ReInitializeDialog.score=Notas
+ReInitializeDialog.comments=Commentarios
+ReInitializeDialog.header=Header
+GenerateRadar.warning=Cuidado
+GenerateRadar.warningMessage=Tiene que elegir 4 a 7 campos para generar un
grafico
+MyFilter.header=Header
+RadarDialog.close=cerrar
+JQ.CommentColumn=Commentarios
\ No newline at end of file
Index: src/org/qsos/data/messagesFR.properties
===================================================================
RCS file: src/org/qsos/data/messagesFR.properties
diff -N src/org/qsos/data/messagesFR.properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/data/messagesFR.properties 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,49 @@
+JQ.nameEditor=JQEditor
+JQ.TitleColumn=Titre
+JQ.DescColumn=Description
+JQ.ScoreColumn=Note
+JQ.iconApplication=icon_penguin_alone_QSOS_16
+JQ.header=Header
+SheetCTabItem.error=Erreur
+SheetCTabItem.errorLoading=Une erreur est apparue: Erreur pendant le
chargement!
+SheetCTabItem.header=Header
+SheetCTabItem.applicationLabel=Domaine:
+SheetCTabItem.ReleaseLabel=Version
+SheetCTabItem.languageLabel=langue:
+SheetCTabItem.licenseLabel=Licence:
+SheetCTabItem.urlLLabel=URL:
+SheetCTabItem.descriptionLabel=Description:
+SheetCTabItem.authorLabel=Auteur:
+SheetCTabItem.emailLabel=Email:
+SheetCTabItem.imageQSOSLabel=image_qsos
+SheetCTabItem.commentLabel=Commentaire:
+SheetCTabItem.scoreLabel=Note:
+SheetCTabItem.ErrorInitializeScoreComment=Probleme lors de l'initialisation du
score et du commentaire!
+OpenSheetAction.toolTipTextOpen=Ouvrir une nouvelle fiche QSOS
+PrintAction.toolTipTextPrint=Imprimer une nouvelle fiche QSOS
+PrintAction.error=Erreur
+PrintAction.errorMessage=Désolé, vous ne pouvez pas imprimer tant qu'aucune
fiche n'a été ouverte
+RadarAction.toolTipTextRadar=Creation de la mire
+RadarAction.errorRadar=Erreur
+RadarAction.errorMessageRadar=Désolé, vous ne pouvez pas créer de mire si
aucune fiche n'a été ouverte.
+RadarDialog.SelectFields4to7=Choisissez 4 à 7 champs pour générer une mire.
+RadarDialog.buttonCreateRadar=Créer une mire
+ReinitializeFieldsAction.toolTipTextReInitialize=Réinitialiser les champs de
la fiche QSOS
+ReinitializeFieldsAction.confirmationQuestion=Etes vous sûr de vouloir
réinitialiser les champs?
+ReinitializeFieldsAction.confirmation=Confirmation
+ReinitializeFieldsAction.error=Erreur
+ReinitializeFieldsAction.errorMessageSelectNothing=Vous n'avez rien
selectionner!
+ReinitializeFieldsAction.errorMessageNotOpenDoc= Désolé, vous ne pouvez pas
réinitialiser tant qu'aucune fiche n'a été ouverte
+SaveSheetAction.toolTipTextSave=Sauver une fiche
+SaveSheetAction.error=Erreur
+SaveSheetAction.errorMessageNotOpenDoc=Désolé, vous ne pouvez pas sauver tant
qu'aucune fiche n'a été ouverte
+ReInitializeDialog.reInitializeTitle=réinitialiser les champs
+ReInitializeDialog.reInitialiseQuestion=Quels champs voulez vous réinitialiser?
+ReInitializeDialog.score=Notes
+ReInitializeDialog.comments=Commentaires
+ReInitializeDialog.header=Header
+GenerateRadar.warning=Attention
+GenerateRadar.warningMessage=Désolé vous devez choisr 4 à 7 champs pour
génerer une mire
+MyFilter.header=Header
+RadarDialog.close=fermer
+JQ.CommentColumn=Commentaire
\ No newline at end of file
Index: src/org/qsos/interfaces/RadarDialog.java
===================================================================
RCS file: src/org/qsos/interfaces/RadarDialog.java
diff -N src/org/qsos/interfaces/RadarDialog.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/RadarDialog.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,156 @@
+/*
+** $Id: RadarDialog.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+/*
+ * Created on 31 mai 2006
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.qsos.interfaces;
+
+
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.qsos.data.Messages;
+import org.qsos.main.JQ;
+import org.qsos.radar.GenerateRadar;
+
+/**
+ * This class represents the Action to make radar dialog
+ *
+ * <br>
+ * first step:
+ * <br>open new dialog box to choose the contents
+ *
+ * <br><br>second step:
+ * <br>Test if they are at minimum 4 contents check oR 7 maximun
+ *
+ * <br><br>Third step:
+ * <br>Create a new window with the image of the radar
+ */
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class RadarDialog extends TitleAreaDialog
+{
+
+ private JQ window;
+ private GenerateRadar generateRadar;
+
+
+
+ /**
+ * @param parent
+ * @param w
+ */
+ public RadarDialog(Shell parent, JQ w)
+ {
+ super(parent);
+ setShellStyle( SWT.MODELESS | SWT.TITLE);
+
+ window = w;
+ }
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent)
+ {
+ Control contents = super.createContents(parent);
+ String title= ((String) ((SheetCTabItem)
window.getCTabFolder().getSelection()).getSaveLibQSOS().getAppname()).concat(((SheetCTabItem)
window.getCTabFolder().getSelection()).getSaveLibQSOS().getRelease());
+
+ // Set the title
+ setTitle(title);
+
+ // Set the message
+ setMessage(Messages.getString("RadarDialog.SelectFields4to7"));
//$NON-NLS-1$
+
+
+ return contents;
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea (Composite parent)
+ {
+ Composite composite = (Composite)
super.createDialogArea(parent);
+
+ GenerateRadar generateFactor = new GenerateRadar(window);
+ generateFactor.createCheckboxTree(parent);
+ generateRadar = generateFactor;
+
+ return composite;
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent)
+ {
+
+ createButton (parent,
IDialogConstants.OPEN_ID,Messages.getString("RadarDialog.buttonCreateRadar"),true);
//$NON-NLS-1$
+
+ createButton(parent, IDialogConstants.CLOSE_ID,
Messages.getString("RadarDialog.close"),false); //$NON-NLS-1$
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
+ protected void buttonPressed (int buttonId)
+ {
+ if (buttonId == IDialogConstants.CLOSE_ID)
+ {
+ setReturnCode (buttonId);
+ close();
+ }
+ else if (buttonId == IDialogConstants.OPEN_ID)
+ {
+ // When you push the button a new Image of the radar is
create
+ generateRadar.createRadar();
+ }
+ }
+
+
+ public void run()
+ {
+ this.open();
+ }
+
+}
Index: src/org/qsos/interfaces/ReInitializeDialog.java
===================================================================
RCS file: src/org/qsos/interfaces/ReInitializeDialog.java
diff -N src/org/qsos/interfaces/ReInitializeDialog.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/ReInitializeDialog.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,202 @@
+/*
+** $Id: ReInitializeDialog.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.qsos.data.Messages;
+
+
+
+/**
+ * This class represents the dialog box to reinitialize a Qsos sheet
+ *
+ *
+ * <br>
+ * first step:
+ * <br>open new dialog box to choose the fields u want to reinitialize
+ *
+ * <br><br>second step:
+ * <br>the fields are saved
+ *
+ */
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class ReInitializeDialog extends TitleAreaDialog
+{
+
+ private boolean answer[];
+ Button scoreButton;
+ Button commentButton;
+ Button headerButton;
+
+
+ /**
+ * @param shell
+ */
+ public ReInitializeDialog(Shell shell)
+ {
+ super(shell);
+ //, boolean score_, boolean comment_,boolean header_
+ answer = new boolean[4];
+
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent)
+ {
+ Control contents = super.createContents(parent);
+
+ // Set the title
+
setTitle(Messages.getString("ReInitializeDialog.reInitializeTitle"));
//$NON-NLS-1$
+
+ // Set the message
+ //setMessage("What do you want to reinitialize?");
+
+ // Set the image
+ // if (image != null) setTitleImage(image);
+
+
+ return contents;
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea (Composite parent)
+ {
+ Composite composite = (Composite)
super.createDialogArea(parent);
+
+ composite.setLayout( new GridLayout(1,true) );
+
+ Label explicationLabel = new Label(composite,SWT.CENTER);
+
explicationLabel.setText(Messages.getString("ReInitializeDialog.reInitialiseQuestion"));
//$NON-NLS-1$
+
+ scoreButton = new Button (composite,SWT.CHECK);
+
scoreButton.setText(Messages.getString("ReInitializeDialog.score"));
//$NON-NLS-1$
+
+ commentButton = new Button (composite,SWT.CHECK);
+
commentButton.setText(Messages.getString("ReInitializeDialog.comments"));
//$NON-NLS-1$
+
+ headerButton = new Button (composite,SWT.CHECK);
+
headerButton.setText(Messages.getString("ReInitializeDialog.header"));
//$NON-NLS-1$
+ headerButton.addSelectionListener(new SelectionListener()
+ {
+
+ public void widgetSelected(SelectionEvent arg0)
+ {
+ answer[2] = headerButton.getSelection();
+
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+
+ }
+
+ });
+
+ scoreButton.addSelectionListener(new SelectionListener()
+ {
+
+ public void
widgetSelected(SelectionEvent arg0)
+ {
+ answer[0]=
scoreButton.getSelection();
+ }
+
+ public void
widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+
+ commentButton.addSelectionListener(new SelectionListener()
+ {
+
+ public void
widgetSelected(SelectionEvent arg0)
+ {
+ answer[1] =
commentButton.getSelection();
+ }
+
+ public void
widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+
+ }
+
+ });
+
+ return composite;
+
+ }
+
+ /**
+ * @return boolean[4]
+ */
+ public boolean[] run()
+ {
+ int ok = this.open();
+ if (ok != 0)
+ {
+ // Score
+ answer[0] = false;
+ answer[1] = false;
+ answer[2] = false;
+
+ // User put cancel
+ answer[3] = false;
+ }
+ else
+ {
+ // User put ok
+ answer[3] = true;
+ }
+
+ return answer;
+
+ }
+
+}
Index: src/org/qsos/interfaces/SheetCTabItem.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetCTabItem.java
diff -N src/org/qsos/interfaces/SheetCTabItem.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetCTabItem.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,1814 @@
+/*
+** $Id: SheetCTabItem.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableTreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.TableTreeItem;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.qsos.data.IElement;
+import org.qsos.data.ImageRegistryQSOS;
+import org.qsos.data.JQConst;
+import org.qsos.main.JQ;
+import org.qsos.utils.LibQSOS;
+import org.qsos.data.Messages;
+
+
+/**
+ * @author MODELIN_M
+ *
+ * SheetCTabItem is a class extends of CTabItem.
+ * This class has methods specialy implemented for the JQ application.
+ *
+ *
+ *
+ */
+public class SheetCTabItem extends CTabItem
+{
+
+ private JQ jqApp;
+ private LibQSOS libQSOS;
+ private LibQSOS saveLibQSOS;
+ private CTabFolder cTF;
+ private TableTreeViewer tableTreeViewer;
+
+ private Group headerGroup;
+ private Group answerGroup;
+ private Group activeGroup;
+ private Group nonActiveGroup;
+
+ // HeaderGroup's text
+ private Text textLanguage;
+ private Text textAppname;
+ private Text textRelease;
+ private Text textLicense;
+ private Text textDesc;
+ private Text textUrl;
+ private Text textAuthors;
+ private Text textAuthorsMail;
+
+ // AnswerGroup'Button and text
+ private Button buttonDesc0;
+ private Button buttonDesc1;
+ private Button buttonDesc2;
+ private Text textComment;
+ private Text textScore;
+
+ // Active element
+ private IElement element;
+
+ // URL of the sheet
+ private URL urlSheet;
+
+
+
+ /**
+ * Constructor
+ *
+ * @param arg0
+ * @param arg1
+ * @param adress_sheet
+ * @param answerMainCompo
+ * @param w
+ */
+ public SheetCTabItem (CTabFolder arg0, int arg1, String adress_sheet,
Composite answerMainCompo, JQ w)
+ {
+ super(arg0, arg1);
+
+ cTF = arg0;
+ jqApp = w;
+
+
+ // Initialize adress of the sheet
+ InitializeLibQSOS (adress_sheet);
+
+ // Create the answerComposite
+ createHeaderGroup(answerMainCompo);
+ createAnswerGroup(answerMainCompo);
+
+ // Rename the tabulation
+ if (saveLibQSOS.getAppname() != null)
+ {
+ if (saveLibQSOS.getRelease() != null)
+ {
+ this.setText ( saveLibQSOS.getAppname() + " " +
saveLibQSOS.getRelease() ); //$NON-NLS-1$
+ }
+ else
+ {
+ this.setText ( saveLibQSOS.getAppname() );
+ }
+ }
+ else
+ {
+ // Cast a int to string
+ this.setText ( "" + cTF.getItemCount() ); //$NON-NLS-1$
+ }
+
+
+ }
+
+ /**
+ *
+ *
+ * @param adress_sheet
+ */
+ private void InitializeLibQSOS(String adress_sheet)
+ {
+
+
+ // Creation of a LibQSOS Document
+ libQSOS = new LibQSOS();
+
+ // Creation of a save of LibQSOS:
+ saveLibQSOS = new LibQSOS();
+
+ try
+ {
+ // Change adress String to URL adress
+ urlSheet = new URL (adress_sheet);
+
+ // Document loading
+ libQSOS.load(urlSheet);
+ saveLibQSOS.load(urlSheet);
+
+ } catch (MalformedURLException e)
+ {
+
MessageDialog.openError(getParent().getShell(),Messages.getString("SheetCTabItem.error"),Messages.getString("SheetCTabItem.errorLoading"));
//$NON-NLS-1$ //$NON-NLS-2$
+ e.printStackTrace();
+
+ }
+ }
+
+
+
+
+ /**
+ * Method for create the headerGroup.
+ * The composite is create and return for show properties
+ *
+ * @param headerComposite
+ */
+ protected void createHeaderGroup(Composite parent)
+ {
+
+ headerGroup = new Group (parent, SWT.BORDER);
+
headerGroup.setText(Messages.getString("SheetCTabItem.header")); //$NON-NLS-1$
+ headerGroup.setLayout( new FormLayout() );
+
+
+ //********
+ // Label Appname
+ Label labelAppname = new Label(headerGroup, SWT.LEFT);
+
labelAppname.setText(Messages.getString("SheetCTabItem.applicationLabel"));
//$NON-NLS-1$
+ labelAppname.setBackground(JQConst.backGround_JQEditor);
+ labelAppname.pack();
+ FormData formDataLabelAppname= new FormData();
+ formDataLabelAppname.top = new FormAttachment(headerGroup,5);
+ formDataLabelAppname.left = new FormAttachment(headerGroup,5);
+ formDataLabelAppname.right = new FormAttachment(10,-5);
+ labelAppname.setLayoutData(formDataLabelAppname);
+
+ // Text Appname
+ textAppname = new Text (headerGroup, SWT.SIMPLE |SWT.LEFT );
+ FormData formDataTextAppname = new FormData();
+ formDataTextAppname.top = new FormAttachment(0,5);
+ formDataTextAppname.left = new
FormAttachment(labelAppname,5,SWT.RIGHT);
+ formDataTextAppname.right= new FormAttachment(70,-5);
+ textAppname.setLayoutData(formDataTextAppname);
+ if (this.getSaveLibQSOS().getAppname()!= "") //$NON-NLS-1$
+ {
+ textAppname.setText(this.getSaveLibQSOS().getAppname());
+ }
+
+
+ //********
+ // Label Release
+ Label labelRelease = new Label(headerGroup, SWT.LEFT);
+
labelRelease.setText(Messages.getString("SheetCTabItem.ReleaseLabel"));
//$NON-NLS-1$
+ labelRelease.setBackground(JQConst.backGround_JQEditor);
+ labelRelease.pack();
+ FormData formDataLabelRelease= new FormData();
+ formDataLabelRelease.top = new
FormAttachment(textAppname,5,SWT.BOTTOM);
+ formDataLabelRelease.left = new FormAttachment(0,5);
+ formDataLabelRelease.right = new FormAttachment(10,-5);
+ labelRelease.setLayoutData(formDataLabelRelease);
+
+
+ // Text Release
+ textRelease = new Text (headerGroup, SWT.SIMPLE | SWT.LEFT );
+ FormData formDataTextRelease = new FormData();
+ formDataTextRelease.top = new
FormAttachment(labelAppname,5,SWT.BOTTOM);
+ formDataTextRelease.left = new
FormAttachment(labelRelease,5,SWT.RIGHT);
+ formDataTextRelease.right= new FormAttachment(70,-5);
+ textRelease.setLayoutData(formDataTextRelease);
+ if (this.getSaveLibQSOS().getRelease()!= "") //$NON-NLS-1$
+ {
+ textRelease.setText(this.getSaveLibQSOS().getRelease());
+ }
+
+
+ //********
+ // Label Language
+ Label labelLanguage = new Label(headerGroup,SWT.LEFT);
+
labelLanguage.setText(Messages.getString("SheetCTabItem.languageLabel"));
//$NON-NLS-1$
+ labelLanguage.setBackground(JQConst.backGround_JQEditor);
+ labelLanguage.pack();
+ FormData formDataLabelLanguage = new FormData();
+ formDataLabelLanguage.top = new
FormAttachment(labelRelease,1,5);
+ formDataLabelLanguage.left = new FormAttachment(0,5);
+ formDataLabelLanguage.right = new FormAttachment(10,-5);
+ labelLanguage.setLayoutData(formDataLabelLanguage);
+
+ // Text language
+ textLanguage = new Text ( headerGroup, SWT.SIMPLE|SWT.LEFT );
+ FormData formDataTextLanguage = new FormData();
+ formDataTextLanguage.left = new
FormAttachment(labelLanguage,5,SWT.RIGHT);
+ formDataTextLanguage.top = new FormAttachment(labelRelease,5);
+ formDataTextLanguage.right= new FormAttachment(70,-5);
+ textLanguage.setLayoutData(formDataTextLanguage);
+ if (getSaveLibQSOS().getLanguage()!= "") //$NON-NLS-1$
+ {
+
textLanguage.setText(this.getSaveLibQSOS().getLanguage());
+ }
+
+
+ //***************
+ // Label License
+ Label labelLicense = new Label(headerGroup, SWT.LEFT);
+
labelLicense.setText(Messages.getString("SheetCTabItem.licenseLabel"));
//$NON-NLS-1$
+ labelLicense.setBackground(JQConst.backGround_JQEditor);
+ labelLicense.pack();
+ FormData formDataLabelLicense = new FormData();
+ formDataLabelLicense.top = new FormAttachment(textLanguage,1);
+ formDataLabelLicense.left = new FormAttachment(headerGroup,5);
+ formDataLabelLicense.right = new FormAttachment(10,-5);
+ labelLicense.setLayoutData(formDataLabelLicense);
+
+ // Text License
+ textLicense = new Text (headerGroup, SWT.SIMPLE | SWT.LEFT );
+ FormData formDataTextLicense = new FormData();
+ formDataTextLicense.top = new FormAttachment(textLanguage,5);
+ formDataTextLicense.left = new
FormAttachment(labelLicense,5,SWT.RIGHT);
+ formDataTextLicense.right= new FormAttachment(70,-5);
+ textLicense.setLayoutData(formDataTextLicense);
+ if (this.getSaveLibQSOS().getLicenseDesc()!= "") //$NON-NLS-1$
+ {
+
textLicense.setText(this.getSaveLibQSOS().getLicenseDesc());
+ }
+
+
+
+ //***************
+ // Label URL
+ Label labelUrl = new Label(headerGroup, SWT.LEFT);
+
labelUrl.setText(Messages.getString("SheetCTabItem.urlLLabel")); //$NON-NLS-1$
+ labelUrl.setBackground(JQConst.backGround_JQEditor);
+ labelUrl.pack();
+ FormData formDataLabelUrl = new FormData();
+ formDataLabelUrl.top = new FormAttachment(textLicense,5);
+ formDataLabelUrl.left = new FormAttachment(headerGroup,5);
+ formDataLabelUrl.right = new FormAttachment(10,-5);
+ labelUrl.setLayoutData(formDataLabelUrl);
+
+ // Text URL
+ textUrl = new Text (headerGroup, SWT.SIMPLE | SWT.LEFT);
+ FormData formDataTextUrl = new FormData();
+ formDataTextUrl.top = new FormAttachment(textLicense,5);
+ formDataTextUrl.left = new
FormAttachment(labelUrl,5,SWT.RIGHT);
+ formDataTextUrl.right= new FormAttachment(70,-5);
+ textUrl.setLayoutData(formDataTextUrl);
+ if (this.getSaveLibQSOS().getUrl()!= "") //$NON-NLS-1$
+ {
+ textUrl.setText(this.getSaveLibQSOS().getUrl());
+ }
+
+
+
+
+ //***************
+ // Label Desc
+ Label labelDesc = new Label(headerGroup, SWT.LEFT);
+
labelDesc.setText(Messages.getString("SheetCTabItem.descriptionLabel"));
//$NON-NLS-1$
+ labelDesc.setBackground(JQConst.backGround_JQEditor);
+ labelDesc.pack();
+ FormData formDataLabelDesc = new FormData();
+ formDataLabelDesc.top = new FormAttachment(textUrl,5);
+ formDataLabelDesc.left = new FormAttachment(headerGroup,5);
+ formDataLabelDesc.right = new FormAttachment(10,-5);
+ labelDesc.setLayoutData(formDataLabelDesc);
+
+ // Text Desc
+ textDesc = new Text (headerGroup, SWT.MULTI | SWT.LEFT |
SWT.MULTI);
+ FormData formDataTextDesc = new FormData();
+ formDataTextDesc.top = new FormAttachment(textUrl,5);
+ formDataTextDesc.left = new
FormAttachment(labelDesc,5,SWT.RIGHT);
+ formDataTextDesc.right= new FormAttachment(100,-5);
+ textDesc.setLayoutData(formDataTextDesc);
+ if (this.getSaveLibQSOS().getDesc()!= "") //$NON-NLS-1$
+ {
+ textDesc.setText(this.getSaveLibQSOS().getDesc());
+ }
+
+
+
+
+ //***************
+ // Label Authors
+ Label labelAuthors = new Label(headerGroup, SWT.LEFT);
+
labelAuthors.setText(Messages.getString("SheetCTabItem.authorLabel"));
//$NON-NLS-1$
+ labelAuthors.setBackground(JQConst.backGround_JQEditor);
+ labelAuthors.pack();
+ FormData formDataLabelAuthors = new FormData();
+
+ formDataLabelAuthors.left = new FormAttachment(headerGroup,5);
+ formDataLabelAuthors.right = new FormAttachment(10,-5);
+ formDataLabelAuthors.top = new FormAttachment(textDesc,5);
+ labelAuthors.setLayoutData(formDataLabelAuthors);
+
+ // Text Authors
+ textAuthors = new Text ( headerGroup, SWT.SIMPLE | SWT.LEFT );
+ FormData formDataTextAuthors = new FormData();
+ formDataTextAuthors.left = new
FormAttachment(headerGroup,5,SWT.RIGHT);
+ formDataTextAuthors.right= new FormAttachment(50,-5);
+ formDataTextAuthors.top = new FormAttachment(labelAuthors,5);
+ textAuthors.setLayoutData(formDataTextAuthors);
+ if (this.getSaveLibQSOS().getAuthors().size() > 0)
+ {
+ textAuthors.setText((String)
this.getSaveLibQSOS().getAuthors().get(0));
+ }
+
+ // Text MailAuthors
+ Label labelAuthorsMail = new Label(headerGroup, SWT.LEFT );
+
labelAuthorsMail.setText(Messages.getString("SheetCTabItem.emailLabel"));
//$NON-NLS-1$
+ labelAuthorsMail.setBackground(JQConst.backGround_JQEditor);
+ labelAuthorsMail.pack();
+ FormData formDataLabelAuthorsMail = new FormData();
+ formDataLabelAuthorsMail.left = new
FormAttachment(textAuthors,5);
+ formDataLabelAuthorsMail.right = new FormAttachment(100,-5);
+ formDataLabelAuthorsMail.top = new FormAttachment(textDesc,5);
+ labelAuthorsMail.setLayoutData(formDataLabelAuthorsMail);
+
+ textAuthorsMail = new Text ( headerGroup, SWT.SIMPLE |
SWT.LEFT);
+ FormData formDataTextAuthorsMail = new FormData();
+ formDataTextAuthorsMail.left = new
FormAttachment(textAuthors,5,SWT.RIGHT);
+ formDataTextAuthorsMail.right= new FormAttachment(100,-5);
+ formDataTextAuthorsMail.top = new
FormAttachment(labelAuthors,5);
+ textAuthorsMail.setLayoutData(formDataTextAuthorsMail);
+ if (this.getSaveLibQSOS().getAuthors().size() > 0)
+ {
+
textAuthorsMail.setText(this.getSaveLibQSOS().getEmail((String)
this.getSaveLibQSOS().getAuthors().get(0)));
+ }
+
+
+ //***************
+ // Label Image
+ Label labelImage= new Label(headerGroup, SWT.BORDER |
SWT.CENTER);
+ ImageRegistryQSOS iR = new ImageRegistryQSOS();
+ Image imageQSOS =
iR.get(Messages.getString("SheetCTabItem.imageQSOSLabel")); //$NON-NLS-1$
+ labelImage.setImage(imageQSOS);
+ FormData formDataLabelImage = new FormData();
+ formDataLabelImage.left = new FormAttachment (73,0);
+ formDataLabelImage.right= new FormAttachment (98,0);
+ formDataLabelImage.top = new FormAttachment (0,0);
+ formDataLabelImage.bottom = new FormAttachment
(labelDesc,-5,SWT.TOP);
+ labelImage.setLayoutData(formDataLabelImage);
+ labelImage.pack();
+
+
+ // Add listener at textAppname
+ textAppname.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+ textAppname.setText
(getSaveLibQSOS().getAppname());
+ tableTreeViewer.refresh();
+ textRelease.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textAppname.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+
+ // Save the change on the sheet
+
getSaveLibQSOS().setAppname(textAppname.getText());
+
+ // Rename the tabulation
+ if (saveLibQSOS.getAppname() !=
null)
+ {
+ if
(saveLibQSOS.getRelease() != null)
+ {
+
cTF.getSelection().setText ( saveLibQSOS.getAppname() + " " +
saveLibQSOS.getRelease() ); //$NON-NLS-1$
+ }
+ else
+ {
+
cTF.getSelection().setText ( saveLibQSOS.getAppname() );
+ }
+ }
+ else
+ {
+ // Cast a int to string
+
cTF.getSelection().setText ( "" + cTF.getItemCount() ); //$NON-NLS-1$
+ }
+
//cTF.getSelection().setText(textAppname.getText());
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textRelease.setFocus();
+ break;
+ }
+ }
+ });
+
+ //Add listener at textRelease
+ textRelease.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textRelease.setText(getSaveLibQSOS().getRelease());
+ tableTreeViewer.refresh();
+ textLanguage.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textRelease.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+
+ // Save change
+
getSaveLibQSOS().setRelease(textRelease.getText());
+
+ // Rename the tabulation
+ if (saveLibQSOS.getAppname() !=
null)
+ {
+ if
(saveLibQSOS.getRelease() != null)
+ {
+
cTF.getSelection().setText( saveLibQSOS.getAppname() + " " +
saveLibQSOS.getRelease() ); //$NON-NLS-1$
+ }
+ else
+ {
+
cTF.getSelection().setText ( saveLibQSOS.getAppname() );
+ }
+ }
+ else
+ {
+ // Cast a int to string
+
cTF.getSelection().setText ( "" + cTF.getItemCount() ); //$NON-NLS-1$
+ }
+
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textLanguage.setFocus();
+ break;
+ }
+ }
+ });
+
+ // Add listener at textLanguage
+ textLanguage.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textLanguage.setText(getSaveLibQSOS().getLanguage());
+ tableTreeViewer.refresh();
+ textLicense.forceFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textLanguage.addVerifyListener(new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+
getSaveLibQSOS().setLanguage(textLanguage.getText());
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textLicense.forceFocus();
+ break;
+ }
+ }
+ });
+
+
+ //Add listener at textLicense
+ textLicense.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textLicense.setText(getSaveLibQSOS().getLicenseDesc());
+ tableTreeViewer.refresh();
+ textUrl.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textLicense.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+
getSaveLibQSOS().setLicenseDesc(textLicense.getText());
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textUrl.setFocus();
+ break;
+ }
+ }
+ });
+
+ //Add listener at textUrl
+ textUrl.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textUrl.setText(getSaveLibQSOS().getUrl());
+ tableTreeViewer.refresh();
+ textDesc.forceFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textUrl.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.TAB_KEYCODE:
+
getSaveLibQSOS().setUrl(textUrl.getText());
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textDesc.forceFocus();
+ break;
+ }
+ }
+ });
+
+ //Add listener at textDesc
+ textDesc.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textDesc.setText(getSaveLibQSOS().getDesc());
+ tableTreeViewer.refresh();
+ textAuthors.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textDesc.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+
getSaveLibQSOS().setDesc(textDesc.getText());
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textAuthors.setFocus();
+ break;
+ }
+ }
+ });
+
+ //Add listener at textAuthors
+ textAuthors.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+ textAuthors.setText((String)
getSaveLibQSOS().getAuthors().get(0));
+ tableTreeViewer.refresh();
+ //textAuthors.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+ textAuthors.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ if (cTF.getItemCount() > 0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.ENTER_KEYCODE2:
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.TAB_KEYCODE:
+
tableTreeViewer.refresh();
+ arg0.doit = false;
+
textAuthorsMail.forceFocus();
+
+ }
+ }
+ }
+ });
+
+ //Add listener at textAuthors
+ textAuthorsMail.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textAuthorsMail.setText(getSaveLibQSOS().getEmail((String)getSaveLibQSOS().getAuthors().get(0)));
+ tableTreeViewer.refresh();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //nothing
+ }
+
+ });
+
+ textAuthorsMail.addVerifyListener( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ if (cTF.getItemCount() > 0)
+ {
+ switch (arg0.keyCode)
+ {
+ case
JQConst.ENTER_KEYCODE2:
+ case
JQConst.ENTER_KEYCODE:
+ case
JQConst.TAB_KEYCODE:
+
getSaveLibQSOS().delAuthor((String) getSaveLibQSOS().getAuthors().get(0));
+
getSaveLibQSOS().addAuthor(textAuthors.getText(),""); //$NON-NLS-1$
+
tableTreeViewer.refresh();
+
arg0.doit = false;
+ boolean
afterHeader = true;
+
nextItem();
+
+ }
+ }
+ }
+ });
+
+ headerGroup.setBackground(JQConst.backGround_JQEditor);
+ activeGroup = headerGroup;
+
+ }
+
+ /**
+ * Method for create the answerComposite of this sheetCTabItem.
+ * The answer composite is the composite for help the user to complete
the fields of the sheet
+ *
+ * @param parent
+ */
+ protected void createAnswerGroup(Composite parent)
+ {
+
+ answerGroup = new Group (parent, SWT.BORDER | SWT.V_SCROLL |
SWT.H_SCROLL);
+
+
+ // Label Desc0
+ buttonDesc0 = new Button (answerGroup,SWT.RADIO);
+ buttonDesc0.setBackground(JQConst.backGround_JQEditor);
+ FormData formDataButtonDesc0 = new FormData();
+ formDataButtonDesc0.top = new FormAttachment(answerGroup,5);
+ formDataButtonDesc0.left = new FormAttachment(answerGroup,5);
+ formDataButtonDesc0.right = new FormAttachment(70,-5);
+ buttonDesc0.setLayoutData(formDataButtonDesc0);
+
+ // Button Desc1
+ buttonDesc1 = new Button (answerGroup,SWT.RADIO);
+ buttonDesc1.setBackground(JQConst.backGround_JQEditor);
+ FormData formDataButtonDesc1 = new FormData();
+ formDataButtonDesc1.top = new FormAttachment(buttonDesc0,5);
+ formDataButtonDesc1.left = new FormAttachment(0,5);
+ formDataButtonDesc1.right = new FormAttachment(70,-5);
+ buttonDesc1.setLayoutData(formDataButtonDesc1);
+
+ // Button Desc2
+ buttonDesc2 = new Button (answerGroup,SWT.RADIO);
+ buttonDesc2.setBackground(JQConst.backGround_JQEditor);
+ FormData formDataButtonDesc2 = new FormData();
+ formDataButtonDesc2.top = new FormAttachment(buttonDesc1,5);
+ formDataButtonDesc2.left = new FormAttachment(0,5);
+ formDataButtonDesc2.right = new FormAttachment(70,-5);
+ buttonDesc2.setLayoutData(formDataButtonDesc2);
+
+ // Label Comment
+ final Label labelComment = new Label(answerGroup, SWT.LEFT);
+ labelComment.setBackground(JQConst.backGround_JQEditor);
+
labelComment.setText(Messages.getString("SheetCTabItem.commentLabel"));
//$NON-NLS-1$
+ FormData formDataLabelComment = new FormData();
+ formDataLabelComment.left = new FormAttachment(0,5);
+ formDataLabelComment.top = new FormAttachment(buttonDesc2,30);
+ labelComment.setLayoutData(formDataLabelComment);
+
+ // Text Comment
+ textComment = new Text ( answerGroup, SWT.MULTI | SWT.LEFT |
SWT.BORDER);
+ FormData formDataTextComment = new FormData();
+ formDataTextComment.left = new FormAttachment(labelComment,5);
+ formDataTextComment.right= new FormAttachment(100,-5);
+ formDataTextComment.top = new FormAttachment(buttonDesc2,30);
+ textComment.setLayoutData(formDataTextComment);
+
+ // Label Score
+ Label labelScore = new Label(answerGroup, SWT.LEFT);
+ labelScore.setBackground(JQConst.backGround_JQEditor);
+
labelScore.setText(Messages.getString("SheetCTabItem.scoreLabel"));
//$NON-NLS-1$
+ FormData formDataLabelScore = new FormData();
+ formDataLabelScore.left = new FormAttachment(75,5);
+ formDataLabelScore.right = new FormAttachment(100,-5);
+ formDataLabelScore.top = new FormAttachment(0,5);
+ labelScore.setLayoutData(formDataLabelScore);
+
+ // Text Score
+ textScore = new Text ( answerGroup, SWT.SIMPLE | SWT.CENTER |
SWT.BORDER);
+ FormData formDataTextScore = new FormData();
+ formDataTextScore.top = new FormAttachment(labelScore,5,
SWT.BOTTOM);
+ formDataTextScore.left = new FormAttachment(labelScore, 40,
SWT.LEFT);
+ textScore.setTextLimit(1);
+ textScore.setLayoutData(formDataTextScore);
+
+ buttonDesc0.addKeyListener(new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+
+ boolean afterHeader = false;
+
textScore.setText(JQConst.SCORE_0);
+ nextItem();
+
+ if (buttonDesc0.getSelection())
+ {
+
buttonDesc0.forceFocus();
+ }
+ else if
(buttonDesc1.getSelection())
+ {
+
buttonDesc1.forceFocus();
+ }
+ else if
(buttonDesc2.getSelection())
+ {
+
buttonDesc2.forceFocus();
+ }
+
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+ buttonDesc1.addKeyListener(new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+
textScore.setText(JQConst.SCORE_1);
+ boolean afterHeader = false;
+ nextItem();
+ if (buttonDesc0.getSelection())
+ {
+
buttonDesc0.forceFocus();
+ }
+ else if
(buttonDesc1.getSelection())
+ {
+
buttonDesc1.forceFocus();
+ }
+ else if
(buttonDesc2.getSelection())
+ {
+
buttonDesc2.forceFocus();
+ }
+
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+ buttonDesc2.addKeyListener(new KeyListener()
+ {
+
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+ boolean afterHeader = false;
+
textScore.setText(JQConst.SCORE_2);
+ nextItem();
+ if (buttonDesc0.getSelection())
+ {
+
buttonDesc0.forceFocus();
+ }
+ else if
(buttonDesc1.getSelection())
+ {
+
buttonDesc1.forceFocus();
+ }
+ else if
(buttonDesc2.getSelection())
+ {
+
buttonDesc2.forceFocus();
+ }
+
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+
+
+
+ buttonDesc0.addSelectionListener( new SelectionListener()
+ {
+
+ public void widgetSelected(SelectionEvent arg0)
+ {
+ textScore.setText(JQConst.SCORE_0);
+ try
+ {
+ element.setScore(textScore.getText());
+ tableTreeViewer.refresh();
+ } catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+ buttonDesc1.addSelectionListener( new SelectionListener(){
+
+ public void widgetSelected(SelectionEvent arg0)
+ {
+ textScore.setText(JQConst.SCORE_1);
+ try
+ {
+ element.setScore(textScore.getText());
+ tableTreeViewer.refresh();
+ } catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+
+ buttonDesc2.addSelectionListener( new SelectionListener(){
+
+ public void widgetSelected(SelectionEvent arg0)
+ {
+ textScore.setText(JQConst.SCORE_2);
+ try
+ {
+ element.setScore(textScore.getText());
+ tableTreeViewer.refresh();
+ } catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+
+ textComment.addVerifyListener(new VerifyListener(){
+
+ public void verifyText(VerifyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.TAB_KEYCODE:
+ case JQConst.ENTER_KEYCODE:
+ case JQConst.ENTER_KEYCODE2:
+
+ // Save change
+
element.setComment(textComment.getText());
+
+
+ tableTreeViewer.refresh();
+ arg0.doit = false;
+ textScore.setFocus();
+ nextItem();
+ break;
+ }
+
+
+ }
+
+ });
+
+ textComment.addKeyListener(new KeyListener()
+ {
+
+ public void keyPressed(KeyEvent arg0)
+ {
+ switch (arg0.keyCode)
+ {
+ case JQConst.KEYCODE_ESCAPE:
+
textComment.setText(element.getComment());
+ tableTreeViewer.refresh();
+ textScore.setFocus();
+ break;
+ }
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+
+ textScore.addKeyListener( new KeyListener()
+ {
+ public void keyPressed(KeyEvent arg0)
+ {
+
+ switch (arg0.keyCode)
+ {
+ case JQConst.UP_KEYCODE:
+ lastItem();
+ break;
+ case
JQConst.TAB_KEYCODE:
+ //String text =
textScore.getText();
+ try
+ {
+
element.setScore(textScore.getText());
+
tableTreeViewer.refresh();
+ } catch
(IOException e1)
+ {
+ // TODO
Auto-generated catch block
+
e1.printStackTrace();
+ }
+
+
textComment.forceFocus();
+ break;
+
+ case JQConst.KEYCODE_0:
+ case
JQConst.KEYCODE_0_BIS:
+
textScore.setText("0"); //$NON-NLS-1$
+ break;
+
+ case JQConst.KEYCODE_1:
+ case
JQConst.KEYCODE_1_BIS:
+
textScore.setText("1"); //$NON-NLS-1$
+ break;
+
+ case JQConst.KEYCODE_2:
+ case
JQConst.KEYCODE_2_BIS:
+
textScore.setText("2"); //$NON-NLS-1$
+ break;
+
+ case
JQConst.DOWN_KEYCODE:
+ case
JQConst.ENTER_KEYCODE2:
+ case
JQConst.ENTER_KEYCODE:
+ try
+ {
+
element.setScore(textScore.getText());
+
tableTreeViewer.refresh();
+ } catch
(IOException e)
+ {
+
e.printStackTrace();
+ }
+ boolean
afterHeader = false;
+
arg0.doit = false;
+ // Go to the
next item
+
SheetCTabItem.this.nextItem();
+
+ break;
+ }
+
+ }
+
+ public void keyReleased(KeyEvent arg0)
+ {
+ //Nothing
+ }
+
+ });
+
+
+ textScore.addVerifyListener ( new VerifyListener()
+ {
+ public void verifyText(VerifyEvent arg0)
+ {
+ if (arg0.text.equals(""))
//$NON-NLS-1$
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(false);
+ }
+ else if
(arg0.text.equals("0")) //$NON-NLS-1$
+ {
+
buttonDesc0.setSelection(true);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(false);
+ }
+ else if
(arg0.text.equals("1")) //$NON-NLS-1$
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(true);
+
buttonDesc2.setSelection(false);
+ }
+ else if
(arg0.text.equals("2")) //$NON-NLS-1$
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(true);
+ }
+ else if
(arg0.text.equals("\t")) //$NON-NLS-1$
+ {
+ // Case when user
pressed tab
+ if
(element.getScore().equals(JQConst.SCORE_0))
+ {
+
buttonDesc0.setSelection(true);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(false);
+ }
+ else if
(element.getScore().equals(JQConst.SCORE_1))
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(true);
+
buttonDesc2.setSelection(false);
+ }
+ else if
(element.getScore().equals(JQConst.SCORE_2))
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(true);
+ }
+ else
+ {
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(false);
+ }
+ }
+ else
+ {
+ // No score is selected
+ arg0.doit = false;
+
buttonDesc0.setSelection(false);
+
buttonDesc1.setSelection(false);
+
buttonDesc2.setSelection(false);
+ }
+
+ }
+
+ });
+
+
+
+
+
+
+
+
+ answerGroup.setBackground(JQConst.backGround_JQEditor);
+
+ // For set a nonActiveGroup (do not delete)
+ nonActiveGroup = answerGroup;
+
+ }
+
+
+
+
+
+ /**
+ * Method for refresh the answerComposite of JQ application
+ * @param ielement
+ * It's the element which new answerGroup shows
+ *
+ *
+ * @return
+ * return is the answerGroup
+ */
+ public Composite refreshAnswerComposite(IElement ielement)
+ {
+
+ if (answerGroup.isEnabled())
+ {
+ // Set element (global Variable)
+ element = ielement;
+
+ // Set group's title
+ if (element.getTitle()!= null)
+ {
+ answerGroup.setText(element.getTitle());
+ }
+
+ // Set desc0
+ if (element.getDesc0() != null)
+ {
+ buttonDesc0.setText( element.getDesc0() );
+ }
+ else
+ {
+ buttonDesc0.setText(""); //$NON-NLS-1$
+ }
+
+ // Set desc1
+ if (element.getDesc1() != null)
+ {
+ buttonDesc1.setText(element.getDesc1());
+ }
+ else
+ {
+ buttonDesc1.setText(""); //$NON-NLS-1$
+ }
+
+ // Set desc2
+ if (element.getDesc2() != null)
+ {
+ buttonDesc2.setText(element.getDesc2());
+ }
+ else
+ {
+ buttonDesc2.setText(""); //$NON-NLS-1$
+ }
+
+ // Set Comment
+ if (element.getComment() != null)
+ {
+ textComment.setText(element.getComment());
+ }
+ else
+ {
+ textComment.setText(""); //$NON-NLS-1$
+ }
+
+ // Set Score
+ if (element.getScore() != null)
+ {
+ textScore.setText(element.getScore());
+ }
+ else
+ {
+ textScore.setText(""); //$NON-NLS-1$
+ }
+
+ // Set the selection of the radio button in function of
the score
+ if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_0))
+ {
+ buttonDesc0.setSelection(true);
+ }
+ else if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_1))
+ {
+ buttonDesc1.setSelection(true);
+ }
+ else if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_2))
+ {
+ buttonDesc2.setSelection(true);
+ }
+ }
+
+ return answerGroup;
+
+ }
+
+ // First case for header
+ /**
+ * This method give a group which is located on a anwerComposite of a
jq application.
+ * It set the activeGroup last used and it location, and it size.
+ *
+ * For indication: this method changed the activeGroup and the
nonActiveGroup of the SheetCTabItem
+ *
+ * @param choice
+ * if (choice = 1)
+ * method return the
headerGroup (so you can put element = null)
+ * else
+ * method return the
answerGroup completed with the element
+ *
+ * @param element
+ * When the choice = 1 you can put null
like element
+ * others case you must set the element
which you want show
+ *
+ * @return
+ * Method return a group place on the
answerComposite
+ */
+ public Composite giveComposite(int choice, IElement element)
+ {
+
+ if (choice != 0)
+ {
+ if (choice == 1)
+ {
+ nonActiveGroup = answerGroup;
+ activeGroup = headerGroup;
+ }
+ else
+ {
+
+ refreshAnswerComposite(element);
+ nonActiveGroup = headerGroup;
+ activeGroup = answerGroup;
+
+ }
+ }
+
+ if (activeGroup.getLayout() == null)
+ {
+ nonActiveGroup.setLayoutData(null);
+ activeGroup.setLayout( new FormLayout() );
+ }
+
+ // Creation of a formData for AnswerComposite
+ FormData formDataAnswerGroup = new FormData();
+
+
+ // Set emplacement of the answerComposite
+ formDataAnswerGroup.top = new FormAttachment(cTF,0,SWT.TOP);
+ formDataAnswerGroup.left = new FormAttachment(cTF,0,SWT.LEFT);
+ formDataAnswerGroup.bottom = new
FormAttachment(jqApp.getAnswerComposite(),0,SWT.BOTTOM);
+ formDataAnswerGroup.right = new FormAttachment(cTF,0,SWT.RIGHT);
+
+ //Attribuate a formData to the answerComposite
+ activeGroup.setLayoutData(formDataAnswerGroup);
+
+ // Force the activeGroup' size
+
jqApp.getAnswerComposite().setSize(cTF.getSize().x,jqApp.getAnswerComposite().getSize().y);
+
activeGroup.setSize(jqApp.getAnswerComposite().getSize().x-1,jqApp.getAnswerComposite().getSize().y-1);
+
+
+
+ // Hide the onActiveGroup
+ nonActiveGroup.setVisible(false);
+ activeGroup.setVisible(true);
+
+
+ // Set the focus on the element selected
+ if (activeGroup.equals(answerGroup))
+ {
+ textScore.forceFocus();
+ refreshAnswerComposite(element);
+ }
+ else
+ {
+ textAppname.forceFocus();
+ }
+
+ activeGroup.update();
+
+ return activeGroup;
+ }
+
+
+ /**
+ *
+ * This method select the next Item to complete in the tableTreeViewer.
+ * It not selected simples titles, or section name.
+ *
+ */
+ private void nextItem ()
+ {
+
+ int selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex();
+
+ jqApp.getTableTreeViewer().getTableTree().getTable().setFocus();
+ jqApp.getAnswerComposite().update();
+
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(selectionTable+1);
+
+ ISelection select = jqApp.getTableTreeViewer().getSelection();
+
+ boolean itemNotFound=true;
+
+ TableTreeItem[] item ;
+ int itemCountMax =
jqApp.getTableTreeViewer().getTableTree().getTable().getItems().length;
+
+ selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex()+1;
+ IElement elementSelected;
+
+
+ while (itemNotFound)
+ {
+ select = jqApp.getTableTreeViewer().getSelection();
+ StructuredSelection structuredSelectionTransition =
(StructuredSelection) select;
+ Object objectTransition =
structuredSelectionTransition.getFirstElement();
+ elementSelected = (IElement) objectTransition;
+
+ selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex();
+
+ if (selectionTable < 0)
+ {
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(0);
+ }
+ else if (selectionTable == 0)
+ {
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(1);
+ }
+ else
+ {
+
+ if (elementSelected.getElements() == null)
+ {
+ select =
jqApp.getTableTreeViewer().getSelection();
+
jqApp.getTableTreeViewer().setSelection(select);
+ itemNotFound = false;
+ }
+ else
+ {
+
+ selectionTable++;
+
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(selectionTable);
+
+ }
+ }
+
+ }
+ }
+
+
+ /**
+ *
+ * This method select the last Item to complete in the tableTreeViewer.
+ * It not selected simples titles, or section name.
+ *
+ */
+ private void lastItem ()
+ {
+
+ int selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex();
+
+ jqApp.getTableTreeViewer().getTableTree().getTable().setFocus();
+ jqApp.getAnswerComposite().update();
+
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(selectionTable-1);
+
+ ISelection select = jqApp.getTableTreeViewer().getSelection();
+
+ boolean itemNotFound=true;
+
+ TableTreeItem[] item ;
+ int itemCountMax =
jqApp.getTableTreeViewer().getTableTree().getTable().getItems().length;
+
+ selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex()-1;
+ IElement elementSelected;
+
+
+ while (itemNotFound)
+ {
+ select = jqApp.getTableTreeViewer().getSelection();
+ StructuredSelection structuredSelectionTransition =
(StructuredSelection) select;
+ Object objectTransition =
structuredSelectionTransition.getFirstElement();
+ elementSelected = (IElement) objectTransition;
+
+ selectionTable =
jqApp.getTableTreeViewer().getTableTree().getTable().getSelectionIndex();
+
+ if (selectionTable < 0 )
+ {
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(itemCountMax-1);
+ }
+ else if (selectionTable == 0)
+ {
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(0);
+ giveComposite(1,null);
+ itemNotFound = false;
+ }
+ else
+ {
+
+ if (elementSelected.getElements() == null)
+ {
+ select =
jqApp.getTableTreeViewer().getSelection();
+
jqApp.getTableTreeViewer().setSelection(select);
+ itemNotFound = false;
+ }
+ else
+ {
+
+ selectionTable--;
+
+
jqApp.getTableTreeViewer().getTableTree().getTable().setSelection(selectionTable);
+
+ }
+ }
+
+ }
+ }
+
+
+ /**
+ * This method get the LibQSOS variable.
+ * When you changed a field in the tableTreeViewer, it was save in this
LibQSOS.
+ * This LibQSOS have no header, which was delete in open, just an
element named "Header"
+ * with no children
+ *
+ *
+ * @return libQSOS
+ *
+ */
+ public LibQSOS getLibQSOS()
+ {
+ return libQSOS;
+ }
+
+
+ /**
+ * This method set the LibQSOS variable.
+ * When you changed a field in the tableTreeViewer, it was save in this
LibQSOS.
+ * This LibQSOS have no header, which was delete in open, just an
element named "Header"
+ * with no children
+ *
+ *
+ * @param libQSOS
+ */
+ public void setLibQSOS(LibQSOS libQSOS)
+ {
+ this.libQSOS = libQSOS;
+ }
+
+ /**
+ * This method get the saveLibQSOS variable.
+ * When you changed a field in the tableTreeViewer, it was save in this
LibQSOS.
+ * This LibQSOS have no header, which was delete in open, just an
element named "Header"
+ * with no children
+ *
+ *
+ * @return saveLibQSOS
+ */
+ public LibQSOS getSaveLibQSOS()
+ {
+ return saveLibQSOS;
+ }
+
+ /**
+ * This method set the saveLibQSOS variable.
+ * When you changed a field in the tableTreeViewer, it was NOT save in
this saveLibQSOS.
+ * Only all informations of the header was save and load in this
variable.
+ * When the user saves, all informations of libQSOS was saved in
saveLibQSOS.
+ *
+ *
+ * @param saveLibQSOS
+ */
+ public void setSaveLibQSOS(LibQSOS saveLibQSOS)
+ {
+ this.saveLibQSOS = saveLibQSOS;
+ }
+
+
+
+
+
+ /**
+ * This method return an AnswerGroup.
+ * An answerGroup is a group with fields to complete (or precomplete).
+ * It was created for help to complete the tableTreeViewer.
+ *
+ * When you change the selection in a tableTreeViewer answer is not
recreated but recompleted with the new element.
+ * AnswerGroup have keyListener for simplification of navigation in
tableTreeViewer:
+ * Enter: for go to next score
+ * Escape: for cancel the text writed
+ * Up/down: for navigate in the tableTreeViewer (like
enter)
+ * Tab: for complete the comment
+ *
+ *
+ * @return Returns the answerGroup.
+ */
+ public Group getAnswerGroup()
+ {
+ return answerGroup;
+ }
+ /**
+ * This method set the AnswerGroup.
+ * An answerGroup is a group with fields to complete (or precomplete).
+ * It was created for help to complete the tableTreeViewer.
+ *
+ * When you change the selection in a tableTreeViewer answer is not
recreated but recompleted with the new element.
+ * AnswerGroup have keyListener for simplification of navigation in
tableTreeViewer:
+ * Enter: for go to next score
+ * Escape: for cancel the text writed
+ * Up/down: for navigate in the tableTreeViewer (like
enter)
+ * Tab: for complete the comment
+ *
+ *
+ *
+ * @param answerGroup
+ * The answerGroup to set.
+ */
+ public void setAnswerGroup(Group answerGroup)
+ {
+ this.answerGroup = answerGroup;
+ }
+
+
+
+
+ /**
+ * This method get the headerGroup.
+ * A headerGroup is a group with fields, relative of the header, to
complete (or precomplete).
+ * It was created for help to complete the tableTreeViewer.
+ *
+ * headerGroup have keyListener for simplification of navigation in
tableTreeViewer:
+ * Enter or Tab: for go to next field
+ * Escape: for cancel the text writed
+ *
+ *
+ * @return Returns the headerGroup.
+ */
+ public Group getHeaderGroup()
+ {
+ return headerGroup;
+ }
+
+ /**
+ * This method set the headerGroup.
+ * A headerGroup is a group with fields, relative of the header, to
complete (or precomplete).
+ * It was created for help to complete the tableTreeViewer.
+ *
+ * headerGroup have keyListener for simplification of navigation in
tableTreeViewer:
+ * Enter or Tab: for go to next field
+ * Escape: for cancel the text writed
+ *
+ *
+ *
+ * @param headerGroup
+ */
+ public void setHeaderGroup(Group headerGroup) {
+ this.headerGroup = headerGroup;
+ }
+
+ /**
+ * Method for set the tableTreeViewer of the sheetCTabItem
+ *
+ * @return tableTreeViewer
+ */
+ public TableTreeViewer getTableTreeViewer()
+ {
+ return tableTreeViewer;
+ }
+
+ /**
+ * Method for get the tableTreeViewer of the sheetCTabItem
+ *
+ * @param tableTreeViewer
+ */
+ public void setTableTreeViewer(TableTreeViewer tableTreeViewer)
+ {
+ this.tableTreeViewer = tableTreeViewer;
+ }
+
+
+ /**
+ * Method for reinitialize the sheet :
+ * only the fields of libQSOS are reinitialized.
+ *
+ * @param answer
+ * answer is a array of 3 booleans
+ * when answer[0] is true the scores of
the sheet are reinitialized
+ * when answer[0] is true the comments of
the sheet are reinitialized
+ * when answer[0] is true the header of
the sheet are reinitialized
+ */
+ public void reInitialized(boolean answer[])
+ {
+
+ // Set the first element to the header
+ tableTreeViewer.getTableTree().getTable().setSelection(1);
+
+ boolean scoreSelected = answer[0];
+ boolean commentSelected = answer[1];
+ boolean headerSelected = answer[2];
+
+ // Declaration
+ int selectionTable;
+ ISelection select ;
+ TableTreeItem[] item ;
+ IElement elementSelected;
+
+ // Force focus on the tableTreeViewer
+ tableTreeViewer.getTableTree().getTable().setFocus();
+
+
+ int itemCountMax =
tableTreeViewer.getTableTree().getTable().getItems().length;
+
+ String text;
+ do
+ {
+ select = tableTreeViewer.getSelection();
+ StructuredSelection structuredSelectionTransition =
(StructuredSelection) select;
+ Object objectTransition =
structuredSelectionTransition.getFirstElement();
+ elementSelected = (IElement) objectTransition;
+
+ selectionTable =
tableTreeViewer.getTableTree().getTable().getSelectionIndex();
+
+ if ( (selectionTable > 0) && (selectionTable <
itemCountMax) )
+ {
+ if (elementSelected != null)
+ {
+ try
+ {
+ if (scoreSelected)
+ {
+
elementSelected.setScore(""); //$NON-NLS-1$
+ }
+ if (commentSelected)
+ {
+
elementSelected.setComment(""); //$NON-NLS-1$
+ }
+
+ } catch (IOException e)
+ {
+
System.out.println(Messages.getString("SheetCTabItem.ErrorInitializeScoreComment"));
//$NON-NLS-1$
+ e.printStackTrace();
+ }
+
+
+ }
+ selectionTable++;
+
tableTreeViewer.getTableTree().getTable().setSelection(selectionTable);
+
+ }
+
+ }while ((selectionTable > 0)&&(selectionTable < itemCountMax));
+
+ if (headerSelected)
+ {
+ textLanguage.setText(""); //$NON-NLS-1$
+ //textAppname.setText(""); //$NON-NLS-1$
+ textRelease.setText(""); //$NON-NLS-1$
+ textLicense.setText(""); //$NON-NLS-1$
+ textDesc.setText(""); //$NON-NLS-1$
+ textUrl.setText(""); //$NON-NLS-1$
+ textAuthors.setText(""); //$NON-NLS-1$
+ textAuthorsMail.setText(""); //$NON-NLS-1$
+ }
+
+ tableTreeViewer.getTableTree().getTable().setSelection(0);
+
+ tableTreeViewer.refresh();
+
+ }
+}
Index: src/org/qsos/interfaces/SheetCellModifier.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetCellModifier.java
diff -N src/org/qsos/interfaces/SheetCellModifier.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetCellModifier.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,238 @@
+/*
+** $Id: SheetCellModifier.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+import java.io.IOException;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.Item;
+import org.qsos.data.IElement;
+import org.qsos.data.JQConst;
+import org.qsos.data.Messages;
+
+/**
+ * This class represents the cell modifier for the JQEditor program
+ */
+/**
+ * @author MULOT_L
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class SheetCellModifier implements ICellModifier
+{
+ private Viewer viewer;
+ private String title;
+ private String desc;
+ private String comment;
+ private String score;
+
+ /**
+ * @param viewer
+ */
+ public SheetCellModifier(Viewer viewer)
+ {
+ this.viewer = viewer;
+ title = Messages.getString("JQ.TitleColumn");
+ desc = Messages.getString("JQ.DescColumn");
+ comment = Messages.getString("JQ.CommentColumn");
+ score = Messages.getString("JQ.ScoreColumn");
+ }
+
+ /**
+ * Returns whether the property can be modified
+ *
+ * @param element
+ * the element
+ * @param property
+ * the property
+ * @return boolean
+ */
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
java.lang.String)
+ */
+ public boolean canModify(Object element, String property)
+ {
+ // Allow editing of all values
+
+ // Can be changed by the last condition more the condition on
the property
+ if ( ((String) ((IElement)element).getDesc0() != "" ) &&
((String) ((IElement)element).getDesc1() != "" ) && ((String)
((IElement)element).getDesc2() != "" )) //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ {
+ if ( property.equalsIgnoreCase(score))
+ {
+ //viewer.getControl().setBackground(new
Color(null, 1,100,1));
+ return true;
+ }
+ else if ( property.equalsIgnoreCase(comment))
+ {
+ //viewer.getControl().setBackground(new
Color(null, 1,100,1));
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if ( property.equalsIgnoreCase(comment))
+ {
+ //viewer.getControl().setBackground(new
Color(null, 1,100,1));
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ //return true;
+ }
+
+
+ /**
+ * Returns the value for the property
+ *
+ * @param element
+ * the element
+ * @param property
+ * the property
+ * @return Object
+ */
+ public Object getValue(Object element, String property)
+ {
+ IElement p = (IElement) element;
+ if (title.equals(property))
+ {
+ return p.getTitle();
+ }
+ else if (desc.equalsIgnoreCase(property))
+ {
+ if (( (IElement) element).getDesc() != "") //$NON-NLS-1$
+ {
+ return p.getDesc();
+ }
+ else// if ( ((IElement) element).getScore() != "" )
+ {
+ if (((IElement) element).getScore() ==
JQConst.SCORE_0)
+ {
+ return p.getDesc0();
+ }
+ else if (((IElement) element).getScore() ==
JQConst.SCORE_1)
+ {
+ return p.getDesc1();
+ }
+ else
+ {
+ return p.getDesc2();
+ }
+ }
+ }
+ else if (comment.equalsIgnoreCase(property))
+ {
+ return p.getComment();
+ }
+ else if (score.equalsIgnoreCase(property))
+ {
+ return p.getScore();
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+
+ /**
+ * Modifies the element
+ *
+ * @param element
+ * the element
+ * @param property
+ * the property
+ * @param value
+ * the value
+ */
+ public void modify(Object element, String property, Object value)
+ {
+ if (element instanceof Item)
+ {
+ element = ((Item) element).getData();
+ }
+
+
+ IElement p = (IElement) element;
+
+ if (title.equals(property))
+ {
+ p.setTitle((String) value);
+ }
+ else if (desc.equalsIgnoreCase(property))
+ {
+ if (( (IElement) element).getDesc() != "") //$NON-NLS-1$
+ {
+ p.setDesc((String) value);
+ }
+ else// if ( ((IElement) element).getScore() != "" )
+ {
+ if (((IElement) element).getScore() ==
JQConst.SCORE_0)
+ {
+ p.setDesc0((String) value);
+ }
+ else if (((IElement) element).getScore() ==
JQConst.SCORE_1)
+ {
+ p.setDesc1((String) value);
+ }
+ else
+ {
+ p.setDesc2((String) value);
+ }
+ }
+ }
+ else if (comment.equalsIgnoreCase(property))
+ {
+ p.setComment((String) value);
+ }
+ else if (score.equalsIgnoreCase(property))
+ {
+ try
+ {
+ // If the value is not 0,1 or 2 the value is
not save
+ if
((((String)value).equals(JQConst.SCORE_0))||(((String)value).equals(JQConst.SCORE_1))||(((String)value).equals(JQConst.SCORE_2)))
+ {
+ p.setScore((String) value);
+ }
+ } catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ // Force the viewer to refresh
+ viewer.refresh();
+ }
+}
\ No newline at end of file
Index: src/org/qsos/interfaces/SheetTableTreeContentProvider.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetTableTreeContentProvider.java
diff -N src/org/qsos/interfaces/SheetTableTreeContentProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetTableTreeContentProvider.java 16 Jun 2006
14:16:35 -0000 1.1
@@ -0,0 +1,134 @@
+/*
+** $Id: SheetTableTreeContentProvider.java,v 1.1 2006/06/16 14:16:35 goneri
Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.qsos.data.Element;
+import org.qsos.data.ISheet;
+
+
+public class SheetTableTreeContentProvider implements ITreeContentProvider
+{
+
+
+ /**
+ * This class provides the content for the TableTreeViewer in
SheetTableTree
+ */
+ private static final Object[] EMPTY = new Object[] {};
+
+ private ISheet iSheet;
+
+ public SheetTableTreeContentProvider(ISheet sheet)
+ {
+ super();
+ iSheet = sheet;
+ }
+
+ /**
+ * Gets the children for a Element
+ *
+ * @param arg0 the Element
+ * @return Object[]
+ */
+ public Object[] getChildren(Object arg0)
+ {
+ if (arg0 instanceof Element)
+ {
+ if ( ((Element) arg0).getElements() != null )
+ {
+ return ((Element) arg0).getElements().toArray();
+ }
+ else
+ {
+ return EMPTY;
+ //return ((List) arg0).toArray();
+ //return (Element[]) ((List) arg0).toArray(new
Element[((List) arg0).size()]);
+ }
+ }
+
+ // If error with sheet
+ return EMPTY;
+ }
+
+ /**
+ * Gets the parent Element for an other Element
+ *
+ * @param arg0 the Element
+ * @return Object
+ */
+ public Object getParent(Object arg0)
+ {
+ return ((Element) arg0).getContainer();
+ }
+
+ /**
+ * Gets whether this Element has children
+ *
+ * @param arg0 the Element
+ * @return boolean
+ */
+ public boolean hasChildren(Object arg0)
+ {
+ return getChildren(arg0).length > 0;
+ }
+
+ /**
+ * Gets the elements for the table
+ *
+ * @param arg0 the model
+ * @return Object[]
+ */
+ public Object[] getElements(Object arg0)
+ {
+ // Returns all the teams in the model
+ //return ((PlayerTableModel) arg0).teams;
+ //return ( (Element) arg0).getContainer().getElement
+ return ((Element) iSheet.getRoot()).getElements().toArray();
+ }
+
+ /**
+ * Disposes any resources
+ */
+ public void dispose()
+ {
+ // We don't create any resources, so we don't dispose any
+ }
+
+ /**
+ * Called when the input changes
+ *
+ * @param arg0 the parent viewer
+ * @param arg1 the old input
+ * @param arg2 the new input
+ */
+ public void inputChanged(Viewer arg0, Object arg1, Object arg2)
+ {
+ // Nothing to do
+ }
+}
Index: src/org/qsos/interfaces/SheetTableTreeLabelProvider.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetTableTreeLabelProvider.java
diff -N src/org/qsos/interfaces/SheetTableTreeLabelProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetTableTreeLabelProvider.java 16 Jun 2006
14:16:35 -0000 1.1
@@ -0,0 +1,235 @@
+/*
+** $Id: SheetTableTreeLabelProvider.java,v 1.1 2006/06/16 14:16:35 goneri Exp
$
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.qsos.data.IElement;
+import org.qsos.data.JQConst;
+
+/**
+ * This class provides the labels for PlayerTable
+ */
+public class SheetTableTreeLabelProvider implements ITableLabelProvider
+{
+ // Image to display if the player led his team
+ private Image image = null;
+
+ // Constructs a PlayerLabelProvider
+ public SheetTableTreeLabelProvider()
+ {
+ super();
+
+ }
+
+ /**
+ * Gets the image for the specified column
+ *
+ * @param arg0
+ * the player
+ * @param arg1
+ * the column
+ * @return Image
+ */
+ public Image getColumnImage(Object arg0, int arg1)
+ {
+ return image;
+ }
+
+ /**
+ * Gets the text for the specified column
+ *
+ * @param arg0
+ * the player
+ * @param arg1
+ * the column
+ * @return String
+ */
+ public String getColumnText(Object arg0, int arg1)
+ {
+ IElement element = (IElement) arg0;
+ String text = ""; //$NON-NLS-1$
+
+
+ if ( element.getElements() == null)
+ {
+ if ( element.getDesc() == "" ) //$NON-NLS-1$
+ {
+
+ switch (arg1)
+ {
+ case JQConst.COLUMN_TITLE:
+ text = element.getTitle();
+ break;
+ case JQConst.COLUMN_DESC:
+ if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_0))
+ {
+ //String text =
+ //comboBox.se
+ text =
element.getDesc0();
+
+ }
+ else if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_1))
+ {
+ text =
element.getDesc1();
+ }
+ else if
(element.getScore().equalsIgnoreCase(JQConst.SCORE_2))
+ {
+ text =
element.getDesc2();
+ }
+ break;
+ case JQConst.COLUMN_COMMENT:
+ text = element.getComment();
+ break;
+ case JQConst.COLUMN_SCORE:
+ text = element.getScore();
+ break;
+ }
+
+ }
+ else
+ {
+ switch (arg1)
+ {
+ case JQConst.COLUMN_TITLE:
+ text = element.getDesc();
+ break;
+ case JQConst.COLUMN_DESC:
+ text = element.getComment();
+ break;
+ }
+ }
+
+ }
+ else
+ {
+ if ( element.getElements() != null)
+ {
+ if ( element.getDesc() != "") //$NON-NLS-1$
+ {
+ switch (arg1)
+ {
+ case JQConst.COLUMN_TITLE:
+ text =
element.getDesc();
+ break;
+ }
+ }
+ else if ( element.getTitle() != null)
+ {
+
+ // Case: main section
+ switch (arg1)
+ {
+ case JQConst.COLUMN_TITLE:
+ text =
element.getTitle();
+ break;
+ }
+
+ }
+ else
+ {
+ // Last case (for header)
+ // Nothing
+ }
+ }
+ else
+ {
+ // Inexistant Case
+ //text = element.toString();
+ text = element.getText();
+ }
+
+ }
+
+ return text;
+ }
+
+ /**
+ * Adds a listener
+ *
+ * @param arg0
+ * the listener
+ */
+ public void addListener(ILabelProviderListener arg0)
+ {
+ // Throw it away
+ new Listener()
+ {
+
+ public void handleEvent(Event arg0) {
+ switch (arg0.type)
+ {
+ case SWT.Selection:
+ System.out.println(arg0);
+ break;
+ }
+
+ }
+
+ };
+ }
+
+ /**
+ * Dispose any created resources
+ */
+ public void dispose()
+ {
+ // Dispose
+ }
+
+ /**
+ * Returns whether the specified property, if changed, would affect the
+ * label
+ *
+ * @param arg0
+ * the player
+ * @param arg1
+ * the property
+ * @return boolean
+ */
+ public boolean isLabelProperty(Object arg0, String arg1)
+ {
+ return false;
+ }
+
+ /**
+ * Removes the specified listener
+ *
+ * @param arg0
+ * the listener
+ */
+ public void removeListener(ILabelProviderListener arg0)
+ {
+ // Do nothing
+
+ }
+}
\ No newline at end of file
Index: src/org/qsos/interfaces/SheetTreeContentProvider.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetTreeContentProvider.java
diff -N src/org/qsos/interfaces/SheetTreeContentProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetTreeContentProvider.java 16 Jun 2006
14:16:35 -0000 1.1
@@ -0,0 +1,131 @@
+/*
+** $Id: SheetTreeContentProvider.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.custom.CTabFolder;
+import org.qsos.data.Element;
+import org.qsos.data.ISheet;
+
+/**
+ * This class provides the content for the tree in FileTree
+ */
+public class SheetTreeContentProvider implements ITreeContentProvider
+{
+private static final Object[] EMPTY = new Object[] {};
+
+ private ISheet iSheet;
+
+
+ public SheetTreeContentProvider(CTabFolder cTabFolder)
+ {
+ super();
+ iSheet = ((SheetCTabItem)
cTabFolder.getSelection()).getLibQSOS().getSheet();
+ }
+
+
+ /**
+ * Gets the children for a Element
+ *
+ * @param arg0 the Element
+ * @return Object[]
+ */
+ public Object[] getChildren(Object arg0)
+ {
+ if (arg0 instanceof Element)
+ {
+ if ( ((Element) arg0).getElements()!= null )
+ {
+ return ((Element) arg0).getElements().toArray();
+ }
+ else
+ {
+ return EMPTY;
+ }
+ }
+
+ // If error with sheet
+ return EMPTY;
+ }
+
+ /**
+ * Gets the parent Element for an other Element
+ *
+ * @param arg0 the Element
+ * @return Object
+ */
+ public Object getParent(Object arg0)
+ {
+ return ((Element) arg0).getContainer();
+ }
+
+ /**
+ * Gets whether this Element has children
+ *
+ * @param arg0 the Element
+ * @return boolean
+ */
+ public boolean hasChildren(Object arg0)
+ {
+ return getChildren(arg0).length > 0;
+ }
+
+ /**
+ * Gets the elements for the table
+ *
+ * @param arg0 the model
+ * @return Object[]
+ */
+ public Object[] getElements(Object arg0)
+ {
+ // Returns all the teams in the model
+ //return ((PlayerTableModel) arg0).teams;
+ //return ( (Element) arg0).getContainer().getElement
+ return ((Element) iSheet.getRoot()).getElements().toArray();
+ }
+
+ /**
+ * Disposes any resources
+ */
+ public void dispose()
+ {
+ // We don't create any resources, so we don't dispose any
+ }
+
+ /**
+ * Called when the input changes
+ *
+ * @param arg0 the parent viewer
+ * @param arg1 the old input
+ * @param arg2 the new input
+ */
+ public void inputChanged(Viewer arg0, Object arg1, Object arg2)
+ {
+ // Nothing to do
+ }
+}
\ No newline at end of file
Index: src/org/qsos/interfaces/SheetTreeLabelProvider.java
===================================================================
RCS file: src/org/qsos/interfaces/SheetTreeLabelProvider.java
diff -N src/org/qsos/interfaces/SheetTreeLabelProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/interfaces/SheetTreeLabelProvider.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,47 @@
+/*
+** $Id: SheetTreeLabelProvider.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.interfaces;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.qsos.data.Element;
+
+public class SheetTreeLabelProvider extends LabelProvider
+{
+ public String getText(Object element)
+ {
+
+ if ( ( (Element) element).getTitle() != null)
+ {
+ return ( (Element) element).getTitle();
+ }
+ else
+ {
+ return ( (Element) element).getDesc();
+ }
+
+ }
+}
Index: src/org/qsos/main/JQ.java
===================================================================
RCS file: src/org/qsos/main/JQ.java
diff -N src/org/qsos/main/JQ.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/main/JQ.java 16 Jun 2006 14:16:35 -0000 1.1
@@ -0,0 +1,988 @@
+/*
+** $Id: JQ.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.main;
+
+
+import org.eclipse.jface.action.CoolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableTreeViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.TableTreeItem;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.qsos.action.OpenSheetAction;
+import org.qsos.action.PrintAction;
+import org.qsos.action.ReinitializeFieldsAction;
+import org.qsos.action.SaveSheetAction;
+import org.qsos.action.RadarAction;
+import org.qsos.data.IElement;
+import org.qsos.data.ImageRegistryQSOS;
+import org.qsos.data.JQConst;
+import org.qsos.data.Messages;
+import org.qsos.interfaces.SheetCTabItem;
+import org.qsos.interfaces.SheetCellModifier;
+import org.qsos.interfaces.SheetTableTreeContentProvider;
+import org.qsos.interfaces.SheetTableTreeLabelProvider;
+import org.qsos.interfaces.SheetTreeContentProvider;
+import org.qsos.interfaces.SheetTreeLabelProvider;
+import org.qsos.utils.LibQSOS;
+
+
+
+
+/**
+ * @author MODELIN_M
+ *
+ * JQ is the main class of the JQEditor program.
+ * This class is extends of ApplicationWindow.
+ *
+ */
+public class JQ extends ApplicationWindow
+{
+ // This application
+ private JQ jq;
+
+
+ // Variables for Actions
+ private OpenSheetAction openSheetAction;
+ private RadarAction radarAction;
+ private SaveSheetAction saveSheetAction;
+ private PrintAction printAction;
+ private ReinitializeFieldsAction reinitializeFieldsAction;
+
+
+ // main TabFolder for the sheet's view
+ private CTabFolder cTabFolder;
+
+ // TableTreeViewer
+ private TableTreeViewer tableTreeViewer;
+
+ //
+ public ImageRegistryQSOS imageRegistry;
+
+ // TreeViewer
+ private TreeViewer treeViewer;
+
+ // Composite for the treeView
+ private Composite treeViewComposite;
+
+ // Composite for the answer
+ private Composite answerComposite;
+
+
+
+
+ /**
+ * Contructor: add a ToolBar and a StatusLine
+ *
+ * @param parentShell
+ * Shell
+ */
+ public JQ(Shell parentShell)
+ {
+ super(parentShell);
+ imageRegistry = new ImageRegistryQSOS();
+
+ addStatusLine();
+ addToolBar(SWT.BORDER);
+ }
+
+
+
+
+ /**
+ * Contructor
+ */
+ public JQ()
+ {
+ super(null);
+
+ addStatusLine();
+ addCoolBar(SWT.BORDER);
+ }
+
+ /**
+ * Method for run the JQ application.
+ *
+ */
+ public void run()
+ {
+ // Don't return from open() until window closes
+ setBlockOnOpen(true);
+
+ // Open the main window
+ open();
+
+ // Dispose the display
+ Display.getCurrent().dispose();
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ protected void configureShell(Shell shell)
+ {
+ super.configureShell(shell);
+
+ shell.setBackground(JQConst.backGround_JQEditor);
+
+ shell.setText(Messages.getString("JQ.nameEditor"));
//$NON-NLS-1$
+
+ getCoolBarManager().getControl().setSize(80,30);
+
+ imageRegistry = new ImageRegistryQSOS();
+
+ shell.setImage(
imageRegistry.get(Messages.getString("JQ.iconApplication"))); //$NON-NLS-1$
+
+
+ // Initialize action
+ openSheetAction = new OpenSheetAction(this);
+ radarAction = new RadarAction(this);
+ saveSheetAction = new SaveSheetAction(this);
+ printAction = new PrintAction(this);
+ reinitializeFieldsAction = new ReinitializeFieldsAction(this);
+
+ // Initialize jq
+ jq = this;
+
+ }
+
+
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.ApplicationWindow#createToolBarManager(int)
+ */
+ protected ToolBarManager createToolBarManager(int style)
+ {
+
+ // Initialize Action
+ //-------------------
+ openSheetAction = new OpenSheetAction(this);
+ radarAction = new RadarAction(this);
+ saveSheetAction = new SaveSheetAction(this);
+ printAction = new PrintAction(this);
+ reinitializeFieldsAction = new ReinitializeFieldsAction(this);
+
+
+ ToolBarManager toolBarManager = new ToolBarManager(style);
+
+ toolBarManager.add(new Separator());
+ toolBarManager.add(openSheetAction);
+ toolBarManager.add(saveSheetAction);
+ toolBarManager.add(printAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(radarAction);
+ toolBarManager.add(new Separator());
+ toolBarManager.add(reinitializeFieldsAction);
+
+ return toolBarManager;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.ApplicationWindow#createCoolBarManager(int)
+ */
+ protected CoolBarManager createCoolBarManager(int style)
+ {
+
+ CoolBarManager cool_bar_manager = new CoolBarManager(SWT.LEFT);
+
+ cool_bar_manager.add(createToolBarManager(SWT.LEFT));
+
+ return cool_bar_manager;
+ }
+
+
+
+
+ /* (non-Javadoc)
+ * @see
org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent)
+ {
+ parent.setBackground(JQConst.backGround_JQEditor);
+
+ getShell().setMaximized(true);
+
+ // Creation of a FormLayout for organize the main Window
+ FormLayout mainFormLayout = new FormLayout();
+ parent.setLayout(mainFormLayout);
+
+
+ // Attribuate a formData to the CoolBar for set its emplacement
+ FormData formDataCoolBar = new FormData();
+ getCoolBarControl().setLayoutData(formDataCoolBar);
+
+ // Set the emplacement of the top of CoolBar
+ formDataCoolBar.top = new FormAttachment(0,5);
+
+ // We create the main CTabFolder
+ createCTabFolder(parent);
+
+
+ // We create the TreeViewer
+ createTreeViewer(parent);
+
+ // Create the window for the answer
+ createAnswerComposite(parent);
+
+ return parent;
+
+ }
+
+
+ /**
+ *
+ * This class create the answerComposite
+ * It s a window under the main window.
+ * It permits to the user to complete the fields of sheet
+ *
+ * @param parent
+ * composite where the window is visible
+ *
+ */
+ protected void createAnswerComposite( Composite parent )
+ {
+
+ // Create the new Composite for the AnswerWindow
+ answerComposite = new Composite(parent, SWT.BORDER);
+
+ // Creation of a formData for AnswerComposite
+ FormData formDataAnswerComposite = new FormData();
+
+ // Attribuate a formData to the CTabFolder
+ answerComposite.setLayoutData(formDataAnswerComposite);
+
+ // Set the emplacement of the CTabFolder
+ formDataAnswerComposite.top = new FormAttachment(cTabFolder,5);
+ formDataAnswerComposite.left = new
FormAttachment(treeViewComposite,5);
+ formDataAnswerComposite.bottom = new FormAttachment(100,-5);
+ formDataAnswerComposite.right = new FormAttachment(100,-5);
+
+
+ // Set color for the AnswerComposite
+ answerComposite.setBackground(JQConst.backGround_JQEditor);
+ }
+
+
+
+ /**
+ *
+ * Method for refresh the AnswerComposite of the JQ application
+ *
+ */
+ public void refreshAnswerComposite()
+ {
+ //Creation of a formData for AnswerComposite
+ FormData formDataAnswerComposite = new FormData();
+
+ // Attribuate a formData to the CTabFolder
+ answerComposite.setLayoutData(formDataAnswerComposite);
+
+ // Set emplacement of the CTabFolder
+ formDataAnswerComposite.top = new
FormAttachment(cTabFolder,5,SWT.BOTTOM);
+ formDataAnswerComposite.left = new
FormAttachment(treeViewComposite,5,SWT.RIGHT);
+ formDataAnswerComposite.bottom = new FormAttachment(100,-5);
+ formDataAnswerComposite.right = new
FormAttachment(cTabFolder,-5,SWT.RIGHT);
+
+
+ }
+
+
+ /**
+ * This class create the CTabFolder in a composite with good's
properties
+ * The CTabItem contains properties of sheet
+ * Two listeners are implemented: one for Selection and an other for
resize.
+ *
+ *
+ * @param parent
+ * composite where the CTabFolder is
visible
+ */
+ protected void createCTabFolder(final Composite parent)
+ {
+ // Attribuate a formData to the CTabFolder
+ FormData formDataTableFolder = new FormData();
+
+ // Create a CTabFolder
+ cTabFolder = new CTabFolder(parent, SWT.CLOSE | SWT.FLAT |
SWT.BORDER);
+
+ // Set same height between buttons of coolBar and the TabFolder
+
cTabFolder.setTabHeight(getCoolBarManager().getControl().getSize().y);
+
+ // Style of the tabulation
+ cTabFolder.setSimple(false);
+ cTabFolder.setBorderVisible(false);
+
+ // Attribuate a FormLayout to a CTabFolder for set his
emplacement
+ cTabFolder.setLayoutData(formDataTableFolder);
+
+ //Put the border of cTabFolder visible
+ cTabFolder.setBorderVisible(true);
+
+ // Set emplacement of the CTabFolder
+ formDataTableFolder.top = new FormAttachment(0,5);
+ formDataTableFolder.left = new
FormAttachment(getCoolBarControl(),5);
+ formDataTableFolder.bottom = new FormAttachment(75,-5);
+ formDataTableFolder.right = new FormAttachment(100,-5);
+
+ // Set color of the background
+ cTabFolder.setBackground(JQConst.backGround_JQEditor);
+
+ // Set the color for the CTabItem selected
+ cTabFolder.setSelectionBackground(JQConst.backGround_JQEditor3);
+
+ // Put the "close" of cTabFolder unselected unvisible
+ cTabFolder.setUnselectedCloseVisible(false);
+
+
+ cTabFolder.addListener(SWT.Resize, new Listener()
+ {
+ public void handleEvent(Event e)
+ {
+ switch (e.type)
+ {
+ case SWT.Resize:
+ if (cTabFolder != null)
+ {
+ if (cTabFolder.getItemCount() >
0)
+ {
+
refreshTableTreeViewer();
+
refreshAnswerComposite();
+
((SheetCTabItem)cTabFolder.getSelection()).giveComposite(0,null);
+
+ }
+ }
+ break;
+ }
+ }
+ });
+
+
+
+ cTabFolder.addSelectionListener( new SelectionListener()
+ {
+
+ public void widgetSelected(SelectionEvent arg0)
+ {
+ // Case when you select a tab
+ if (cTabFolder.getItemCount()>0)
+ {
+ // Refresh the treeViewer
+ refreshTreeViewer();
+
+ // Set all answerGroup hide
+ for (int i=0; i<
cTabFolder.getItemCount();i++)
+ {
+
((SheetCTabItem)cTabFolder.getItem(i)).getHeaderGroup().setVisible(false);
+
((SheetCTabItem)cTabFolder.getItem(i)).getAnswerGroup().setVisible(false);
+ }
+
+ // Set the answerGroup of the tab
selected visible
+ ((SheetCTabItem)
cTabFolder.getSelection()).getHeaderGroup().setVisible(true);
+
+ }
+ }
+
+
+ public void widgetDefaultSelected(SelectionEvent arg0)
+ {
+ // Nothing
+ }
+
+ });
+ }
+
+
+
+ /**
+ *
+ * Method for create the TableTreeViewer with good properties and size.
+ * A listener of selection is implemented (type
ISelectionChangedListener)
+ * This listener refreshs the AnswerComposite and the treeViewer
+ *
+ * @param parent
+ * Composite where the TableTreeViewer is
show
+ *
+ * @param sheetCTabItem
+ * TabItem of the CTabFolder where's sheet
is open
+ *
+ * @return
+ * Control of tableTreeViewer
+ */
+ protected Control createTableTreeViewer(Composite parent, SheetCTabItem
sheetCTabItem)
+ {
+ // Create the table viewer to display the sheet
+ tableTreeViewer = new TableTreeViewer(parent);
+ tableTreeViewer.getTableTree().setLayoutData(new
GridData(GridData.FILL_BOTH));
+
+ // Set the content and label providers
+ tableTreeViewer.setContentProvider( new
SheetTableTreeContentProvider( sheetCTabItem.getLibQSOS().getSheet() ));
+ tableTreeViewer.setLabelProvider( new
SheetTableTreeLabelProvider() );
+
+ // Copy getRoot in element...
+ IElement element =
sheetCTabItem.getLibQSOS().getSheet().getRoot();
+
+ // Set header NULL
+ ((IElement)element.getElements().get(0)).setElements(null);
+ // DO NOT CHANGE THE TERME OF JQ.HEADER
+ // IF YOU CHANGED SOMETHING CHANGE IN THE LISTENER OF
tableTreeViewer some lines under
+
((IElement)element.getElements().get(0)).setDesc(Messages.getString("JQ.header"));
//$NON-NLS-1$
+
+
+
+ tableTreeViewer.setInput(element);
+
+ //sheetCTabItem.getLibQSOS().setSheet(sheetSave);
+
//((IElement)sheetCTabItem.getLibQSOS().getSheet().getRoot()).addElement((IElement)
sheetSave.getRoot().getElements().get(0));
+
+
+ // Set up the table
+ Table table = tableTreeViewer.getTableTree().getTable();
+ new TableColumn(table,SWT.LEFT); // Title column
+ new TableColumn(table,SWT.LEFT); // Desc0,1,2 Column
+ new TableColumn(table,SWT.RIGHT); // Comment Column
+ new TableColumn(table,SWT.RIGHT); // Score Column
+
+
+ // Create the CellEditor
+ CellEditor[] tableTreeEditor = new
CellEditor[JQConst.MAX_COLUMN_NUMBER];
+
+ // Loop for put TextCellEditor in the table
+ int i = 0;
+ for ( i = 0; i < JQConst.MAX_COLUMN_NUMBER; i++ )
+ {
+ tableTreeEditor[i] = new TextCellEditor(table);
+ }
+
+ // Set the editor, cell modifier, and column properties
+ String[] titleColumn = {
Messages.getString("JQ.TitleColumn"),Messages.getString("JQ.DescColumn"),
Messages.getString("JQ.CommentColumn"), Messages.getString("JQ.ScoreColumn") };
+ tableTreeViewer.setColumnProperties(titleColumn);
+ tableTreeViewer.setCellModifier( new SheetCellModifier(
tableTreeViewer));
+ tableTreeViewer.setCellEditors(tableTreeEditor);
+
+ // Expand everything
+ tableTreeViewer.expandAll();
+
+ // Pack the columns
+ for (i = 0; i < table.getColumnCount(); i++)
+ {
+ table.getColumn(i).setResizable(true);
+ table.getColumn(i).setMoveable(false);
+
+ // Put field's alignment on left side
+ table.getColumn(i).setAlignment(SWT.LEFT);
+
+ // Resize all columns
+ switch (i)
+ {
+ case JQConst.COLUMN_TITLE:
+
table.getColumn(i).setText(Messages.getString("JQ.TitleColumn")); //$NON-NLS-1$
+
table.getColumn(i).getText().toUpperCase();
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_TITLE
);
+ break;
+ case JQConst.COLUMN_DESC:
+
table.getColumn(i).setText(Messages.getString("JQ.DescColumn")); //$NON-NLS-1$
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_DESC
);
+ break;
+ case JQConst.COLUMN_COMMENT:
+
table.getColumn(i).setText(Messages.getString("JQ.CommentColumn"));
//$NON-NLS-1$
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_COMMENT
);
+ break;
+ case JQConst.COLUMN_SCORE:
+
table.getColumn(i).setText(Messages.getString("JQ.ScoreColumn")); //$NON-NLS-1$
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_SCORE
);
+ break;
+ }
+ }
+
+
+ // Turn off the header et turn on the lines
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ // Scroll to top
+ tableTreeViewer.reveal(tableTreeViewer.getElementAt(0));
+
+
+ //TODO make a method for put color on good section
+ //Put color on item Header
+ table.getItem(0).setBackground(JQConst.backGround_JQEditor);
+
+
+ // Listener for selection on tableTreeViewer
+ tableTreeViewer.addSelectionChangedListener( new
ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent
event)
+ {
+ IStructuredSelection selection =
(IStructuredSelection) event.getSelection();
+
+ // Cast the selection on IElement
+ IElement element =
(IElement)selection.getFirstElement();
+
+ if (element != null)
+ {
+ if ( element.getElements() == null)
+ {
+ if (
element.getDesc().equalsIgnoreCase(Messages.getString("JQ.header")))
//$NON-NLS-1$
+ {
+ if
(cTabFolder.getItemCount()>0)
+ {
+
+ // Set all
answerGroup hide
+ for (int i = 0;
i < cTabFolder.getItemCount();i++)
+ {
+
((SheetCTabItem)cTabFolder.getItem(i)).getHeaderGroup().setVisible(false);
+
((SheetCTabItem)cTabFolder.getItem(i)).getAnswerGroup().setVisible(false);
+ }
+
+ // Set the
answerGroup of the tab selected visible
+
((SheetCTabItem) cTabFolder.getSelection()).getHeaderGroup().setVisible(true);
+ }
+
+ }
+ else
+ {
+ // Common case
+ if
(cTabFolder.getItemCount() > 0)
+ {
+
+ // Set all
answerGroup hide
+ for (int i = 0;
i < cTabFolder.getItemCount();i++)
+ {
+
((SheetCTabItem)cTabFolder.getItem(i)).getHeaderGroup().setVisible(false);
+
((SheetCTabItem)cTabFolder.getItem(i)).getAnswerGroup().setVisible(false);
+ }
+
+
+ //Set the
answerGroup of the tab selected visible
+
((SheetCTabItem) cTabFolder.getSelection()).refreshAnswerComposite(element);
+
+
+ // Select the
answerComposite (Header = 1; Answer != 1)
+ int
answerChoice = 2;
+
((SheetCTabItem)
cTabFolder.getSelection()).giveComposite(answerChoice,element).setVisible(true);
+
+//
+
refreshAnswerComposite();
+
+ }
+ }
+
+ }
+ }
+ }
+ });
+
+
+ return tableTreeViewer.getControl();
+ }
+
+
+ /**
+ *
+ * Method for resize columns of the active tableTreeViewer
+ *
+ */
+ public void refreshTableTreeViewer ()
+ {
+ // Set up the table
+
+ Table table = tableTreeViewer.getTableTree().getTable();
+ table.update();
+ // Pack the columns
+ int i;
+ for (i = 0; i < table.getColumnCount(); i++)
+ {
+
+ cTabFolder.update();
+ //table.getColumn(i).pack();
+ table.getColumn(i).setResizable(true);
+ table.getColumn(i).setMoveable(false);
+
+ // Put field's alignment on left side
+ table.getColumn(i).setAlignment(SWT.LEFT);
+
+
+ // Resize all columns
+ switch (i)
+ {
+ case JQConst.COLUMN_TITLE:
+
//table.getColumn(i).setText(JQConst.TITLE);
+
table.getColumn(i).getText().toUpperCase();
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_TITLE
);
+ break;
+ case JQConst.COLUMN_DESC:
+
//table.getColumn(i).setText(JQConst.DESC);
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_DESC
);
+ break;
+ case JQConst.COLUMN_COMMENT:
+
//table.getColumn(i).setText(JQConst.COMMENT);
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_COMMENT
);
+ break;
+ case JQConst.COLUMN_SCORE:
+
//table.getColumn(i).setText(JQConst.SCORE);
+
table.getColumn(i).setWidth(cTabFolder.getSize().x/JQConst.DENOMINATOR_WIDTH_COLUMN_SCORE
);
+ break;
+ }
+
+ }
+ }
+
+
+
+
+ /**
+ *
+ * Method for create the treeViewer
+ * This method set the BackGround'color, the formData and
+ * set a listener on selection ( SelectionChangedListener )
+ *
+ *
+ * @param parent
+ * composite where's treeViewer is visible
+ *
+ *
+ */
+ protected void createTreeViewer(Composite parent)
+ {
+
+ // Creation of a composite in the TreeViewer
+ treeViewComposite = new Composite(parent,SWT.BORDER | SWT.FLAT);
+
+ // Set the background with the color of JQEditor
+ treeViewComposite.setBackground(JQConst.backGround_JQEditor);
+
+
+ // Attribuate a layout to headerComposite
+ treeViewComposite.setLayout(new FormLayout());
+
+ // Creation of the FormData for the compositeTreeView
+ FormData formDataTreeViewComposite = new FormData();
+
+ // Attribuate a formData to the treeViewComposite
+ treeViewComposite.setLayoutData(formDataTreeViewComposite);
+
+
+ // Set position of treeViewComposite
+ formDataTreeViewComposite.top = new
FormAttachment(getCoolBarControl(),5,SWT.DOWN);
+ formDataTreeViewComposite.left = new FormAttachment(0,5);
+ formDataTreeViewComposite.right = new
FormAttachment(cTabFolder,-5,SWT.LEFT);
+ formDataTreeViewComposite.bottom = new FormAttachment(100,-5);
+
+
+ // Create the treeViewer
+ treeViewer = new TreeViewer(treeViewComposite,SWT.LEFT);
+
+ // Set the background of the treeVeiwer with the color of
JQEditor
+
treeViewer.getControl().setBackground(JQConst.backGround_JQEditor);
+
+ // Create a formData for the treeViewer and attribuate it to
the treeView
+ FormData formDataTreeViewer = new FormData();
+ treeViewer.getTree().setLayoutData(formDataTreeViewer);
+
+ // Set position of treeVewer on the composite
+ formDataTreeViewer.top = new FormAttachment(0,5);
+ formDataTreeViewer.left = new FormAttachment(0,5);
+ formDataTreeViewer.right = new FormAttachment(100,-5);
+ formDataTreeViewer.bottom = new FormAttachment(100,-5);
+
+
+
+
+
+ treeViewer.addSelectionChangedListener( new
ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent arg0)
+ {
+ ISelection itemTreeSelection =
treeViewer.getSelection();
+ if ( cTabFolder.getItemCount() > 0)
+ {
+ if ( itemTreeSelection != null)
+ {
+ TableTreeViewer tTV =
((SheetCTabItem)cTabFolder.getSelection()).getTableTreeViewer();
+
+
tTV.setSelection(itemTreeSelection);
+ }
+ }
+ }
+
+ });
+
+ }
+
+ /**
+ * Method for refresh the treeViewer of the JQ application.
+ *
+ *
+ */
+ public void refreshTreeViewer()
+ {
+
+ if (cTabFolder.getItemCount() > 0)
+ {
+ treeViewer.setContentProvider(new
SheetTreeContentProvider(cTabFolder));
+ treeViewer.setLabelProvider(new
SheetTreeLabelProvider());
+ IElement elementToInput = (((SheetCTabItem)
cTabFolder.getSelection()).getLibQSOS().getSheet().getRoot());
+ treeViewer.setInput(elementToInput);
+ }
+
+ }
+
+
+
+ /**
+ * Method for create a new Sheet
+ * This method is call by a button
+ *
+ */
+ public void createNewSheet ()
+ {
+
+ }
+
+ /**
+ *
+ * Method for open a sheet
+ * This method is called by the Open button
+ *
+ * @param adress
+ * Adress URL of a sheet (depends of the
system)
+ *
+ */
+ public void openSheet (String adress)
+ {
+
+ // Hide the answer composite for insert a new
+ if (cTabFolder.getItemCount() > 0)
+ {
+ ((SheetCTabItem)
cTabFolder.getSelection()).getAnswerGroup().setVisible(false);
+ ((SheetCTabItem)
cTabFolder.getSelection()).getHeaderGroup().setVisible(false);
+ }
+ final SheetCTabItem sheetCTabItem = new
SheetCTabItem(cTabFolder,SWT.BORDER|SWT.CLOSE,adress,answerComposite,jq );
+
+
+
sheetCTabItem.setControl(createTableTreeViewer(cTabFolder,sheetCTabItem));
+ sheetCTabItem.setTableTreeViewer(tableTreeViewer);
+
+ // Listener when the user close this cTabItem
+ sheetCTabItem.addDisposeListener(new DisposeListener()
+ {
+ public void widgetDisposed(DisposeEvent arg0)
+ {
+ IElement element =
sheetCTabItem.getLibQSOS().getSheet().getRoot();
+
element.getElements().set(0,sheetCTabItem.getSaveLibQSOS().getSheet().getRoot().getElements().get(0));
+
+ sheetCTabItem.getAnswerGroup().dispose();
+ sheetCTabItem.getHeaderGroup().dispose();
+ treeViewer.setInput(null);
+ treeViewComposite.update();
+
+ if (cTabFolder.getItemCount() > 0)
+ {
+ refreshTreeViewer();
+ }
+
+ }
+ });
+
+
+ // Select the SheetCTabItem
+ cTabFolder.setSelection(sheetCTabItem);
+
+ // Set the HeaderGroup Visible
+ int choiceHeaderIsVisible = 0;
+ ((SheetCTabItem)
cTabFolder.getSelection()).giveComposite(choiceHeaderIsVisible,null);
+
+
+ if ( cTabFolder.getItemCount() > 0 )
+ {
+ refreshTreeViewer();
+ }
+
+
+
+ }
+
+
+ /**
+ * Method for save the active sheet on a file
+ *
+ * @param adressSaveFile
+ */
+ public void saveSheet (String adressSaveFile)
+ {
+ LibQSOS lib = ((SheetCTabItem)
cTabFolder.getSelection()).getLibQSOS();
+ LibQSOS saveLib = ((SheetCTabItem)
cTabFolder.getSelection()).getSaveLibQSOS();
+
+ int numberSection = ((SheetCTabItem)
cTabFolder.getSelection()).getSaveLibQSOS().getSheet().getRoot().getElements().size();
+ for (int i = 1; i < numberSection; i++ )
+ {
+
saveLib.getSheet().getRoot().getElements().set(i,lib.getSheet().getRoot().getElements().get(i));
+ }
+
+
+ if (adressSaveFile != null)
+ {
+ saveLib.write(adressSaveFile);
+ }
+
+
+
+ }
+
+ /**
+ * Method for get this jq Application
+ *
+ * @return jq
+ */
+ public JQ getApp()
+ {
+ return jq;
+ }
+
+
+ /**
+ * Method for get the cTabFolder of the JQ application.
+ *
+ * @return cTabFolder
+ */
+ public CTabFolder getCTabFolder()
+ {
+
+ return cTabFolder;
+ }
+
+ /**
+ * Method for set the cTabFolder of the jq application.
+ *
+ * @param cTF
+ */
+ public void setCTabFolder(CTabFolder cTF)
+ {
+ cTabFolder = cTF;
+ }
+
+
+ /**
+ * Main for launch the program
+ *
+ * @param args
+ */
+ public static void main(String[] args)
+ {
+
+
+ JQ jq = new JQ();
+
+ jq.run();
+
+ // Dispose
+ jq.imageRegistry.dispose();
+ jq.cTabFolder.dispose();
+ jq.answerComposite.dispose();
+ jq.treeViewComposite.dispose();
+ }
+
+
+ /**
+ * Method for get the tableTreeViewer of the CTabItem.
+ *
+ * @return tableTreeViewer
+ */
+ public TableTreeViewer getTableTreeViewer()
+ {
+ return tableTreeViewer;
+ }
+
+
+ /**
+ * Method for set the tableTreeViewer of the CTabItem.
+ *
+ * @param tableTreeViewer
+ *
+ */
+ public void setTableTreeViewer(TableTreeViewer tableTreeViewer)
+ {
+ this.tableTreeViewer = tableTreeViewer;
+ }
+
+
+ /**
+ * Method for get the answerComposite of the JQ application
+ *
+ * @return answerComposite
+ * Composite under the cTabFolder where the fields
of the sheet are show
+ */
+ public Composite getAnswerComposite()
+ {
+ return answerComposite;
+ }
+
+
+ /**
+ * Method for set the answerComposite of the JQ
+ *
+ * @param answerComposite
+ * Composite under the cTabFolder where the fields
of the sheet are show
+ */
+ public void setAnswerComposite(Composite answerComposite)
+ {
+ this.answerComposite = answerComposite;
+
+ }
+
+
+
+}
Index: src/org/qsos/radar/GenerateRadar.java
===================================================================
RCS file: src/org/qsos/radar/GenerateRadar.java
diff -N src/org/qsos/radar/GenerateRadar.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/radar/GenerateRadar.java 16 Jun 2006 14:16:35 -0000
1.1
@@ -0,0 +1,418 @@
+/*
+** $Id: GenerateRadar.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.radar;
+
+
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.awt.SWT_AWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.jfree.chart.ChartPanel;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.plot.SpiderWebPlot;
+import org.jfree.data.category.DefaultCategoryDataset;
+import org.qsos.data.IElement;
+import org.qsos.data.JQConst;
+import org.qsos.data.Messages;
+import org.qsos.interfaces.SheetCTabItem;
+import org.qsos.main.JQ;
+
+
+
+public class GenerateRadar
+{
+
+ static JQ window;
+ public Object[] categories=new Object[7] ;
+ public int numCat;
+ public String TextCat[]=new String[7];
+ public double ScoreCat[]=new double[7];
+ public Double ScoreCat2[]=new Double[20];
+ public Double ScoreCat3[]=new Double[20];
+ public Double ScoreCat4[]=new Double[20];
+ public Double ScoreCat5[]=new Double[20];
+ public double SumScore;
+ public double SumScore2;
+ public double SumScore3;
+ public double SumScore4;
+ public static int CatNumber;
+
+ /**
+ * Contructor:
+ *
+ * @param w
+ * JQ
+ */
+
+ public GenerateRadar(JQ w)
+ {
+ window = w;
+ }
+
+
+ /**
+ * This class creates a composite in which the radar char will be
+ * implemented
+ *
+ * @param parent
+ * Composite where the chart will be seen
+ * @param Categories
+ * String[] that contains the name of the
elements [4 min and 7 max] the user has chosen to visualize
+ * @param Scores
+ * Double[] that contains the average
score of each category
+ * @return Control
+ *
+ */
+ public static Control createChart(Composite parent,String[] Categories,
double[] Scores)
+ {
+
+ Composite Charcomposite = new Composite(parent, SWT.EMBEDDED);
+ Charcomposite.setLayout(new FillLayout());
+ DefaultCategoryDataset dataset = new DefaultCategoryDataset();
+
+ //
+ for (int i=0;i<CatNumber;i++)
+ {
+ dataset.addValue(Scores[i],getTitle(),Categories[i]);
+ }
+
+
+ String BackGroundMire=null;
+
+ //Configuration of the spiderwebplot
+ SpiderWebPlot plot = new SpiderWebPlot();
+ plot.setDataset(dataset);
+ plot.setMaxValue(JQConst.RADAR_MAX_VALUE);
+ plot.setSeriesPaint(JQConst.RADAR_SERIES_PAINT);
+ plot.setAxisLabelGap(JQConst.RADAR_AXIS_LABEL_GAP);
+ plot.setHeadPercent(JQConst.RADAR_HEAD_PERCENT);
+ plot.setInteriorGap(JQConst.RADAR_INTERIOR_GAP);
+ plot.setWebFilled(true);
+
+ //The backgroundpicture used as a spiderweb is chosen according
to the
+ //number of categories selected
+ switch (CatNumber)
+ {
+ case 4:
+ BackGroundMire=JQConst.RADAR_SPIDERWEB_4;
+ break;
+ case 5:
+ BackGroundMire=JQConst.RADAR_SPIDERWEB_5;
+ break;
+ case 6:
+ BackGroundMire=JQConst.RADAR_SPIDERWEB_6;
+ break;
+ case 7:
+ BackGroundMire=JQConst.RADAR_SPIDERWEB_7;
+ break;
+ }
+ javax.swing.ImageIcon icon = new
javax.swing.ImageIcon(BackGroundMire);
+ plot.setBackgroundImage(icon.getImage());
+
+
+ //chart creation
+ JFreeChart chart = new JFreeChart(plot);
+
+ //Here the background color from the shell is taken in order to
match AWT and SWT backgrounds
+ Color backgroundColor = parent.getBackground();
+
+ //JFreechart doesn't support SWT so we create an AWT Frame that
will depend on Charcomposite
+ java.awt.Frame chartPanel = SWT_AWT.new_Frame(Charcomposite);
+ chartPanel.setLayout(new java.awt.GridLayout());
+ ChartPanel jfreeChartPanel = new ChartPanel(chart);
+
+ chartPanel.setBackground(new
java.awt.Color(backgroundColor.getRed(),backgroundColor.getGreen(),backgroundColor.getBlue()));
+
+ chartPanel.add(jfreeChartPanel);
+ chartPanel.pack();
+
+
+ return parent;
+
+ }
+
+ /**
+ *This Class creates a shell with a layout and calls the createchart
method
+ *which will return the radar chart
+ *
+ address@hidden Categories
+ * String[] that contains the name
of the elements [4 min and 7 max] the user has chosen to visualize
+ address@hidden Scores
+ * Double[] that contains the average
score of each category
+ *
+ *
+ */
+ public void run(String[] Categories, double[] Scores)
+ {
+ if ( window.getCTabFolder().getItemCount() != 0)
+ {
+ Shell shell = new
Shell(window.getShell().getDisplay(),SWT.DIALOG_TRIM);
+ shell.setSize(500,500);
+ FillLayout layout = new FillLayout();
+ layout.type = SWT.VERTICAL;
+ shell.setLayout(layout);
+
+ shell.forceActive();
+
+ createChart(shell,Categories,Scores);
+
+ shell.open();
+
+ }
+ }
+
+ /**
+ * This class creates a composite which include a checkboxtreeviewer
and a button.
+ * It uses 2 listeners: 1 for the checking if the user has checked a
box and
+ * another for the 0K button in order to check the validity of the
selected elements.
+ * @param parent
+ * Composite
+ * @return Control
+ */
+
+ public Control createCheckboxTree(Composite parent)
+ {
+
+ numCat=0;
+
+ Composite checkTreeComposite = new Composite(parent,SWT.NONE);
+ checkTreeComposite.setLayout(new
org.eclipse.swt.layout.FormLayout());
+
+
+ FormData CheckData = new FormData();
+ final CheckboxTreeViewer checkboxTreeViewer = new
CheckboxTreeViewer(checkTreeComposite);
+ checkboxTreeViewer.getTree().setLayoutData(CheckData);
+ CheckData.height=430;
+ CheckData.width=320;
+
+ checkboxTreeViewer.setContentProvider(new
SheetCheckContentProvider(window.getCTabFolder()));
+ checkboxTreeViewer.setLabelProvider(new
SheetCheckLabelProvider());
+ checkboxTreeViewer.addFilter(new MyFilter());
+
+ IElement elementToInput = (((SheetCTabItem)
window.getCTabFolder().getSelection()).getLibQSOS().getSheet().getRoot());
+ checkboxTreeViewer.setInput(elementToInput);
+ checkboxTreeViewer.expandToLevel(2);
+
+ checkboxTreeViewer.addCheckStateListener(new
ICheckStateListener()
+ {
+ //This listeners verifies if the user a checked a box
and wether it should be appeared checked or not
+
+ public void checkStateChanged(CheckStateChangedEvent
event) {
+ if (event.getChecked())
+ {
+ if (numCat < 7)
+ {
+
categories[numCat++]=event.getElement();
+
checkboxTreeViewer.setSubtreeChecked(event.getElement(),true);
+ }
+ else
+ {
+ //System.out.println("Erreur");
//$NON-NLS-1$
+
checkboxTreeViewer.setChecked(event.getElement(),false);
+ }
+ }
+ else if (!event.getChecked())
+ {
+ if
(((IElement)event.getElement()).getContainer() != null)
+ {
+ boolean state =
checkboxTreeViewer.getChecked(((IElement)event.getElement()).getContainer()) ;
+ if (!state)
+ {
+
checkboxTreeViewer.setSubtreeChecked(event.getElement(),false);
+ numCat--;
+ }
+ else
+ {
+
checkboxTreeViewer.setChecked(event.getElement(),true);
+ }
+ }
+ }
+ }
+ });
+
+
+ checkTreeComposite.pack();
+
+
+ return checkTreeComposite;
+ }
+
+
+
+ public void createRadar()
+ {
+ int i;
+ int j;
+ int k;
+ int l;
+ int m;
+ CatNumber=0;
+ for (i=0;i<categories.length;i++)
+ {
+ if (categories[i] != null)
+ {
+ CatNumber++;
+ }
+
+ }
+ if (CatNumber <= 7 && CatNumber >=4)
+ {
+ for(i = 0;i<CatNumber;i++)
+ {
+ TextCat[i] = ((IElement)
(categories[i])).getTitle();
+
+ if (((IElement) (categories[i])).getElements()
== null)
+ {
+ if
(((IElement)(categories[i])).getScore() == "" ||
((IElement)(categories[i])).getScore().equalsIgnoreCase("0") )//||
((IElement)(categories[i])).getScore() =="0") //$NON-NLS-1$ //$NON-NLS-2$
+ {
+ ScoreCat[i]=0.01;
+ }
+ else
+ {
+
ScoreCat[i]=(Double.valueOf(((IElement)categories[i]).getScore())).doubleValue();
+ }
+ }
+ else
+ {
+ SumScore=0.0;
+ Object ele2[] = ((IElement)
(categories[i])).getElements().toArray();
+ for(j= 0;j<ele2.length;j++)
+ {
+
+ if (((IElement)
(ele2[j])).getElements() == null)
+ {
+ if
(((IElement)(ele2[j])).getScore() == "" ||
((IElement)(ele2[j])).getScore().equalsIgnoreCase("0") ) //$NON-NLS-1$
//$NON-NLS-2$
+ {
+
ScoreCat2[j]=Double.valueOf("0.01"); //$NON-NLS-1$
+ }
+ else
+ {
+
ScoreCat2[j]=Double.valueOf( ((IElement)ele2[j]).getScore());
+ }
+ }
+ else
+ {
+ SumScore2=0.0;
+ Object ele3[] =
((IElement) (ele2[j])).getElements().toArray();
+ for(k=
0;k<ele3.length;k++)
+ {
+ {
+ if
(((IElement) (ele3[k])).getElements() == null)
+ {
+
if (((IElement)(ele3[k])).getScore() == "" ||
((IElement)(ele3[k])).getScore().equalsIgnoreCase("0") ) //$NON-NLS-1$
//$NON-NLS-2$
+
{
+
ScoreCat3[k]=Double.valueOf("0.01"); //$NON-NLS-1$
+
}
+
else
+
{
+
ScoreCat3[k]=Double.valueOf( ((IElement)ele3[k]).getScore());
+
}
+ }
+ else
+ {
+
SumScore3=0.0;
+
Object ele4[] = ((IElement) (ele3[k])).getElements().toArray();
+
for(l= 0;l<ele4.length;l++)
+
{
+
if (((IElement) (ele4[l])).getElements() == null)
+
{
+
if (((IElement)(ele4[l])).getScore() == "" ||
((IElement)(ele4[l])).getScore().equalsIgnoreCase("0")) //$NON-NLS-1$
//$NON-NLS-2$
+
{
+
ScoreCat4[l]=Double.valueOf("0.01"); //$NON-NLS-1$
+
}
+
else
+
{
+
ScoreCat4[l]=Double.valueOf(
((IElement)ele4[l]).getScore());
+
}
+
}
+
else
+
{
+
SumScore4=0.0;
+
Object ele5[] = ((IElement)
(ele4[l])).getElements().toArray();
+
for(m= 0;m<ele5.length;m++)
+
{
+
if (((IElement)(ele5[m])).getScore() == "" ||
((IElement)(ele5[m])).getScore().equalsIgnoreCase("0") ) //$NON-NLS-1$
//$NON-NLS-2$
+
{
+
ScoreCat5[m]=Double.valueOf("0.01");
//$NON-NLS-1$
+
}
+
+
else
+
{
+
ScoreCat5[m]=Double.valueOf(((IElement)ele5[m]).getScore());
+
}
+
SumScore4 = SumScore4 + ScoreCat5[m].doubleValue();
+
}
+
double Scores3=(SumScore4 / ele5.length);
+
+
ScoreCat4[l]=Double.valueOf(String.valueOf(Scores3));
+
}
+
SumScore3= SumScore3+ScoreCat4[l].doubleValue();
+
}
+
double Scores2=(SumScore3 / ele4.length);
+
+
ScoreCat3[k]=Double.valueOf(String.valueOf(Scores2));
+ }
+
SumScore2= SumScore2+ScoreCat3[k].doubleValue();
+ }
+ }
+ double
Scores=(SumScore2 / ele3.length);
+
+
ScoreCat2[j]=Double.valueOf(String.valueOf(Scores));
+ }
+ SumScore=
SumScore+ScoreCat2[j].doubleValue();
+ }
+ ScoreCat[i]=(SumScore/ele2.length);
+ }
+ }
+ run(TextCat,ScoreCat);
+ }
+ else
+ {
+
MessageDialog.openWarning(window.getShell(),Messages.getString("GenerateRadar.warning"),Messages.getString("GenerateRadar.warningMessage"));
//$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+ }
+
+
+ /**
+ * @return String
+ */
+ public static String getTitle()
+ {
+ return ((String) ((SheetCTabItem)
window.getApp().getCTabFolder().getSelection()).getSaveLibQSOS().getAppname()).concat(((SheetCTabItem)
window.getApp().getCTabFolder().getSelection()).getSaveLibQSOS().getRelease());
+ }
+}
+
Index: src/org/qsos/radar/MyFilter.java
===================================================================
RCS file: src/org/qsos/radar/MyFilter.java
diff -N src/org/qsos/radar/MyFilter.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/radar/MyFilter.java 16 Jun 2006 14:16:35 -0000 1.1
@@ -0,0 +1,67 @@
+/*
+** $Id: MyFilter.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.radar;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.qsos.data.IElement;
+import org.qsos.data.Messages;
+
+/**
+ * This class represents a filter that is used by the checkboxtree
+ *
+ */
+public class MyFilter extends ViewerFilter
+{
+ /**
+ * @param viewer
+ * Viewer
+ * @param element
+ * Object
+ * @param parentElement
+ * Object
+ * @return boolean
+ */
+ public boolean select(Viewer viewer,Object parentElement,Object element)
+ {
+ if (((IElement) element).getElements() == null)
+ {
+ if (((IElement)
element).getMeta().equalsIgnoreCase(Messages.getString("MyFilter.header")) ||
((IElement) element).getScore() == null)
//Messages.getString("MyFilter.header") //$NON-NLS-1$
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+}
Index: src/org/qsos/radar/SheetCheckContentProvider.java
===================================================================
RCS file: src/org/qsos/radar/SheetCheckContentProvider.java
diff -N src/org/qsos/radar/SheetCheckContentProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/radar/SheetCheckContentProvider.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,135 @@
+/*
+** $Id: SheetCheckContentProvider.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.radar;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.custom.CTabFolder;
+import org.qsos.data.Element;
+import org.qsos.data.ISheet;
+import org.qsos.interfaces.SheetCTabItem;
+
+/**
+ * This class provides content for the checkboxtree
+ *
+ */
+public class SheetCheckContentProvider implements ITreeContentProvider
+{
+
+private static final Object[] EMPTY = new Object[] {};
+
+ private ISheet iSheet;
+
+ /**
+ * Constructor that also initalizes the Sheet
+ *
+ * @param cTabFolder
+ */
+ public SheetCheckContentProvider(CTabFolder cTabFolder)
+ {
+ super();
+ iSheet = ((SheetCTabItem)
cTabFolder.getSelection()).getLibQSOS().getSheet();
+ }
+
+ /**
+ *
+ * @param arg0
+ * Object
+ * @return Object[]
+ */
+ public Object[] getChildren(Object arg0)
+ {
+ if (arg0 instanceof Element)
+ {
+ if ( ((Element) arg0).getElements()!= null )
+ {
+ return ((Element) arg0).getElements().toArray();
+ }
+ else
+ {
+ return EMPTY;
+ }
+ }
+
+ // If error with sheet
+ return EMPTY;
+ }
+
+ /**
+ * Gets the parent Element for an other Element
+ *
+ * @param arg0 the Element
+ * @return Object
+ */
+ public Object getParent(Object arg0)
+ {
+ return ((Element) arg0).getContainer();
+ }
+
+ /**
+ * Gets whether this Element has children
+ *
+ * @param arg0 the Element
+ * @return boolean
+ */
+ public boolean hasChildren(Object arg0)
+ {
+ return getChildren(arg0).length > 0;
+ }
+
+ /**
+ * Gets the elements for the table
+ *
+ * @param arg0 the model
+ * @return Object[]
+ */
+ public Object[] getElements(Object arg0)
+ {
+
+ return ((Element) iSheet.getRoot()).getElements().toArray();
+ }
+
+ /**
+ * Disposes any resources
+ */
+ public void dispose()
+ {
+ // We don't create any resources, so we don't dispose any
+ }
+
+ /**
+ * Called when the input changes
+ *
+ * @param arg0 the parent viewer
+ * @param arg1 the old input
+ * @param arg2 the new input
+ */
+ public void inputChanged(Viewer arg0, Object arg1, Object arg2)
+ {
+ // Nothing to do
+ }
+}
Index: src/org/qsos/radar/SheetCheckLabelProvider.java
===================================================================
RCS file: src/org/qsos/radar/SheetCheckLabelProvider.java
diff -N src/org/qsos/radar/SheetCheckLabelProvider.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/qsos/radar/SheetCheckLabelProvider.java 16 Jun 2006 14:16:35
-0000 1.1
@@ -0,0 +1,47 @@
+/*
+** $Id: SheetCheckLabelProvider.java,v 1.1 2006/06/16 14:16:35 goneri Exp $
+**
+** Copyright (C) 2006 ESME SUDRIA ( www.esme.fr )
+**
+** Authors:
+** BOUCHER Nicolas <address@hidden>
+** MODELIN Maxence <address@hidden>
+** MULOT Louis <address@hidden>
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+**
+**
+*/
+package org.qsos.radar;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.qsos.data.Element;
+
+/**
+ * This class provides the labels for Checkboxtree
+ */
+public class SheetCheckLabelProvider extends LabelProvider
+{
+ /**
+ * @param element
+ * Object
+ * @return String
+ */
+ public String getText(Object element)
+ {
+ return ( (Element) element).getTitle();
+ }
+
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qsos-commits] qsos/apps/JQEditor LICENSE lib/LibQSOS.jar lib/...,
Goneri Le Bouder <=