Editor Filters [message #447608] |
Tue, 11 April 2006 19:29 |
Eclipse User |
|
|
|
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 #447689 is a reply to message #447672] |
Wed, 12 April 2006 18:43 |
Eclipse User |
|
|
|
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...
|
|
|
Powered by
FUDForum. Page generated in 0.03920 seconds