Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Filtered Tree(Displaying Filtered Tree)
Filtered Tree [message #717233] Fri, 19 August 2011 16:46 Go to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Is it possible to display the Tree View of the Editor page created using Sapphire to display selected or filtered items.

e.g I have a tree view like this

+ Parent
- Child-Type-1
- Child-Type-2
- Child-Type-3

Let say I have three editor pages for each Child-Type, and i want to edit their details on the respective page, so when the user selects the Child-type it should take the use to the respect Child-Type-Page that i have created to edit their details.

I remember that with the Eclipse Forms and the Tree View Part we do the filtering , does Sapphire support that ? Its quiet similar to the MANIFEST editor that we have for plugins with an Overview page and each page for each sub/or child items

if someone has tried please let me know how to do it ?

~ Kamesh

[Updated on: Fri, 19 August 2011 16:47]

Report message to a moderator

Re: Filtered Tree [message #717305 is a reply to message #717233] Fri, 19 August 2011 21:50 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 940
Registered: July 2009
Senior Member
I am not quite sure what you are asking...

Sapphire does allow you to create an editor that's composed of multiple pages where each page edits a subset of the model. The only caveat is that we only support a master-details tree-based page layout at the moment. There is no support for the basic arrangement of multiple fixed sections on a page, but something like that can be easily added if needed by adopters.

The calendar sample provides a multi-page editor example.

If this wasn't what you were asking about, could you clarify your question?

- Konstantin
Re: Filtered Tree [message #717328 is a reply to message #717305] Sat, 20 August 2011 01:48 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
thanks for the response Konstantin. To explain in detail let us take the web.xml

Let me put my scenario with web.xml, let say i categorize web.xml as,

-- Basic (name, description, display-name etc.,)
-- Servlets (servlet, servlet-url-mapping etc.,)
-- Jsp Config( tag libs, jsp property group etc.,)

All these sections/parts will come under one roof called "web-app"

So when I create the editor, i will have three pages for Basic, Servlets and Jsp Config and ideally these will so the tree or sections that are applicable for them

e.g
when on page Basic the editor will display a section which will have name, description, display-name etc.,

when on page Servlets the editor will display a section which will have name, ervlet, servlet-url-mapping etc.,

But all page will have the web-app tree displayed as one of the parts on the left hand side (the traditional) way, but will be filtered to display only the appropriate page model items

I hope to made it clear.

2. Is it possible to add Doctype with DTD information using Sapphire Annotation like we add the @XmlNamespace?

~Kamesh

[Updated on: Sat, 20 August 2011 01:57]

Report message to a moderator

Re: Filtered Tree [message #717729 is a reply to message #717328] Mon, 22 August 2011 07:48 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
for #2
i was able to add DTD information using the @CustomRootBinding, but then wont be nice to have an @Doctype annotation which will take the three paraemeters rootElementName, publicId and systemId and will add the DOCTYPE to the underlying XML document ?
I tried adding my custom annotation called @Doctype and tried to use in conjunction with @CustomRootBinding, but the my RootElementController never seem to read the annoation, am I missing something here ? Cant we not use our custom annotations ( created at custom plugin level and not at Sapphire) with Sapphire?

~Kamesh
Re: Filtered Tree [message #717918 is a reply to message #717729] Mon, 22 August 2011 17:27 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 940
Registered: July 2009
Senior Member
> So when I create the editor, i will have three pages for Basic, Servlets and Jsp Config and
> ideally these will so the tree or sections that are applicable for them

It sounds like you are asking if you can create an editor composed of multiple form pages, each showing a subset of the model. That is certainly possible. Just define multiple pages in sdef and as part of the definition of each page define the parts that you wish to edit on that page.

> 2. Is it possible to add Doctype with DTD information using Sapphire Annotation like we add the @XmlNamespace?

It is best to create a separate thread for unrelated questions...

Sapphire does support DTD doctype declarations. See StandardRootElementController in createRootElement(). If your @XmlRootBinding declaration does not specify a namespace and specifies schemaLocation that ends with ".dtd", then the doctype will be created instead of the equivalent XML Schema declaration.

> I tried adding my custom annotation called @Doctype and tried to use in conjunction with @CustomRootBinding,
> but the my RootElementController never seem to read the annoation, am I missing something here ?

Make sure that your annotation classes have @Retention( RetentionPolicy.RUNTIME ) on them. Without this declaration, your annotation will not be visible at runtime. Read more about Java annotation retention here:

http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/RetentionPolicy.html

- Konstantin
Re: Filtered Tree [message #717962 is a reply to message #717918] Mon, 22 August 2011 20:22 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
thanks for the thoughts!

Quote:
Sapphire does support DTD doctype declarations. See StandardRootElementController in createRootElement(). If your @XmlRootBinding declaration does not specify a namespace and specifies schemaLocation that ends with ".dtd", then the doctype will be created instead of the equivalent XML Schema declaration.




  • I personally feel that mixing of XSD semantics with that of DTD semantics is a bad practice. Moreover when someone uses the @XmlRootBinding annotation they tend to think that with its attributes its best fit for XSD rather than DTD and a programmer instinct never allows me to add DTD in schemaLocation attribute and as a Annotation user I never know that i can specify DTD with schemaLocation
  • Even the StandardRootElementController does not allow me to add public id , system id combination and it always tends to add "systemId"


On the summary i leave it you to decide as to whether to add,


  • a new annotation called @Doctype which will have the attributes like elementName, publicId, systemId and we can give another implementation for RootElementController called DtdRootElementController which does the necessary job of adding <!DOCTYPE> and thus seperating concerns and gives the adopters much clarity
  • another way is to add addtional attributes like publicId, systemId to @XmlRootBinding and enhance the logic in StandardRootElementController to add <!DOCTYPE> with all permuatation and combinations of PublicID and SystemID



Quote:
It is best to create a separate thread for unrelated questions...

I know its better to split the questions as that will enable the Adopters to search better, but this was done in an hurry and hence was pushed in to same .. but search engines are much smarter these days to list what we want Wink
Re: Filtered Tree [message #717986 is a reply to message #717962] Mon, 22 August 2011 23:23 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 940
Registered: July 2009
Senior Member
We can certainly examine improving this API. Feel free to open an enhancement request to track this.

- Konstantin
Re: Filtered Tree [message #718266 is a reply to message #717986] Tue, 23 August 2011 18:54 Go to previous message
Kamesh Sampath is currently offline Kamesh Sampath
Messages: 213
Registered: July 2009
Senior Member
Opened an enhancement BUG-355457
Previous Topic:Code Generation
Next Topic:Little error in Tutorial
Goto Forum:
  


Current Time: Fri Sep 19 14:01:50 GMT 2014

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

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