Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » toolbar problem
toolbar problem [message #89355] Tue, 03 May 2005 12:53 Go to next message
Eclipse UserFriend
Originally posted by: Gab.hotmail.com

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 #89432 is a reply to message #89355] Tue, 03 May 2005 14:29 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You should try over in th eclipse.platform newsgroup. This newsgroup is
for the VisualEditor project itself. The eclipse.platform readers may be
able ot help you.

Gab wrote:
> 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
>
>

--
Thanks,
Rich Kulp
Re: toolbar problem [message #607318 is a reply to message #89355] Tue, 03 May 2005 14:29 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You should try over in th eclipse.platform newsgroup. This newsgroup is
for the VisualEditor project itself. The eclipse.platform readers may be
able ot help you.

Gab wrote:
> 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
>
>

--
Thanks,
Rich Kulp
Previous Topic:jLabel.setFont(font);
Next Topic:Using FormAttachment in FormLayout
Goto Forum:
  


Current Time: Fri Apr 26 15:25:46 GMT 2024

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

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

Back to the top