Skip to main content



      Home
Home » Archived » Sapphire » Custom Part Creation
Custom Part Creation [message #711551] Sat, 06 August 2011 05:34 Go to next message
Eclipse UserFriend
Hello,

Can anyone tell me how to create a custom part, I have a requirement where
I need to create a Custom Property editor which by default needs to provide
me couple labels and text controls like below

LABEL 1 : TEXT-FIELD-ONE
LABEL 2 : TEXT-FIELD-TWO

Ultimately when I save/persist the value text-field-one and text-field-two
value will be merged together as single value for the property field.

The reason for me going with content assist is that I need the two - fields
to be created automatically and in one of the fields I want to provide the
Java Content Assist feature.

Please correct me if my approach is wrong and is there any better approach
for my requirement.

~Kamesh
Re: Custom Part Creation [message #713611 is a reply to message #711551] Mon, 08 August 2011 12:46 Go to previous messageGo to next message
Eclipse UserFriend
You can implement your own property editor by extending PropertyEditorRenderer and PropertyEditorRendererFactory classes, and then specifying that your implementation should be used like so...

<property-editor>
    <property>MyProperty</property>
    <hint>
        <name>factory</name>
        <value>MyCustomPropertyEditorFactory</value>  <!-- subject to import directives -->
    </hint>
</property-editor>


Writing a new property editor isn't easy. See various existing implementations of PropertyEditorRenderer in the framework to gauge the scope of the effort.

I think a better way to achieve this result would be to do the merging/parsing at the model level. Create two separate properties and then create custom XML binding instead of using the declarative variety. See @CustomXmlValueBinding and XmlValueBindingImpl.

- Konstantin
Re: Custom Part Creation [message #714082 is a reply to message #713611] Tue, 09 August 2011 14:50 Go to previous message
Eclipse UserFriend
yeah i felt that difficulty ... will try your suggestion
Previous Topic:Content Assist
Next Topic:Overriding Sapphire Actions
Goto Forum:
  


Current Time: Mon Jul 07 00:28:02 EDT 2025

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

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

Back to the top