Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Custom Pages and on Change event(Custom Page to XML form editor and UI component on change rule)
Custom Pages and on Change event [message #668716] Fri, 06 May 2011 19:58 Go to next message
Naga  is currently offline Naga Friend
Messages: 2
Registered: May 2011
Junior Member
I came across Eclipse Sapphire, when I was searching for sample code for my project which involves creating a multi page form editor with an XML source. I found it very interesting and easy to create those pages using sapphire framework.

I have couple of questions on that,
- How do I add additional custom page (like the summary page added in the Sapphire extension editor) to XML based editor
- I have to implement some rule in the UI components, like if selection of one component changes, I have to disable or change value on the other UI component. Since UI is mostly defined in XML and annotation How do I achieve this

Your help is very much appreciated.
Re: Custom Pages and on Change event [message #668722 is a reply to message #668716] Fri, 06 May 2011 20:27 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
> How do I add additional custom page (like the summary
> page added in the Sapphire extension editor) to XML based
> editor

The base class for editors is SapphireEditor. A simple two page editor with form and xml source view is SapphireEditorForXml. I would recommend looking at the source of that class to see how pages are added. For more complex example, see CalendarEditor in Sapphire samples (two form pages + two source pages). Of course, you can always look at the Sapphire extensions editor itself that you reference... SapphireExtensionEditor in the sdk plugin. The easiest way to see the source is to install the source feature from the repository.

> I have to implement some rule in the UI components, like
> if selection of one component changes, I have to disable or
> change value on the other UI component. Since UI is mostly
> defined in XML and annotation How do I achieve this

Sapphire approach is to describe these interactions in the model. For enablement, there is @Enablement annotation. For changing values, there is @DefaultValue annotation. See the samples project for examples of this.
Re: Custom Pages and on Change event [message #668723 is a reply to message #668716] Fri, 06 May 2011 20:28 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 952
Registered: July 2009
Senior Member
> How do I add additional custom page (like the summary page
> added in the Sapphire extension editor) to XML based editor

The base class for editors is SapphireEditor. A simple two page editor with form and xml source view is SapphireEditorForXml. I would recommend looking at the source of that class to see how pages are added. For more complex example, see CalendarEditor in Sapphire samples (two form pages + two source pages). Of course, you can always look at the Sapphire extensions editor itself that you reference... SapphireExtensionEditor in the sdk plugin. The easiest way to see the source is to install the source feature from the repository.

> I have to implement some rule in the UI components, like if
> selection of one component changes, I have to disable or
> change value on the other UI component. Since UI is mostly
> defined in XML and annotation How do I achieve this

Sapphire approach is to describe these interactions in the model. For enablement, there is @Enablement annotation. For changing values, there is @DefaultValue annotation. See the samples project for examples of this.
Previous Topic:Custom Pages and on Change event
Next Topic:How is Sapphire handled in production builds?
Goto Forum:
  


Current Time: Wed Nov 26 20:46:47 GMT 2014

Powered by FUDForum. Page generated in 0.04546 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software