Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Putting a Toolbar inside an EditorPart
Putting a Toolbar inside an EditorPart [message #432797] Fri, 26 March 2004 14:42 Go to next message
David Havrda is currently offline David Havrda
Messages: 18
Registered: July 2009
Junior Member
I have a plug-in and I wish to put a ToolBar inside of an Editor/EditorPart?
I do NOT want to append menu items to the existing menu nor do I wish to
have a context menu. I want a BAR style ToolBar to show up in my editor
area. Any help would be appreciated. Below is a snippet of code I have
tried. I found some of it elsewhere on the forums.

This is a piece of code from the createPartControl(Composite parent) method
of my editor.
properties is a Composite which is a child of parent arguement.
Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);

layout = new GridLayout();

decs.setLayout(layout);

decs.setBounds(20, 30, 200, 30);

Menu menu = new Menu(decs, SWT.BAR);

decs.setMenuBar(menu);

MenuItem item = new MenuItem(menu, SWT.PUSH);

item.setText("item");
Re: Putting a Toolbar inside an EditorPart [message #432800 is a reply to message #432797] Fri, 26 March 2004 15:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: paull.NOSPAMcodetelligence.com

I'm not exactly sure what you want to accomplish. Did you look at
contributeToToolBar() in your editor contributor?

Paul Lever
www.codetelligence.com

"David Havrda" <dhavrda@motive.com> wrote in message
news:c420q7$jcn$1@eclipse.org...
> I have a plug-in and I wish to put a ToolBar inside of an
Editor/EditorPart?
> I do NOT want to append menu items to the existing menu nor do I wish to
> have a context menu. I want a BAR style ToolBar to show up in my editor
> area. Any help would be appreciated. Below is a snippet of code I have
> tried. I found some of it elsewhere on the forums.
>
> This is a piece of code from the createPartControl(Composite parent)
method
> of my editor.
> properties is a Composite which is a child of parent arguement.
> Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);
>
> layout = new GridLayout();
>
> decs.setLayout(layout);
>
> decs.setBounds(20, 30, 200, 30);
>
> Menu menu = new Menu(decs, SWT.BAR);
>
> decs.setMenuBar(menu);
>
> MenuItem item = new MenuItem(menu, SWT.PUSH);
>
> item.setText("item");
>
>
Re: Putting a Toolbar inside an EditorPart [message #432801 is a reply to message #432800] Fri, 26 March 2004 16:10 Go to previous messageGo to next message
David Havrda is currently offline David Havrda
Messages: 18
Registered: July 2009
Junior Member
I want to have a toolbar actually reside in the editor area.


"Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
news:c425cv$odv$1@eclipse.org...
> I'm not exactly sure what you want to accomplish. Did you look at
> contributeToToolBar() in your editor contributor?
>
> Paul Lever
> www.codetelligence.com
>
> "David Havrda" <dhavrda@motive.com> wrote in message
> news:c420q7$jcn$1@eclipse.org...
> > I have a plug-in and I wish to put a ToolBar inside of an
> Editor/EditorPart?
> > I do NOT want to append menu items to the existing menu nor do I wish to
> > have a context menu. I want a BAR style ToolBar to show up in my editor
> > area. Any help would be appreciated. Below is a snippet of code I have
> > tried. I found some of it elsewhere on the forums.
> >
> > This is a piece of code from the createPartControl(Composite parent)
> method
> > of my editor.
> > properties is a Composite which is a child of parent arguement.
> > Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);
> >
> > layout = new GridLayout();
> >
> > decs.setLayout(layout);
> >
> > decs.setBounds(20, 30, 200, 30);
> >
> > Menu menu = new Menu(decs, SWT.BAR);
> >
> > decs.setMenuBar(menu);
> >
> > MenuItem item = new MenuItem(menu, SWT.PUSH);
> >
> > item.setText("item");
> >
> >
>
>
Re: Putting a Toolbar inside an EditorPart [message #432803 is a reply to message #432801] Fri, 26 March 2004 16:31 Go to previous messageGo to next message
Eclipse User
Originally posted by: paull.NOSPAMcodetelligence.com

So are you looking for a floating toolbar? Not that I know how to do that.

Paul Lever
www.codetelligence.com

"David Havrda" <dhavrda@motive.com> wrote in message
news:c425va$p5j$1@eclipse.org...
> I want to have a toolbar actually reside in the editor area.
>
>
> "Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
> news:c425cv$odv$1@eclipse.org...
> > I'm not exactly sure what you want to accomplish. Did you look at
> > contributeToToolBar() in your editor contributor?
> >
> > Paul Lever
> > www.codetelligence.com
> >
> > "David Havrda" <dhavrda@motive.com> wrote in message
> > news:c420q7$jcn$1@eclipse.org...
> > > I have a plug-in and I wish to put a ToolBar inside of an
> > Editor/EditorPart?
> > > I do NOT want to append menu items to the existing menu nor do I wish
to
> > > have a context menu. I want a BAR style ToolBar to show up in my
editor
> > > area. Any help would be appreciated. Below is a snippet of code I
have
> > > tried. I found some of it elsewhere on the forums.
> > >
> > > This is a piece of code from the createPartControl(Composite parent)
> > method
> > > of my editor.
> > > properties is a Composite which is a child of parent arguement.
> > > Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);
> > >
> > > layout = new GridLayout();
> > >
> > > decs.setLayout(layout);
> > >
> > > decs.setBounds(20, 30, 200, 30);
> > >
> > > Menu menu = new Menu(decs, SWT.BAR);
> > >
> > > decs.setMenuBar(menu);
> > >
> > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > >
> > > item.setText("item");
> > >
> > >
> >
> >
>
>
Re: Putting a Toolbar inside an EditorPart [message #432805 is a reply to message #432803] Fri, 26 March 2004 16:54 Go to previous messageGo to next message
David Havrda is currently offline David Havrda
Messages: 18
Registered: July 2009
Junior Member
No fixed is fine. Say my editor area has some controls at the top and then
below that resides a fixed toolbar. I know the layout sounds funny but that
is my task.

"Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
news:c4278f$qjo$1@eclipse.org...
> So are you looking for a floating toolbar? Not that I know how to do that.
>
> Paul Lever
> www.codetelligence.com
>
> "David Havrda" <dhavrda@motive.com> wrote in message
> news:c425va$p5j$1@eclipse.org...
> > I want to have a toolbar actually reside in the editor area.
> >
> >
> > "Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
> > news:c425cv$odv$1@eclipse.org...
> > > I'm not exactly sure what you want to accomplish. Did you look at
> > > contributeToToolBar() in your editor contributor?
> > >
> > > Paul Lever
> > > www.codetelligence.com
> > >
> > > "David Havrda" <dhavrda@motive.com> wrote in message
> > > news:c420q7$jcn$1@eclipse.org...
> > > > I have a plug-in and I wish to put a ToolBar inside of an
> > > Editor/EditorPart?
> > > > I do NOT want to append menu items to the existing menu nor do I
wish
> to
> > > > have a context menu. I want a BAR style ToolBar to show up in my
> editor
> > > > area. Any help would be appreciated. Below is a snippet of code I
> have
> > > > tried. I found some of it elsewhere on the forums.
> > > >
> > > > This is a piece of code from the createPartControl(Composite parent)
> > > method
> > > > of my editor.
> > > > properties is a Composite which is a child of parent arguement.
> > > > Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);
> > > >
> > > > layout = new GridLayout();
> > > >
> > > > decs.setLayout(layout);
> > > >
> > > > decs.setBounds(20, 30, 200, 30);
> > > >
> > > > Menu menu = new Menu(decs, SWT.BAR);
> > > >
> > > > decs.setMenuBar(menu);
> > > >
> > > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > >
> > > > item.setText("item");
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: Putting a Toolbar inside an EditorPart [message #432806 is a reply to message #432805] Fri, 26 March 2004 20:03 Go to previous message
James Willans is currently offline James Willans
Messages: 303
Registered: July 2009
Senior Member
David,

I'm not sure it helps, but is something like this done in GEF where the
palette is integrated into the editor? You might want to take a look at
the code and see how that is done.

James

David Havrda wrote:

> No fixed is fine. Say my editor area has some controls at the top and then
> below that resides a fixed toolbar. I know the layout sounds funny but that
> is my task.

> "Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
> news:c4278f$qjo$1@eclipse.org...
> > So are you looking for a floating toolbar? Not that I know how to do that.
> >
> > Paul Lever
> > www.codetelligence.com
> >
> > "David Havrda" <dhavrda@motive.com> wrote in message
> > news:c425va$p5j$1@eclipse.org...
> > > I want to have a toolbar actually reside in the editor area.
> > >
> > >
> > > "Paul L" <paull@NOSPAMcodetelligence.com> wrote in message
> > > news:c425cv$odv$1@eclipse.org...
> > > > I'm not exactly sure what you want to accomplish. Did you look at
> > > > contributeToToolBar() in your editor contributor?
> > > >
> > > > Paul Lever
> > > > www.codetelligence.com
> > > >
> > > > "David Havrda" <dhavrda@motive.com> wrote in message
> > > > news:c420q7$jcn$1@eclipse.org...
> > > > > I have a plug-in and I wish to put a ToolBar inside of an
> > > > Editor/EditorPart?
> > > > > I do NOT want to append menu items to the existing menu nor do I
> wish
> > to
> > > > > have a context menu. I want a BAR style ToolBar to show up in my
> > editor
> > > > > area. Any help would be appreciated. Below is a snippet of code I
> > have
> > > > > tried. I found some of it elsewhere on the forums.
> > > > >
> > > > > This is a piece of code from the createPartControl(Composite parent)
> > > > method
> > > > > of my editor.
> > > > > properties is a Composite which is a child of parent arguement.
> > > > > Decorations decs = new Decorations(properties, SWT.DIALOG_TRIM);
> > > > >
> > > > > layout = new GridLayout();
> > > > >
> > > > > decs.setLayout(layout);
> > > > >
> > > > > decs.setBounds(20, 30, 200, 30);
> > > > >
> > > > > Menu menu = new Menu(decs, SWT.BAR);
> > > > >
> > > > > decs.setMenuBar(menu);
> > > > >
> > > > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > > >
> > > > > item.setText("item");
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
Previous Topic:Newbie trouble: dynamic wizard controls
Next Topic:true SYSTEM_MODAL behaviour? : additional fact
Goto Forum:
  


Current Time: Thu Apr 17 14:34:57 EDT 2014

Powered by FUDForum. Page generated in 0.07501 seconds