View | Details | Raw Unified | Return to bug 132275
Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java (-13 / +15 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2004 IBM Corporation and others.
2
 * Copyright (c) 2000, 2006 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 36-41 Link Here
36
import org.eclipse.core.runtime.IPath;
36
import org.eclipse.core.runtime.IPath;
37
import org.eclipse.core.runtime.IProgressMonitor;
37
import org.eclipse.core.runtime.IProgressMonitor;
38
import org.eclipse.jface.dialogs.Dialog;
38
import org.eclipse.jface.dialogs.Dialog;
39
import org.eclipse.jface.dialogs.IDialogConstants;
39
import org.eclipse.jface.operation.IRunnableWithProgress;
40
import org.eclipse.jface.operation.IRunnableWithProgress;
40
import org.eclipse.jface.viewers.CheckStateChangedEvent;
41
import org.eclipse.jface.viewers.CheckStateChangedEvent;
41
import org.eclipse.jface.viewers.DecoratingLabelProvider;
42
import org.eclipse.jface.viewers.DecoratingLabelProvider;
Lines 135-147 Link Here
135
136
136
			GridLayout layout= new GridLayout();
137
			GridLayout layout= new GridLayout();
137
			layout.numColumns= 1;
138
			layout.numColumns= 1;
139
	        layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
140
	        layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);			
138
			composite.setLayout(layout);
141
			composite.setLayout(layout);
139
			final GridData data= new GridData(SWT.FILL, SWT.FILL, true, true);
142
			final GridData data= new GridData(SWT.FILL, SWT.FILL, true, true);
140
			composite.setLayoutData(data);
143
			composite.setLayoutData(data);
141
144
142
			//add controls to composite as necessary
145
			//add controls to composite as necessary
143
			Label label= new Label(composite, SWT.LEFT|SWT.WRAP);
146
			Label label= new Label(composite, SWT.LEFT|SWT.WRAP);
144
			label.setText(NLS.bind(PatchMessages.Diff_2Args, new String[] {PatchMessages.PreviewPatchPage_SelectProject, rpSelectedProject.getName()}));
147
			label.setText(NLS.bind(PatchMessages.PreviewPatchPage_SelectProject, rpSelectedProject.getName()));
145
			final GridData data2= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
148
			final GridData data2= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
146
			label.setLayoutData(data2);
149
			label.setLayoutData(data2);
147
150
Lines 159-164 Link Here
159
162
160
			setupListeners();
163
			setupListeners();
161
164
165
			Dialog.applyDialogFont(composite);
166
			
162
			return parent;
167
			return parent;
163
		}
168
		}
164
169
Lines 281-286 Link Here
281
286
282
		setControl(composite);
287
		setControl(composite);
283
288
289
		initializeDialogUnits(parent);
290
		
284
		buildPatchOptionsGroup(composite);
291
		buildPatchOptionsGroup(composite);
285
292
286
		Splitter splitter= new Splitter(composite, SWT.VERTICAL);
293
		Splitter splitter= new Splitter(composite, SWT.VERTICAL);
Lines 296-314 Link Here
296
				return CompareUI.findContentViewer(oldViewer, (ICompareInput) input, this, fCompareConfiguration);
303
				return CompareUI.findContentViewer(oldViewer, (ICompareInput) input, this, fCompareConfiguration);
297
			}
304
			}
298
		};
305
		};
299
		GridData gd= new GridData();
306
		fHunkViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
300
		gd.verticalAlignment= GridData.FILL;
301
		gd.horizontalAlignment= GridData.FILL;
302
		gd.grabExcessHorizontalSpace= true;
303
		gd.grabExcessVerticalSpace= true;
304
		fHunkViewer.setLayoutData(gd);
305
307
306
		//create Match Project button
308
		//create Match Project button
307
		fMatchProject= new Button(composite, SWT.PUSH);
309
		fMatchProject= new Button(composite, SWT.PUSH);
308
		gd= new GridData();
310
		fMatchProject.setLayoutData(new GridData(SWT.END, GridData.BEGINNING, false, false));
