Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to contribute to problems view
how to contribute to problems view [message #324284] Tue, 22 January 2008 04:04 Go to next message
Eclipse UserFriend
Hi, all:

I want to contribute an action to problems view, I take this,
http://wiki.eclipse.org/Menu_Contributions/Problems_View_Exa mple
as a reference, but:
1. my action is always disabled
2. I can't find the OpenMarkerHandler handler because I'd like to "monkey
and see it", how to get the problem entry object. It's wired, I searched all
the source code.

Any advice is appreciated.
Thanks in advanced.

Nick
Re: how to contribute to problems view [message #324298 is a reply to message #324284] Tue, 22 January 2008 09:22 Go to previous messageGo to next message
Eclipse UserFriend
That was a proposed usecase to see if the new menu contributions in 3.3
could support the problems view. There is no supporting code.

However if you look at org.eclipse.ui.ide/plugin.xml there should be a
lot of examples in HEAD of adding commands/handlers/menu contributions
to the new problems view.

Also check out the help link listed below, it discusses commands,
handlers, and then placing references to the commands in menus and
toolbars (menu contributions)

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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Re: how to contribute to problems view [message #324336 is a reply to message #324298] Tue, 22 January 2008 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Paul:

The link list is very useful, Thanks!

But, unfortunately my contributed handler can't access the current selected
marker because Problem view does not expose useful public accessors, such as
"getSelection()", it only supplies a "setSelection()" public method, hoho~~~

And I believe that there are other views that do not supply useful public
accessors, because that they haven't considered the new menu contribution
situation.

So, should I raise a enhancement bug?


"Paul Webster" <pwebster@ca.ibm.com> 写入消息
news:fn4u2m$k96$3@build.eclipse.org...
> That was a proposed usecase to see if the new menu contributions in 3.3
> could support the problems view. There is no supporting code.
>
> However if you look at org.eclipse.ui.ide/plugin.xml there should be a
> lot of examples in HEAD of adding commands/handlers/menu contributions
> to the new problems view.
>
> Also check out the help link listed below, it discusses commands,
> handlers, and then placing references to the commands in menus and
> toolbars (menu contributions)
>
> 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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Re: how to contribute to problems view [message #324360 is a reply to message #324336] Wed, 23 January 2008 10:03 Go to previous messageGo to next message
Eclipse UserFriend
Nick Tan wrote:
> Hi, Paul:
>
> The link list is very useful, Thanks!
>
> But, unfortunately my contributed handler can't access the current
> selected marker because Problem view does not expose useful public
> accessors, such as "getSelection()", it only supplies a "setSelection()"
> public method, hoho~~~
>
> And I believe that there are other views that do not supply useful
> public accessors, because that they haven't considered the new menu
> contribution situation.

Your handler should get the current selection from
HandlerUtil.getCurrentSelection(event). Does that not work?

AFAIK the problems view is not exposed in API at all ... but for most
views you can find its selection using
getSite().getSelectionProvider().getSelection()

Later,
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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Re: how to contribute to problems view [message #324406 is a reply to message #324360] Wed, 23 January 2008 21:32 Go to previous message
Eclipse UserFriend
"Paul Webster" <pwebster@ca.ibm.com> 写入消息
news:fn7ksj$ft5$3@build.eclipse.org...
> Your handler should get the current selection from
> HandlerUtil.getCurrentSelection(event). Does that not work?

I was wondering how to access the selection object (here is a marker
instance) in an applicationContext instance, and
HandlerUtil.getCurrentSelection(event) is exactly what I need.
> AFAIK the problems view is not exposed in API at all ... but for most
> views you can find its selection using
> getSite().getSelectionProvider().getSelection()

yeap, I should have realized the common way, that is selection service.

Thanks Paul!

> Later,
> 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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:Exporting a plugin fails due to self-reference?!?
Next Topic:IncrementalProjectBuilder.build and bundle shutdown
Goto Forum:
  


Current Time: Tue Jul 15 02:50:06 EDT 2025

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

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

Back to the top