KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > link > ILinkedModeListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text.link;
12
13 /**
14  * Protocol used by {@link LinkedModeModel}s to communicate state changes, such
15  * as leaving linked mode, suspending it due to a child mode coming up, and
16  * resuming after a child mode has left.
17  * <p>
18  * This interface may implemented by clients.
19  * </p>
20  *
21  * @since 3.0
22  */

23 public interface ILinkedModeListener {
24
25     /** Flag to <code>leave</code> specifying no special action. */
26     int NONE= 0;
27     /**
28      * Flag to <code>leave</code> specifying that all nested modes should
29      * exit.
30      */

31     int EXIT_ALL= 1 << 0;
32     /**
33      * Flag to <code>leave</code> specifying that the caret should be moved to
34      * the exit position.
35      */

36     int UPDATE_CARET= 1 << 1;
37     /**
38      * Flag to <code>leave</code> specifying that a UI of a parent mode should
39      * select the current position.
40      */

41     int SELECT= 1 << 2;
42     /**
43      * Flag to <code>leave</code> specifying that document content outside of
44      * a linked position was modified.
45      */

46     int EXTERNAL_MODIFICATION= 1 << 3;
47
48     /**
49      * The leave event occurs when linked is left.
50      *
51      * @param model the model being left
52      * @param flags the reason and commands for leaving linked mode
53      */

54     void left(LinkedModeModel model, int flags);
55
56     /**
57      * The suspend event occurs when a nested linked mode is installed within
58      * <code>model</code>.
59      *
60      * @param model the model being suspended due to a nested model being
61      * installed
62      */

63     void suspend(LinkedModeModel model);
64
65     /**
66      * The resume event occurs when a nested linked mode exits.
67      *
68      * @param model the linked mode model being resumed due to a nested mode
69      * exiting
70      * @param flags the commands to execute when resuming after suspend
71      */

72     void resume(LinkedModeModel model, int flags);
73 }
74
Popular Tags