Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 214696 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SnippetEditorPropertyPage.java (-2 / +4 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 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.snippeteditor;
12
package org.eclipse.jdt.internal.debug.ui.snippeteditor;
12
13
Lines 20-25 Link Here
20
import org.eclipse.debug.ui.ILaunchConfigurationTab;
21
import org.eclipse.debug.ui.ILaunchConfigurationTab;
21
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
22
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
22
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
23
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
24
import org.eclipse.jdt.internal.debug.ui.launcher.JavaWorkingDirectoryBlock;
23
import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock;
25
import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock;
24
import org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock;
26
import org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock;
25
import org.eclipse.jface.operation.IRunnableWithProgress;
27
import org.eclipse.jface.operation.IRunnableWithProgress;
Lines 34-40 Link Here
34
 */
36
 */
35
public class SnippetEditorPropertyPage extends PropertyPage {
37
public class SnippetEditorPropertyPage extends PropertyPage {
36
	
38
	
37
	private WorkingDirectoryBlock fWorkingDirBlock = new WorkingDirectoryBlock();
39
	private WorkingDirectoryBlock fWorkingDirBlock = new JavaWorkingDirectoryBlock();
38
	
40
	
39
	private JavaJRETab fJRETab = new JavaJRETab();
41
	private JavaJRETab fJRETab = new JavaJRETab();
40
	
42
	
(-)ui/org/eclipse/jdt/internal/debug/ui/launcher/AppletWorkingDirectoryBlock.java (-2 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 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 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.launcher;
12
package org.eclipse.jdt.internal.debug.ui.launcher;
12
13
Lines 14-20 Link Here
14
import org.eclipse.jdt.launching.JavaRuntime;
15
import org.eclipse.jdt.launching.JavaRuntime;
15
16
16
 
17
 
17
public class AppletWorkingDirectoryBlock extends WorkingDirectoryBlock {
18
public class AppletWorkingDirectoryBlock extends JavaWorkingDirectoryBlock {
18
19
19
	/**
20
	/**
20
	 * @see org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock#setDefaultWorkingDir()
21
	 * @see org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock#setDefaultWorkingDir()
(-)ui/org/eclipse/jdt/internal/debug/ui/launcher/WorkingDirectoryBlock.java (-21 / +80 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
2
 * Copyright (c) 2005, 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 7-18 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.ui.launcher;
12
package org.eclipse.jdt.internal.debug.ui.launcher;
12
13
13
import java.io.File;
14
import java.io.File;
14
15
15
import org.eclipse.core.resources.IContainer;
16
import org.eclipse.core.resources.IContainer;
17
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.resources.IResource;
17
import org.eclipse.core.resources.IWorkspaceRoot;
19
import org.eclipse.core.resources.IWorkspaceRoot;
18
import org.eclipse.core.resources.ResourcesPlugin;
20
import org.eclipse.core.resources.ResourcesPlugin;
Lines 23-36 Link Here
23
import org.eclipse.core.variables.VariablesPlugin;
25
import org.eclipse.core.variables.VariablesPlugin;
24
import org.eclipse.debug.core.ILaunchConfiguration;
26
import org.eclipse.debug.core.ILaunchConfiguration;
25
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
27
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
28
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
26
import org.eclipse.debug.ui.StringVariableSelectionDialog;
29
import org.eclipse.debug.ui.StringVariableSelectionDialog;
27
import org.eclipse.jdt.core.IJavaProject;
28
import org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchTab;
29
import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds;
30
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
31
import org.eclipse.jdt.internal.debug.ui.SWTFactory;
30
import org.eclipse.jdt.internal.debug.ui.SWTFactory;
32
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
31
import org.eclipse.jface.util.Assert;
33
import org.eclipse.jdt.launching.JavaRuntime;
34
import org.eclipse.swt.events.ModifyEvent;
32
import org.eclipse.swt.events.ModifyEvent;
35
import org.eclipse.swt.events.ModifyListener;
33
import org.eclipse.swt.events.ModifyListener;
36
import org.eclipse.swt.events.SelectionAdapter;
34
import org.eclipse.swt.events.SelectionAdapter;
Lines 50-56 Link Here
50
 * A control for setting the working directory associated with a launch
48
 * A control for setting the working directory associated with a launch
51
 * configuration.
49
 * configuration.
52
 */
50
 */
53
public class WorkingDirectoryBlock extends JavaLaunchTab {
51
public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
54
			
52
			
55
	// Local directory
53
	// Local directory
56
	private Button fWorkspaceButton;
54
	private Button fWorkspaceButton;
Lines 103-108 Link Here
103
	
101
	
104
	private WidgetListener fListener = new WidgetListener();
102
	private WidgetListener fListener = new WidgetListener();
105
	
103
	
104
	/**
105
	 * The name of the launch configuration attribute that will be used to save
106
	 * the location of the working directory.
107
	 */
108
	private final String workingDirectoryAttribteName;
109
	
110
	/**
111
	 * The help context id to use to connect this working directory block
112
	 * to the help system.
113
	 */
114
	private final String helpContextId;
115
	
116
	/**
117
	 * Creates a new WorkingDirectoryBlock for setting a working directory.
118
	 * 
119
	 * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
120
	 */
121
	public WorkingDirectoryBlock(String workingDirectoryAttribteName) {
122
		this(workingDirectoryAttribteName, null);
123
	}
124
	
125
	/**
126
	 * Creates a new WorkingDirectoryBlock for setting a working directory.
127
	 * 
128
	 * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
129
	 * @param helpContextId the help context id to use to hook onto the help system
130
	 */
131
	public WorkingDirectoryBlock(String workingDirectoryAttribteName,
132
			String helpContextId) {
133
		Assert.isNotNull(workingDirectoryAttribteName);
134
		this.workingDirectoryAttribteName = workingDirectoryAttribteName;
135
		this.helpContextId = helpContextId;
136
	}
137
	
106
	/* (non-Javadoc)
138
	/* (non-Javadoc)
107
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
139
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
108
	 */
140
	 */
Lines 110-116 Link Here
110
		Font font = parent.getFont();	
142
		Font font = parent.getFont();	
111
		Group group = SWTFactory.createGroup(parent, LauncherMessages.WorkingDirectoryBlock_12, 2, 1, GridData.FILL_HORIZONTAL);
143
		Group group = SWTFactory.createGroup(parent, LauncherMessages.WorkingDirectoryBlock_12, 2, 1, GridData.FILL_HORIZONTAL);
112
		setControl(group);
144
		setControl(group);
113
		PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);
145
		
146
		if (helpContextId != null) {
147
			PlatformUI.getWorkbench().getHelpSystem().setHelp(group, helpContextId);	
148
		}
149
		
114
	//default choice
150
	//default choice
115
		Composite comp = SWTFactory.createComposite(group, font, 2, 2, GridData.FILL_BOTH, 0, 0);
151
		Composite comp = SWTFactory.createComposite(group, font, 2, 2, GridData.FILL_BOTH, 0, 0);
116
		fUseDefaultDirButton = SWTFactory.createRadioButton(comp, LauncherMessages.WorkingDirectoryBlock_18);
152
		fUseDefaultDirButton = SWTFactory.createRadioButton(comp, LauncherMessages.WorkingDirectoryBlock_18);
Lines 192-198 Link Here
192
                        res = containers[0];
228
                        res = containers[0];
193
                    }
229
                    }
194
                } 
230
                } 
195
			    catch (CoreException e) {}
231
			    catch (CoreException e) {
232
			    	log(e);
233
			    }
196
			} 
234
			} 
