1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 20 package org.netbeans.spi.project; 21 22 /** 23 * Callback permitting {@link org.netbeans.api.project.Project}s to inform the 24 * {@link org.netbeans.api.project.ProjectManager} 25 * of important lifecycle events. 26 * Currently the only available events are modification of the project metadata 27 * and project deletion notification. 28 * However in the future other events may be added, such as moving 29 * the project, which the project manager would need to be informed of. 30 * <p> 31 * This interface may only be implemented by the project manager. A 32 * {@link ProjectFactory} will receive an instance in 33 * {@link ProjectFactory#loadProject}. 34 * </p> 35 * @author Jesse Glick 36 */ 37 public interface ProjectState { 38 39 /** 40 * Inform the manager that the project's in-memory state has been modified 41 * and that a call to {@link ProjectFactory#saveProject} may be needed. 42 * May not be called during {@link ProjectFactory#loadProject}. 43 * <p>Acquires write access. 44 */ 45 void markModified(); 46 47 /** 48 * <p>Inform the manager that the project has been deleted. The project will 49 * be removed from any {@link org.netbeans.api.project.ProjectManager}'s mappings. 50 * If {@link org.netbeans.api.project.ProjectManager#findProject} is called on the project directory, 51 * the {@link ProjectFactory ProjectFactories} are asked again to recognize 52 * the project.</p> 53 * 54 * <p>The project is no longer recognized as created by the {@link org.netbeans.api.project.ProjectManager}.</p> 55 * 56 * <p>Acquires write access.</p> 57 * 58 * @throws IllegalStateException if notifyDeleted is called more than once for a project. 59 * @since 1.6 60 */ 61 void notifyDeleted() throws IllegalStateException; 62 63 } 64