2 * Created on 12.02.2004
4 * To change the template for this generated file go to
5 * Window>Preferences>Java>Code Generation>Code and Comments
7 package net.sourceforge.phpeclipse.xdebug.ui;
9 import net.sourceforge.phpdt.internal.ui.dialogs.StatusDialog;
11 import org.eclipse.swt.SWT;
12 import org.eclipse.swt.events.SelectionAdapter;
13 import org.eclipse.swt.events.SelectionEvent;
14 import org.eclipse.swt.layout.GridData;
15 import org.eclipse.swt.layout.GridLayout;
16 import org.eclipse.swt.widgets.Button;
17 import org.eclipse.swt.widgets.Composite;
18 import org.eclipse.swt.widgets.Control;
19 import org.eclipse.swt.widgets.DirectoryDialog;
20 import org.eclipse.swt.widgets.Label;
21 import org.eclipse.swt.widgets.Shell;
22 import org.eclipse.swt.widgets.Text;
27 * To change the template for this generated type comment go to
28 * Window>Preferences>Java>Code Generation>Code and Comments
30 public class EditPathMapDialog extends StatusDialog {
33 private Text fLocalPathText;
34 private Text fRemotePathText;
35 private String[] fInitialValues;
36 private String fLocalPath;
37 private String fRemotePath;
39 public EditPathMapDialog(Shell parentShell, String aDialogTitle, String[] initialValues) {
41 setTitle(aDialogTitle);
42 fInitialValues= initialValues;
45 protected void okPressed() {
46 fLocalPath= fLocalPathText.getText();
47 fRemotePath = fRemotePathText.getText();
50 protected Control createDialogArea(Composite composite) {
51 Composite comp = new Composite(composite, SWT.NONE);
52 comp.setLayout(new GridLayout());
54 Composite fileComp= new Composite(comp,SWT.NONE);
55 GridLayout gridLayout = new GridLayout();
56 gridLayout.numColumns = 3;
57 // gridLayout.marginHeight = 0;
58 // gridLayout.marginWidth = 0;
59 fileComp.setLayout(gridLayout);
61 Label label= new Label(fileComp,SWT.NONE);
62 label.setText("Local_Path");
65 fLocalPathText = new Text(fileComp,SWT.SINGLE | SWT.BORDER);
66 GridData gd = new GridData();
68 fLocalPathText.setLayoutData(gd);
69 fLocalPathText.setText(fInitialValues[0]);
70 Button button= new Button(fileComp, SWT.PUSH);
71 button.setText("Browse");
72 button.addSelectionListener(new SelectionAdapter() {
73 public void widgetSelected(SelectionEvent e) {
74 handleBrowseButtonSelected();
77 label= new Label(fileComp,SWT.NONE);
78 label.setText("Remote Path");
79 fRemotePathText = new Text(fileComp,SWT.SINGLE | SWT.BORDER);
80 fRemotePathText.setText(fInitialValues[1]);
81 gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
82 gd.horizontalSpan = 2;
83 fRemotePathText.setLayoutData(gd);
88 public String[] getPathPair() {
89 return new String[] {fLocalPath,fRemotePath};
93 private void handleBrowseButtonSelected() {
94 DirectoryDialog dd = new DirectoryDialog(getShell(),SWT.OPEN);
95 dd.setMessage("Select the directory to map");
96 String path=dd.open();
99 fLocalPathText.setText(path);