<< Click to Display Table of Contents >> BeforeSaveFile Event - Java |
[GUI version only]
Is fired when the user clicked the Save File button in the toolbar (or pushed the corresponding key).
public void BeforeSaveFile(
CancelEvent e
)
CancelEvent e
The cancel event is defined as:
public class CancelEvent extends java.util.EventObject {
private boolean cancel = false;
public boolean getCancel() {
return cancel;
}
public void setCancel(boolean cancel) {
this.cancel = cancel;
}
public CancelEvent(VpeControl source) {
super(source);
}
}
You can call e.setCancel(true) if you want to cancel the event, i.e. deny that the file save dialog will be shown. Cancelling the operation allows you to display your own save dialog and to export your own document, for example to a memory stream and from there to a database.
Example:
public void BeforeSaveFile(CancelEvent e) {
e.setCancel(true);
}