Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » rulerContextMenuAboutToShow in Text Editor
rulerContextMenuAboutToShow in Text Editor [message #286716] Wed, 15 June 2005 13:35 Go to next message
Eclipse UserFriend
I am extending TextEditor and I want to control the contents of the ruler
pop-up. I want to both add new items, which I've managed to do, but I want
to remove some prexisitng items. For example, I want to reomve all
references to QuickDiff.

I believe in I'm in the right area but need guidance....

can someone point me in the right direction?

Thanks
Re: rulerContextMenuAboutToShow in Text Editor [message #286732 is a reply to message #286716] Thu, 16 June 2005 03:55 Go to previous messageGo to next message
Eclipse UserFriend
you could override isPrefQuickDiffAlwaysOn from
AbstractDecoratedTextEditor to avoid quick diff enablement.

-tom

Charles Godwin wrote:
> I am extending TextEditor and I want to control the contents of the
> ruler pop-up. I want to both add new items, which I've managed to do,
> but I want to remove some prexisitng items. For example, I want to
> reomve all references to QuickDiff.
>
> I believe in I'm in the right area but need guidance....
>
> can someone point me in the right direction?
>
> Thanks
>
Re: rulerContextMenuAboutToShow in Text Editor [message #286738 is a reply to message #286732] Thu, 16 June 2005 08:49 Go to previous messageGo to next message
Eclipse UserFriend
Tom

Thanks for the advice but it doesn't seem to work.
I added this to my editor class that extends TextEditor

protected boolean isPrefQuickDiffAlwaysOn() {
return false;
}

I then did more testing and added this override code:

protected void rulerContextMenuAboutToShow(IMenuManager menu) {
super.rulerContextMenuAboutToShow(menu);
menu.remove("quickdiff.menu");
menu.remove("quickdiff");
IContributionItem[] contrib = menu.getItems();
menu.setRemoveAllWhenShown(true);
}

I analyzed the IcontributionItems list at the point of my getItems() there
are NO contributions in the list, just soem seperators.

I then added setRemoveAllWhenShown and set a breakpoint in this routine to
see what contributions exist at the end of the Show of the menu.

from ContributionManager.class
/* (non-Javadoc)
* Method declared on IContributionManager.
*/
public void removeAll() {
contributions.clear();
dynamicItems = 0;
markDirty();
}

There are these items in the list:
Add Bookmark...
Add Task...
<seperator>
Enable QuickDiff Ctrl+Shift+Q

How did they get there?! Am I goint tohave to create my own ruler or
extend ContributionManager?!
Re: rulerContextMenuAboutToShow in Text Editor [message #286745 is a reply to message #286738] Thu, 16 June 2005 09:59 Go to previous messageGo to next message
Eclipse UserFriend
I think I've found it!

The popup menu items are being added from plugin.xml files adding to the
popup
Here's the "offending" code from
Find 'quickdiff' in
'C:\eclipse\plugins\org.eclipse.ui.editors_3.0.1\plugin.prop erties'

<extension
point="org.eclipse.ui.popupMenus">
<viewerContribution
targetID="#TextRulerContext"

now how to override succesfully i.e disable this set and use my own.
Re: rulerContextMenuAboutToShow in Text Editor [message #286781 is a reply to message #286745] Fri, 17 June 2005 03:54 Go to previous messageGo to next message
Eclipse UserFriend
In 3.1, that contribution is gone.

-tom

Charles Godwin wrote:
> I think I've found it!
>
> The popup menu items are being added from plugin.xml files adding to the
> popup
> Here's the "offending" code from
> Find 'quickdiff' in
> 'C:\eclipse\plugins\org.eclipse.ui.editors_3.0.1\plugin.prop erties'
> <extension
> point="org.eclipse.ui.popupMenus">
> <viewerContribution
> targetID="#TextRulerContext"
>
> now how to override succesfully i.e disable this set and use my own.
>
>
>
Re: rulerContextMenuAboutToShow in Text Editor [message #286794 is a reply to message #286781] Fri, 17 June 2005 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Tom.

can you tell me where the contribution is documented. I can't seem to find
it in the what's new for 3.1.

I switched to 3.1 this morning and can't see any mesurable diffrenece in
behavour about overriding the plug-in settings.

Thanks again.
Re: rulerContextMenuAboutToShow in Text Editor [message #286805 is a reply to message #286794] Fri, 17 June 2005 11:40 Go to previous message
Eclipse UserFriend
Ooops. I read "done" instead of "gone". Sorry.

I'm still lost to see if there's anyway to remove plug-in contributions.
The problem is worse with 3.1 as the number of Textruler items has
increased.
Previous Topic:Font In Project Navigator
Next Topic:SWT_AWT & JDialog in a plugin
Goto Forum:
  


Current Time: Tue Mar 11 12:53:46 EDT 2025

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

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

Back to the top