309
		gd.verticalAlignment= GridData.BEGINNING;
310
		gd.horizontalAlignment= GridData.END;
311
		fMatchProject.setLayoutData(gd);
312
311
313
		fMatchProject.setText(PatchMessages.PreviewPatchPage_MatchProjects);
312
		fMatchProject.setText(PatchMessages.PreviewPatchPage_MatchProjects);
314
		fMatchProject.setEnabled(false);
313
		fMatchProject.setEnabled(false);
Lines 408-414 Link Here
408
407
409
		Group group= new Group(parent, SWT.NONE);
408
		Group group= new Group(parent, SWT.NONE);
410
		group.setText(PatchMessages.PreviewPatchPage_PatchOptions_title);
409
		group.setText(PatchMessages.PreviewPatchPage_PatchOptions_title);
411
		gl= new GridLayout(); gl.numColumns= 4; gl.marginHeight= 0;
410
		gl= new GridLayout(); gl.numColumns= 4;
412
		group.setLayout(gl);
411
		group.setLayout(gl);
413
		group.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL|GridData.GRAB_HORIZONTAL));
412
		group.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL|GridData.GRAB_HORIZONTAL));
414
413
Lines 470-475 Link Here
470
				}
469
				}
471
			);
470
			);
472
		gd= new GridData(GridData.VERTICAL_ALIGN_CENTER);
471
		gd= new GridData(GridData.VERTICAL_ALIGN_CENTER);
472
		int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
473
		Point minSize = b.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
474
		gd.widthHint = Math.max(widthHint, minSize.x);		
473
		b.setLayoutData(gd);
475
		b.setLayoutData(gd);
474
476
475
		addSpacer(group);
477
		addSpacer(group);
