Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Why is C'tor of UIElement protected?
Why is C'tor of UIElement protected? [message #335297] Tue, 31 March 2009 07:25 Go to next message
Eclipse UserFriend
Hello,

I'm using a custom self written control (HyperlinkMenu). I successfully
pluged my control into the Eclipse IHandlerService, so enablement and
disablement of commands are getting tracked and displayed by the control
(Using a HyperlingMenuManager and a HyperlinkMenuContributionItem).

Currently I wand so participate from IElementUpdater and therefore use
UIElement since (I think) using it is the only way to get the
updateElement() of IElementUpdater events passed to my control.

Unfortunately the constructor of UIElement is protected. So without having
to use Java reflection it is impossible for me to use it (I think).

Is there any good reason why the Class is unusable from outside?
And does someone know a way how to take advantage from IElementUpdater
without using hacks like reflections?

If anybody is interested in HyperlinkMenu just reply and I'll post it.
Thanks,
Jan
Re: Why is C'tor of UIElement protected? [message #335307 is a reply to message #335297] Tue, 31 March 2009 12:14 Go to previous message
Eclipse UserFriend
Jan Kohnert wrote:
>
> Is there any good reason why the Class is unusable from outside?
> And does someone know a way how to take advantage from IElementUpdater
> without using hacks like reflections?

UIElement is API, but it must be subclassed. Either a typed subclass or
an anonymous subclass works fine.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Previous Topic:[menus] submenu in popup menu does not show up when manually populated
Next Topic:Adding filter in Project Explorer
Goto Forum:
  


Current Time: Fri Apr 25 23:49:02 EDT 2025

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

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

Back to the top