1765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeWINDOWBUILDER PROPERTY SHEET LIBRARY 2765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye------------------------------------- 3765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 4765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeThis project is a fork of a subset of the WindowBuilder Eclipse 5765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyeplugin: http://www.eclipse.org/windowbuilder/ 6765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 7765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeSpecifically, it contains the subset of WindowBuilder related to the 8765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyepropertysheet, intended for reuse in AOSP by the ADT plugin. 9765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 10765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeThe fork was modified as follows: 11765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Started with revision 424 from the trunk: 12765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye http://dev.eclipse.org/svnroot/tools/org.eclipse.windowbuilder/trunk 13765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 14765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Extracted the property package from org.eclipse.wb.core: 15765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye src/org/eclipse/wb/internal/core/model/property 16765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye and then everything it transitively references. This turns out to 17765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye be a lot. I then started pruning out references to code we don't 18765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye need, such as support for editing Java constructs such as enums, or 19765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye dealing with a Java code model, etc. This means some of the files 20765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye have been edited to remove methods and fields. For example, the 21765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye property category code was modified to no longer support the 22765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye persistent storage of categories. 23765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 24765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* The WindowBuilder code depended on a number of Apache Commons 25765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye libraries such as collections, lang, etc. Since ADT already uses 26765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye Guava, which provides a lot of the same functionality, I replaced 27765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye all the Commons calls with Guava calls in order to avoid having to 28765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye make ADT depend on (and load at runtime) the Commons libraries. 29765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 30765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Finally, the propertysheet code was made into a library instead of a 31765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye plugin, such that it can be loaded into the ADT plugin. This meant 32765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye mostly rewriting the DesignerPlugin class. It has kept its name 33765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye (since a lot of code references it for logging, resource loading 34765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye etc), but it is no longer an actual plugin. Instead it has init and 35765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye dispose methods for use by the AdtPlugin, and for logging it 36765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye delegates to the ADT plugin, etc. 37765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 38765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Icons were moved into the DesignerPlugin package such that the 39765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye resource loading code could use a relative path, since with an 40765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye absolute path it would be looking in the embedding plugin's 41765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye resources. 42765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 43765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* To be consistent with the ADT codebase, I converted the files from 44765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye \r\n to \n newlines. Other than that, all formatting was left 45765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye unmodified. 46765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 47765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Removed unused resources such as unreferences colors from 48765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye IColorConstants, unneeded messages from ModelMessages, and so on. 49765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 50765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* Note also that this Eclipse project is using a modified version of 51765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye the standard ADT Eclipse compiler settings: methods overriding other 52765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye methods and interfaces *without* using an @Override annotation are 53765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye ignored, since they were not using @Override annotations in the 54765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye WindowBuilder source base. 55765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 56765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 57765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeADT ENHANCEMENTS 58765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye------------------ 59765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye* I also modified the propertysheet in a few ways to add features 60765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye needed by ADT. These are all bracketed in the codebase with 61765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye // BEGIN ADT MODIFICATIONS 62765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye ... 63765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye // END ADT MODIFICATIONS 64765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 65765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye Specifically, I made the property table able to expand all and 66765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye collapse all. Properties have sorting priorities, and have separate 67765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye name and title attributes (and tooltips show the property name 68765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye rather than the title.) Text property editors allow field completion 69765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye by providing IContentProposalProvider (and optionally 70765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye ILabelProvider) instances via their getAdapter method. And the 71765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye property table will color values differently based on whether the 72765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye property is modified. (This allows us to draw default attributes 73765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye differently). Finally, the propertysheet now supports "expand by 74765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye default" (and for certain categories to be excluded, such as 75765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye deprecations). 76765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 774b1a9d7baa71df312585022c22e8025fafaba95aTor NorbyeWINDOW DOCKING 784b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye--------------- 794b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye 804b1a9d7baa71df312585022c22e8025fafaba95aTor NorbyeThe window docking support (the "FlyoutControlComposite" and 814b1a9d7baa71df312585022c22e8025fafaba95aTor Norbyesupporting classes) was also included, since it's used to present the 824b1a9d7baa71df312585022c22e8025fafaba95aTor Norbyeproperty sheet view in ADT. This code was also modified in a couple of 834b1a9d7baa71df312585022c22e8025fafaba95aTor Norbyeminor ways, using the same modification markers as above: 844b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye- Support invisible children (where the whole flyout is hidden) 854b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye- Added a "dismiss hover" method used to hide a temporary hover 864b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye (needed when the hovers are used with native drag & drop) 874b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye- Added a listener interface and notification when window states chane 884b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye (used to auto-zoom the layout canvas when windows are collapsed or 894b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye expanded). 904b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye- Changed the sizeall cursor used for dragging composites from the SWT 914b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye SIZE_ALL cursor to the HAND cursor since (at least on Mac) the 924b1a9d7baa71df312585022c22e8025fafaba95aTor Norbye cursor looked wrong for docking. 93765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 94765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeUPDATES 95765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye-------- 96765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 97765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeWe should keep an eye on the propertysheet code in WindowBuilder and 98765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyemigrate bug fixes and feature enhancements. To do that, first check 99765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyeout revision 424 from 100765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyehttp://dev.eclipse.org/svnroot/tools/org.eclipse.windowbuilder/trunk 101765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeThat's the same baseline that this fork was based on. 102765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeYou can limit the checkout to just the org.eclipse.wb.core tree. 103765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 104765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeThen check out the newest revision of WindowBuilder in a separate 105765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyedirectory. 106765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 107765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeNow diff the two trees. Look for diffs in the packages related to the 108765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyepropertysheet; this is going to be the packages that are present in 109765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyethis library. If any of the diffs are related to the propertysheet or 110765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyesupporting code, apply them to this library, and then update this 111765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyedocument to contain the new baseline revision (use 'svnversion .' to 112765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyeget the number). Note that the diffs may need some rewriting if they 113765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyereference Apache Commons code. 114765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye 115765e52e2d30d0754625b8c7af6c36e93612f15beTor NorbyeNote that the ComponentsPropertiesPage.java class which is the main 116765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyewindow in WindowBuilder is not used in our implementation; we instead 117765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyehave the PropertySheetPage class in ADT, so changes in that class 118765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyeshould be checked to see whether they apply to our property sheet page 119765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbye(which uses the PropertyTable in a similar way, but obviously is based 120765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyearound our own UI model rather than the WindowBuilder ObjectInfo 121765e52e2d30d0754625b8c7af6c36e93612f15beTor Norbyemodel. 122