Mercurial > projects > dwt2
comparison org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IFormattingContext.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
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 | |
15 module org.eclipse.jface.text.formatter.IFormattingContext; | |
16 | |
17 import org.eclipse.jface.text.formatter.MultiPassContentFormatter; // packageimport | |
18 import org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy; // packageimport | |
19 import org.eclipse.jface.text.formatter.FormattingContext; // packageimport | |
20 import org.eclipse.jface.text.formatter.IFormattingStrategy; // packageimport | |
21 import org.eclipse.jface.text.formatter.IContentFormatterExtension; // packageimport | |
22 import org.eclipse.jface.text.formatter.IFormattingStrategyExtension; // packageimport | |
23 import org.eclipse.jface.text.formatter.IContentFormatter; // packageimport | |
24 import org.eclipse.jface.text.formatter.FormattingContextProperties; // packageimport | |
25 import org.eclipse.jface.text.formatter.ContentFormatter; // packageimport | |
26 | |
27 import java.lang.all; | |
28 import java.util.Map; | |
29 import java.util.Set; | |
30 | |
31 | |
32 import org.eclipse.jface.preference.IPreferenceStore; | |
33 | |
34 /** | |
35 * Formatting context used in formatting strategies implementing interface | |
36 * <code>IFormattingStrategyExtension</code>. | |
37 * | |
38 * @see IFormattingStrategyExtension | |
39 * @since 3.0 | |
40 */ | |
41 public interface IFormattingContext { | |
42 | |
43 /** | |
44 * Dispose of the formatting context. | |
45 * <p> | |
46 * Must be called after the formatting context has been used in a | |
47 * formatting process. | |
48 */ | |
49 void dispose(); | |
50 | |
51 /** | |
52 * Returns the preference keys used for the retrieval of formatting | |
53 * preferences. | |
54 * | |
55 * @return The preference keys for formatting | |
56 */ | |
57 String[] getPreferenceKeys(); | |
58 | |
59 /** | |
60 * Retrieves the property <code>key</code> from the formatting context | |
61 * | |
62 * @param key | |
63 * Key of the property to store in the context | |
64 * @return The property <code>key</code> if available, <code>null</code> | |
65 * otherwise | |
66 */ | |
67 Object getProperty(Object key); | |
68 | |
69 /** | |
70 * Is this preference key for a bool preference? | |
71 * | |
72 * @param key | |
73 * The preference key to query its type | |
74 * @return <code>true</code> iff this key is for a bool preference, | |
75 * <code>false</code> otherwise. | |
76 */ | |
77 bool isBooleanPreference(String key); | |
78 | |
79 /** | |
80 * Is this preference key for a double preference? | |
81 * | |
82 * @param key | |
83 * The preference key to query its type | |
84 * @return <code>true</code> iff this key is for a double preference, | |
85 * <code>false</code> otherwise. | |
86 */ | |
87 bool isDoublePreference(String key); | |
88 | |
89 /** | |
90 * Is this preference key for a float preference? | |
91 * | |
92 * @param key | |
93 * The preference key to query its type | |
94 * @return <code>true</code> iff this key is for a float preference, | |
95 * <code>false</code> otherwise. | |
96 */ | |
97 bool isFloatPreference(String key); | |
98 | |
99 /** | |
100 * Is this preference key for an integer preference? | |
101 * | |
102 * @param key | |
103 * The preference key to query its type | |
104 * @return <code>true</code> iff this key is for an integer preference, | |
105 * <code>false</code> otherwise. | |
106 */ | |
107 bool isIntegerPreference(String key); | |
108 | |
109 /** | |
110 * Is this preference key for a long preference? | |
111 * | |
112 * @param key | |
113 * The preference key to query its type | |
114 * @return <code>true</code> iff this key is for a long preference, | |
115 * <code>false</code> otherwise. | |
116 */ | |
117 bool isLongPreference(String key); | |
118 | |
119 /** | |
120 * Is this preference key for a string preference? | |
121 * | |
122 * @param key | |
123 * The preference key to query its type | |
124 * @return <code>true</code> iff this key is for a string preference, | |
125 * <code>false</code> otherwise. | |
126 */ | |
127 bool isStringPreference(String key); | |
128 | |
129 /** | |
130 * Stores the preferences from a map to a preference store. | |
131 * <p> | |
132 * Note that the preference keys returned by | |
133 * {@link #getPreferenceKeys()} must not be used in the preference store. | |
134 * Otherwise the preferences are overwritten. | |
135 * </p> | |
136 * | |
137 * @param map | |
138 * Map to retrieve the preferences from | |
139 * @param store | |
140 * Preference store to store the preferences in | |
141 */ | |
142 void mapToStore(Map map, IPreferenceStore store); | |
143 | |
144 /** | |
145 * Stores the property <code>key</code> in the formatting context. | |
146 * | |
147 * @param key | |
148 * Key of the property to store in the context | |
149 * @param property | |
150 * Property to store in the context. If already present, the new | |
151 * property overwrites the present one. | |
152 */ | |
153 void setProperty(Object key, Object property); | |
154 | |
155 /** | |
156 * Retrieves the preferences from a preference store in a map. | |
157 * <p> | |
158 * Note that the preference keys returned by | |
159 * {@link #getPreferenceKeys()} must not be used in the map. Otherwise the | |
160 * preferences are overwritten. | |
161 * </p> | |
162 * | |
163 * @param store | |
164 * Preference store to retrieve the preferences from | |
165 * @param map | |
166 * Map to store the preferences in | |
167 * @param useDefault | |
168 * <code>true</code> if the default preferences should be | |
169 * used, <code>false</code> otherwise | |
170 */ | |
171 void storeToMap(IPreferenceStore store, Map map, bool useDefault); | |
172 } |