|
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()); |