Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2005 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.ant.internal.ui.launchConfigurations;
 
 import  org.eclipse.swt.widgets.Button;
 import  org.eclipse.swt.widgets.Composite;

The Ant classpath tab
 
 public class AntClasspathTab extends JavaClasspathTab {
 	
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab#isShowBootpath()
 	 */
 	public boolean isShowBootpath() {
 		return false;
 	}

Creates actions to manipulate the classpath.

Parameters:
pathButtonComp composite buttons are contained in
Since:
3.0
 
 	protected void createPathButtons(Composite pathButtonComp) {		
 		createButton(pathButtonCompnew MoveUpAction());
 		createButton(pathButtonCompnew MoveDownAction());
 		createButton(pathButtonCompnew RemoveAction());
 		createButton(pathButtonCompnew AddJarAction());
 		Button button = createButton(pathButtonCompnew AddFolderAction());
 		createButton(pathButtonCompaction);
 		action.setEnabled(true);
 		
 		actionnew EditAntHomeEntryAction(this);
 		createButton(pathButtonCompaction);
 		action.setEnabled(true);
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#setDirty(boolean)
 	 */
 	public void setDirty(boolean dirty) {
 		super.setDirty(dirty);
 	}
 	
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
 	 */
 	public void initializeFrom(ILaunchConfiguration configuration) {
 		try {
 			AntUtil.migrateToNewClasspathFormat(configuration);
 		} catch (CoreException e) {
 		}
 		super.initializeFrom(configuration);
 	}
 	/* (non-Javadoc)
 	 * @see org.eclipse.jdt.internal.debug.ui.launcher.IEntriesChangedListener#entriesChanged(org.eclipse.jdt.internal.debug.ui.launcher.IClasspathViewer)
 	 */
 	public void entriesChanged(IClasspathViewer viewer) {
 		super.entriesChanged(viewer);
 		for (int i = 0; i < tabs.lengthi++) {
 			ILaunchConfigurationTab tab = tabs[i];
 			if (tab instanceof AntTargetsTab) {
 				((AntTargetsTab)tab).setDirty(true);
 			}
		}
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
	 */
	public boolean isValid(ILaunchConfiguration launchConfig) {
		boolean validsuper.isValid(launchConfig);
		if (!valid) {
			return false;
		}
		return validateAntHome();
	}
	private boolean validateAntHome() {
		IClasspathEntry userEntrymodel.getUserEntry();
		IClasspathEntry[] entriesuserEntry.getEntries();
		for (int i = 0; i < entries.lengthi++) {
			ClasspathEntry entry = (ClasspathEntryentries[i];
			IRuntimeClasspathEntry runtimeEntryentry.getDelegate();
			if (runtimeEntry instanceof AntHomeClasspathEntry) {
				try {
catch (CoreException ce) {
					return false;
				}
				break;
			}
		}
		return true;
	}
New to GrepCode? Check out our FAQ X