Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF Editor with Palette and Toolbar
GEF Editor with Palette and Toolbar [message #516314] Tue, 23 February 2010 10:20 Go to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Hi, has anyone created a GEF editor with both a flyout palette and a
toolbar? I need to create a graphical editor that supports zoom in and out,
and contains a toolbar that does not zoom. I have tried creating an editor
that extends GraphicalEditorWithFlyoutPalette, and I have overridden the
createGraphicalViewer method. In createGraphicalViewer, I have attached a
toolbar to the parent Composite. I also used a ScalableRootEditPart.
However, I am running into different issues because of the palette. Any
suggestions or reference(s) to example(s) would be greatly appreciated.
Thanks alot - Barry
Re: GEF Editor with Palette and Toolbar [message #516384 is a reply to message #516314] Tue, 23 February 2010 19:46 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 23/02/2010 14:53, Barry Dresdner wrote:
> Hi, has anyone created a GEF editor with both a flyout palette and a
> toolbar? I need to create a graphical editor that supports zoom in and out,
> and contains a toolbar that does not zoom. I have tried creating an editor
> that extends GraphicalEditorWithFlyoutPalette, and I have overridden the
> createGraphicalViewer method. In createGraphicalViewer, I have attached a
> toolbar to the parent Composite. I also used a ScalableRootEditPart.
> However, I am running into different issues because of the palette. Any
> suggestions or reference(s) to example(s) would be greatly appreciated.
> Thanks alot - Barry
>
>

Where is the toolbar? Why not put it on the main toolbat area of you app?
Re: GEF Editor with Palette and Toolbar [message #516388 is a reply to message #516384] Tue, 23 February 2010 20:13 Go to previous messageGo to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Ah, excellent question/suggestion.
Our UI team in their infinite wisdom prefers a toolbar within the editor
along with a palette.
We can actually get a GEF editor working with the toolbar as long as it
doesn't have the palette (extends GraphicalEditor)
Once we add the palette (extends GraphicalEditorWithFlyoutPalette), then we
run into major issues.
Most likely a layout issue or a problem with where the toolbar is added.
thanks

"Phillipus" <p.beauvoir@dadabeatnik.com> wrote in message
news:hm1b9s$v99$1@build.eclipse.org...
> On 23/02/2010 14:53, Barry Dresdner wrote:
>> Hi, has anyone created a GEF editor with both a flyout palette and a
>> toolbar? I need to create a graphical editor that supports zoom in and
>> out,
>> and contains a toolbar that does not zoom. I have tried creating an
>> editor
>> that extends GraphicalEditorWithFlyoutPalette, and I have overridden the
>> createGraphicalViewer method. In createGraphicalViewer, I have attached
>> a
>> toolbar to the parent Composite. I also used a ScalableRootEditPart.
>> However, I am running into different issues because of the palette. Any
>> suggestions or reference(s) to example(s) would be greatly appreciated.
>> Thanks alot - Barry
>>
>>
>
> Where is the toolbar? Why not put it on the main toolbat area of you app?
>
Re: GEF Editor with Palette and Toolbar [message #516410 is a reply to message #516388] Tue, 23 February 2010 20:35 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 23/02/2010 20:13, Barry Dresdner wrote:
> Ah, excellent question/suggestion.
> Our UI team in their infinite wisdom prefers a toolbar within the editor
> along with a palette.
> We can actually get a GEF editor working with the toolbar as long as it
> doesn't have the palette (extends GraphicalEditor)
> Once we add the palette (extends GraphicalEditorWithFlyoutPalette), then we
> run into major issues.
> Most likely a layout issue or a problem with where the toolbar is added.
> thanks
>
> "Phillipus"<p.beauvoir@dadabeatnik.com> wrote in message
> news:hm1b9s$v99$1@build.eclipse.org...
>> On 23/02/2010 14:53, Barry Dresdner wrote:
>>> Hi, has anyone created a GEF editor with both a flyout palette and a
>>> toolbar? I need to create a graphical editor that supports zoom in and
>>> out,
>>> and contains a toolbar that does not zoom. I have tried creating an
>>> editor
>>> that extends GraphicalEditorWithFlyoutPalette, and I have overridden the
>>> createGraphicalViewer method. In createGraphicalViewer, I have attached
>>> a
>>> toolbar to the parent Composite. I also used a ScalableRootEditPart.
>>> However, I am running into different issues because of the palette. Any
>>> suggestions or reference(s) to example(s) would be greatly appreciated.
>>> Thanks alot - Barry
>>>
>>>
>>
>> Where is the toolbar? Why not put it on the main toolbat area of you app?
>>
>
>

Yes, I'm not a fan of localised toolbars. Sounds like you need to
experiment with the toolbar's parent.
Re: GEF Editor with Palette and Toolbar [message #516411 is a reply to message #516410] Tue, 23 February 2010 16:04 Go to previous messageGo to next message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Yes. That's what we are doing. I was just hoping someone may have done
this already and can provide a little insight to help speed things along.
thanks

"Phillipus" <p.beauvoir@dadabeatnik.com> wrote in message
news:hm1e5o$mab$1@build.eclipse.org...
> On 23/02/2010 20:13, Barry Dresdner wrote:
>> Ah, excellent question/suggestion.
>> Our UI team in their infinite wisdom prefers a toolbar within the editor
>> along with a palette.
>> We can actually get a GEF editor working with the toolbar as long as it
>> doesn't have the palette (extends GraphicalEditor)
>> Once we add the palette (extends GraphicalEditorWithFlyoutPalette), then
>> we
>> run into major issues.
>> Most likely a layout issue or a problem with where the toolbar is added.
>> thanks
>>
>> "Phillipus"<p.beauvoir@dadabeatnik.com> wrote in message
>> news:hm1b9s$v99$1@build.eclipse.org...
>>> On 23/02/2010 14:53, Barry Dresdner wrote:
>>>> Hi, has anyone created a GEF editor with both a flyout palette and a
>>>> toolbar? I need to create a graphical editor that supports zoom in and
>>>> out,
>>>> and contains a toolbar that does not zoom. I have tried creating an
>>>> editor
>>>> that extends GraphicalEditorWithFlyoutPalette, and I have overridden
>>>> the
>>>> createGraphicalViewer method. In createGraphicalViewer, I have
>>>> attached
>>>> a
>>>> toolbar to the parent Composite. I also used a ScalableRootEditPart.
>>>> However, I am running into different issues because of the palette.
>>>> Any
>>>> suggestions or reference(s) to example(s) would be greatly appreciated.
>>>> Thanks alot - Barry
>>>>
>>>>
>>>
>>> Where is the toolbar? Why not put it on the main toolbat area of you
>>> app?
>>>
>>
>>
>
> Yes, I'm not a fan of localised toolbars. Sounds like you need to
> experiment with the toolbar's parent.
>
Re: GEF Editor with Palette and Toolbar [message #516452 is a reply to message #516411] Wed, 24 February 2010 04:22 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Override createPartControl of your editor..
        @Override
    public void createPartControl(Composite parent)
    {
        Composite c = new Composite(parent, SWT.None);
        c.setLayout(new GridLayout(1, true));
        ToolBar tb = new ToolBar(c, SWT.None);
        tb.setLayoutData(new org.eclipse.swt.layout.GridData(
                org.eclipse.swt.layout.GridData.FILL_HORIZONTAL));
        ToolItem ti1 = new ToolItem(tb, SWT.PUSH);
        ti1.setText("Tool item 1");
        ToolItem ti2 = new ToolItem(tb, SWT.PUSH);
        ti2.setText("Tool item 2");
        ToolItem ti3 = new ToolItem(tb, SWT.PUSH);
        ti3.setText("Tool item 3");
        ToolItem ti4 = new ToolItem(tb, SWT.PUSH);
        ti4.setText("Tool item 4");
        Composite composite = new Composite(c, SWT.None);
        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
        composite.setLayout(new FillLayout());
        super.createPartControl(composite);
    }    


is it this you want or somthing else...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: GEF Editor with Palette and Toolbar [message #516453 is a reply to message #516411] Wed, 24 February 2010 04:23 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Override createPartControl of your editor..
        @Override
    public void createPartControl(Composite parent)
    {
        Composite c = new Composite(parent, SWT.None);
        c.setLayout(new GridLayout(1, true));
        ToolBar tb = new ToolBar(c, SWT.None);
        tb.setLayoutData(new org.eclipse.swt.layout.GridData(
                org.eclipse.swt.layout.GridData.FILL_HORIZONTAL));
        ToolItem ti1 = new ToolItem(tb, SWT.PUSH);
        ti1.setText("Tool item 1");
        ToolItem ti2 = new ToolItem(tb, SWT.PUSH);
        ti2.setText("Tool item 2");
        ToolItem ti3 = new ToolItem(tb, SWT.PUSH);
        ti3.setText("Tool item 3");
        ToolItem ti4 = new ToolItem(tb, SWT.PUSH);
        ti4.setText("Tool item 4");
        Composite composite = new Composite(c, SWT.None);
        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
        composite.setLayout(new FillLayout());
        super.createPartControl(composite);
    }    


is it this you want or somthing else...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: GEF Editor with Palette and Toolbar [message #516454 is a reply to message #516411] Wed, 24 February 2010 04:23 Go to previous messageGo to next message
Vijay RajFriend
Messages: 608
Registered: July 2009
Senior Member
Quote:
Override createPartControl of your editor..
        @Override
    public void createPartControl(Composite parent)
    {
        Composite c = new Composite(parent, SWT.None);
        c.setLayout(new GridLayout(1, true));
        ToolBar tb = new ToolBar(c, SWT.None);
        tb.setLayoutData(new org.eclipse.swt.layout.GridData(
                org.eclipse.swt.layout.GridData.FILL_HORIZONTAL));
        ToolItem ti1 = new ToolItem(tb, SWT.PUSH);
        ti1.setText("Tool item 1");
        ToolItem ti2 = new ToolItem(tb, SWT.PUSH);
        ti2.setText("Tool item 2");
        ToolItem ti3 = new ToolItem(tb, SWT.PUSH);
        ti3.setText("Tool item 3");
        ToolItem ti4 = new ToolItem(tb, SWT.PUSH);
        ti4.setText("Tool item 4");
        Composite composite = new Composite(c, SWT.None);
        composite.setLayoutData(new GridData(GridData.FILL_BOTH));
        composite.setLayout(new FillLayout());
        super.createPartControl(composite);
    }    


is it this you want or somthing else...


i did this on shapes example and it worked...


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay

[Updated on: Wed, 24 February 2010 04:25]

Report message to a moderator

Re: GEF Editor with Palette and Toolbar [message #516595 is a reply to message #516454] Wed, 24 February 2010 09:18 Go to previous message
Barry Dresdner is currently offline Barry DresdnerFriend
Messages: 75
Registered: July 2009
Member
Hi Vijay,
That is exactly what I needed!
It is simple and works beautifully with the palette.
thank you very much,
Barry

"vijay" <vijay.rajonline@gmail.com> wrote in message
news:hm29kp$lf2$1@build.eclipse.org...
> Override createPartControl of your editor..
>
> @Override
> public void createPartControl(Composite parent)
> {
> Composite c = new Composite(parent, SWT.None);
> c.setLayout(new GridLayout(1, true));
> ToolBar tb = new ToolBar(c, SWT.None);
> tb.setLayoutData(new org.eclipse.swt.layout.GridData(
> org.eclipse.swt.layout.GridData.FILL_HORIZONTAL));
> ToolItem ti1 = new ToolItem(tb, SWT.PUSH);
> ti1.setText("Tool item 1");
> ToolItem ti2 = new ToolItem(tb, SWT.PUSH);
> ti2.setText("Tool item 2");
> ToolItem ti3 = new ToolItem(tb, SWT.PUSH);
> ti3.setText("Tool item 3");
> ToolItem ti4 = new ToolItem(tb, SWT.PUSH);
> ti4.setText("Tool item 4");
> Composite composite = new Composite(c, SWT.None);
> composite.setLayoutData(new GridData(GridData.FILL_BOTH));
> composite.setLayout(new FillLayout());
> super.createPartControl(composite);
> }
> is it this you want or somthing else...
> --
> ---------------------
> Regards,
> Vijay
Previous Topic:Routing of connections
Next Topic:Custom connection decoration
Goto Forum:
  


Current Time: Fri Apr 26 16:05:29 GMT 2024

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

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

Back to the top