cjr wrote:I got the MyButton bean working OK, though cannot figure out how to use the MyButtonCustomizer class. Any clues?
Right-click on the widget and select
Customize.... That will open whatever customizer has been defined for the class.
cjr wrote:I note that a widget which extends a Composite (creating several native sub-widgets, say) simply gets drawn as a grey rectangle in design mode.
That sounds odd. The widget should look exactly the same in design time and at runtime. Are the sub-widgets statically defined, or are they created dynamically at runtime (so that they would not exist at design time)?
cjr wrote:Is there any way to change this? I'd like to be able to have the designer display something else (like some placeholder text) while in design mode, ideally without having to include custom paint code in code that we want to ship. If that isn't possible, is there some kind of "am_I_running_in_the_designer" test we can use to conditionally add our own paintListener?
Designer supports the standard
Beans.isDesignTime() check provided by the JDK. That should return
true when your widget is running in Designer (or any GUI builder for that matter).
cjr wrote:Is there a way to customize the default values of custom properties?
Did you try initializing the default values in your widget class itself?
cjr wrote:We will need to build our custom widgets against your api_src code; are you intending to release new versions of this in conjunction with the designer? I'm wondering how best to manage this in our source tree.
All of the api_src is available in the
plugins\com.swtdesigner_4.2.1\api_src directory. Any updates will always be in that directory and will match the associated Designer build. This public API is new to v4.2.1 and will almost certainly be enhanced in the future.
You can use the
api_src code any way you like. You can copy it into your project (as was done with the example), or you could compile against the
designer.jar as a prereq.