View | Details | Raw Unified | Return to bug 224588 | Differences between
and this patch

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/patch/Patcher.java (-1 / +27 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
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
Lines 179-184 Link Here
179
		fDiffs = patchReader.getDiffs();
179
		fDiffs = patchReader.getDiffs();
180
	}
180
	}
181
	
181
	
182
	public void countLines() {
183
		FileDiff[] fileDiffs = getDiffs();
184
		for (int i = 0; i < fileDiffs.length; i++) {
185
			int addedLines = 0;
186
			int removedLines = 0;
187
			FileDiff fileDiff = fileDiffs[i];
188
			for (int j = 0; j < fileDiff.getHunkCount(); j++) {
189
				Hunk hunk = fileDiff.getHunks()[j];
190
				String[] lines = hunk.getLines();
191
				for (int k = 0; k < lines.length; k++) {
192
					char c = lines[k].charAt(0);
193
					switch (c) {
194
					case '+':
195
						addedLines++;
196
						continue;
197
					case '-':
198
						removedLines++;
199
						continue;
200
					}
201
				}
202
			}
203
			fileDiff.setAddedLines(addedLines);
204
			fileDiff.setRemovedLines(removedLines);
205
		}
206
	}
207
	
182
	//---- applying a patch file
208
	//---- applying a patch file
183
209
184
	public void applyAll(IProgressMonitor pm, Shell shell, String title) throws CoreException {
210
	public void applyAll(IProgressMonitor pm, Shell shell, String title) throws CoreException {
(-)compare/org/eclipse/compare/internal/patch/PatchMessages.properties (+1 lines)
Lines 102-107 Link Here
102
PreviewPatchPage_FuzzUsed=(fuzz factor used: {0})
102
PreviewPatchPage_FuzzUsed=(fuzz factor used: {0})
103
PreviewPatchPage_AllContextIgnored=(fuzz factor used: {0}, all context lines ignored)
103
PreviewPatchPage_AllContextIgnored=(fuzz factor used: {0}, all context lines ignored)
104
PreviewPatchPage2_ShowMatched=Show &matched hunks
104
PreviewPatchPage2_ShowMatched=Show &matched hunks
105
PreviewPatchPage2_AddedRemovedLines=Patch contains {0} added and {1} removed line(s).
105
PreviewPatchLabelDecorator_ProjectDoesNotExist=(Project does not exist in workspace)
106
PreviewPatchLabelDecorator_ProjectDoesNotExist=(Project does not exist in workspace)
106
107
107
#
108
#
(-)compare/org/eclipse/compare/internal/patch/PatchMessages.java (+1 lines)
Lines 105-110 Link Here
105
	public static String PreviewPatchPage2_RetargetAction;
105
	public static String PreviewPatchPage2_RetargetAction;
106
	public static String PreviewPatchPage2_RetargetTooltip;
106
	public static String PreviewPatchPage2_RetargetTooltip;
107
	public static String PreviewPatchPage2_ShowMatched;
107
	public static String PreviewPatchPage2_ShowMatched;
108
	public static String PreviewPatchPage2_AddedRemovedLines;
108
	public static String RetargetPatchElementDialog_0;
109
	public static String RetargetPatchElementDialog_0;
109
	public static String RetargetPatchElementDialog_1;
110
	public static String RetargetPatchElementDialog_1;
110
}
111
}
(-)compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java (-1 / +53 lines)
Lines 12-20 Link Here
12
12
13
import java.lang.reflect.InvocationTargetException;
13
import java.lang.reflect.InvocationTargetException;
14
import java.util.Iterator;
14
import java.util.Iterator;
15
import java.util.regex.Pattern;
15
16
16
import org.eclipse.compare.CompareConfiguration;
17
import org.eclipse.compare.CompareConfiguration;
17
import org.eclipse.compare.CompareUI;
18
import org.eclipse.compare.CompareUI;
19
import org.eclipse.compare.internal.ComparePreferencePage;
18
import org.eclipse.compare.internal.CompareUIPlugin;
20
import org.eclipse.compare.internal.CompareUIPlugin;
19
import org.eclipse.compare.internal.ICompareUIConstants;
21
import org.eclipse.compare.internal.ICompareUIConstants;
20
import org.eclipse.core.runtime.Assert;
22
import org.eclipse.core.runtime.Assert;
Lines 27-32 Link Here
27
import org.eclipse.jface.dialogs.IDialogConstants;
29
import org.eclipse.jface.dialogs.IDialogConstants;
28
import org.eclipse.jface.dialogs.IDialogSettings;
30
import org.eclipse.jface.dialogs.IDialogSettings;
29
import org.eclipse.jface.operation.IRunnableWithProgress;
31
import org.eclipse.jface.operation.IRunnableWithProgress;
32
import org.eclipse.jface.preference.IPreferenceStore;
30
import org.eclipse.jface.resource.JFaceResources;
33
import org.eclipse.jface.resource.JFaceResources;
31
import org.eclipse.jface.util.IPropertyChangeListener;
34
import org.eclipse.jface.util.IPropertyChangeListener;
32
import org.eclipse.jface.util.PropertyChangeEvent;
35
import org.eclipse.jface.util.PropertyChangeEvent;
Lines 37-42 Link Here
37
import org.eclipse.jface.viewers.TreeSelection;
40
import org.eclipse.jface.viewers.TreeSelection;
38
import org.eclipse.jface.window.Window;
41
import org.eclipse.jface.window.Window;
39
import org.eclipse.jface.wizard.WizardPage;
42
import org.eclipse.jface.wizard.WizardPage;
43
import org.eclipse.osgi.util.NLS;
40
import org.eclipse.swt.SWT;
44
import org.eclipse.swt.SWT;
41
import org.eclipse.swt.events.ModifyEvent;
45
import org.eclipse.swt.events.ModifyEvent;
42
import org.eclipse.swt.events.ModifyListener;
46
import org.eclipse.swt.events.ModifyListener;
Lines 73-78 Link Here
73
	
