NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Andrew Hopkinson Posted via mailing list.
|
Posted: Wed Oct 22, 2008 7:20 pm Post subject: Extending Save action for a mime-type |
|
|
Hi,
I have written a small module that adds an additional menu option to
files of a specific mime-type. What I would like to do is extend the
Save action for the mime-type to execute the same Action code. Is their
a Simple way to achieve this.
Cheers
Andrew |
|
| Back to top |
|
 |
Tonny Kohar Posted via mailing list.
|
Posted: Thu Oct 23, 2008 5:48 am Post subject: Extending Save action for a mime-type |
|
|
Hi,
On Thu, Oct 23, 2008 at 2:21 AM, Andrew Hopkinson
<address-removed> wrote:
| Quote: | Hi,
I have written a small module that adds an additional menu option to files
of a specific mime-type. What I would like to do is extend the Save action
for the mime-type to execute the same Action code. Is their a Simple way to
achieve this.
|
It is depend on how you link the SaveCookie to YourDataObject to Your MIME-TYPE.
If you follow the as above (SaveCookie-DataObject-MIME-TYPE), the
already build in SaveAction should work automatically depending on the
Lookup, you do not need to do something special for it. The way
particular object is saved/persisted usually is on the helper class
for the DataObject.eg: YourDataObjectSupport.java, but it might be
different depend on how you architecture the things :)
If you want to add another menu entry for saving eg: SaveAs or Save
Special, just add a new Action that call your dataobject/lookup the
SaveCookie and execute it eg:
on your Action actionPerformed/performAction method you can call something like
SaveAsCookie cookie = yourDataObject.getCookie(SaveCookie.class);
cookie.save();
Cheers
Tonny Kohar
--
Citra FX Photo Effects
imagine, design, create ...
http://www.kiyut.com |
|
| Back to top |
|
 |
Andrew Hopkinson Posted via mailing list.
|
Posted: Thu Oct 23, 2008 8:11 am Post subject: Extending Save action for a mime-type |
|
|
Hi,
Thanks for the response but this does not quite fit my scenario. What I have done is write some addition functionality for the bpel file extension and at the moment I can only execute this by selecting the new context menu option for bpel files. What I would like to do is have the same Action executed whenever a bpel file is saved. So this is a case of adding my Action to the existing SaveCookie functionality of the bpel module.
Cheers
Andrew
Tonny Kohar wrote: | Quote: | | Quote: | Hi,
On Thu, Oct 23, 2008 at 2:21 AM, Andrew Hopkinson
<address-removed> ([email]address-removed[/email]) wrote:
| Quote: | Hi,
I have written a small module that adds an additional menu option to files
of a specific mime-type. What I would like to do is extend the Save action
for the mime-type to execute the same Action code. Is their a Simple way to
achieve this.
|
It is depend on how you link the SaveCookie to YourDataObject to Your MIME-TYPE.
If you follow the as above (SaveCookie-DataObject-MIME-TYPE), the
already build in SaveAction should work automatically depending on the
Lookup, you do not need to do something special for it. The way
particular object is saved/persisted usually is on the helper class
for the DataObject.eg: YourDataObjectSupport.java, but it might be
different depend on how you architecture the things :)
If you want to add another menu entry for saving eg: SaveAs or Save
Special, just add a new Action that call your dataobject/lookup the
SaveCookie and execute it eg:
on your Action actionPerformed/performAction method you can call something like
SaveAsCookie cookie = yourDataObject.getCookie(SaveCookie.class);
cookie.save();
Cheers
Tonny Kohar
| |
--
[/url] [url=http://blogs.sun.com/toxophily/]Andrew Hopkinson
Principal Engineer, Field Assist Support Team
Sun Microsystems, Inc.
Java House, Guillemont Park, Minley Road, Blackwater
Camberley, Hampshire GU17 9QG GB
Phone : +44 (0)1252 422 890 Mobile : +44 (0)7876 682 529
+44 (0)7884 185 063 Fax : +44 (0)1252 423 530 Email : address-removed ([email]address-removed[/email]) Blog : http://blogs.sun.com/toxophily/
[/url] [url=http://www.glassfishesb.com]
Sun's Open ESB Community (http://open-esb.dev.java.net) |
|
| Back to top |
|
 |
Tonny Kohar Posted via mailing list.
|
Posted: Thu Oct 23, 2008 9:04 am Post subject: Extending Save action for a mime-type |
|
|
Hi,
On Thu, Oct 23, 2008 at 3:11 PM, Andrew Hopkinson
<address-removed> wrote:
| Quote: | Hi,
Thanks for the response but this does not quite fit my scenario. What I have
done is write some addition functionality for the bpel file extension and at
the moment I can only execute this by selecting the new context menu option
for bpel files. What I would like to do is have the same Action executed
whenever a bpel file is saved. So this is a case of adding my Action to the
existing SaveCookie functionality of the bpel module.
|
Remember that SaveCookie is only an interface, the real implementation
on how to save the things is defined somewhere (usually it is in the
helper class of your dataobject). So you can invoke your addtional
action by putting that into the implementation of the SaveCookie.
Note: I am not familiar with bpel module/projects, so take it as a
grain of salt.
This become problem if bpel is not under your control, you are only
using/linked with that module.
The possibilty might be reduced into
- bpel provide public API to attach you additonal custom things, maybe
you can ask the bpel developers to provide such public API
- Or remove the registered bpel stuff from the system eg: layer.xml,
attach your own bpel things that basically just inherit from the bpel
and overide only the necessary methods eg: save function, so you end
up with minimal code
I am also interested in another ways to accomplish the above, any ideas ?
Cheers
Tonny Kohar
--
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|