Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 11:25 Go to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
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 16:14 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Sat Nov 09 03:09:08 GMT 2024

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

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

Back to the top