(-)compare/org/eclipse/compare/internal/patch/PatchMessages.properties (-4 / +4 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2000, 2004 IBM Corporation and others.
2
# Copyright (c) 2000, 2006 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 38-44 Link Here
38
InputPatchPage_ChooseFileButton_text=&Browse...
38
InputPatchPage_ChooseFileButton_text=&Browse...
39
InputPatchPage_UseClipboardButton_text=&Clipboard
39
InputPatchPage_UseClipboardButton_text=&Clipboard
40
InputPatchPage_UseWorkspaceButton_text=&Workspace
40
InputPatchPage_UseWorkspaceButton_text=&Workspace
41
InputPatchPage_WorkspaceSelectPatch_text=&Select the location of the patch
41
InputPatchPage_WorkspaceSelectPatch_text=&Select the location of the patch:
42
InputPatchPage_NothingSelected_message=Select a file or folder to be patched
42
InputPatchPage_NothingSelected_message=Select a file or folder to be patched
43
InputPatchPage_ClipboardIsEmpty_message=Clipboard is empty
43
InputPatchPage_ClipboardIsEmpty_message=Clipboard is empty
44
InputPatchPage_NoTextInClipboard_message=Clipboard does not contain text
44
InputPatchPage_NoTextInClipboard_message=Clipboard does not contain text
Lines 68-74 Link Here
68
PreviewPatchPage_Target=(target: {0})
68
PreviewPatchPage_Target=(target: {0})
69
PreviewPatchPage_Left_title= Original
69
PreviewPatchPage_Left_title= Original
70
PreviewPatchPage_Right_title= Result
70
PreviewPatchPage_Right_title= Result
71
PreviewPatchPage_PatchOptions_title=Patch Options
71
PreviewPatchPage_PatchOptions_title=Patch options
72
PreviewPatchPage_IgnoreSegments_text=&Ignore leading path name segments:
72
PreviewPatchPage_IgnoreSegments_text=&Ignore leading path name segments:
73
PreviewPatchPage_ReversePatch_text=&Reverse patch
73
PreviewPatchPage_ReversePatch_text=&Reverse patch
74
PreviewPatchPage_FuzzFactor_text=&Maximum fuzz factor:
74
PreviewPatchPage_FuzzFactor_text=&Maximum fuzz factor:
Lines 80-86 Link Here
80
PreviewPatchPage_NoMatch_error=(no match)
80
PreviewPatchPage_NoMatch_error=(no match)
81
PreviewPatchPage_MatchProjects=Match &Project...
81
PreviewPatchPage_MatchProjects=Match &Project...
82
PreviewPatchPage_RetargetPatch=Retarget Patch
82
PreviewPatchPage_RetargetPatch=Retarget Patch
83
PreviewPatchPage_SelectProject=Select the project in your workspace that corresponds to project
83
PreviewPatchPage_SelectProject=Select the project in your workspace that corresponds to project ''{0}'':
84
PreviewPatchPage_FileIsReadOnly_error=(file is read-only)
84
PreviewPatchPage_FileIsReadOnly_error=(file is read-only)
85
PreviewPatchPage_GuessFuzz_text= &Guess
85
PreviewPatchPage_GuessFuzz_text= &Guess
86
PreviewPatchPage_GuessFuzzProgress_text= Guessing Fuzz Factor...
86
PreviewPatchPage_GuessFuzzProgress_text= Guessing Fuzz Factor...
(-)compare/org/eclipse/compare/internal/patch/InputPatchPage.java (-13 / +17 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2006 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 27-32 Link Here
27
import org.eclipse.core.runtime.IPath;
27
import org.eclipse.core.runtime.IPath;
28
import org.eclipse.core.runtime.Path;
28
import org.eclipse.core.runtime.Path;
29
import org.eclipse.jface.dialogs.Dialog;
29
import org.eclipse.jface.dialogs.Dialog;
30
import org.eclipse.jface.dialogs.IDialogConstants;
30
import org.eclipse.jface.dialogs.IDialogSettings;
31
import org.eclipse.jface.dialogs.IDialogSettings;
31
import org.eclipse.jface.dialogs.MessageDialog;
32
import org.eclipse.jface.dialogs.MessageDialog;
32
import org.eclipse.jface.viewers.ISelectionChangedListener;
33
import org.eclipse.jface.viewers.ISelectionChangedListener;
Lines 44-49 Link Here
44
import org.eclipse.swt.events.SelectionEvent;
45
import org.eclipse.swt.events.SelectionEvent;
45
import org.eclipse.swt.events.ShellAdapter;
46
import org.eclipse.swt.events.ShellAdapter;
46
import org.eclipse.swt.events.ShellEvent;
47
import org.eclipse.swt.events.ShellEvent;
48
import org.eclipse.swt.graphics.Point;
47
import org.eclipse.swt.layout.GridData;
49
import org.eclipse.swt.layout.GridData;
48
import org.eclipse.swt.layout.GridLayout;
50
import org.eclipse.swt.layout.GridLayout;
49
import org.eclipse.swt.widgets.Button;
51
import org.eclipse.swt.widgets.Button;
Lines 89-94 Link Here
89
	private Button fUsePatchFileButton;
91
	private Button fUsePatchFileButton;
90
92
91
	private Button fUseWorkspaceButton;
93
	private Button fUseWorkspaceButton;
94
	private Label fWorkspaceSelectLabel;
92
	private TreeViewer fTreeViewer;
95
	private TreeViewer fTreeViewer;
93
96
94
	private PatchWizard fPatchWizard;
97
	private PatchWizard fPatchWizard;
Lines 143-148 Link Here
143
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
146
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
144
		setControl(composite);
147
		setControl(composite);
145
148
149
		initializeDialogUnits(parent);
150
		
146
		buildPatchFileGroup(composite);
151
		buildPatchFileGroup(composite);
147
		
152
		
148
		//see if there are any better options presently selected
153
		//see if there are any better options presently selected
Lines 277-282 Link Here
277
	}
282
	}
278
283
279
	private void setEnableWorkspacePatch(boolean enable) {
284
	private void setEnableWorkspacePatch(boolean enable) {
285
		fWorkspaceSelectLabel.setEnabled(enable);
280
		fTreeViewer.getTree().setEnabled(enable);
286
		fTreeViewer.getTree().setEnabled(enable);
281
	}
287
	}
