今天听到一个神奇的中间件。
Jigloo:Eclipse 的 GUI 构造器使用说明
开始使用 Jigloo:Eclipse 的 GUI 构造器 开始之前 本教程适用于想要构建桌面应用程序并使用名为 Jigloo 的 Eclipse 插件来为其应用程序创建 UI 的 Java 开发人员。样例应用程序将使用 XML、XML Schema 和 JAXB 以及一些 Java 5 功能,例如 Annotation 和 Generic。 关于本教程 Java 是构建富桌面应用程序的优秀平台。
当Java 于 1995 年出现时,它附带了 Abstract Window Toolkit (AWT)。这曾是 Java 的第一个用于构建桌面应用程序的 UI 库。1998 年发行的 JDK 1.2 包括 Swing,一个有很大改进的工具包。在那之后,还对 Swing 进行了多次改进。它现在是一个功能强大的 UI 库,可在多种不同的平台上良好运行。SWT 是一个适用于 Java 的非常有竞争力的 UI 工具包,它可提供很多优点。现在使用 Jigloo,您可以快速构建以 Swing 或 SWT 为目标的 UI。您甚至可以构建包括 Swing 组件的 SWT 应用程序,但是那超出了本教程的讨论范围。 在本教程中,您将通过构建简单的工作流应用程序来了解 Jigloo。您将使用 Eclipse 插件 Jigloo 来为应用程序创建 UI。然后将构建和测试应用程序,并将其打包以供其他人使用。
http://springside.github.io/document.html
Introduction
Note: Jigloo is free for non-commercial use, but purchase of a Professional License is required for commercial use (after successfully evaluating Jigloo).
CloudGarden's Jigloo GUI Builder is a plugin for the Eclipse Java IDE and WebSphere Studio, which allows you to build and manage both Swing and SWT GUI classes.
Jigloo creates and manages code for all the parts of Swing or SWT GUIs as well as code to handle events, and shows you the GUIs as they are being built. Jigloo parses java class files to construct the form that you use when designing your GUI (round-tripping), so it can work on classes that were generated by other GUI builders or IDEs, or hand-coded classes. It can also convert from a Swing GUI to a SWT GUI and vice-versa.
Jigloo is straightforward, fast, powerful, easy to use and fully integrated with Eclipse. It can lead to substantial time-savings for GUI development and maintainance tasks.
Jigloo is highly-customizable: the parts of your code which Jigloo will parse can be restricted, and the classes which are instantiated when Jigloo parses your code and constructs the Form editor can be specified using patterns. The code generated by Jigloo can also be customized, and existing code can be re-arranged to follow the preferred style (eg, using getters for GUI elements, or separating elements by blank lines, braces or tagged comments).
Custom classes can be added to forms, and JavaBeans with Customizers and custom properties are supported. In addition, Jigloo supports visual inheritance - it can design classes which extend other custom classes, which may be public, abstract or non-public. Navigation between code and form editors is very easy - with Jigloo highlighting the relevant section of code when the form editor has focus, or the relevant form element when the code editor has focus.
Components are added, layouts changed etc, by selecting from a palette, or by options in the right-click context menus. They can be resized and dragged about in the form editor and in the outline view, and their properties, layout constraints and event handlers can be changed easily in a properties editor. Multi-selection of components makes widespread changes easy to perform. Class-changing (eg, from a Composite to a Group, a combo-box to a text field, or to any custom class) can also save design time. The GUI can be "previewed" or run using editor actions.
A basic knowledge of the Swing and SWT components is useful, but not essential - and the javadoc can be easily accessed (by a right-click option) directly from the GUI editor.
--------------------------------------------------------------------------------
Where does the name "Jigloo" come from?
1) Jigloo = Jig + gloo - because a jig is used to hold pieces together while being assembled - with glue, or
2) Jigloo = J + igloo - because if you can't think of anything better, then start your Java project with a J, and an igloo is a cool building.
--------------------------------------------------------------------------------
Features and Requirements
Eclipse: from 3.0 to 3.5
Java: 1.3, 1.4, 5 or 6
Platforms: Windows, Linux (gtk) and Mac OSX. It has not been tested on other platforms, but may perform successfully on them
The Jigloo GUI builder offers the following features:
Basic:
Builds complete Java classes for GUIs in SWT or Swing with an easy-to-use WYSIWYG editor.
Two-way (or round-trip) java code editing - changes made in the Form Editor are reflected in the code, and changes made to the code are also reflected in the Form Editor.
Can recognize and manipulate code generated by hand or by IDE (eg, Netbeans, JBuilder, VEP etc).
Converts between Swing and SWT GUIs (both ways).
Palette for adding components and setting layouts.
Easy navigation between source and form editors, with the selection in the form editor following the location of the cursor in the source editor, and the source editor scrolling to the code relevant to the selected element in the form editor.
Multi-selection of components - for setting of properties, layout parameters, and copy/cut/paste/delete.
Context-menu options for adding components and setting layouts (use of palette and/or context menu controlled by preferences page).
Manipulates most properties of the GUI components, such as colors, fonts, images, sizes, borders etc,
Creates event handlers for any and all of the component's events.
When creating components, initial text, image and layout properties can be quickly set using a single creation dialog.
Basic editing commands, copy/cut/paste/delete, as well as "Move up/down", to rearrange components.
Infinite Undo/Redo capability for all actions (setting of properties, layouts, layout constraints, cut, paste, add, delete and move).
The GUI editor and Outline view can be used to drag/copy-and-drop components inside and between containers.
Java code and GUI form viewed in single editor - either a split-pane (horizontal or vertical) or tabbed-pane layout is selectable.
Generates stub models for certain elements (eg, JTable, JSpinner, JList etc), and can parse models from code.
SWT_AWT supported (for embedding Swing components inside SWT controls and vice versa).
Property categories - define your own categories, or move properties between pre-defined "Basic", "Expert" and "Hidden" categories
Code Handling:
There are many ways to customize the parsing of the Java code.
Blocks of code which are not directly involved in building the GUI can be hidden from Jigloo by user-customizable comment tags.
The classes which Jigloo will instantiate while parsing the code can be controlled on a fine-grain level.
The code generated by Jigloo can also be customized:
It can follow the convention of the existing code (eg, JBuilder code uses getter methods to initialize it's components, and Jigloo can detect and use this format).
It can separate elements with braces, blank lines, or user-defined comments.
Layout:
Handles most Swing and SWT layouts (including Swing GroupLayout, JGoodies FormLayout, Clearthoughts TableLayout, GridBag, SWT Form and absolute layouts).
Handles custom layouts - add them like custom components.
Delphi/Visual Studio layout-manager mode for SWT FormLayout (and Swing AnchorLayout).
Intuitive (mouse-dragging) method for changing the grid properties of Swing GridBagLayouts.
Snap grid allows components to be located and resized to a uniform 5 to 20 pixel grid.
Components can be drag-and-dropped (and copy-and-dropped) between containers, re-ordered and resized by mouse-dragging.
Advanced:
Visual Inheritance is supported - Jigloo can be used to build classes which are extensions of other visual classes.
Custom classes extending Component (Swing) or Control (SWT) can be added to the GUI.
Non-visual classes can also be added to the GUI, and their properties edited with the property editor.
The class of a GUI element can be changed (eg, changing a Composite to a Group, or to a custom class) with a context-menu option.
Parts of a GUI class can be extracted and saved as a new class.
Easy access to the Javadoc for Swing and SWT components and layouts
Ability to preview or run the generated java code from a toolbar button.
Screenshot
Below is a screenshot of Jigloo version 4.0 (click on it for the full-sized image in a new window), being used (in a Windows platform). In the GUI editor, the "FlowerShop" example is being edited in a maximized Jigloo editor - a label inherited from FlowerShop's superclass (ShopFrame) is highlighted, and it's properties, layout, layout constraints and event handlers are shown ready for editing in the "GUI Properties" editor. The Java source code is shown below the form editor (the source code can also be aligned to the right of the form editor, or can be in a separate tab inside the editor). The tree view of the whole form is shown in the "Outline" view on the right-hand side.
Download & Installation
Notes for Eclipse 2, and Java 1.3 users:
If you are using Jigloo with WebSphere with Eclipse 2, or just Eclipse 2 then you need to modify Jigloo's plugin.xml file to remove the following line: <import plugin="org.eclipse.ui.forms"/> from the <requires> section of the file. Then restart Eclipse.
If you are using Java version 1.3 then you need to download this xml.jar file and place it in the jigloo plugin folder, then restart Eclipse.
Installation using update manager:
You should use the Update Manager in Eclipse to download and install Jigloo - just open it (under "Help->Software Updates->Find and Install"). You will need to create a new remote site entry in the update manager for the Jigloo update-site - the url is: http://cloudgarden.com/update-site
For more detailed help, read this.
Installation using zip file:
Alternatively, you can download the zip file from here. Unzip it into the eclipse folder so that the structure is eclipse/plugins/com.cloudgarden.jigloo_4.#.#
Examples
You can create examples using Eclipse's "New" wizard - in Eclipse, choose "File->New->Other" and under "GUI Forms" you will see an "Examples" section.
Documentation and Tutorials
Three tutorials come bundled with Jigloo, and can also be viewed online:
A Jigloo Swing Tutorial
A Jigloo Swing Tutorial in German - with many thanks to Juergen Sauer !!!
A Jigloo SWT Tutorial
A Jigloo Swing Application Framework (JSR 296) Tutorial
The documentation bundle "Jigloo GUI Builder User's Guide" is contained in the Jigloo plugin - after you install Jigloo, open up the "Help->Help Contents" menu in Eclipse and go to the entry for "Jigloo GUI Builder Guide".
It is recommended you look at the "Quick Start" section in the Jigloo documentation before using Jigloo in earnest. Also, please read the FAQs, which address some common questions/problems.
If you will be running SWT applications inside Eclipse, it is important that you read the "Preparing your project to use the SWT classes" part of the "Getting Started" section of the "Jigloo GUI Builder Guide".
Purchasing a Commercial license for Jigloo version 4
For terms of use, and whether or not you need to purchase a commercial license, please read this.
The Commercial License for Jigloo version 4 costs $85 USD for a single-user license including one year of upgrades.
A single license allows one developer, or employee of a company, institution or government, to use Jigloo as part of their work.
The license covers perpetual use of Jigloo, and includes one year of upgrades. ie, you can use Jigloo for ever, but you can only download upgrades free for one year after purchase. To purchase further years of upgrades, see below.
You may purchase Professional Licenses using your credit card via the PayPal site, by clicking on the PayPal button below.