Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7fa43152d9d27dc185df5693418bc99682b23e93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.text.link;

/**
 * Protocol used by {@link LinkedModeModel}s to communicate state changes, such
 * as leaving linked mode, suspending it due to a child mode coming up, and
 * resuming after a child mode has left.
 * <p>
 * This interface may implemented by clients.
 * </p>
 * 
 * @since 3.0
 */
public interface ILinkedModeListener {

	/** Flag to <code>leave</code> specifying no special action. */
	int NONE= 0;
	/**
	 * Flag to <code>leave</code> specifying that all nested modes should
	 * exit.
	 */
	int EXIT_ALL= 1 << 0;
	/**
	 * Flag to <code>leave</code> specifying that the caret should be moved to
	 * the exit position.
	 */
	int UPDATE_CARET= 1 << 1;
	/**
	 * Flag to <code>leave</code> specifying that a UI of a parent mode should
	 * select the current position.
	 */
	int SELECT= 1 << 2;
	/**
	 * Flag to <code>leave</code> specifying that document content outside of
	 * a linked position was modified.
	 */
	int EXTERNAL_MODIFICATION= 1 << 3;

	/**
	 * The leave event occurs when linked is left.
	 * 
	 * @param model the model being left
	 * @param flags the reason and commands for leaving linked mode
	 */
	void left(LinkedModeModel model, int flags);

	/**
	 * The suspend event occurs when a nested linked mode is installed within
	 * <code>model</code>.
	 * 
	 * @param model the model being suspended due to a nested model being
	 *        installed
	 */
	void suspend(LinkedModeModel model);

	/**
	 * The resume event occurs when a nested linked mode exits.
	 * 
	 * @param model the linked mode model being resumed due to a nested mode
	 *        exiting
	 * @param flags the commands to execute when resuming after suspend
	 */
	void resume(LinkedModeModel model, int flags);
}

Back to the top