282
288
Lines 303-316 Link Here
303
		fUsePatchFileButton.setText(PatchMessages.InputPatchPage_FileButton_text);
309
		fUsePatchFileButton.setText(PatchMessages.InputPatchPage_FileButton_text);
304
310
305
		fPatchFileNameField= new Combo(composite, SWT.BORDER);
311
		fPatchFileNameField= new Combo(composite, SWT.BORDER);
306
		//gd.horizontalIndent= 8;
307
		gd= new GridData(GridData.FILL_HORIZONTAL);
312
		gd= new GridData(GridData.FILL_HORIZONTAL);
308
		gd.widthHint= SIZING_TEXT_FIELD_WIDTH;
313
		gd.widthHint= SIZING_TEXT_FIELD_WIDTH;
309
		fPatchFileNameField.setLayoutData(gd);
314
		fPatchFileNameField.setLayoutData(gd);
310
315
311
		fPatchFileBrowseButton= new Button(composite, SWT.PUSH);
316
		fPatchFileBrowseButton= new Button(composite, SWT.PUSH);
312
		fPatchFileBrowseButton.setText(PatchMessages.InputPatchPage_ChooseFileButton_text);
317
		fPatchFileBrowseButton.setText(PatchMessages.InputPatchPage_ChooseFileButton_text);
313
		fPatchFileBrowseButton.setLayoutData(new GridData());
318
		GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
319
		int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
320
		Point minSize = fPatchFileBrowseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
321
		data.widthHint = Math.max(widthHint, minSize.x);
322
		fPatchFileBrowseButton.setLayoutData(data);
314
323
315
		//3rd row
324
		//3rd row
316
		fUseWorkspaceButton= new Button(composite, SWT.RADIO);
325
		fUseWorkspaceButton= new Button(composite, SWT.RADIO);
Lines 389-411 Link Here
389
	}
398
	}
390
399
391
	private void addWorkspaceControls(Composite composite) {
400
	private void addWorkspaceControls(Composite composite) {
392
393
	
401
	
394
		Composite newComp = new Composite(composite, SWT.NONE);
402
		Composite newComp = new Composite(composite, SWT.NONE);
395
		GridLayout layout= new GridLayout(1, false);
403
		GridLayout layout= new GridLayout(1, false);
396
		layout.marginWidth = 15;
404
		layout.marginLeft = 16; //align w/ lable of check button
397
		layout.marginHeight = 0;
398
		layout.marginLeft = 5;
399
		newComp.setLayout(layout);
405
		newComp.setLayout(layout);
400
		newComp.setLayoutData(new GridData(GridData.FILL_BOTH));
406
		newComp.setLayoutData(new GridData(GridData.FILL_BOTH));
401
			
407
			
402
		new Label(newComp, SWT.LEFT).setText(PatchMessages.InputPatchPage_WorkspaceSelectPatch_text);
408
		fWorkspaceSelectLabel = new Label(newComp, SWT.LEFT);
403
		
409
		fWorkspaceSelectLabel.setText(PatchMessages.InputPatchPage_WorkspaceSelectPatch_text);
410
404
		fTreeViewer= new TreeViewer(newComp, SWT.BORDER);
411
		fTreeViewer= new TreeViewer(newComp, SWT.BORDER);
405
		final GridData gd= new GridData(SWT.FILL, SWT.FILL, true, true);
412
		fTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
406
		gd.widthHint= 0;
407
		gd.heightHint= 0;
408
		fTreeViewer.getTree().setLayoutData(gd);
409
413
410
		fTreeViewer.setLabelProvider(new WorkbenchLabelProvider());
414
		fTreeViewer.setLabelProvider(new WorkbenchLabelProvider());
411
		fTreeViewer.setContentProvider(new WorkbenchContentProvider());
415
		fTreeViewer.setContentProvider(new WorkbenchContentProvider());

Return to bug 132275