77
	
74
	private Combo fStripPrefixSegments;
78
	private Combo fStripPrefixSegments;
75
	private Text fFuzzField;
79
	private Text fFuzzField;
80
	private Label addedRemovedLines;
76
	
81
	
77
	private Action fExcludeAction;
82
	private Action fExcludeAction;
78
	private Action fIncludeAction;
83
	private Action fIncludeAction;
Lines 148-154 Link Here
148
			}});
153
			}});
149
154
150
		c.setLayoutData(new GridData(GridData.FILL_BOTH));
155
		c.setLayoutData(new GridData(GridData.FILL_BOTH));
151
	
156
		
157
		addedRemovedLines = new Label(composite, SWT.NONE);
158
		addedRemovedLines.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
159
				| GridData.VERTICAL_ALIGN_BEGINNING));
160
			
152
		setControl(composite);
161
		setControl(composite);
153
		
162
		
154
		restoreWidgetValues();
163
		restoreWidgetValues();
Lines 332-337 Link Here
332
			// TODO: We should only do this if the tree needs to be rebuilt
341
			// TODO: We should only do this if the tree needs to be rebuilt
333
			rebuildTree();
342
			rebuildTree();
334
			updateEnablements();
343
			updateEnablements();
344
			addedRemovedLines.setText(countLines());
335
		}
345
		}
336
	}
346
	}
337
	
347
	
Lines 670-675 Link Here
670
	void saveWidgetValues() {
680
	void saveWidgetValues() {
671
		settings.put(EXPAND_PATCH_OPTIONS, patchOptions.isExpanded());
681
		settings.put(EXPAND_PATCH_OPTIONS, patchOptions.isExpanded());
672
	}
682
	}
683
	
