Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Create ToolBar for Direct Edit
Create ToolBar for Direct Edit [message #59349] Wed, 29 January 2003 07:16 Go to next message
Hal is currently offline HalFriend
Messages: 67
Registered: July 2009
Member
I am trying to create a ToolBar for Direct Edit, I create my own CellEditor
and the createControl(Composite parent) method, I use the Tool Bar example
from the SWT page.

But my question is what should I pass to the Menu() contructor? It does not
take a Composite class, it needs a
Control class, and where I can get a reference to the Control from the
Composite class?

Thanks

<< my implementation of createControl(Composite parent) method >>
toolBar = new ToolBar(parent, SWT.NONE);
final Menu menu = new Menu(???, SWT.POP_UP);

for (int i = 0; i < 8; i++) {
MenuItem item = new MenuItem(menu, SWT.PUSH);
item.setText("Item " + i);
}
Re: Create ToolBar for Direct Edit [message #59399 is a reply to message #59349] Wed, 29 January 2003 16:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

A composite is a control.
You might have trouble with focus issues. Your Toolbar will never gain
focus, therefore it will never fire focus lost. GEF tries to bring down
CellEditors when they lose focus, but yours will remain active.

"Hal" <otaconss2@hotmail.com> wrote in message
news:b18rrb$v3v$1@rogue.oti.com...
> I am trying to create a ToolBar for Direct Edit, I create my own
CellEditor
> and the createControl(Composite parent) method, I use the Tool Bar example
> from the SWT page.
>
> But my question is what should I pass to the Menu() contructor? It does
not
> take a Composite class, it needs a
> Control class, and where I can get a reference to the Control from the
> Composite class?
>
> Thanks
>
> << my implementation of createControl(Composite parent) method >>
> toolBar = new ToolBar(parent, SWT.NONE);
> final Menu menu = new Menu(???, SWT.POP_UP);
>
> for (int i = 0; i < 8; i++) {
> MenuItem item = new MenuItem(menu, SWT.PUSH);
> item.setText("Item " + i);
> }
>
>
Re: Create ToolBar for Direct Edit [message #59759 is a reply to message #59399] Wed, 29 January 2003 18:49 Go to previous messageGo to next message
Hal is currently offline HalFriend
Messages: 67
Registered: July 2009
Member
Should I use a Table instead?

Basically I want my control to have an icon and text.
CCombo and List won't work, they only support text.

What kind of controls I should use? i wants it shows both icon and text.

Thank you.


"Randy Hudson" <none@us.ibm.com> wrote in message
news:b18tfs$tl$1@rogue.oti.com...
> A composite is a control.
> You might have trouble with focus issues. Your Toolbar will never gain
> focus, therefore it will never fire focus lost. GEF tries to bring down
> CellEditors when they lose focus, but yours will remain active.
>
> "Hal" <otaconss2@hotmail.com> wrote in message
> news:b18rrb$v3v$1@rogue.oti.com...
> > I am trying to create a ToolBar for Direct Edit, I create my own
> CellEditor
> > and the createControl(Composite parent) method, I use the Tool Bar
example
> > from the SWT page.
> >
> > But my question is what should I pass to the Menu() contructor? It does
> not
> > take a Composite class, it needs a
> > Control class, and where I can get a reference to the Control from the
> > Composite class?
> >
> > Thanks
> >
> > << my implementation of createControl(Composite parent) method >>
> > toolBar = new ToolBar(parent, SWT.NONE);
> > final Menu menu = new Menu(???, SWT.POP_UP);
> >
> > for (int i = 0; i < 8; i++) {
> > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > item.setText("Item " + i);
> > }
> >
> >
>
>
Re: Create ToolBar for Direct Edit [message #59781 is a reply to message #59759] Wed, 29 January 2003 18:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Why not compose a label and a Text control on a composite?
"Hal" <otaconss2@hotmail.com> wrote in message
news:b196gv$9k2$1@rogue.oti.com...
> Should I use a Table instead?
>
> Basically I want my control to have an icon and text.
> CCombo and List won't work, they only support text.
>
> What kind of controls I should use? i wants it shows both icon and text.
>
> Thank you.
>
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b18tfs$tl$1@rogue.oti.com...
> > A composite is a control.
> > You might have trouble with focus issues. Your Toolbar will never gain
> > focus, therefore it will never fire focus lost. GEF tries to bring down
> > CellEditors when they lose focus, but yours will remain active.
> >
> > "Hal" <otaconss2@hotmail.com> wrote in message
> > news:b18rrb$v3v$1@rogue.oti.com...
> > > I am trying to create a ToolBar for Direct Edit, I create my own
> > CellEditor
> > > and the createControl(Composite parent) method, I use the Tool Bar
> example
> > > from the SWT page.
> > >
> > > But my question is what should I pass to the Menu() contructor? It
does
> > not
> > > take a Composite class, it needs a
> > > Control class, and where I can get a reference to the Control from the
> > > Composite class?
> > >
> > > Thanks
> > >
> > > << my implementation of createControl(Composite parent) method >>
> > > toolBar = new ToolBar(parent, SWT.NONE);
> > > final Menu menu = new Menu(???, SWT.POP_UP);
> > >
> > > for (int i = 0; i < 8; i++) {
> > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > item.setText("Item " + i);
> > > }
> > >
> > >
> >
> >
>
>
Re: Create ToolBar for Direct Edit [message #60384 is a reply to message #59781] Thu, 30 January 2003 20:40 Go to previous message
Hal is currently offline HalFriend
Messages: 67
Registered: July 2009
Member
I can't since i want a List of item (with icons and text) to let user to
choose.

So I create a Table as my Direct Edit Control, but how can I listen to
user's change in Selection and then call doSetValue() in my direct Manager?

Here is how I create a SWT Table for my direct edit control:
table = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);

for (int i = 0; i < 12; i++) {

TableItem item = new TableItem(table, 0);

item.setText("Item " + i);}

table.setSize(10, 10);



"Randy Hudson" <none@us.ibm.com> wrote in message
news:b196mm$9oo$1@rogue.oti.com...
> Why not compose a label and a Text control on a composite?
> "Hal" <otaconss2@hotmail.com> wrote in message
> news:b196gv$9k2$1@rogue.oti.com...
> > Should I use a Table instead?
> >
> > Basically I want my control to have an icon and text.
> > CCombo and List won't work, they only support text.
> >
> > What kind of controls I should use? i wants it shows both icon and text.
> >
> > Thank you.
> >
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b18tfs$tl$1@rogue.oti.com...
> > > A composite is a control.
> > > You might have trouble with focus issues. Your Toolbar will never
gain
> > > focus, therefore it will never fire focus lost. GEF tries to bring
down
> > > CellEditors when they lose focus, but yours will remain active.
> > >
> > > "Hal" <otaconss2@hotmail.com> wrote in message
> > > news:b18rrb$v3v$1@rogue.oti.com...
> > > > I am trying to create a ToolBar for Direct Edit, I create my own
> > > CellEditor
> > > > and the createControl(Composite parent) method, I use the Tool Bar
> > example
> > > > from the SWT page.
> > > >
> > > > But my question is what should I pass to the Menu() contructor? It
> does
> > > not
> > > > take a Composite class, it needs a
> > > > Control class, and where I can get a reference to the Control from
the
> > > > Composite class?
> > > >
> > > > Thanks
> > > >
> > > > << my implementation of createControl(Composite parent) method >>
> > > > toolBar = new ToolBar(parent, SWT.NONE);
> > > > final Menu menu = new Menu(???, SWT.POP_UP);
> > > >
> > > > for (int i = 0; i < 8; i++) {
> > > > MenuItem item = new MenuItem(menu, SWT.PUSH);
> > > > item.setText("Item " + i);
> > > > }
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:Animation
Next Topic:Problem with LogicDesigner Plugin Source Code in GEF I20030107
Goto Forum:
  


Current Time: Sat Aug 31 23:04:38 GMT 2024

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

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

Back to the top