1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.ui; 12 13 /** 14 * Interface for listening to workbench lifecycle events. 15 * <p> 16 * This interface may be implemented by clients. 17 * </p> 18 * 19 * @see IWorkbench#addWorkbenchListener 20 * @see IWorkbench#removeWorkbenchListener 21 * @since 3.2 22 */ 23 public interface IWorkbenchListener { 24 25 /** 26 * Notifies that the workbench is about to shut down. 27 * <p> 28 * This method is called immediately prior to workbench shutdown before any 29 * windows have been closed. 30 * </p> 31 * <p> 32 * The listener may veto a regular shutdown by returning <code>false</code>, 33 * although this will be ignored if the workbench is being forced to shut down. 34 * </p> 35 * <p> 36 * Since other workbench listeners may veto the shutdown, the listener should 37 * not dispose resources or do any other work during this notification that would 38 * leave the workbench in an inconsistent state. 39 * </p> 40 * 41 * @param workbench the workbench 42 * @param forced <code>true</code> if the workbench is being forced to shutdown, 43 * <code>false</code> for a regular close 44 * @return <code>true</code> to allow the workbench to proceed with shutdown, 45 * <code>false</code> to veto a non-forced shutdown 46 */ 47 public boolean preShutdown(IWorkbench workbench, boolean forced); 48 49 /** 50 * Performs arbitrary finalization after the workbench stops running. 51 * <p> 52 * This method is called during workbench shutdown after all windows 53 * have been closed. 54 * </p> 55 * 56 * @param workbench the workbench 57 */ 58 public void postShutdown(IWorkbench workbench); 59 60 } 61