|
Lines 4-10
Link Here
|
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
|
Lines 42-53
Link Here
|
| 42 |
public class CVSDecoratorPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage { |
42 |
public class CVSDecoratorPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage { |
| 43 |
|
43 |
|
| 44 |
private static class PreviewFile { |
44 |
private static class PreviewFile { |
| 45 |
|
45 |
|
| 46 |
public final String name, tag, mode; |
46 |
public final String name, tag, mode; |
| 47 |
public final int type; |
47 |
public final int type; |
| 48 |
public final boolean added, dirty, hasRemote, ignored, newResource; |
48 |
public final boolean added, dirty, hasRemote, ignored, newResource; |
| 49 |
public Collection children; |
49 |
public Collection children; |
| 50 |
|
50 |
|
| 51 |
public PreviewFile(String name, int type, boolean added, boolean newResource, boolean dirty, boolean ignored, boolean hasRemote, String mode, String tag) { |
51 |
public PreviewFile(String name, int type, boolean added, boolean newResource, boolean dirty, boolean ignored, boolean hasRemote, String mode, String tag) { |
| 52 |
this.name= name; |
52 |
this.name= name; |
| 53 |
this.type= type; |
53 |
this.type= type; |
|
Lines 60-66
Link Here
|
| 60 |
this.tag= tag != null ? tag : ""; //$NON-NLS-1$ |
60 |
this.tag= tag != null ? tag : ""; //$NON-NLS-1$ |
| 61 |
this.children= Collections.EMPTY_LIST; |
61 |
this.children= Collections.EMPTY_LIST; |
| 62 |
} |
62 |
} |
| 63 |
|
63 |
|
| 64 |
public void configureDecoration(CVSDecoration decoration) { |
64 |
public void configureDecoration(CVSDecoration decoration) { |
| 65 |
decoration.setResourceType(type); |
65 |
decoration.setResourceType(type); |
| 66 |
decoration.setAdded(added); |
66 |
decoration.setAdded(added); |
|
Lines 72-100
Link Here
|
| 72 |
decoration.setKeywordSubstitution(mode); |
72 |
decoration.setKeywordSubstitution(mode); |
| 73 |
} |
73 |
} |
| 74 |
} |
74 |
} |
| 75 |
|
75 |
|
| 76 |
private static class FormatEditor extends SelectionAdapter { |
76 |
private static class FormatEditor extends SelectionAdapter { |
| 77 |
private final Text fText; |
77 |
private final Text fText; |
| 78 |
private final Map fBindings; |
78 |
private final Map fBindings; |
| 79 |
private final String fKey; |
79 |
private final String fKey; |
| 80 |
|
80 |
|
| 81 |
public FormatEditor(Composite composite, String title, String buttonText, Map bindings, String key) { |
81 |
public FormatEditor(Composite composite, String title, String buttonText, Map bindings, String key) { |
| 82 |
|
82 |
|
| 83 |
fKey= key; |
83 |
fKey= key; |
| 84 |
fBindings= bindings; |
84 |
fBindings= bindings; |
| 85 |
|
85 |
|
| 86 |
final Label label= SWTUtils.createLabel(composite, title); |
86 |
final Label label= SWTUtils.createLabel(composite, title); |
| 87 |
label.setLayoutData(SWTUtils.createGridData(SWT.DEFAULT, SWT.DEFAULT, false, false)); |
87 |
label.setLayoutData(SWTUtils.createGridData(SWT.DEFAULT, SWT.DEFAULT, false, false)); |
| 88 |
|
88 |
|
| 89 |
fText= SWTUtils.createText(composite); |
89 |
fText= SWTUtils.createText(composite); |
| 90 |
|
90 |
|
| 91 |
final Button button = new Button(composite, SWT.NONE); |
91 |
final Button button = new Button(composite, SWT.NONE); |
| 92 |
button.setText(buttonText); |
92 |
button.setText(buttonText); |
| 93 |
button.setLayoutData(new GridData()); |
93 |
button.setLayoutData(new GridData()); |
| 94 |
|
94 |
|
| 95 |
button.addSelectionListener(this); |
95 |
button.addSelectionListener(this); |
| 96 |
} |
96 |
} |
| 97 |
|
97 |
|
| 98 |
public void addModifyListener(ModifyListener listener) { |
98 |
public void addModifyListener(ModifyListener listener) { |
| 99 |
fText.addModifyListener(listener); |
99 |
fText.addModifyListener(listener); |
| 100 |
} |
100 |
} |
|
Lines 102-116
Link Here
|
| 102 |
public String getText() { |
102 |
public String getText() { |
| 103 |
return fText.getText(); |
103 |
return fText.getText(); |
| 104 |
} |
104 |
} |
| 105 |
|
105 |
|
| 106 |
public void widgetSelected(SelectionEvent e) { |
106 |
public void widgetSelected(SelectionEvent e) { |
| 107 |
|
107 |
|
| 108 |
final ILabelProvider labelProvider = new LabelProvider() { |
108 |
final ILabelProvider labelProvider = new LabelProvider() { |
| 109 |
public String getText(Object element) { |
109 |
public String getText(Object element) { |
| 110 |
return ((Map.Entry)element).getKey() + " - " + ((Map.Entry)element).getValue(); //$NON-NLS-1$ |
110 |
return ((Map.Entry)element).getKey() + " - " + ((Map.Entry)element).getValue(); //$NON-NLS-1$ |
| 111 |
} |
111 |
} |
| 112 |
}; |
112 |
}; |
| 113 |
|
113 |
|
| 114 |
final IStructuredContentProvider contentsProvider = new IStructuredContentProvider() { |
114 |
final IStructuredContentProvider contentsProvider = new IStructuredContentProvider() { |
| 115 |
public Object[] getElements(Object inputElement) { |
115 |
public Object[] getElements(Object inputElement) { |
| 116 |
return ((Collection)inputElement).toArray(); |
116 |
return ((Collection)inputElement).toArray(); |
|
Lines 118-124
Link Here
|
| 118 |
public void dispose() {} |
118 |
public void dispose() {} |
| 119 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} |
119 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {} |
| 120 |
}; |
120 |
}; |
| 121 |
|
121 |
|
| 122 |
final ListSelectionDialog dialog= new ListSelectionDialog( |
122 |
final ListSelectionDialog dialog= new ListSelectionDialog( |
| 123 |
fText.getShell(), |
123 |
fText.getShell(), |
| 124 |
fBindings.entrySet(), |
124 |
fBindings.entrySet(), |
|
Lines 128-145
Link Here
|
| 128 |
dialog.setTitle(CVSUIMessages.CVSDecoratorPreferencesPage_1); //$NON-NLS-1$ |
128 |
dialog.setTitle(CVSUIMessages.CVSDecoratorPreferencesPage_1); //$NON-NLS-1$ |
| 129 |
if (dialog.open() != Window.OK) |
129 |
if (dialog.open() != Window.OK) |
| 130 |
return; |
130 |
return; |
| 131 |
|
131 |
|
| 132 |
Object[] result = dialog.getResult(); |
132 |
Object[] result = dialog.getResult(); |
| 133 |
|
133 |
|
| 134 |
for (int i = 0; i < result.length; i++) { |
134 |
for (int i = 0; i < result.length; i++) { |
| 135 |
fText.insert("{"+((Map.Entry)result[i]).getKey() +"}"); //$NON-NLS-1$ //$NON-NLS-2$ |
135 |
fText.insert("{"+((Map.Entry)result[i]).getKey() +"}"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 136 |
} |
136 |
} |
| 137 |
} |
137 |
} |
| 138 |
|
138 |
|
| 139 |
public void performOk(IPreferenceStore store) { |
139 |
public void performOk(IPreferenceStore store) { |
| 140 |
store.setValue(fKey, fText.getText()); |
140 |
store.setValue(fKey, fText.getText()); |
| 141 |
} |
141 |
} |
| 142 |
|
142 |
|
| 143 |
public void performDefaults(IPreferenceStore store) { |
143 |
public void performDefaults(IPreferenceStore store) { |
| 144 |
store.setToDefault(fKey); |
144 |
store.setToDefault(fKey); |
| 145 |
fText.setText(store.getDefaultString(fKey)); |
145 |
fText.setText(store.getDefaultString(fKey)); |
|
Lines 149-157
Link Here
|
| 149 |
fText.setText(store.getString(fKey)); |
149 |
fText.setText(store.getString(fKey)); |
| 150 |
} |
150 |
} |
| 151 |
} |
151 |
} |
| 152 |
|
152 |
|
| 153 |
private abstract class Tab extends Observable { |
153 |
private abstract class Tab extends Observable { |
| 154 |
|
154 |
|
| 155 |
public abstract void initializeValues(IPreferenceStore store); |
155 |
public abstract void initializeValues(IPreferenceStore store); |
| 156 |
public abstract void performDefaults(IPreferenceStore store); |
156 |
public abstract void performDefaults(IPreferenceStore store); |
| 157 |
public abstract void performOk(IPreferenceStore store); |
157 |
public abstract void performOk(IPreferenceStore store); |
|
Lines 160-215
Link Here
|
| 160 |
} |
160 |
} |
| 161 |
|
161 |
|
| 162 |
private class IconDecoratorTab extends Tab implements SelectionListener { |
162 |
private class IconDecoratorTab extends Tab implements SelectionListener { |
| 163 |
|
163 |
|
| 164 |
private final Button fDirty, fHasRemote, fAdded, fNewResource; |
164 |
private final Button fDirty, fHasRemote, fAdded, fNewResource; |
| 165 |
|
165 |
|
| 166 |
public IconDecoratorTab(TabFolder parent) { |
166 |
public IconDecoratorTab(TabFolder parent) { |
| 167 |
|
167 |
|
| 168 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); |
168 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); |
| 169 |
|
169 |
|
| 170 |
fDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_2); //$NON-NLS-1$ |
170 |
fDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_2); //$NON-NLS-1$ |
| 171 |
fDirty.addSelectionListener(this); |
171 |
fDirty.addSelectionListener(this); |
| 172 |
|
172 |
|
| 173 |
fHasRemote= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_3); //$NON-NLS-1$ |
173 |
fHasRemote= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_3); //$NON-NLS-1$ |
| 174 |
fHasRemote.addSelectionListener(this); |
174 |
fHasRemote.addSelectionListener(this); |
| 175 |
|
175 |
|
| 176 |
fAdded= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_4); //$NON-NLS-1$ |
176 |
fAdded= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_4); //$NON-NLS-1$ |
| 177 |
fAdded.addSelectionListener(this); |
177 |
fAdded.addSelectionListener(this); |
| 178 |
|
178 |
|
| 179 |
fNewResource= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_5); //$NON-NLS-1$ |
179 |
fNewResource= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_5); //$NON-NLS-1$ |
| 180 |
fNewResource.addSelectionListener(this); |
180 |
fNewResource.addSelectionListener(this); |
| 181 |
|
181 |
|
| 182 |
final TabItem item= new TabItem(parent, SWT.NONE); |
182 |
final TabItem item= new TabItem(parent, SWT.NONE); |
| 183 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_6); //$NON-NLS-1$ |
183 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_6); //$NON-NLS-1$ |
| 184 |
item.setControl(composite); |
184 |
item.setControl(composite); |
| 185 |
} |
185 |
} |
| 186 |
|
186 |
|
| 187 |
public void widgetSelected(SelectionEvent e) { |
187 |
public void widgetSelected(SelectionEvent e) { |
| 188 |
setChanged(); |
188 |
setChanged(); |
| 189 |
notifyObservers(); |
189 |
notifyObservers(); |
| 190 |
} |
190 |
} |
| 191 |
|
191 |
|
| 192 |
public void initializeValues(IPreferenceStore store) { |
192 |
public void initializeValues(IPreferenceStore store) { |
| 193 |
fDirty.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); |
193 |
fDirty.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); |
| 194 |
fAdded.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); |
194 |
fAdded.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); |
| 195 |
fHasRemote.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); |
195 |
fHasRemote.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); |
| 196 |
fNewResource.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); |
196 |
fNewResource.setSelection(store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); |
| 197 |
} |
197 |
} |
| 198 |
|
198 |
|
| 199 |
public void performOk(IPreferenceStore store) { |
199 |
public void performOk(IPreferenceStore store) { |
| 200 |
store.setValue(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); |
200 |
store.setValue(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); |
| 201 |
store.setValue(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); |
201 |
store.setValue(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); |
| 202 |
store.setValue(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION, fHasRemote.getSelection()); |
202 |
store.setValue(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION, fHasRemote.getSelection()); |
| 203 |
store.setValue(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION, fNewResource.getSelection()); |
203 |
store.setValue(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION, fNewResource.getSelection()); |
| 204 |
} |
204 |
} |
| 205 |
|
205 |
|
| 206 |
public void performDefaults(IPreferenceStore store) { |
206 |
public void performDefaults(IPreferenceStore store) { |
| 207 |
fDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); |
207 |
fDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION)); |
| 208 |
fAdded.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); |
208 |
fAdded.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION)); |
| 209 |
fHasRemote.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); |
209 |
fHasRemote.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION)); |
| 210 |
fNewResource.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); |
210 |
fNewResource.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION)); |
| 211 |
} |
211 |
} |
| 212 |
|
212 |
|
| 213 |
public void setPreferences(Preferences prefs) { |
213 |
public void setPreferences(Preferences prefs) { |
| 214 |
prefs.setDefault(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); |
214 |
prefs.setDefault(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION, fDirty.getSelection()); |
| 215 |
prefs.setDefault(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); |
215 |
prefs.setDefault(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION, fAdded.getSelection()); |
|
Lines 219-257
Link Here
|
| 219 |
|
219 |
|
| 220 |
public void widgetDefaultSelected(SelectionEvent e) { |
220 |
public void widgetDefaultSelected(SelectionEvent e) { |
| 221 |
} |
221 |
} |
| 222 |
} |
222 |
} |
| 223 |
|
223 |
|
| 224 |
private class TextDecoratorTab extends Tab implements ModifyListener { |
224 |
private class TextDecoratorTab extends Tab implements ModifyListener { |
| 225 |
|
225 |
|
| 226 |
private final FormatEditor fFileDecoration; |
226 |
private final FormatEditor fFileDecoration; |
| 227 |
private final FormatEditor fFolderDecoration; |
227 |
private final FormatEditor fFolderDecoration; |
| 228 |
private final FormatEditor fProjectDecoration; |
228 |
private final FormatEditor fProjectDecoration; |
| 229 |
|
229 |
|
| 230 |
private final Text dirtyFlag; |
230 |
private final Text dirtyFlag; |
| 231 |
private final Text addedFlag; |
231 |
private final Text addedFlag; |
| 232 |
|
232 |
|
| 233 |
public TextDecoratorTab(TabFolder parent) { |
233 |
public TextDecoratorTab(TabFolder parent) { |
| 234 |
|
234 |
|
| 235 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT, 3); |
235 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT, 3); |
| 236 |
Dialog.applyDialogFont(composite); |
236 |
Dialog.applyDialogFont(composite); |
| 237 |
|
237 |
|
| 238 |
fFileDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_7, CVSUIMessages.CVSDecoratorPreferencesPage_8, BINDINGS, ICVSUIConstants.PREF_FILETEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
238 |
fFileDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_7, CVSUIMessages.CVSDecoratorPreferencesPage_8, BINDINGS, ICVSUIConstants.PREF_FILETEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
| 239 |
fFolderDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_9, CVSUIMessages.CVSDecoratorPreferencesPage_10, FOLDER_BINDINGS, ICVSUIConstants.PREF_FOLDERTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
239 |
fFolderDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_9, CVSUIMessages.CVSDecoratorPreferencesPage_10, FOLDER_BINDINGS, ICVSUIConstants.PREF_FOLDERTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
| 240 |
fProjectDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_11, CVSUIMessages.CVSDecoratorPreferencesPage_12, FOLDER_BINDINGS, ICVSUIConstants.PREF_PROJECTTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
240 |
fProjectDecoration= new FormatEditor(composite, CVSUIMessages.CVSDecoratorPreferencesPage_11, CVSUIMessages.CVSDecoratorPreferencesPage_12, FOLDER_BINDINGS, ICVSUIConstants.PREF_PROJECTTEXT_DECORATION); //$NON-NLS-1$ //$NON-NLS-2$ |
| 241 |
|
241 |
|
| 242 |
fFileDecoration.addModifyListener(this); |
242 |
fFileDecoration.addModifyListener(this); |
| 243 |
fFolderDecoration.addModifyListener(this); |
243 |
fFolderDecoration.addModifyListener(this); |
| 244 |
fProjectDecoration.addModifyListener(this); |
244 |
fProjectDecoration.addModifyListener(this); |
| 245 |
|
245 |
|
| 246 |
SWTUtils.createPlaceholder(composite, 1, 3); |
246 |
SWTUtils.createPlaceholder(composite, 1, 3); |
| 247 |
final Label dirtyLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_13, 1); //$NON-NLS-1$ |
247 |
final Label dirtyLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_13, 1); //$NON-NLS-1$ |
| 248 |
dirtyLabel.setLayoutData(new GridData()); |
248 |
dirtyLabel.setLayoutData(new GridData()); |
| 249 |
|
249 |
|
| 250 |
dirtyFlag = new Text(composite, SWT.BORDER); |
250 |
dirtyFlag = new Text(composite, SWT.BORDER); |
| 251 |
dirtyFlag.setLayoutData(SWTUtils.createHFillGridData(1)); |
251 |
dirtyFlag.setLayoutData(SWTUtils.createHFillGridData(1)); |
| 252 |
dirtyFlag.addModifyListener(this); |
252 |
dirtyFlag.addModifyListener(this); |
| 253 |
SWTUtils.createPlaceholder(composite, 1, 1); |
253 |
SWTUtils.createPlaceholder(composite, 1, 1); |
| 254 |
|
254 |
|
| 255 |
|
255 |
|
| 256 |
final Label addedLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_14, 1); //$NON-NLS-1$ |
256 |
final Label addedLabel= SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_14, 1); //$NON-NLS-1$ |
| 257 |
addedLabel.setLayoutData(new GridData()); |
257 |
addedLabel.setLayoutData(new GridData()); |
|
Lines 260-273
Link Here
|
| 260 |
addedFlag.setLayoutData(SWTUtils.createHFillGridData(1)); |
260 |
addedFlag.setLayoutData(SWTUtils.createHFillGridData(1)); |
| 261 |
addedFlag.addModifyListener(this); |
261 |
addedFlag.addModifyListener(this); |
| 262 |
SWTUtils.createPlaceholder(composite, 1, 1); |
262 |
SWTUtils.createPlaceholder(composite, 1, 1); |
| 263 |
|
263 |
|
| 264 |
SWTUtils.createPlaceholder(composite, 1, 3); |
264 |
SWTUtils.createPlaceholder(composite, 1, 3); |
| 265 |
|
265 |
|
| 266 |
final TabItem item= new TabItem(parent, SWT.NONE); |
266 |
final TabItem item= new TabItem(parent, SWT.NONE); |
| 267 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_15); //$NON-NLS-1$ |
267 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_15); //$NON-NLS-1$ |
| 268 |
item.setControl(composite); |
268 |
item.setControl(composite); |
| 269 |
} |
269 |
} |
| 270 |
|
270 |
|
| 271 |
public void initializeValues(IPreferenceStore store) { |
271 |
public void initializeValues(IPreferenceStore store) { |
| 272 |
fFileDecoration.initializeValue(store); |
272 |
fFileDecoration.initializeValue(store); |
| 273 |
fFolderDecoration.initializeValue(store); |
273 |
fFolderDecoration.initializeValue(store); |
|
Lines 275-281
Link Here
|
| 275 |
addedFlag.setText(store.getString(ICVSUIConstants.PREF_ADDED_FLAG)); |
275 |
addedFlag.setText(store.getString(ICVSUIConstants.PREF_ADDED_FLAG)); |
| 276 |
dirtyFlag.setText(store.getString(ICVSUIConstants.PREF_DIRTY_FLAG)); |
276 |
dirtyFlag.setText(store.getString(ICVSUIConstants.PREF_DIRTY_FLAG)); |
| 277 |
} |
277 |
} |
| 278 |
|
278 |
|
| 279 |
public void performOk(IPreferenceStore store) { |
279 |
public void performOk(IPreferenceStore store) { |
| 280 |
fFileDecoration.performOk(store); |
280 |
fFileDecoration.performOk(store); |
| 281 |
fFolderDecoration.performOk(store); |
281 |
fFolderDecoration.performOk(store); |
|
Lines 283-294
Link Here
|
| 283 |
store.setValue(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); |
283 |
store.setValue(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); |
| 284 |
store.setValue(ICVSUIConstants.PREF_DIRTY_FLAG, dirtyFlag.getText()); |
284 |
store.setValue(ICVSUIConstants.PREF_DIRTY_FLAG, dirtyFlag.getText()); |
| 285 |
} |
285 |
} |
| 286 |
|
286 |
|
| 287 |
public void performDefaults(IPreferenceStore store) { |
287 |
public void performDefaults(IPreferenceStore store) { |
| 288 |
fFileDecoration.performDefaults(store); |
288 |
fFileDecoration.performDefaults(store); |
| 289 |
fFolderDecoration.performDefaults(store); |
289 |
fFolderDecoration.performDefaults(store); |
| 290 |
fProjectDecoration.performDefaults(store); |
290 |
fProjectDecoration.performDefaults(store); |
| 291 |
|
291 |
|
| 292 |
addedFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_ADDED_FLAG)); |
292 |
addedFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_ADDED_FLAG)); |
| 293 |
dirtyFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_DIRTY_FLAG)); |
293 |
dirtyFlag.setText(store.getDefaultString(ICVSUIConstants.PREF_DIRTY_FLAG)); |
| 294 |
} |
294 |
} |
|
Lines 316-322
Link Here
|
| 316 |
prefs.setDefault(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); |
316 |
prefs.setDefault(ICVSUIConstants.PREF_ADDED_FLAG, addedFlag.getText()); |
| 317 |
} |
317 |
} |
| 318 |
} |
318 |
} |
| 319 |
|
319 |
|
| 320 |
private class GeneralTab extends Tab implements SelectionListener { |
320 |
private class GeneralTab extends Tab implements SelectionListener { |
| 321 |
private final Button fShowDirty; |
321 |
private final Button fShowDirty; |
| 322 |
private final Button fUseFontDecorations; |
322 |
private final Button fUseFontDecorations; |
|
Lines 324-335
Link Here
|
| 324 |
public GeneralTab(TabFolder parent) { |
324 |
public GeneralTab(TabFolder parent) { |
| 325 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); |
325 |
final Composite composite= SWTUtils.createHFillComposite(parent, SWTUtils.MARGINS_DEFAULT); |
| 326 |
Dialog.applyDialogFont(composite); |
326 |
Dialog.applyDialogFont(composite); |
| 327 |
|
327 |
|
| 328 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_36, CVSUIMessages.CVSDecoratorPreferencesPage_37); //$NON-NLS-1$ //$NON-NLS-2$ |
328 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_36, CVSUIMessages.CVSDecoratorPreferencesPage_37); //$NON-NLS-1$ //$NON-NLS-2$ |
| 329 |
|
329 |
|
| 330 |
fShowDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_16); //$NON-NLS-1$ |
330 |
fShowDirty= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_16); //$NON-NLS-1$ |
| 331 |
SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_17); //$NON-NLS-1$ |
331 |
SWTUtils.createLabel(composite, CVSUIMessages.CVSDecoratorPreferencesPage_17); //$NON-NLS-1$ |
| 332 |
|
332 |
|
| 333 |
fUseFontDecorations= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_18); //$NON-NLS-1$ |
333 |
fUseFontDecorations= SWTUtils.createCheckBox(composite, CVSUIMessages.CVSDecoratorPreferencesPage_18); //$NON-NLS-1$ |
| 334 |
|
334 |
|
| 335 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_19, CVSUIMessages.CVSDecoratorPreferencesPage_20); //$NON-NLS-1$ //$NON-NLS-2$ |
335 |
SWTUtils.createPreferenceLink((IWorkbenchPreferenceContainer) getContainer(), composite, CVSUIMessages.CVSDecoratorPreferencesPage_19, CVSUIMessages.CVSDecoratorPreferencesPage_20); //$NON-NLS-1$ //$NON-NLS-2$ |
|
Lines 339-352
Link Here
|
| 339 |
|
339 |
|
| 340 |
final TabItem item= new TabItem(parent, SWT.NONE); |
340 |
final TabItem item= new TabItem(parent, SWT.NONE); |
| 341 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_21); //$NON-NLS-1$ |
341 |
item.setText(CVSUIMessages.CVSDecoratorPreferencesPage_21); //$NON-NLS-1$ |
| 342 |
item.setControl(composite); |
342 |
item.setControl(composite); |
| 343 |
} |
343 |
} |
| 344 |
|
344 |
|
| 345 |
public void widgetSelected(SelectionEvent e) { |
345 |
public void widgetSelected(SelectionEvent e) { |
| 346 |
setChanged(); |
346 |
setChanged(); |
| 347 |
notifyObservers(); |
347 |
notifyObservers(); |
| 348 |
} |
348 |
} |
| 349 |
|
349 |
|
| 350 |
public void widgetDefaultSelected(SelectionEvent e) { |
350 |
public void widgetDefaultSelected(SelectionEvent e) { |
| 351 |
} |
351 |
} |
| 352 |
|
352 |
|
|
Lines 359-380
Link Here
|
| 359 |
fShowDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY)); |
359 |
fShowDirty.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CALCULATE_DIRTY)); |
| 360 |
fUseFontDecorations.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_USE_FONT_DECORATORS)); |
360 |
fUseFontDecorations.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_USE_FONT_DECORATORS)); |
| 361 |
} |
361 |
} |
| 362 |
|
362 |
|
| 363 |
public void performOk(IPreferenceStore store) { |
363 |
public void performOk(IPreferenceStore store) { |
| 364 |
store.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); |
364 |
store.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); |
| 365 |
store.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); |
365 |
store.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); |
| 366 |
} |
366 |
} |
| 367 |
|
367 |
|
| 368 |
public void setPreferences(Preferences preferences) { |
368 |
public void setPreferences(Preferences preferences) { |
| 369 |
preferences.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); |
369 |
preferences.setValue(ICVSUIConstants.PREF_CALCULATE_DIRTY, fShowDirty.getSelection()); |
| 370 |
preferences.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); |
370 |
preferences.setValue(ICVSUIConstants.PREF_USE_FONT_DECORATORS, fUseFontDecorations.getSelection()); |
| 371 |
} |
371 |
} |
| 372 |
} |
372 |
} |
| 373 |
|
373 |
|
| 374 |
public class Preview extends LabelProvider implements Observer, ITreeContentProvider { |
374 |
public class Preview extends LabelProvider implements Observer, ITreeContentProvider { |
| 375 |
|
375 |
|
| 376 |
private final ResourceManager fImageCache; |
376 |
private final ResourceManager fImageCache; |
| 377 |
private final TreeViewer fViewer; |
377 |
private final TreeViewer fViewer; |
| 378 |
|
378 |
|
| 379 |
public Preview(Composite composite) { |
379 |
public Preview(Composite composite) { |
| 380 |
SWTUtils.createLabel(composite, "Previe&w:"); |
380 |
SWTUtils.createLabel(composite, "Previe&w:"); |
|
Lines 386-400
Link Here
|
| 386 |
fViewer.setInput(ROOT); |
386 |
fViewer.setInput(ROOT); |
| 387 |
fViewer.expandAll(); |
387 |
fViewer.expandAll(); |
| 388 |
} |
388 |
} |
| 389 |
|
389 |
|
| 390 |
public void refresh() { |
390 |
public void refresh() { |
| 391 |
fViewer.refresh(true); |
391 |
fViewer.refresh(true); |
| 392 |
} |
392 |
} |
| 393 |
|
393 |
|
| 394 |
public void update(Observable o, Object arg) { |
394 |
public void update(Observable o, Object arg) { |
| 395 |
refresh(); |
395 |
refresh(); |
| 396 |
} |
396 |
} |
| 397 |
|
397 |
|
| 398 |
public Object[] getChildren(Object parentElement) { |
398 |
public Object[] getChildren(Object parentElement) { |
| 399 |
return ((PreviewFile)parentElement).children.toArray(); |
399 |
return ((PreviewFile)parentElement).children.toArray(); |
| 400 |
} |
400 |
} |
|
Lines 421-435
Link Here
|
| 421 |
public Color getBackground(Object element) { |
421 |
public Color getBackground(Object element) { |
| 422 |
return getDecoration(element).getBackgroundColor(); |
422 |
return getDecoration(element).getBackgroundColor(); |
| 423 |
} |
423 |
} |
| 424 |
|
424 |
|
| 425 |
public Color getForeground(Object element) { |
425 |
public Color getForeground(Object element) { |
| 426 |
return getDecoration(element).getForegroundColor(); |
426 |
return getDecoration(element).getForegroundColor(); |
| 427 |
} |
427 |
} |
| 428 |
|
428 |
|
| 429 |
public Font getFont(Object element) { |
429 |
public Font getFont(Object element) { |
| 430 |
return getDecoration(element).getFont(); |
430 |
return getDecoration(element).getFont(); |
| 431 |
} |
431 |
} |
| 432 |
|
432 |
|
| 433 |
public String getText(Object element) { |
433 |
public String getText(Object element) { |
| 434 |
final CVSDecoration decoration = getDecoration(element); |
434 |
final CVSDecoration decoration = getDecoration(element); |
| 435 |
final StringBuffer buffer = new StringBuffer(); |
435 |
final StringBuffer buffer = new StringBuffer(); |
|
Lines 442-455
Link Here
|
| 442 |
buffer.append(suffix); |
442 |
buffer.append(suffix); |
| 443 |
return buffer.toString(); |
443 |
return buffer.toString(); |
| 444 |
} |
444 |
} |
| 445 |
|
445 |
|
| 446 |
public CVSDecoration getDecoration(Object element) { |
446 |
public CVSDecoration getDecoration(Object element) { |
| 447 |
final CVSDecoration decoration = buildDecoration((PreviewFile)element); |
447 |
final CVSDecoration decoration = buildDecoration((PreviewFile)element); |
| 448 |
((PreviewFile)element).configureDecoration(decoration); |
448 |
((PreviewFile)element).configureDecoration(decoration); |
| 449 |
decoration.compute(); |
449 |
decoration.compute(); |
| 450 |
return decoration; |
450 |
return decoration; |
| 451 |
} |
451 |
} |
| 452 |
|
452 |
|
| 453 |
public Image getImage(Object element) { |
453 |
public Image getImage(Object element) { |
| 454 |
final String s; |
454 |
final String s; |
| 455 |
switch (((PreviewFile)element).type) { |
455 |
switch (((PreviewFile)element).type) { |
|
Lines 472-482
Link Here
|
| 472 |
return null; |
472 |
return null; |
| 473 |
} |
473 |
} |
| 474 |
} |
474 |
} |
| 475 |
|
475 |
|
| 476 |
private static class ThemeListener implements IPropertyChangeListener { |
476 |
private static class ThemeListener implements IPropertyChangeListener { |
| 477 |
|
477 |
|
| 478 |
private final Preview fPreview; |
478 |
private final Preview fPreview; |
| 479 |
|
479 |
|
| 480 |
ThemeListener(Preview preview) { |
480 |
ThemeListener(Preview preview) { |
| 481 |
fPreview= preview; |
481 |
fPreview= preview; |
| 482 |
} |
482 |
} |
|
Lines 484-490
Link Here
|
| 484 |
fPreview.refresh(); |
484 |
fPreview.refresh(); |
| 485 |
} |
485 |
} |
| 486 |
} |
486 |
} |
| 487 |
|
487 |
|
| 488 |
protected static final Collection ROOT; |
488 |
protected static final Collection ROOT; |
| 489 |
protected static final Map BINDINGS; |
489 |
protected static final Map BINDINGS; |
| 490 |
protected static final Map FOLDER_BINDINGS; |
490 |
protected static final Map FOLDER_BINDINGS; |
|
Lines 497-503
Link Here
|
| 497 |
BINDINGS.put(CVSDecoratorConfiguration.FILE_REVISION, CVSUIMessages.CVSDecoratorPreferencesPage_25); //$NON-NLS-1$ |
497 |
BINDINGS.put(CVSDecoratorConfiguration.FILE_REVISION, CVSUIMessages.CVSDecoratorPreferencesPage_25); //$NON-NLS-1$ |
| 498 |
BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_26); //$NON-NLS-1$ |
498 |
BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_26); //$NON-NLS-1$ |
| 499 |
BINDINGS.put(CVSDecoratorConfiguration.ADDED_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_27); //$NON-NLS-1$ |
499 |
BINDINGS.put(CVSDecoratorConfiguration.ADDED_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_27); //$NON-NLS-1$ |
| 500 |
|
500 |
|
| 501 |
FOLDER_BINDINGS= new HashMap(); |
501 |
FOLDER_BINDINGS= new HashMap(); |
| 502 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_NAME, CVSUIMessages.CVSDecoratorPreferencesPage_28); //$NON-NLS-1$ |
502 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_NAME, CVSUIMessages.CVSDecoratorPreferencesPage_28); //$NON-NLS-1$ |
| 503 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_TAG, CVSUIMessages.CVSDecoratorPreferencesPage_29); //$NON-NLS-1$ |
503 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.RESOURCE_TAG, CVSUIMessages.CVSDecoratorPreferencesPage_29); //$NON-NLS-1$ |
|
Lines 506-513
Link Here
|
| 506 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, CVSUIMessages.CVSDecoratorPreferencesPage_32); //$NON-NLS-1$ |
506 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_USER, CVSUIMessages.CVSDecoratorPreferencesPage_32); //$NON-NLS-1$ |
| 507 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, CVSUIMessages.CVSDecoratorPreferencesPage_33); //$NON-NLS-1$ |
507 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_ROOT, CVSUIMessages.CVSDecoratorPreferencesPage_33); //$NON-NLS-1$ |
| 508 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, CVSUIMessages.CVSDecoratorPreferencesPage_34); //$NON-NLS-1$ |
508 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_REPOSITORY, CVSUIMessages.CVSDecoratorPreferencesPage_34); //$NON-NLS-1$ |
|
|
509 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.REMOTELOCATION_LABEL, CVSUIMessages.CVSDecoratorPreferencesPage_38); //$NON-NLS-1$ |
| 509 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_35); //$NON-NLS-1$ |
510 |
FOLDER_BINDINGS.put(CVSDecoratorConfiguration.DIRTY_FLAG, CVSUIMessages.CVSDecoratorPreferencesPage_35); //$NON-NLS-1$ |
| 510 |
|
511 |
|
| 511 |
final PreviewFile project= new PreviewFile("Project", IResource.PROJECT, false, false, false, false, true, null, "v1_0"); //$NON-NLS-1$ //$NON-NLS-2$ |
512 |
final PreviewFile project= new PreviewFile("Project", IResource.PROJECT, false, false, false, false, true, null, "v1_0"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 512 |
final ArrayList children= new ArrayList(); |
513 |
final ArrayList children= new ArrayList(); |
| 513 |
children.add(new PreviewFile("Folder", IResource.FOLDER, false, false, false, false, true, null, null)); //$NON-NLS-1$ |
514 |
children.add(new PreviewFile("Folder", IResource.FOLDER, false, false, false, false, true, null, null)); //$NON-NLS-1$ |
|
Lines 521-552
Link Here
|
| 521 |
ROOT= Collections.singleton(project); |
522 |
ROOT= Collections.singleton(project); |
| 522 |
} |
523 |
} |
| 523 |
|
524 |
|
| 524 |
|
525 |
|
| 525 |
private TextDecoratorTab fTextTab; |
526 |
private TextDecoratorTab fTextTab; |
| 526 |
private IconDecoratorTab fIconTab; |
527 |
private IconDecoratorTab fIconTab; |
| 527 |
private GeneralTab fGeneralTab; |
528 |
private GeneralTab fGeneralTab; |
| 528 |
|
529 |
|
| 529 |
private Preview fPreview; |
530 |
private Preview fPreview; |
| 530 |
private ThemeListener fThemeListener; |
531 |
private ThemeListener fThemeListener; |
| 531 |
|
532 |
|
| 532 |
protected Control createContents(Composite parent) { |
533 |
protected Control createContents(Composite parent) { |
| 533 |
|
534 |
|
| 534 |
final Composite composite= SWTUtils.createHVFillComposite(parent, SWTUtils.MARGINS_NONE); |
535 |
final Composite composite= SWTUtils.createHVFillComposite(parent, SWTUtils.MARGINS_NONE); |
| 535 |
|
536 |
|
| 536 |
final Composite folderComposite= SWTUtils.createHFillComposite(composite, SWTUtils.MARGINS_NONE); |
537 |
final Composite folderComposite= SWTUtils.createHFillComposite(composite, SWTUtils.MARGINS_NONE); |
| 537 |
|
538 |
|
| 538 |
// create a tab folder for the page |
539 |
// create a tab folder for the page |
| 539 |
final TabFolder tabFolder = new TabFolder(folderComposite, SWT.NONE); |
540 |
final TabFolder tabFolder = new TabFolder(folderComposite, SWT.NONE); |
| 540 |
tabFolder.setLayout(new TabFolderLayout()); |
541 |
tabFolder.setLayout(new TabFolderLayout()); |
| 541 |
tabFolder.setLayoutData(SWTUtils.createHFillGridData()); |
542 |
tabFolder.setLayoutData(SWTUtils.createHFillGridData()); |
| 542 |
|
543 |
|
| 543 |
// text decoration options |
544 |
// text decoration options |
| 544 |
fGeneralTab= new GeneralTab(tabFolder); |
545 |
fGeneralTab= new GeneralTab(tabFolder); |
| 545 |
fTextTab= new TextDecoratorTab(tabFolder); |
546 |
fTextTab= new TextDecoratorTab(tabFolder); |
| 546 |
fIconTab= new IconDecoratorTab(tabFolder); |
547 |
fIconTab= new IconDecoratorTab(tabFolder); |
| 547 |
|
548 |
|
| 548 |
fPreview= new Preview(composite); |
549 |
fPreview= new Preview(composite); |
| 549 |
|
550 |
|
| 550 |
fTextTab.addObserver(fPreview); |
551 |
fTextTab.addObserver(fPreview); |
| 551 |
fIconTab.addObserver(fPreview); |
552 |
fIconTab.addObserver(fPreview); |
| 552 |
fGeneralTab.addObserver(fPreview); |
553 |
fGeneralTab.addObserver(fPreview); |
|
Lines 554-572
Link Here
|
| 554 |
initializeValues(); |
555 |
initializeValues(); |
| 555 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.DECORATORS_PREFERENCE_PAGE); |
556 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.DECORATORS_PREFERENCE_PAGE); |
| 556 |
Dialog.applyDialogFont(parent); |
557 |
Dialog.applyDialogFont(parent); |
| 557 |
|
558 |
|
| 558 |
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener= new ThemeListener(fPreview)); |
559 |
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener= new ThemeListener(fPreview)); |
| 559 |
|
560 |
|
| 560 |
return tabFolder; |
561 |
return tabFolder; |
| 561 |
} |
562 |
} |
| 562 |
|
563 |
|
| 563 |
public void dispose() { |
564 |
public void dispose() { |
| 564 |
if (fThemeListener != null) |
565 |
if (fThemeListener != null) |
| 565 |
PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener); |
566 |
PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener); |
| 566 |
if (fPreview != null) |
567 |
if (fPreview != null) |
| 567 |
fPreview.dispose(); |
568 |
fPreview.dispose(); |
| 568 |
} |
569 |
} |
| 569 |
|
570 |
|
| 570 |
/** |
571 |
/** |
| 571 |
* Initializes states of the controls from the preference store. |
572 |
* Initializes states of the controls from the preference store. |
| 572 |
*/ |
573 |
*/ |
|
Lines 608-614
Link Here
|
| 608 |
*/ |
609 |
*/ |
| 609 |
protected void performDefaults() { |
610 |
protected void performDefaults() { |
| 610 |
final IPreferenceStore store = getPreferenceStore(); |
611 |
final IPreferenceStore store = getPreferenceStore(); |
| 611 |
|
612 |
|
| 612 |
fTextTab.performDefaults(store); |
613 |
fTextTab.performDefaults(store); |
| 613 |
fIconTab.performDefaults(store); |
614 |
fIconTab.performDefaults(store); |
| 614 |
fGeneralTab.performDefaults(store); |
615 |
fGeneralTab.performDefaults(store); |
|
Lines 626-642
Link Here
|
| 626 |
protected IPreferenceStore doGetPreferenceStore() { |
627 |
protected IPreferenceStore doGetPreferenceStore() { |
| 627 |
return CVSUIPlugin.getPlugin().getPreferenceStore(); |
628 |
return CVSUIPlugin.getPlugin().getPreferenceStore(); |
| 628 |
} |
629 |
} |
| 629 |
|
630 |
|
| 630 |
|
631 |
|
| 631 |
public CVSDecoration buildDecoration(PreviewFile file) { |
632 |
public CVSDecoration buildDecoration(PreviewFile file) { |
| 632 |
final Preferences prefs = new Preferences(); |
633 |
final Preferences prefs = new Preferences(); |
| 633 |
|
634 |
|
| 634 |
fIconTab.setPreferences(prefs); |
635 |
fIconTab.setPreferences(prefs); |
| 635 |
fTextTab.setPreferences(prefs); |
636 |
fTextTab.setPreferences(prefs); |
| 636 |
fGeneralTab.setPreferences(prefs); |
637 |
fGeneralTab.setPreferences(prefs); |
| 637 |
|
638 |
|
| 638 |
final CVSDecoration decoration= new CVSDecoration(file.name, prefs, fTextTab.getFileTextFormat(), fTextTab.getFolderTextFormat(), fTextTab.getProjectTextFormat()); |
639 |
final CVSDecoration decoration= new CVSDecoration(file.name, prefs, fTextTab.getFileTextFormat(), fTextTab.getFolderTextFormat(), fTextTab.getProjectTextFormat()); |
| 639 |
|
640 |
|
| 640 |
decoration.setKeywordSubstitution(Command.KSUBST_TEXT.getShortDisplayText()); |
641 |
decoration.setKeywordSubstitution(Command.KSUBST_TEXT.getShortDisplayText()); |
| 641 |
decoration.setRevision("1.45"); //$NON-NLS-1$ |
642 |
decoration.setRevision("1.45"); //$NON-NLS-1$ |
| 642 |
try { |
643 |
try { |