197
		    else {	    
235
		    else {	    
198
				res = root.findMember(path);
236
				res = root.findMember(path);
Lines 247-262 Link Here
247
		try {
285
		try {
248
			ILaunchConfiguration config = getLaunchConfiguration();
286
			ILaunchConfiguration config = getLaunchConfiguration();
249
			if (config != null) {
287
			if (config != null) {
250
				IJavaProject javaProject = JavaRuntime.getJavaProject(config);
288
				IProject project = getProject(config);
251
				if (javaProject != null) {
289
				if (project != null) {
252
					setDefaultWorkingDirectoryText("${workspace_loc:" + javaProject.getPath().makeRelative().toOSString() + "}");  //$NON-NLS-1$//$NON-NLS-2$
290
					setDefaultWorkingDirectoryText("${workspace_loc:" + project.getFullPath().makeRelative().toOSString() + "}");  //$NON-NLS-1$//$NON-NLS-2$
253
					return;
291
					return;
254
				}
292
				}
255
			}
293
			}
256
		} 
294
		} 
257
		catch (CoreException ce) {}
295
		catch (CoreException ce) {
296
			log(ce);
297
		}
258
		setDefaultWorkingDirectoryText(System.getProperty("user.dir")); //$NON-NLS-1$
298
		setDefaultWorkingDirectoryText(System.getProperty("user.dir")); //$NON-NLS-1$
259
	}
299
	}