684
	private String countLines() {
685
		int added = 0, removed = 0;
686
		
687
		IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
688
		String addedLinesRegex = store.getString(ComparePreferencePage.ADDED_LINES_REGEX);
689
		String removedLinesRegex = store.getString(ComparePreferencePage.REMOVED_LINES_REGEX);
690
		
691
		if ((addedLinesRegex == null || "".equals(addedLinesRegex)) //$NON-NLS-1$
692
				&& (removedLinesRegex == null || "".equals(removedLinesRegex))) { //$NON-NLS-1$
693
			
694
			fPatcher.countLines();
695
			FileDiff[] fileDiffs = fPatcher.getDiffs();
696
			for (int i = 0; i < fileDiffs.length; i++) {
697
				added += fileDiffs[i].getAddedLines();
698
				removed += fileDiffs[i].getRemovedLines();
699
			}
700
			
701
		} else {
702
703
			Pattern addedPattern = Pattern.compile(addedLinesRegex);
704
			Pattern removedPattern = Pattern.compile(removedLinesRegex);
705
706
			FileDiff[] fileDiffs = fPatcher.getDiffs();
707
			for (int i = 0; i < fileDiffs.length; i++) {
708
				Hunk[] hunks = fileDiffs[i].getHunks();
709
				for (int j = 0; j < hunks.length; j++) {
710
					String[] lines = hunks[j].getLines();
711
					for (int k = 0; k < lines.length; k++) {
712
						String line = lines[k];
713
						if (addedPattern.matcher(line).find())
714
							added++;
715
						if (removedPattern.matcher(line).find())
716
							removed++;
717
					}
718
				}
719
			}
720
		}
721
		
722
		return NLS.bind(PatchMessages.PreviewPatchPage2_AddedRemovedLines,
723
				new String[] { added + "", removed + "" }); //$NON-NLS-1$ //$NON-NLS-2$
724
	}
