]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/processors/ProcessorLifecycle.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.browsing.ui.common / src / org / simantics / browsing / ui / common / processors / ProcessorLifecycle.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.common.processors;
13
14 import org.simantics.browsing.ui.GraphExplorer;
15 import org.simantics.browsing.ui.PrimitiveQueryProcessor;
16
17 /**
18  * An interface that {@link PrimitiveQueryProcessor} implementations may
19  * implement in order to receive lifecycle-related notifications that can be
20  * used e.g. for internal housekeeping.
21  * 
22  * @author Tuukka Lehtonen
23  */
24 public interface ProcessorLifecycle {
25
26     /**
27      * This processor has been attached to the specified {@link GraphExplorer}
28      * via {@link GraphExplorer#setPrimitiveProcessor(PrimitiveQueryProcessor)}
29      * 
30      * @param explorer the explorer to which this processor was just attached
31      */
32     void attached(GraphExplorer explorer);
33
34     /**
35      * This processor has been detached from the specified {@link GraphExplorer}
36      * for one of these reasons:
37      * <ul>
38      * <li>replaced by another {@link PrimitiveQueryProcessor} through an
39      * invocation to
40      * {@link GraphExplorer#setPrimitiveProcessor(PrimitiveQueryProcessor)}</li>
41      * <li>the graph explorer was disposed and all primitive processors are
42      * being detached from it</li>
43      * </ul>
44      * 
45      * @param explorer the explorer from which this processor was just detached
46      */
47     void detached(GraphExplorer explorer);
48
49     /**
50      * Invoked by GraphExplorer when its input is reset through
51      * {@link GraphExplorer#setRoot(Object)}. Allows the processor to do
52      * cleanup if necessary, e.g. for internal caches.
53      */
54     void clear();
55
56 }