Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Customizing palette in Web Page Editor
Customizing palette in Web Page Editor [message #475971] Sun, 11 May 2008 05:01 Go to next message
Eclipse UserFriend
Originally posted by: ning2010.gmail.com

Is it possible to customize the palette in WPE so that when a control is
dragged and dropped into the editor, a dialog window could open up that
allows the user to customize the tag generated?

Currently, I am using the
org.eclipse.jst.jsf.common.standardMetaDataFiles extension point to
provide additional attributes for the tags, but the attributes can only
be hard coded.

Thanks,
Ning
Re: Customizing palette in Web Page Editor [message #475974 is a reply to message #475971] Tue, 13 May 2008 17:41 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
elementEditFactory option. You can implement an elementEditFactory for
your taglib uri(s) by extending AbstractElementEditFactory. You can then
return an object that extends AbstractElementEdit.

Your element edit can then return an IDropCustomizer. The IDropCustomizer
provides a call back interface to allow you to open a dialog and return
custom creation data (see Javadocs).

If you want to further control how this creation data gets translated into
the actual tag that is added to the document, your element edit can also
return its own ITagCreator by implementing getTagCreator.


--Cam
Re: Customizing palette in Web Page Editor [message #475975 is a reply to message #475974] Wed, 21 May 2008 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ning2010.gmail.com

Cameron Bateman wrote:
> Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
> elementEditFactory option. You can implement an elementEditFactory for
> your taglib uri(s) by extending AbstractElementEditFactory. You can
> then return an object that extends AbstractElementEdit.
> Your element edit can then return an IDropCustomizer. The
> IDropCustomizer provides a call back interface to allow you to open a
> dialog and return custom creation data (see Javadocs).
> If you want to further control how this creation data gets translated
> into the actual tag that is added to the document, your element edit can
> also return its own ITagCreator by implementing getTagCreator.
>
>
> --Cam
>

Hi,

I followed your suggestion and was able to open a dialog when a tag was
added to the WPE from the palette. However, this only works when I
select a tag in the palette with one mouse click (mouse down+up) and
then click again in the editor. If I just do a drag-and-drop (mouse down
in the palette area, hold, move the cursor to editor, and release the
mouse button) the dialog never shows up. Is this by design or there is
something I missed?

Thanks
Re: Customizing palette in Web Page Editor [message #475976 is a reply to message #475975] Tue, 27 May 2008 18:43 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> added to the WPE from the palette. However, this only works when I
> select a tag in the palette with one mouse click (mouse down+up) and
> then click again in the editor. If I just do a drag-and-drop (mouse down

This is a bug. I have opened
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234216. You can cc yourself
on the bug. If this issue is important, please add a comment and/or raise
the severity and we will try and triage for the maintenance release (we
are currently in release lock down, so we can't fix it for 3.0).
Re: Customizing palette in Web Page Editor [message #475977 is a reply to message #475974] Mon, 02 June 2008 15:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ning2010.gmail.com

Cameron Bateman wrote:
> Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
> elementEditFactory option. You can implement an elementEditFactory for
> your taglib uri(s) by extending AbstractElementEditFactory. You can
> then return an object that extends AbstractElementEdit.
> Your element edit can then return an IDropCustomizer. The
> IDropCustomizer provides a call back interface to allow you to open a
> dialog and return custom creation data (see Javadocs).
> If you want to further control how this creation data gets translated
> into the actual tag that is added to the document, your element edit can
> also return its own ITagCreator by implementing getTagCreator.
>
>
> --Cam
>

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.
Re: Customizing palette in Web Page Editor [message #475978 is a reply to message #475977] Thu, 05 June 2008 00:06 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> 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
Re: Customizing palette in Web Page Editor [message #617787 is a reply to message #475971] Tue, 13 May 2008 17:41 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
elementEditFactory option. You can implement an elementEditFactory for
your taglib uri(s) by extending AbstractElementEditFactory. You can then
return an object that extends AbstractElementEdit.

Your element edit can then return an IDropCustomizer. The IDropCustomizer
provides a call back interface to allow you to open a dialog and return
custom creation data (see Javadocs).

If you want to further control how this creation data gets translated into
the actual tag that is added to the document, your element edit can also
return its own ITagCreator by implementing getTagCreator.


--Cam
Re: Customizing palette in Web Page Editor [message #617790 is a reply to message #475974] Wed, 21 May 2008 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ning2010.gmail.com

Cameron Bateman wrote:
> Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
> elementEditFactory option. You can implement an elementEditFactory for
> your taglib uri(s) by extending AbstractElementEditFactory. You can
> then return an object that extends AbstractElementEdit.
> Your element edit can then return an IDropCustomizer. The
> IDropCustomizer provides a call back interface to allow you to open a
> dialog and return custom creation data (see Javadocs).
> If you want to further control how this creation data gets translated
> into the actual tag that is added to the document, your element edit can
> also return its own ITagCreator by implementing getTagCreator.
>
>
> --Cam
>

Hi,

I followed your suggestion and was able to open a dialog when a tag was
added to the WPE from the palette. However, this only works when I
select a tag in the palette with one mouse click (mouse down+up) and
then click again in the editor. If I just do a drag-and-drop (mouse down
in the palette area, hold, move the cursor to editor, and release the
mouse button) the dialog never shows up. Is this by design or there is
something I missed?

Thanks
Re: Customizing palette in Web Page Editor [message #617792 is a reply to message #475975] Tue, 27 May 2008 18:43 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> added to the WPE from the palette. However, this only works when I
> select a tag in the palette with one mouse click (mouse down+up) and
> then click again in the editor. If I just do a drag-and-drop (mouse down

This is a bug. I have opened
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234216 You can cc yourself
on the bug. If this issue is important, please add a comment and/or raise
the severity and we will try and triage for the maintenance release (we
are currently in release lock down, so we can't fix it for 3.0).
Re: Customizing palette in Web Page Editor [message #617795 is a reply to message #475974] Mon, 02 June 2008 15:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ning2010.gmail.com

Cameron Bateman wrote:
> Yes, the org.eclipse.jst.pagedesigner.pageDesignerExtension has an
> elementEditFactory option. You can implement an elementEditFactory for
> your taglib uri(s) by extending AbstractElementEditFactory. You can
> then return an object that extends AbstractElementEdit.
> Your element edit can then return an IDropCustomizer. The
> IDropCustomizer provides a call back interface to allow you to open a
> dialog and return custom creation data (see Javadocs).
> If you want to further control how this creation data gets translated
> into the actual tag that is added to the document, your element edit can
> also return its own ITagCreator by implementing getTagCreator.
>
>
> --Cam
>

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.
Re: Customizing palette in Web Page Editor [message #617797 is a reply to message #475977] Thu, 05 June 2008 00:06 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> 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
Re: Customizing palette in Web Page Editor [message #632209 is a reply to message #475975] Tue, 12 October 2010 06:44 Go to previous messageGo to next message
Srinivas Kothuri is currently offline Srinivas KothuriFriend
Messages: 4
Registered: March 2010
Junior Member
Hi,

It would be great on your part if you tell me the procedure you followed to add a new tag to Web Page Editor's palette.

I tried with "org.eclipse.jst.jsf.common.standardMetaDataFiles"
which is not working for me . . .

Thank you,
Srinivas
Re: Customizing palette in Web Page Editor [message #641984 is a reply to message #475971] Mon, 29 November 2010 12:52 Go to previous messageGo to next message
Agustin  is currently offline Agustin Friend
Messages: 26
Registered: November 2010
Location: Uruguay
Junior Member

Do you could explain with doing extended attributes html tags
Re: Customizing palette in Web Page Editor [message #642549 is a reply to message #641984] Wed, 01 December 2010 18:26 Go to previous messageGo to next message
Ian Trimble is currently offline Ian TrimbleFriend
Messages: 137
Registered: July 2009
Senior Member
If you mean adding attributes to HTML tags, then that's currently not possible. We don't support metadata for HTML or "extending" existing metadata. You could log enhancement requests (and even propose a patch!) against JSF Tools in Bugzilla, if you like.
Re: Customizing palette in Web Page Editor [message #661119 is a reply to message #475971] Wed, 23 March 2011 09:22 Go to previous messageGo to next message
Ani  is currently offline Ani Friend
Messages: 37
Registered: November 2010
Member
Hi,

I'm trying to extend the web page editor of eclipse. In the palette i've my own components,
when dragged and dropped i want to create XML text in the text viewer and draw HTML widgets in the design viewer.
So far i'm able to generate both XML and HTML code. Also able to show the XML code in the text editor.
But i'm not getting any clue how to take the generated HTML code and draw corresponding HTML components on the design editor.

currently i'm guessing as below...

I've a dropcustomizer as part of pageDesignerExtension.

public class MyDropCustomizer extends AbstractDropCustomizer {

private MyAdaptable dropCustomizationData;

public IAdaptable getDropCustomizationData()
{
return dropCustomizationData;
}

public IStatus runCustomizer(IFile file, IDOMPosition position)
{
dropCustomizationData = new MyAdaptable();
//TODO set the widget
}

}


At this point i've the required HTML code. But don't know how to integrate with the design editor page.

How can I parse the HTML code and draw corresponding HTML widget on the editor !!!
Is this the right place to integrate!! If no, where should i look further?


Please help!

Thanks,
Re: Customizing palette in Web Page Editor [message #666161 is a reply to message #661119] Tue, 19 April 2011 11:29 Go to previous messageGo to next message
chavi   is currently offline chavi Friend
Messages: 67
Registered: April 2011
Member
Hi Ani,
I have the same question.I think you are able to generate HTML Code.From your previous post i came to know that we can generate prefix but i want to generate same like HTML Code.Apart from that how can i add HTML component in design page & can show property view according to component.
Please share, it will be very helpful.
Re: Customizing palette in Web Page Editor [message #666726 is a reply to message #666161] Fri, 22 April 2011 01:06 Go to previous messageGo to next message
Ani  is currently offline Ani Friend
Messages: 37
Registered: November 2010
Member
hi Chavi, kindly follow this link...i've mentioned what i'm doing.

http://www.eclipse.org/forums/index.php?t=rview&goto=666 571#msg_666571
Re: Customizing palette in Web Page Editor [message #666991 is a reply to message #666726] Mon, 25 April 2011 11:51 Go to previous messageGo to next message
chavi   is currently offline chavi Friend
Messages: 67
Registered: April 2011
Member
Thanks a lot Ani........
Re: Customizing palette in Web Page Editor [message #667156 is a reply to message #666726] Wed, 27 April 2011 07:12 Go to previous messageGo to next message
chavi   is currently offline chavi Friend
Messages: 67
Registered: April 2011
Member
Hi Ani,
Can you please tell me any other approach apart from IFile,
I am not able to implement it.
Re: Customizing palette in Web Page Editor [message #730030 is a reply to message #667156] Tue, 27 September 2011 14:15 Go to previous messageGo to next message
Agustin  is currently offline Agustin Friend
Messages: 26
Registered: November 2010
Location: Uruguay
Junior Member

I found source code that Web Page editor! Where found this?
Re: Customizing palette in Web Page Editor [message #840659 is a reply to message #730030] Tue, 10 April 2012 10:53 Go to previous message
chavi   is currently offline chavi Friend
Messages: 67
Registered: April 2011
Member
You can found Web page Editor source code in Eclipse CVS.Look for org.eclipse.jst.pagedesigner
Previous Topic:Error running JSF2 project on Tomcat6
Next Topic:Maven + JSF = ClassNotFoundException - javax.servlet.jsp.jstl.core.Config
Goto Forum:
  


Current Time: Thu Mar 28 13:55:57 GMT 2024

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

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

Back to the top