[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools.jsf] Re: Customizing palette in Web Page Editor

Could you please elaborate on how to implement getDropCustomizationData() that returns an IAdaptable? I tried to search the source code for an example but could not find any.

This will depend on what you want to do based on drop customization. We do not currently have any framework that uses this data (if you want to propose something, please feel free to write some code and attach it to a bugzilla patch).


Let's say that you have an element called "foo" and you want to allow the user to customize an attribute on foo called "id". So your goal is:

<somePrefix:foo id="<user value>"/>

You would use the the drop customizer to collect the <user value> from the user using your dialog. You will then need to extend the ITagCreator API to change the way the element is created. To do this, you need to return an implementation of ITagCreator from your AbstractElementEdit implementation (the same one that creates the drop customizer).

To do this, create a concrete implementation of AbstractTagCreator that returns your own sub-class of DefaultTagCreationAdvisor. Override getElementCustomizationCommand to return your own ElementCustomizationCommand sub-class that overrides applyAttributeCustomization(). In your override, you will have access to _creationData.getDropCustomizationData() which will automatically be populated with the IAdaptable object that your returned from the drop customizer.

You can simply cast this to a known type, or better, call getAdapter(ISomeInterface.class) to make your customization data more flexible.


--Cam