|Re: Sapphire for a "viewer" application: two questions [message #1041843 is a reply to message #1041457]
||Mon, 15 April 2013 16:54
| Konstantin Komissarchik
Registered: July 2009
1) The output XML contains a "snapshot" of the input XML configuration file (for which I have a separate Sapphire model and editor). I want this original data to be viewable but not updateable. Can this be accomplished at the UI level, or is @ReadOnly the only way to set an element as, well, read-only?
In addition to the override pattern that Greg has described, you can also make a writable property read-only in UI by using "read.only" hint in sdef for the property editor. I haven't tried this exact scenario, but you should be able to make the value of the "read.only" hint a template variable in sdef that you can set in sdef's part include constructs.
2) I'd like to include a custom SWT component that is hover-sensitive and will control displays within another linked viewer. To include this component on a FormEditorPage, should it extend SapphirePart (such that it can be used in a <custom/> element)? I'm having difficulty finding examples of this.
To use <custom/> element in sdef, you would indeed need to implement SapphirePart. There isn't an example of this in samples, but existing implementation in sapphire.ui should be informative. Maybe start with a simple one like LabelPart.
PS: For ease of reading and responding, it is best to restrict one thread to one topic.
Powered by FUDForum
. Page generated in 0.03250 seconds