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
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.browsing.ui.common.processors;
\r
14 import org.simantics.browsing.ui.GraphExplorer;
\r
15 import org.simantics.browsing.ui.PrimitiveQueryProcessor;
\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
22 * @author Tuukka Lehtonen
\r
24 public interface ProcessorLifecycle {
\r
27 * This processor has been attached to the specified {@link GraphExplorer}
\r
28 * via {@link GraphExplorer#setPrimitiveProcessor(PrimitiveQueryProcessor)}
\r
30 * @param explorer the explorer to which this processor was just attached
\r
32 void attached(GraphExplorer explorer);
\r
35 * This processor has been detached from the specified {@link GraphExplorer}
\r
36 * for one of these reasons:
\r
38 * <li>replaced by another {@link PrimitiveQueryProcessor} through an
\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
45 * @param explorer the explorer from which this processor was just detached
\r
47 void detached(GraphExplorer explorer);
\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