Home » Eclipse Projects » GEF » about creationtool for DefaultPaletteToolEntry
about creationtool for DefaultPaletteToolEntry [message #42017] |
Thu, 14 November 2002 05:11  |
Eclipse User |
|
|
|
hi all,
lets say I have boxes as edit parts, and those boxes have names. when user
clicks and tries to add it to diagram, when user first clicked in pallette,
i should display a dialog box and ask for the name of this box. so, i have
this in getPalletteroot
tool = new DefaultPaletteToolEntry(new CreationTool(new
PortCreationFactory()), "In....
and as you see i implemented CreateRequest.Factory in PortCreationFactory,
and display dialog in getNewObject() and ask for name, however this doesn't
work because during this process this method is called for every pixel mouse
moves over parent.
so, how should I implement functionality I need?
thanx,
ozgur
|
|
|
small addition to "about creationtool for DefaultPaletteToolEntry" [message #42048 is a reply to message #42017] |
Thu, 14 November 2002 05:15   |
Eclipse User |
|
|
|
small addition, the thing i described below, happens only when user clicks
cancel in dialog, this means i return null for getNewObject() and this
messes things up little. it works ok when user goes on and clicks ok on
dialog, in which case i return new object....
public Object getNewObject()
{
WNewArgument wna = new WNewArgument();
WizardDialog wd = new WizardDialog(null, wna);
if (wd.open() == WizardDialog.OK)
{
return new InputPortModel("asd", "asd");
}
else
return null;
}
"Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
news:aqvqru$imt$1@rogue.oti.com...
> hi all,
>
> lets say I have boxes as edit parts, and those boxes have names. when user
> clicks and tries to add it to diagram, when user first clicked in
pallette,
> i should display a dialog box and ask for the name of this box. so, i have
> this in getPalletteroot
>
> tool = new DefaultPaletteToolEntry(new CreationTool(new
> PortCreationFactory()), "In....
>
> and as you see i implemented CreateRequest.Factory in PortCreationFactory,
> and display dialog in getNewObject() and ask for name, however this
doesn't
> work because during this process this method is called for every pixel
mouse
> moves over parent.
>
> so, how should I implement functionality I need?
>
> thanx,
> ozgur
>
>
|
|
|
still some small addition to "about creationtool for DefaultPaletteToolEntry" [message #42079 is a reply to message #42048] |
Thu, 14 November 2002 05:36   |
Eclipse User |
|
|
|
sorry for third part but, i want to have this dialog when user just clicks
on pallette item, not when mouse moves over parent. it's clear to me that i
implemented this functionality in wrong place... where is the correct place?
thanx,
"Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
news:aqvr3v$ir5$1@rogue.oti.com...
> small addition, the thing i described below, happens only when user clicks
> cancel in dialog, this means i return null for getNewObject() and this
> messes things up little. it works ok when user goes on and clicks ok on
> dialog, in which case i return new object....
>
> public Object getNewObject()
> {
> WNewArgument wna = new WNewArgument();
> WizardDialog wd = new WizardDialog(null, wna);
> if (wd.open() == WizardDialog.OK)
> {
> return new InputPortModel("asd", "asd");
> }
> else
> return null;
> }
>
>
>
>
> "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> news:aqvqru$imt$1@rogue.oti.com...
> > hi all,
> >
> > lets say I have boxes as edit parts, and those boxes have names. when
user
> > clicks and tries to add it to diagram, when user first clicked in
> pallette,
> > i should display a dialog box and ask for the name of this box. so, i
have
> > this in getPalletteroot
> >
> > tool = new DefaultPaletteToolEntry(new CreationTool(new
> > PortCreationFactory()), "In....
> >
> > and as you see i implemented CreateRequest.Factory in
PortCreationFactory,
> > and display dialog in getNewObject() and ask for name, however this
> doesn't
> > work because during this process this method is called for every pixel
> mouse
> > moves over parent.
> >
> > so, how should I implement functionality I need?
> >
> > thanx,
> > ozgur
> >
> >
>
>
|
|
|
Re: still some small addition to "about creationtool for DefaultPaletteToolEntry" [message #42172 is a reply to message #42079] |
Thu, 14 November 2002 10:25   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
"Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
news:aqvsai$jo5$1@rogue.oti.com...
> sorry for third part but, i want to have this dialog when user just clicks
> on pallette item, not when mouse moves over parent. it's clear to me that
i
> implemented this functionality in wrong place... where is the correct
place?
If you were to continue using the CreationTool, one correct place is to do
this on Tool.activate(). However, why prompt the user before they have
clicked on the Graphical canvas? What if they activated the Tool be
accident?
You should convert to using PaletteTemplates, and the correct place will be
on the TransferDropTargetListener. On handleDrop(), you could prompt the
user for the name.
Dialogs suck. The best solution would be to generate a bogus name, and use
DirectEdit (perhaps you could invoke this immediately upon creation), and
have the user type the realy name.
>
> thanx,
>
> "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> news:aqvr3v$ir5$1@rogue.oti.com...
> > small addition, the thing i described below, happens only when user
clicks
> > cancel in dialog, this means i return null for getNewObject() and this
> > messes things up little. it works ok when user goes on and clicks ok on
> > dialog, in which case i return new object....
> >
> > public Object getNewObject()
> > {
> > WNewArgument wna = new WNewArgument();
> > WizardDialog wd = new WizardDialog(null, wna);
> > if (wd.open() == WizardDialog.OK)
> > {
> > return new InputPortModel("asd", "asd");
> > }
> > else
> > return null;
> > }
> >
> >
> >
> >
> > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > news:aqvqru$imt$1@rogue.oti.com...
> > > hi all,
> > >
> > > lets say I have boxes as edit parts, and those boxes have names. when
> user
> > > clicks and tries to add it to diagram, when user first clicked in
> > pallette,
> > > i should display a dialog box and ask for the name of this box. so, i
> have
> > > this in getPalletteroot
> > >
> > > tool = new DefaultPaletteToolEntry(new CreationTool(new
> > > PortCreationFactory()), "In....
> > >
> > > and as you see i implemented CreateRequest.Factory in
> PortCreationFactory,
> > > and display dialog in getNewObject() and ask for name, however this
> > doesn't
> > > work because during this process this method is called for every pixel
> > mouse
> > > moves over parent.
> > >
> > > so, how should I implement functionality I need?
> > >
> > > thanx,
> > > ozgur
> > >
> > >
> >
> >
>
>
|
|
|
Re: still some small addition to "about creationtool for DefaultPaletteToolEntry" [message #42201 is a reply to message #42172] |
Thu, 14 November 2002 11:25   |
Eclipse User |
|
|
|
Hi Randy!
Thanks for answers and idea about 'dialogs suck'. you're right, however, i'm
under heavy stress nowadays, i'll definetely consider in-place editing. the
thing i described was a very simplified version what i have, so it's not
just a label, it's a string some parts are allowed to edit, some parts are
not and so...
thanx again,
ozgur
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:ar0d96$uk2$1@rogue.oti.com...
>
> "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> news:aqvsai$jo5$1@rogue.oti.com...
> > sorry for third part but, i want to have this dialog when user just
clicks
> > on pallette item, not when mouse moves over parent. it's clear to me
that
> i
> > implemented this functionality in wrong place... where is the correct
> place?
>
> If you were to continue using the CreationTool, one correct place is to do
> this on Tool.activate(). However, why prompt the user before they have
> clicked on the Graphical canvas? What if they activated the Tool be
> accident?
>
> You should convert to using PaletteTemplates, and the correct place will
be
> on the TransferDropTargetListener. On handleDrop(), you could prompt the
> user for the name.
>
> Dialogs suck. The best solution would be to generate a bogus name, and
use
> DirectEdit (perhaps you could invoke this immediately upon creation), and
> have the user type the realy name.
>
> >
> > thanx,
> >
> > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > news:aqvr3v$ir5$1@rogue.oti.com...
> > > small addition, the thing i described below, happens only when user
> clicks
> > > cancel in dialog, this means i return null for getNewObject() and this
> > > messes things up little. it works ok when user goes on and clicks ok
on
> > > dialog, in which case i return new object....
> > >
> > > public Object getNewObject()
> > > {
> > > WNewArgument wna = new WNewArgument();
> > > WizardDialog wd = new WizardDialog(null, wna);
> > > if (wd.open() == WizardDialog.OK)
> > > {
> > > return new InputPortModel("asd", "asd");
> > > }
> > > else
> > > return null;
> > > }
> > >
> > >
> > >
> > >
> > > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > > news:aqvqru$imt$1@rogue.oti.com...
> > > > hi all,
> > > >
> > > > lets say I have boxes as edit parts, and those boxes have names.
when
> > user
> > > > clicks and tries to add it to diagram, when user first clicked in
> > > pallette,
> > > > i should display a dialog box and ask for the name of this box. so,
i
> > have
> > > > this in getPalletteroot
> > > >
> > > > tool = new DefaultPaletteToolEntry(new CreationTool(new
> > > > PortCreationFactory()), "In....
> > > >
> > > > and as you see i implemented CreateRequest.Factory in
> > PortCreationFactory,
> > > > and display dialog in getNewObject() and ask for name, however this
> > > doesn't
> > > > work because during this process this method is called for every
pixel
> > > mouse
> > > > moves over parent.
> > > >
> > > > so, how should I implement functionality I need?
> > > >
> > > > thanx,
> > > > ozgur
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: still some small addition to "about creationtool for DefaultPaletteToolEntry" [message #42256 is a reply to message #42201] |
Thu, 14 November 2002 11:30  |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
> Thanks for answers and idea about 'dialogs suck'. you're right, however,
i'm
> under heavy stress nowadays, i'll definetely consider in-place editing.
the
> thing i described was a very simplified version what i have, so it's not
> just a label, it's a string some parts are allowed to edit, some parts are
> not and so...
Yeah, sometimes you need a dialog. Especially if the properties must be set
before the object can be instantiated in the model. If possible, the
properties in the dialog should be editable on the propertysheet too. I
agree the direct-edit is most effective on just a single attribute, like
"name".
>
> thanx again,
> ozgur
>
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:ar0d96$uk2$1@rogue.oti.com...
> >
> > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > news:aqvsai$jo5$1@rogue.oti.com...
> > > sorry for third part but, i want to have this dialog when user just
> clicks
> > > on pallette item, not when mouse moves over parent. it's clear to me
> that
> > i
> > > implemented this functionality in wrong place... where is the correct
> > place?
> >
> > If you were to continue using the CreationTool, one correct place is to
do
> > this on Tool.activate(). However, why prompt the user before they have
> > clicked on the Graphical canvas? What if they activated the Tool be
> > accident?
> >
> > You should convert to using PaletteTemplates, and the correct place will
> be
> > on the TransferDropTargetListener. On handleDrop(), you could prompt
the
> > user for the name.
> >
> > Dialogs suck. The best solution would be to generate a bogus name, and
> use
> > DirectEdit (perhaps you could invoke this immediately upon creation),
and
> > have the user type the realy name.
> >
> > >
> > > thanx,
> > >
> > > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > > news:aqvr3v$ir5$1@rogue.oti.com...
> > > > small addition, the thing i described below, happens only when user
> > clicks
> > > > cancel in dialog, this means i return null for getNewObject() and
this
> > > > messes things up little. it works ok when user goes on and clicks ok
> on
> > > > dialog, in which case i return new object....
> > > >
> > > > public Object getNewObject()
> > > > {
> > > > WNewArgument wna = new WNewArgument();
> > > > WizardDialog wd = new WizardDialog(null, wna);
> > > > if (wd.open() == WizardDialog.OK)
> > > > {
> > > > return new InputPortModel("asd", "asd");
> > > > }
> > > > else
> > > > return null;
> > > > }
> > > >
> > > >
> > > >
> > > >
> > > > "Ozgur Kurt" <ozgurkurt@hotmail.com> wrote in message
> > > > news:aqvqru$imt$1@rogue.oti.com...
> > > > > hi all,
> > > > >
> > > > > lets say I have boxes as edit parts, and those boxes have names.
> when
> > > user
> > > > > clicks and tries to add it to diagram, when user first clicked in
> > > > pallette,
> > > > > i should display a dialog box and ask for the name of this box.
so,
> i
> > > have
> > > > > this in getPalletteroot
> > > > >
> > > > > tool = new DefaultPaletteToolEntry(new CreationTool(new
> > > > > PortCreationFactory()), "In....
> > > > >
> > > > > and as you see i implemented CreateRequest.Factory in
> > > PortCreationFactory,
> > > > > and display dialog in getNewObject() and ask for name, however
this
> > > > doesn't
> > > > > work because during this process this method is called for every
> pixel
> > > > mouse
> > > > > moves over parent.
> > > > >
> > > > > so, how should I implement functionality I need?
> > > > >
> > > > > thanx,
> > > > > ozgur
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Mon Sep 15 09:37:34 EDT 2025
Powered by FUDForum. Page generated in 0.06488 seconds
|