300
	
301
	/**
302
	 * Retrieves the project that is associated with the specified launch configuration.
303
	 * @param configuration the launch configuration that has been set to this working directory block
304
	 * @return the project specified by the launch configuration, or <tt>null</tt> if nothing has been set
305
	 * @throws CoreException if an error occurred while retrieving the project from the launch configuration
306
	 */
307
	protected abstract IProject getProject(ILaunchConfiguration configuration) throws CoreException;
260
308
261
	/* (non-Javadoc)
309
	/* (non-Javadoc)
262
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
310
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
Lines 273-278 Link Here
273
			}
321
			}
274
			catch (CoreException e) {
322
			catch (CoreException e) {
275
				setErrorMessage(e.getMessage());
323
				setErrorMessage(e.getMessage());
324
				log(e);
276
				return false;
325
				return false;
277
			}
326
			}
278
		} 
327
		} 
Lines 299-305 Link Here
299
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
348
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
300
	 */
349
	 */
301
	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
350
	public void setDefaults(ILaunchConfigurationWorkingCopy config) {
302
		config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
351
		config.setAttribute(workingDirectoryAttribteName, (String)null);
303
	}
352
	}
304
353
305
	/* (non-Javadoc)
354
	/* (non-Javadoc)
Lines 308-322 Link Here
308
	public void initializeFrom(ILaunchConfiguration configuration) {
357
	public void initializeFrom(ILaunchConfiguration configuration) {
309
		setLaunchConfiguration(configuration);
358
		setLaunchConfiguration(configuration);
310
		try {			
359
		try {			
311
			String wd = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
360
			String wd = configuration.getAttribute(workingDirectoryAttribteName, (String)null);
312
			setDefaultWorkingDir();
361
			setDefaultWorkingDir();
313
			if (wd != null) {
362
			if (wd != null) {
314
				setOtherWorkingDirectoryText(wd);
363
				setOtherWorkingDirectoryText(wd);
315
			}
364
			}
316
		} 
365
		} 
317
		catch (CoreException e) {
366
		catch (CoreException e) {
318
			setErrorMessage(LauncherMessages.JavaArgumentsTab_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage()); 
367
			setErrorMessage(LauncherMessages.JavaArgumentsTab_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage());
319
			JDIDebugUIPlugin.log(e);
368
			log(e);
320
		}
369
		}
321
	}
370
	}
322
371
Lines 325-334 Link Here
325
	 */
374
	 */
326
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
375
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
327
		if(fUseDefaultDirButton.getSelection()) {
376
		if(fUseDefaultDirButton.getSelection()) {
328
			configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
377
			configuration.setAttribute(workingDirectoryAttribteName, (String)null);
329
		}
378
		}
330
		else {
379
		else {
331
			configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, getWorkingDirectoryText());
380
			configuration.setAttribute(workingDirectoryAttribteName, getWorkingDirectoryText());
332
		}
381
		}
333
	}
382
	}
334
	
383
	
Lines 340-345 Link Here
340
	}
389
	}
341
	
390
	
342
	/**
391
	/**
392
	 * Logs exceptions that have been caught by this working directory block.
393
	 * The default implementation does nothing. Subclasses should reimplement
394
	 * if they wish to monitor such exceptions.
395
	 * @param e the exception to log
396
	 */
397
	protected void log(CoreException e) {
398
		// do nothing
399
	}
400
	
401
	/**
343
	 * gets the path from the text box that is selected
402
	 * gets the path from the text box that is selected
344
	 * @return the working directory the user wishes to use
403
	 * @return the working directory the user wishes to use
345
	 * @since 3.2
404
	 * @since 3.2
Lines 397-403 Link Here
397
	 * Allows this entire block to be enabled/disabled
456
	 * Allows this entire block to be enabled/disabled
398
	 * @param enabled whether to enable it or not
457
	 * @param enabled whether to enable it or not
399
	 */
458
	 */
