Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Next question - custom editing and hidden attributes
Next question - custom editing and hidden attributes [message #720487] Tue, 30 August 2011 17:19 Go to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
On to my next question...

It's easy enough for standard property editors to show a property, allow the user to edit, and to shuttle the text back into the XML. But what happens when you have a chunk of XML you want to simplify for the user some truly ugly XML and only show bits and pieces while generating the rest of the ugly XML under the covers?

For example, I have this:

  <mbean code="org.jboss.jms.server.destination.QueueService"
    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_Aggregator_Blue_Alert"
    xmbean-dd="xmdesc/Queue-xmbean.xml">
        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
        <depends>jboss.messaging:service=PostOffice</depends>
  </mbean>


In this case, let's say that really the only things I want the user to edit are the two name properties in <mbean name="x,y">...

It appears that I should be able to use child properties, but I suspect the output would look something like...

mbean
   name
      jboss.esb.quickstart.destination:service : _Queue_________
      name : _quickstart_Aggregator_Blue_Alert______


Suggestions? Examples? Pointers? Should I simply offer a child properties list and allow both name and value to be edited? I'm still ferreting out the meaning behind these variables (not much written about them), just exploring options.

Thanks in advance oh wise and wonderful Sapphire community. Smile

--Fitz
Re: Next question - custom editing and hidden attributes [message #720546 is a reply to message #720487] Tue, 30 August 2011 19:34 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
If I understand your question correctly, you are asking how to implement binding to structured content inside XML attribute value...

You have two options.

1. Present the attribute value as a list of key-values. See XmlDelimitedListBindingImpl class. There is a usage example in contacts sample. You will need to override createListEntryResource() to return a custom resource that knows how read/write individual components of a key-value pair. If you read through the code in XmlDelimitedListBindingImpl and DelimitedListBindingImpl, you should get a pretty good understanding of how this works.

2. Present the attributes that you know about as distinct value properties. To do this, you will need to use @CustomXmlValueBinding/XmlValueBindingImpl for each of these properties.

Which one of these you choose depends on your configuration file semantics.

- Konstantin
Re: Next question - custom editing and hidden attributes [message #720589 is a reply to message #720546] Tue, 30 August 2011 22:04 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Thanks Konstantin... I'll take a look at both of these methods and see what might work best in this case.
Previous Topic:Editing XML without namespaces or attributes - just value
Next Topic:SapphireWizardPage -> Missing Page ID
Goto Forum:
  


Current Time: Fri Apr 26 04:59:35 GMT 2024

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

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

Back to the top