673
725
674
726
675
}
727
}
(-)compare/org/eclipse/compare/internal/patch/FileDiff.java (-5 / +28 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2006, 2007 IBM Corporation and others.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
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
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.compare.internal.patch;
11
package org.eclipse.compare.internal.patch;
12
12
13
import java.util.*;
13
import java.util.ArrayList;
14
14
import java.util.Iterator;
15
import org.eclipse.compare.patch.*;
15
import java.util.List;
16
17
import org.eclipse.compare.patch.IFilePatch;
18
import org.eclipse.compare.patch.IFilePatchResult;
19
import org.eclipse.compare.patch.PatchConfiguration;
16
import org.eclipse.compare.structuremergeviewer.Differencer;
20
import org.eclipse.compare.structuremergeviewer.Differencer;
17
import org.eclipse.core.resources.IStorage;
21
import org.eclipse.core.resources.IStorage;
18
import org.eclipse.core.runtime.*;
22
import org.eclipse.core.runtime.IPath;
23
import org.eclipse.core.runtime.IProgressMonitor;
24
import org.eclipse.core.runtime.Path;
19
25
20
/**
26
/**
21
 * A file diff represents a set of hunks that were associated with the
27
 * A file diff represents a set of hunks that were associated with the
Lines 28-33 Link Here
28
	private List fHunks= new ArrayList();
34
	private List fHunks= new ArrayList();
29
	private DiffProject fProject; //the project that contains this diff
35
	private DiffProject fProject; //the project that contains this diff
30
	private String header;
36
	private String header;
37
	private int addedLines, removedLines;
31
	
38
	
32
	/**
39
	/**
33
	 * Create a file diff for the given path and date information.
40
	 * Create a file diff for the given path and date information.
Lines 222-225 Link Here
222
		return newDate;
229
		return newDate;
223
	}
230
	}
224
231
232
	public void setAddedLines(int addedLines) {
233
		this.addedLines = addedLines;
234
	}
235
	
236
	public void setRemovedLines(int removedLines) {
237
		this.removedLines = removedLines;
238
	}
239
240
	public int getAddedLines() {
241
		return addedLines;
242
	}
243
	
244
	public int getRemovedLines() {
245
		return removedLines;
246
	}
247
225
}
248
}
(-)compare/org/eclipse/compare/internal/ComparePreferencePage.java (-19 / +77 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
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
Lines 10-39 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.compare.internal;
11
package org.eclipse.compare.internal;
12
12
13
import java.io.*;
13
import java.io.ByteArrayInputStream;
14
import java.io.InputStream;
14
import java.util.HashMap;
15
import java.util.HashMap;
15
import java.util.Iterator;
16
import java.util.Iterator;
16
import java.util.Map;
17
import java.util.Map;
17
18
18
import org.eclipse.ui.*;
19
import org.eclipse.compare.CompareConfiguration;
20
import org.eclipse.compare.IEncodedStreamContentAccessor;
21
import org.eclipse.compare.ITypedElement;
22
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
23
import org.eclipse.compare.structuremergeviewer.DiffNode;
24
import org.eclipse.compare.structuremergeviewer.Differencer;
25
import org.eclipse.jface.dialogs.Dialog;
26
import org.eclipse.jface.preference.IPreferenceStore;
27
import org.eclipse.jface.preference.PreferencePage;
28
import org.eclipse.jface.preference.RadioGroupFieldEditor;
29
import org.eclipse.jface.util.IPropertyChangeListener;
30
import org.eclipse.jface.util.PropertyChangeEvent;
31
import org.eclipse.swt.SWT;
32
import org.eclipse.swt.events.DisposeEvent;
33
import org.eclipse.swt.events.DisposeListener;
34
import org.eclipse.swt.events.ModifyEvent;
35
import org.eclipse.swt.events.ModifyListener;
36
import org.eclipse.swt.events.SelectionAdapter;
37
import org.eclipse.swt.events.SelectionEvent;
38
import org.eclipse.swt.events.SelectionListener;
39
import org.eclipse.swt.graphics.Image;
40
import org.eclipse.swt.layout.GridData;
41
import org.eclipse.swt.layout.GridLayout;
42
import org.eclipse.swt.widgets.Button;
43
import org.eclipse.swt.widgets.Composite;
44
import org.eclipse.swt.widgets.Control;
45
import org.eclipse.swt.widgets.Label;
46
import org.eclipse.swt.widgets.TabFolder;
47
import org.eclipse.swt.widgets.TabItem;
48
import org.eclipse.swt.widgets.Text;
49
import org.eclipse.ui.IWorkbench;
50
import org.eclipse.ui.IWorkbenchPreferencePage;
51
import org.eclipse.ui.PlatformUI;
19
import org.eclipse.ui.dialogs.PreferenceLinkArea;
52
import org.eclipse.ui.dialogs.PreferenceLinkArea;
20
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
53
import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
21
import org.eclipse.ui.texteditor.AbstractTextEditor;
54
import org.eclipse.ui.texteditor.AbstractTextEditor;
22
55
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.events.*;
25
import org.eclipse.swt.graphics.Image;
26
import org.eclipse.swt.layout.*;
27
import org.eclipse.swt.widgets.*;
28
29
import org.eclipse.jface.dialogs.Dialog;
30
import org.eclipse.jface.preference.*;
31
import org.eclipse.jface.util.*;
32
33
import org.eclipse.compare.*;
34
import org.eclipse.compare.contentmergeviewer.TextMergeViewer;
35
import org.eclipse.compare.structuremergeviewer.*;
36
37
56
38
public class ComparePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
57
public class ComparePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
39
	
58
	
Lines 76-81 Link Here
76
	public static final String HIGHLIGHT_TOKEN_CHANGES= PREFIX + "HighlightTokenChanges"; //$NON-NLS-1$
95
	public static final String HIGHLIGHT_TOKEN_CHANGES= PREFIX + "HighlightTokenChanges"; //$NON-NLS-1$
77
	//public static final String USE_RESOLVE_UI= PREFIX + "UseResolveUI"; //$NON-NLS-1$
96
	//public static final String USE_RESOLVE_UI= PREFIX + "UseResolveUI"; //$NON-NLS-1$
78
	public static final String PATH_FILTER= PREFIX + "PathFilter"; //$NON-NLS-1$
97
	public static final String PATH_FILTER= PREFIX + "PathFilter"; //$NON-NLS-1$
98
	public static final String ADDED_LINES_REGEX= PREFIX + "AddedLinesRegex"; //$NON-NLS-1$
99
	public static final String REMOVED_LINES_REGEX= PREFIX + "RemovedLinesRegex"; //$NON-NLS-1$
79
	
100
	
80
	
101
	
81
	private TextMergeViewer fPreviewViewer;
102
	private TextMergeViewer fPreviewViewer;
Lines 84-89 Link Here
84
	private OverlayPreferenceStore fOverlayStore;
105
	private OverlayPreferenceStore fOverlayStore;
85
	private Map fCheckBoxes= new HashMap();
106
	private Map fCheckBoxes= new HashMap();
86
	private Text fFilters;
107
	private Text fFilters;
108
	private Text addedLinesRegex;
109
	private Text removedLinesRegex;
87
	private SelectionListener fCheckBoxListener;
110
	private SelectionListener fCheckBoxListener;
88
111
89
112
Lines 96-101 Link Here
96
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, SHOW_MORE_INFO),
119
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, SHOW_MORE_INFO),
97
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IGNORE_WHITESPACE),
120
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, IGNORE_WHITESPACE),
98
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PREF_SAVE_ALL_EDITORS),
121
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PREF_SAVE_ALL_EDITORS),
122
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ADDED_LINES_REGEX),
123
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, REMOVED_LINES_REGEX),
99
		
124
		
100
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND),
125
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND),
101
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT),
126
		new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT),
Lines 118-123 Link Here
118
		store.setDefault(SHOW_MORE_INFO, false);
143
		store.setDefault(SHOW_MORE_INFO, false);
119
		store.setDefault(IGNORE_WHITESPACE, false);
144
		store.setDefault(IGNORE_WHITESPACE, false);
120
		store.setDefault(PREF_SAVE_ALL_EDITORS, false);
145
		store.setDefault(PREF_SAVE_ALL_EDITORS, false);
146
		store.setDefault(ADDED_LINES_REGEX, ""); //$NON-NLS-1$
147
		store.setDefault(REMOVED_LINES_REGEX, ""); //$NON-NLS-1$
121
		//store.setDefault(USE_SPLINES, false);
148
		//store.setDefault(USE_SPLINES, false);
122
		store.setDefault(USE_SINGLE_LINE, true);
149
		store.setDefault(USE_SINGLE_LINE, true);
123
		store.setDefault(HIGHLIGHT_TOKEN_CHANGES, true);
150
		store.setDefault(HIGHLIGHT_TOKEN_CHANGES, true);
Lines 158-163 Link Here
158
	 * @see PreferencePage#performOk()
185
	 * @see PreferencePage#performOk()
159
	 */
186
	 */
160
	public boolean performOk() {
187
	public boolean performOk() {
188
		fOverlayStore.setValue(ADDED_LINES_REGEX, addedLinesRegex.getText());
189
		fOverlayStore.setValue(REMOVED_LINES_REGEX, removedLinesRegex.getText());
190
		
161
		fOverlayStore.propagate();
191
		fOverlayStore.propagate();
162
		editor.store();
192
		editor.store();
163
		return true;
193
		return true;
Lines 250-256 Link Here
250
		new Label(composite, SWT.NONE);
280
		new Label(composite, SWT.NONE);
251
		
281
		
252
		Label l= new Label(composite, SWT.WRAP);
282
		Label l= new Label(composite, SWT.WRAP);
253
		l.setText(Utilities.getString("ComparePreferencePage.filter.description")); //$NON-NLS-1$
283
		l.setText(Utilities.getString("ComparePreferencePage.regex.description")); //$NON-NLS-1$
254
		
284
		
255
		Composite c2= new Composite(composite, SWT.NONE);
285
		Composite c2= new Composite(composite, SWT.NONE);
256
		c2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
286
		c2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Lines 259-267 Link Here
259
		c2.setLayout(layout);
289
		c2.setLayout(layout);
260
		
290
		
261
		l= new Label(c2, SWT.NONE);
291
		l= new Label(c2, SWT.NONE);
292
		l.setText(Utilities.getString("ComparePreferencePage.regexAdded.label")); //$NON-NLS-1$
293
		addedLinesRegex = new Text(c2, SWT.BORDER);
294
		addedLinesRegex.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
295
		addedLinesRegex.setText(fOverlayStore.getString(ADDED_LINES_REGEX));
296
		
297
		l= new Label(c2, SWT.NONE);
298
		l.setText(Utilities.getString("ComparePreferencePage.regexRemoved.label")); //$NON-NLS-1$
299
		removedLinesRegex = new Text(c2, SWT.BORDER);
300
		removedLinesRegex.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
301
		removedLinesRegex.setText(fOverlayStore.getString(REMOVED_LINES_REGEX));
302
303
		// a spacer
304
		new Label(composite, SWT.NONE);
305
		
306
		l= new Label(composite, SWT.WRAP);
307
		l.setText(Utilities.getString("ComparePreferencePage.filter.description")); //$NON-NLS-1$
308
		
309
		Composite c3= new Composite(composite, SWT.NONE);
310
		c3.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
311
		layout= new GridLayout(2, false);
312
		layout.marginWidth= 0;
313
		c3.setLayout(layout);
314
		
315
		l= new Label(c3, SWT.NONE);
262
		l.setText(Utilities.getString("ComparePreferencePage.filter.label")); //$NON-NLS-1$
316
		l.setText(Utilities.getString("ComparePreferencePage.filter.label")); //$NON-NLS-1$
263
		
317
		
264
		fFilters= new Text(c2, SWT.BORDER);
318
		fFilters= new Text(c3, SWT.BORDER);
265
		fFilters.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
319
		fFilters.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
266
		fFilters.setText(fOverlayStore.getString(PATH_FILTER));
320
		fFilters.setText(fOverlayStore.getString(PATH_FILTER));
267
		fFilters.addModifyListener(
321
		fFilters.addModifyListener(
Lines 374-379 Link Here
374
		
428
		
375
		if (fFilters != null)
429
		if (fFilters != null)
376
			fFilters.setText(fOverlayStore.getString(PATH_FILTER));
430
			fFilters.setText(fOverlayStore.getString(PATH_FILTER));
431
		if (addedLinesRegex != null)
432
			addedLinesRegex.setText(fOverlayStore.getString(ADDED_LINES_REGEX));
433
		if (removedLinesRegex != null)
434
			removedLinesRegex.setText(fOverlayStore.getString(REMOVED_LINES_REGEX));
377
		
435
		
378
		editor.load();
436
		editor.load();
379
	}
437
	}
(-)plugin.properties (+4 lines)
Lines 110-115 Link Here
110
ComparePreferencePage.ignoreWhitespace.label= Ignore &white space
110
ComparePreferencePage.ignoreWhitespace.label= Ignore &white space
111
ComparePreferencePage.saveBeforePatching.label= A&utomatically save dirty editors before browsing patches
111
ComparePreferencePage.saveBeforePatching.label= A&utomatically save dirty editors before browsing patches
112
112
113
ComparePreferencePage.regex.description=Enter regular expressions used to identify an added or removed line in a patch\n(e.g. '^\\+\\s*\\S' for an added line with at least one word character). 
114
ComparePreferencePage.regexAdded.label=Added lines
115
ComparePreferencePage.regexRemoved.label=Removed lines
116
113
ComparePreferencePage.filter.description= Enter member names that should be excluded from 'Compare With Each Other'.\nList is comma separated (e.g. '*.class, .project, bin/')
117
ComparePreferencePage.filter.description= Enter member names that should be excluded from 'Compare With Each Other'.\nList is comma separated (e.g. '*.class, .project, bin/')
114
ComparePreferencePage.filter.label= &Filtered Members:
118
ComparePreferencePage.filter.label= &Filtered Members:
115
ComparePreferencePage.filter.invalidsegment.error= Filter is invalid: {0}
119
ComparePreferencePage.filter.invalidsegment.error= Filter is invalid: {0}

Return to bug 224588