|
Re: Remove allocation code if cancel [message #128463 is a reply to message #128447] |
Tue, 11 July 2006 23:00 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If your dialog is called from within a command you can't stop processing
at that point. It is too late because there isn't anyway to tell it to
undo all that was just done previously to it.
Basically you can't allow cancel at that point if it means you need to
undo other commands.
--
Thanks,
Rich Kulp
|
|
|
|
Re: Remove allocation code if cancel [message #132286 is a reply to message #132118] |
Wed, 18 October 2006 15:59 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If you don't need to know where you are dropping it (i.e. the dialog
comes up immediately upon selecting the palette entry to allow you to
decide what class to drop, and then allow the user to move the mouse to
where to drop it), then you can use a SelectionCreationToolEntry to do
this. Look at org.eclipse.ve.java.core/java_palette.xmi for
<children
xsi:type=" org.eclipse.ve.internal.cde.palette:SelectionCreationToolEnt ry "
icon16Name=" platform:/plugin/org.eclipse.ve.java.core/icons/full/cview16 /selectbean_view.gif "
selectorClassName=" org.eclipse.ve.java.core/org.eclipse.ve.internal.java.choose bean.ChooseBeanSelector ">
<entryLabel
xsi:type="org.eclipse.ve.internal.cde.utility:TranslatableString "
key="entry.ChooseJavaBean"
bundle="#jcm_bundle"/>
</children>
The selector classname (ChooseBeanSelector) returns the class to drop.
You can replace it with a different selector.
----------
There's no direct way supported to bring up the dialog BEFORE the
command executes but after the mouse button has been pressed for
dropping. You would need to do some overriding. You would need to do
many of the things that the CDECreationTool does (it should subclass
that). Then you would need to override the
AbstractTool.handleButtonUp(int) to put up your dialog, get your
information, and then probably need to do setCommand(getCommand()) again
to have the EditParts recontribute the command for however your dialog
modified the CreationRequest. Then do the super.handleButtonUp(int) to
actually cause it to work. There may be other problems that you will
need to handle.
--
Thanks,
Rich Kulp
|
|
|
Re: Remove allocation code if cancel [message #613518 is a reply to message #128447] |
Tue, 11 July 2006 23:00 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If your dialog is called from within a command you can't stop processing
at that point. It is too late because there isn't anyway to tell it to
undo all that was just done previously to it.
Basically you can't allow cancel at that point if it means you need to
undo other commands.
--
Thanks,
Rich Kulp
|
|
|
|
Re: Remove allocation code if cancel [message #614715 is a reply to message #132118] |
Wed, 18 October 2006 15:59 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If you don't need to know where you are dropping it (i.e. the dialog
comes up immediately upon selecting the palette entry to allow you to
decide what class to drop, and then allow the user to move the mouse to
where to drop it), then you can use a SelectionCreationToolEntry to do
this. Look at org.eclipse.ve.java.core/java_palette.xmi for
<children
xsi:type=" org.eclipse.ve.internal.cde.palette:SelectionCreationToolEnt ry "
icon16Name=" platform:/plugin/org.eclipse.ve.java.core/icons/full/cview16 /selectbean_view.gif "
selectorClassName=" org.eclipse.ve.java.core/org.eclipse.ve.internal.java.choose bean.ChooseBeanSelector ">
<entryLabel
xsi:type="org.eclipse.ve.internal.cde.utility:TranslatableString "
key="entry.ChooseJavaBean"
bundle="#jcm_bundle"/>
</children>
The selector classname (ChooseBeanSelector) returns the class to drop.
You can replace it with a different selector.
----------
There's no direct way supported to bring up the dialog BEFORE the
command executes but after the mouse button has been pressed for
dropping. You would need to do some overriding. You would need to do
many of the things that the CDECreationTool does (it should subclass
that). Then you would need to override the
AbstractTool.handleButtonUp(int) to put up your dialog, get your
information, and then probably need to do setCommand(getCommand()) again
to have the EditParts recontribute the command for however your dialog
modified the CreationRequest. Then do the super.handleButtonUp(int) to
actually cause it to work. There may be other problems that you will
need to handle.
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03792 seconds