Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor Filters
Editor Filters [message #447608] Tue, 11 April 2006 19:29 Go to next message
Eclipse UserFriend
Originally posted by: childress.shapetechllc.com

I have a simple RCP application that allows the user to open a particular
type of file in an editor. The editor consists of a TableViewer that
shows the contents of the file by line, and a StyledText widget that shows
details of the selected line.

I want to provide the ability to filter the contents of the TableViewer by
providing Toggle buttons that turn a particular filter on or off. I have
successfully added the buttons via the org.eclipse.ui.editorActions
extensions,
and they function as expected with a single editor open. However, if I
open a second file and editor, the buttons still function, but the state
is left as they were when the first editor was opened. Thus, if a
particular filter is enabled in the first editor, it is disabled in the
second editor and the button functions opposite in the second editor as it
does in the first.

Is there any way that when an editor receives focus that I can query the
state of the button and set the filter state according to the state of the
button when the editor gets focus? Or, is there any way to set the state
of the button when the editor receives focus so that the button reflects
the state of the filter in the particular instance of the editor?

In looking at the ContributionItem methods, I'm not seeing any way to get
at the information I need.

Thanks.


Ken...
Re: Editor Filters [message #447672 is a reply to message #447608] Wed, 12 April 2006 11:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

What about using your editor's EditorActionBarContributor. It has a
method setActiveEditor(IEditorPart targetEditor) that's called when a
new editor becomes active.

I think IActionBars can give you access to the coolbar manager and the
actions that you want to update.

Later,
PW


Re: Editor Filters [message #447689 is a reply to message #447672] Wed, 12 April 2006 18:43 Go to previous message
Eclipse UserFriend
Originally posted by: childress.shapetechllc.com

Paul Webster wrote:

> What about using your editor's EditorActionBarContributor. It has a
> method setActiveEditor(IEditorPart targetEditor) that's called when a
> new editor becomes active.

> I think IActionBars can give you access to the coolbar manager and the
> actions that you want to update.

I have tried this via,

editor.getEditorSite().getActionBars().getToolBarManager().g etItems()

The problem is that the IContributionItem list that is returned
doesn't give me access to the actual widget to query or set the
state of the button so I can then in turn set the filter accordingly.
Unless, of course, I'm missing something.



Ken...
Previous Topic:Disable the duplication of a perspective by dragging
Next Topic:Preventing two instances of the same application workbench
Goto Forum:
  


Current Time: Fri Dec 13 02:59:47 GMT 2024

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

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

Back to the top