400
	protected void setEnabled(boolean enabled) {
459
	public void setEnabled(boolean enabled) {
401
		fUseDefaultDirButton.setEnabled(enabled);
460
		fUseDefaultDirButton.setEnabled(enabled);
402
		fUseOtherDirButton.setEnabled(enabled);
461
		fUseOtherDirButton.setEnabled(enabled);
403
		if(fOtherWorkingText.isEnabled()) {
462
		if(fOtherWorkingText.isEnabled()) {
(-)ui/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.java (-2 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 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 7-12 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.debug.ui.launchConfigurations;
12
package org.eclipse.jdt.debug.ui.launchConfigurations;
12
13
Lines 20-25 Link Here
20
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
21
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
21
import org.eclipse.jdt.internal.debug.ui.JavaDebugImages;
22
import org.eclipse.jdt.internal.debug.ui.JavaDebugImages;
22
import org.eclipse.jdt.internal.debug.ui.actions.ControlAccessibleListener;
23
import org.eclipse.jdt.internal.debug.ui.actions.ControlAccessibleListener;
24
import org.eclipse.jdt.internal.debug.ui.launcher.JavaWorkingDirectoryBlock;
23
import org.eclipse.jdt.internal.debug.ui.launcher.LauncherMessages;
25
import org.eclipse.jdt.internal.debug.ui.launcher.LauncherMessages;
24
import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock;
26
import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock;
25
import org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock;
27
import org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock;
Lines 72-78 Link Here
72
	}
74
	}
73
	
75
	
74
	protected WorkingDirectoryBlock createWorkingDirBlock() {
76
	protected WorkingDirectoryBlock createWorkingDirBlock() {
75
		return new WorkingDirectoryBlock();
77
		return new JavaWorkingDirectoryBlock();
76
	}
78
	}
77
	
79
	
78
	/**
80
	/**
(-)ui/org/eclipse/jdt/internal/debug/ui/launcher/JavaWorkingDirectoryBlock.java (+40 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
11
 *******************************************************************************/
12
package org.eclipse.jdt.internal.debug.ui.launcher;
13
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.debug.core.ILaunchConfiguration;
17
import org.eclipse.jdt.core.IJavaProject;
18
import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds;
19
import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin;
20
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
21
import org.eclipse.jdt.launching.JavaRuntime;
22
23
public class JavaWorkingDirectoryBlock extends WorkingDirectoryBlock {
24
25
	public JavaWorkingDirectoryBlock() {
26
		super(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
27
				IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);
28
	}
29
30
	protected IProject getProject(ILaunchConfiguration configuration)
31
			throws CoreException {
32
		IJavaProject project = JavaRuntime.getJavaProject(configuration);
33
		return project == null ? null : project.getProject();
34
	}
35
36
	protected void log(CoreException e) {
37
		JDIDebugUIPlugin.log(e);
38
	}
39
40
}
(-)Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntWorkingDirectoryBlock.java (-12 / +6 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 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 7-26 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Remy Chi Jian Suen <remy.suen@gmail.com> - Bug 214696 Expose WorkingDirectoryBlock as API
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ant.internal.ui.launchConfigurations;
12
package org.eclipse.ant.internal.ui.launchConfigurations;
12
13
13
import com.ibm.icu.text.MessageFormat;
14
15
import org.eclipse.ant.internal.ui.AntUIPlugin;
14
import org.eclipse.ant.internal.ui.AntUIPlugin;
16
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.debug.core.ILaunchConfiguration;
16
import org.eclipse.debug.core.ILaunchConfiguration;
18
import org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock;
17
import org.eclipse.jdt.internal.debug.ui.launcher.JavaWorkingDirectoryBlock;
19
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
18
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
20
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil;
19
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil;
21
20
21
import com.ibm.icu.text.MessageFormat;
22
22
23
23
public class AntWorkingDirectoryBlock extends WorkingDirectoryBlock {
24
public class AntWorkingDirectoryBlock extends JavaWorkingDirectoryBlock {
24
	
25
	
25
	private String fDefaultWorkingDirPath;
26
	private String fDefaultWorkingDirPath;
26
27
Lines 67-77 Link Here
67
	private boolean isSameAsDefault(String workingDir) {
68
	private boolean isSameAsDefault(String workingDir) {
68
		return workingDir == null || (workingDir.equals(fDefaultWorkingDirPath) || workingDir.equals(System.getProperty("user.dir"))); //$NON-NLS-1$
69
		return workingDir == null || (workingDir.equals(fDefaultWorkingDirPath) || workingDir.equals(System.getProperty("user.dir"))); //$NON-NLS-1$
69
	}
70
	}
70
	
71
	/* (non-Javadoc)
72
	 * @see org.eclipse.jdt.internal.debug.ui.launcher.WorkingDirectoryBlock#setEnabled(boolean)
73
	 */
74
	protected void setEnabled(boolean enabled) {
75
		super.setEnabled(enabled);
76
	}
77
}
71
}

Return to bug 214696