129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13
|
|
14 module dwtx.jface.text.formatter.IFormattingStrategyExtension;
|
|
15
|
|
16 import dwt.dwthelper.utils;
|
|
17
|
|
18 /**
|
|
19 * Extension interface for <code>IFormattingStrategy</code>.
|
|
20 * <p>
|
|
21 * Updates formatting strategies to be able to receive a more general <code>IFormattingContext</code>
|
|
22 * object from its associated content formatters.
|
|
23 * <p>
|
|
24 * Each formatting process calls the strategy's methods in the following
|
|
25 * sequence:
|
|
26 * <ul>
|
|
27 * <li><code>formatterStarts</code>
|
|
28 * <li><code>format</code>
|
|
29 * <li><code>formatterStops</code>
|
|
30 * </ul>
|
|
31 * <p>
|
|
32 * Note that multiple calls to <code>formatterStarts</code> can be issued to
|
|
33 * a strategy before launching the formatting process with <code>format</code>.
|
|
34 * <p>
|
|
35 * This interface must be implemented by clients. Implementers should be
|
|
36 * registered with a content formatter in order get involved in the formatting
|
|
37 * process.
|
|
38 *
|
|
39 * @see IFormattingContext
|
|
40 * @since 3.0
|
|
41 */
|
|
42 public interface IFormattingStrategyExtension {
|
|
43
|
|
44 /**
|
|
45 * Formats the region with the properties indicated in the formatting
|
|
46 * context previously supplied by <code>formatterStarts(IFormattingContext)</code>.
|
|
47 */
|
|
48 void format();
|
|
49
|
|
50 /**
|
|
51 * Informs the strategy about the start of a formatting process in which it
|
|
52 * will participate.
|
|
53 *
|
|
54 * @param context
|
|
55 * Formatting context used in the corresponding formatting
|
|
56 * process.
|
|
57 */
|
|
58 void formatterStarts(IFormattingContext context);
|
|
59
|
|
60 /**
|
|
61 * Informs the strategy that the formatting process in which it has
|
|
62 * participated has been finished.
|
|
63 */
|
|
64 void formatterStops();
|
|
65 }
|