com.sun.star.frame.TerminationVetoException Java Examples

The following examples show how to use com.sun.star.frame.TerminationVetoException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TerminateListenerWrapper.java    From noa-libre with GNU Lesser General Public License v2.1 3 votes vote down vote up
/**
 * Is called when the master enviroment is about to terminate.
 * 
 * @param eventObject
 *            source of the event
 * 
 * @throws TerminationVetoException
 *             listener can disagree with this query by throwing a veto
 *             exception
 * 
 * @author Andreas Bröker
 */
public void queryTermination(EventObject eventObject)
		throws TerminationVetoException {
	TerminateEvent terminateEvent = new TerminateEvent(eventObject,
			getServiceProvider());
	terminateListener.queryTermination(terminateEvent);
	if (terminateEvent.getVeto())
		throw new TerminationVetoException();
}
 
Example #2
Source File: TerminateListener.java    From translationstudio8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * (non-Javadoc).
 * @param eventObject
 *            the event object
 * @throws TerminationVetoException
 *             the termination veto exception
 * @see com.sun.star.frame.XTerminateListener#queryTermination(com.sun.star.lang.EventObject)
 */
public void queryTermination(com.sun.star.lang.EventObject eventObject) throws TerminationVetoException {
	if (TerminationOpenoffice.isAtWork()) {
		System.out.println("Terminate while we are at work? No way!"); //$NON-NLS-1$
		throw new TerminationVetoException(); // this will veto the
		// termination,
	}
}
 
Example #3
Source File: TerminateListener.java    From tmxeditor8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * (non-Javadoc).
 * @param eventObject
 *            the event object
 * @throws TerminationVetoException
 *             the termination veto exception
 * @see com.sun.star.frame.XTerminateListener#queryTermination(com.sun.star.lang.EventObject)
 */
public void queryTermination(com.sun.star.lang.EventObject eventObject) throws TerminationVetoException {
	if (TerminationOpenoffice.isAtWork()) {
		System.out.println("Terminate while we are at work? No way!"); //$NON-NLS-1$
		throw new TerminationVetoException(); // this will veto the
		// termination,
	}
}