1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.browsing.ui.common.processors;
14 import org.simantics.browsing.ui.GraphExplorer;
15 import org.simantics.browsing.ui.PrimitiveQueryProcessor;
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.
22 * @author Tuukka Lehtonen
24 public interface ProcessorLifecycle {
27 * This processor has been attached to the specified {@link GraphExplorer}
28 * via {@link GraphExplorer#setPrimitiveProcessor(PrimitiveQueryProcessor)}
30 * @param explorer the explorer to which this processor was just attached
32 void attached(GraphExplorer explorer);
35 * This processor has been detached from the specified {@link GraphExplorer}
36 * for one of these reasons:
38 * <li>replaced by another {@link PrimitiveQueryProcessor} through an
40 * {@link GraphExplorer#setPrimitiveProcessor(PrimitiveQueryProcessor)}</li>
41 * <li>the graph explorer was disposed and all primitive processors are
42 * being detached from it</li>
45 * @param explorer the explorer from which this processor was just detached
47 void detached(GraphExplorer explorer);
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.