Toolbar problem [message #454947] |
Tue, 03 May 2005 10:23  |
Eclipse User |
|
|
|
Hey, I have a visual editor and I want to contribute withinn the
toolbar. So, I have a subclass of MultiPageEditorActionBarContributor
public class MyActionBarContributor
extends MultiPageEditorActionBarContributor {
IToolBarManager tbm;
I've redefine setActivePage Method
public void setActivePage(IEditorPart part) {
if (activeEditorPart == part)
return;
(...)
tbm.add(new Separator());
tbm.add(new Action());
(...)
tbm.update(false);
bars.getMenuManager().updateAll(true);
}
public void contributeToToolBar(IToolBarManager manager) {
IActionBars bars = getActionBars();
tbm = bars.getToolBarManager();
but the only which is update is the menu, not the toolbar.. :(.. but the
information is actually in tbm variable.
I've reading about the problem and I found that redefining the
selectionChanged Method from the editor could help me in the refresh
public void selectionChanged(IWorkbenchPart part, ISelection selection)
{
IEditorPart editorPart =
getSite().getWorkbenchWindow().getActivePage().getActiveEdit or();
if (editorPart instanceof MyMultiPageEditorPart)
editorPart =
((MyMultiPageEditorPart)editorPart).getMyActiveEditor();
if (this.equals(editorPart))
updateActions(getSelectionActions());
}
but it does not work.. I will appreciate any idea
Thanks
Gab
|
|
|
Re: Toolbar problem [message #454970 is a reply to message #454947] |
Tue, 03 May 2005 10:31  |
Eclipse User |
|
|
|
You might get an answer on eclipse.platform. That's where JFace issues are
normally discussed.
"Gabriela" <Gabriela@hotmail.com> wrote in message
news:1ccd925484897548b009c1718354dad9$1@www.eclipse.org...
> Hey, I have a visual editor and I want to contribute withinn the
> toolbar. So, I have a subclass of MultiPageEditorActionBarContributor
> public class MyActionBarContributor
> extends MultiPageEditorActionBarContributor {
>
> IToolBarManager tbm;
>
> I've redefine setActivePage Method
>
> public void setActivePage(IEditorPart part) {
> if (activeEditorPart == part)
> return;
>
> (...)
> tbm.add(new Separator());
> tbm.add(new Action());
> (...)
>
> tbm.update(false);
> bars.getMenuManager().updateAll(true);
> }
>
> public void contributeToToolBar(IToolBarManager manager) {
> IActionBars bars = getActionBars();
> tbm = bars.getToolBarManager();
>
>
>
> but the only which is update is the menu, not the toolbar.. :(.. but the
> information is actually in tbm variable.
>
> I've reading about the problem and I found that redefining the
> selectionChanged Method from the editor could help me in the refresh
>
> public void selectionChanged(IWorkbenchPart part, ISelection selection)
> {
> IEditorPart editorPart =
> getSite().getWorkbenchWindow().getActivePage().getActiveEdit or();
> if (editorPart instanceof MyMultiPageEditorPart)
> editorPart =
> ((MyMultiPageEditorPart)editorPart).getMyActiveEditor();
> if (this.equals(editorPart))
> updateActions(getSelectionActions());
> }
>
> but it does not work.. I will appreciate any idea
> Thanks
> Gab
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03175 seconds