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