Sapphire for a "viewer" application: two questions [message #1041239] |
Sun, 14 April 2013 17:11  |
Eclipse User |
|
|
|
I'm looking at implementing a viewer for an XML output file (containing model results), and I have a couple of questions about how Sapphire might be used for this.
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?
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.
|
|
|
|
Re: Sapphire for a "viewer" application: two questions [message #1041843 is a reply to message #1041457] |
Mon, 15 April 2013 12:54   |
Eclipse User |
|
|
|
Quote: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.
Quote: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.
|
|
|
Re: Sapphire for a "viewer" application: two questions [message #1042555 is a reply to message #1041843] |
Tue, 16 April 2013 11:11  |
Eclipse User |
|
|
|
(Sorry about the dual topics; I will split them up in the future.)
Re: 1) Thanks to both of you for suggestions. Greg, I was not aware of that override pattern but that will be very helpful in the future. Konstantin, adding the "read.only" hint with a value of "true" did the trick as far as my output "editor" is concerned. The custom SapphirePart I need will be used for another purpose, not viewing the "snapshotted" original scenario element, so hints like this are certainly sufficient for the time being.
Re: 2): thanks for the feedback, and I'll start with LabelPart as a simple example.
|
|
|
Powered by
FUDForum. Page generated in 0.03045 seconds