Tor Norbye | 765e52e | 2012-04-04 18:36:45 -0700 | [diff] [blame] | 1 | WINDOWBUILDER PROPERTY SHEET LIBRARY |
| 2 | ------------------------------------- |
| 3 | |
| 4 | This project is a fork of a subset of the WindowBuilder Eclipse |
| 5 | plugin: http://www.eclipse.org/windowbuilder/ |
| 6 | |
| 7 | Specifically, it contains the subset of WindowBuilder related to the |
| 8 | propertysheet, intended for reuse in AOSP by the ADT plugin. |
| 9 | |
| 10 | The fork was modified as follows: |
| 11 | * Started with revision 424 from the trunk: |
| 12 | http://dev.eclipse.org/svnroot/tools/org.eclipse.windowbuilder/trunk |
| 13 | |
| 14 | * Extracted the property package from org.eclipse.wb.core: |
| 15 | src/org/eclipse/wb/internal/core/model/property |
| 16 | and then everything it transitively references. This turns out to |
| 17 | be a lot. I then started pruning out references to code we don't |
| 18 | need, such as support for editing Java constructs such as enums, or |
| 19 | dealing with a Java code model, etc. This means some of the files |
| 20 | have been edited to remove methods and fields. For example, the |
| 21 | property category code was modified to no longer support the |
| 22 | persistent storage of categories. |
| 23 | |
| 24 | * The WindowBuilder code depended on a number of Apache Commons |
| 25 | libraries such as collections, lang, etc. Since ADT already uses |
| 26 | Guava, which provides a lot of the same functionality, I replaced |
| 27 | all the Commons calls with Guava calls in order to avoid having to |
| 28 | make ADT depend on (and load at runtime) the Commons libraries. |
| 29 | |
| 30 | * Finally, the propertysheet code was made into a library instead of a |
| 31 | plugin, such that it can be loaded into the ADT plugin. This meant |
| 32 | mostly rewriting the DesignerPlugin class. It has kept its name |
| 33 | (since a lot of code references it for logging, resource loading |
| 34 | etc), but it is no longer an actual plugin. Instead it has init and |
| 35 | dispose methods for use by the AdtPlugin, and for logging it |
| 36 | delegates to the ADT plugin, etc. |
| 37 | |
| 38 | * Icons were moved into the DesignerPlugin package such that the |
| 39 | resource loading code could use a relative path, since with an |
| 40 | absolute path it would be looking in the embedding plugin's |
| 41 | resources. |
| 42 | |
| 43 | * To be consistent with the ADT codebase, I converted the files from |
| 44 | \r\n to \n newlines. Other than that, all formatting was left |
| 45 | unmodified. |
| 46 | |
| 47 | * Removed unused resources such as unreferences colors from |
| 48 | IColorConstants, unneeded messages from ModelMessages, and so on. |
| 49 | |
| 50 | * Note also that this Eclipse project is using a modified version of |
| 51 | the standard ADT Eclipse compiler settings: methods overriding other |
| 52 | methods and interfaces *without* using an @Override annotation are |
| 53 | ignored, since they were not using @Override annotations in the |
| 54 | WindowBuilder source base. |
| 55 | |
| 56 | |
| 57 | ADT ENHANCEMENTS |
| 58 | ------------------ |
| 59 | * I also modified the propertysheet in a few ways to add features |
| 60 | needed by ADT. These are all bracketed in the codebase with |
| 61 | // BEGIN ADT MODIFICATIONS |
| 62 | ... |
| 63 | // END ADT MODIFICATIONS |
| 64 | |
| 65 | Specifically, I made the property table able to expand all and |
| 66 | collapse all. Properties have sorting priorities, and have separate |
| 67 | name and title attributes (and tooltips show the property name |
| 68 | rather than the title.) Text property editors allow field completion |
| 69 | by providing IContentProposalProvider (and optionally |
| 70 | ILabelProvider) instances via their getAdapter method. And the |
| 71 | property table will color values differently based on whether the |
| 72 | property is modified. (This allows us to draw default attributes |
| 73 | differently). Finally, the propertysheet now supports "expand by |
| 74 | default" (and for certain categories to be excluded, such as |
| 75 | deprecations). |
| 76 | |
Tor Norbye | 4b1a9d7 | 2012-04-19 13:32:08 -0700 | [diff] [blame] | 77 | WINDOW DOCKING |
| 78 | --------------- |
| 79 | |
| 80 | The window docking support (the "FlyoutControlComposite" and |
| 81 | supporting classes) was also included, since it's used to present the |
| 82 | property sheet view in ADT. This code was also modified in a couple of |
| 83 | minor ways, using the same modification markers as above: |
| 84 | - Support invisible children (where the whole flyout is hidden) |
| 85 | - Added a "dismiss hover" method used to hide a temporary hover |
| 86 | (needed when the hovers are used with native drag & drop) |
| 87 | - Added a listener interface and notification when window states chane |
| 88 | (used to auto-zoom the layout canvas when windows are collapsed or |
| 89 | expanded). |
| 90 | - Changed the sizeall cursor used for dragging composites from the SWT |
| 91 | SIZE_ALL cursor to the HAND cursor since (at least on Mac) the |
| 92 | cursor looked wrong for docking. |
Tor Norbye | 765e52e | 2012-04-04 18:36:45 -0700 | [diff] [blame] | 93 | |
| 94 | UPDATES |
| 95 | -------- |
| 96 | |
| 97 | We should keep an eye on the propertysheet code in WindowBuilder and |
| 98 | migrate bug fixes and feature enhancements. To do that, first check |
| 99 | out revision 424 from |
| 100 | http://dev.eclipse.org/svnroot/tools/org.eclipse.windowbuilder/trunk |
| 101 | That's the same baseline that this fork was based on. |
| 102 | You can limit the checkout to just the org.eclipse.wb.core tree. |
| 103 | |
| 104 | Then check out the newest revision of WindowBuilder in a separate |
| 105 | directory. |
| 106 | |
| 107 | Now diff the two trees. Look for diffs in the packages related to the |
| 108 | propertysheet; this is going to be the packages that are present in |
| 109 | this library. If any of the diffs are related to the propertysheet or |
| 110 | supporting code, apply them to this library, and then update this |
| 111 | document to contain the new baseline revision (use 'svnversion .' to |
| 112 | get the number). Note that the diffs may need some rewriting if they |
| 113 | reference Apache Commons code. |
| 114 | |
| 115 | Note that the ComponentsPropertiesPage.java class which is the main |
| 116 | window in WindowBuilder is not used in our implementation; we instead |
| 117 | have the PropertySheetPage class in ADT, so changes in that class |
| 118 | should be checked to see whether they apply to our property sheet page |
| 119 | (which uses the PropertyTable in a similar way, but obviously is based |
| 120 | around our own UI model rather than the WindowBuilder ObjectInfo |
| 121 | model. |