Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 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 java.util.List;
 import java.util.Map;
 
 import  org.eclipse.swt.SWT;
 import  org.eclipse.swt.events.SelectionAdapter;
 import  org.eclipse.swt.events.SelectionEvent;
 import  org.eclipse.swt.graphics.Image;
 import  org.eclipse.swt.layout.GridData;
 import  org.eclipse.swt.layout.GridLayout;
 import  org.eclipse.swt.widgets.Button;
 import  org.eclipse.swt.widgets.Composite;
Tab for setting Ant user properties per launch configuration. All properties specified here will be set as user properties on the project for the specified Ant build
 
 public class AntPropertiesTab extends AbstractLaunchConfigurationTab implements IAntBlockContainer {
 	
 	private Button fUseDefaultButton;
     private boolean fSeparateJREtrue;
 	
 	public void createControl(Composite parent) {
 		Composite top = new Composite(parent, SWT.NONE);
 		top.setFont(parent.getFont());
 		setControl(top);
 
 		top.setLayout(new GridLayout());
 		GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
 		top.setLayoutData(gridData);
 		
 		
 		Composite propertiesBlockCompositenew Composite(top, SWT.NONE);
 		GridLayout layout = new GridLayout();
 		layout.numColumns= 2;
 		propertiesBlockComposite.setLayout(layout);
 		propertiesBlockComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
 		
 		
 		Dialog.applyDialogFont(top);
 	}
 	
 	private void createChangeProperties(Composite top) {
 		.addSelectionListener(new SelectionAdapter() {
 			public void widgetSelected(SelectionEvent e) {
 			}
 		});
 	}		
 		
 	private void toggleUseDefaultProperties() {
 		boolean enable= !.getSelection();
         if (!enable) {
             initializeAsGlobal();
         }
 	}

See also:
org.eclipse.debug.ui.ILaunchConfigurationTab.getImage()
 
 	public Image getImage() {
	}

See also:
org.eclipse.debug.ui.ILaunchConfigurationTab.getName()
	public String getName() {
	}

See also:
org.eclipse.debug.ui.ILaunchConfigurationTab.initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
	public void initializeFrom(ILaunchConfiguration configuration) {
        = AntUtil.isSeparateJREAntBuild(configuration);
		Map propertiesnull;
		try {
catch (CoreException ce) {
		}
		String propertyFilesnull;
		try {
catch (CoreException ce) {
		}
		if (properties == null && propertyFiles == null) {
else {
			.setSelection(false);
			String[] files= AntUtil.parseString(propertyFiles","); //$NON-NLS-1$
		}
	}
    private void initializeAsGlobal(boolean separateVM) {
        AntCorePreferences prefs = AntCorePlugin.getPlugin().getPreferences();
        List prefProperties;
        if (separateVM) {
            prefPropertiesprefs.getRemoteAntProperties();
        } else {
            prefPropertiesprefs.getProperties();
        }
        .setPropertiesInput((Property[]) prefProperties.toArray(new Property[prefProperties.size()]));
        .setSelection(true);
    }

See also:
org.eclipse.debug.ui.ILaunchConfigurationTab.performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
		if (.getSelection()) {
			return;
		}
		Map propertiesnull;
		if (items.length > 0) {
			propertiesnew HashMap(items.length);
			for (int i = 0; i < items.lengthi++) {
				Property property = (Property)items[i];
				properties.put(property.getName(), property.getValue(false));
			}
		}
		String filesnull;
		if (items.length > 0) {
			StringBuffer buffnew StringBuffer();
			for (int i = 0; i < items.lengthi++) {
				String path = (String)items[i];
				buff.append(path);
				buff.append(',');
			}
			filesbuff.toString();
		}
	}

See also:
org.eclipse.debug.ui.ILaunchConfigurationTab.setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
	public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
	}
	/* (non-Javadoc)
	 * @see org.eclipse.ant.internal.ui.preferences.IAntBlockContainer#createPushButton(org.eclipse.swt.widgets.Composite, java.lang.String)
	 */
	public void setMessage(String message) {
		super.setMessage(message);
	}
	/* (non-Javadoc)
	 * @see org.eclipse.ant.internal.ui.preferences.IAntBlockContainer#createPushButton(org.eclipse.swt.widgets.Composite, java.lang.String)
	 */
	public void setErrorMessage(String message) {
		super.setErrorMessage(message);
	}
	/* (non-Javadoc)
	 * @see org.eclipse.ant.internal.ui.preferences.IAntBlockContainer#createPushButton(org.eclipse.swt.widgets.Composite, java.lang.String)
	 */
	public Button createPushButton(Composite parentString buttonText) {
		return super.createPushButton(parentbuttonTextnull);
	}

See also:
org.eclipse.ant.internal.ui.preferences.IAntBlockContainer.update()
	public void update() {
	}
	private void updateTargetsTab() {
		//the properties have changed...set the targets tab to 
		//need to be recomputed
		for (int i = 0; i < tabs.lengthi++) {
			ILaunchConfigurationTab tab = tabs[i];
			if (tab instanceof AntTargetsTab) {
				((AntTargetsTab)tab).setDirty(true);
				break;
			}
		}
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
	 */
	public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
        if ( != AntUtil.isSeparateJREAntBuild(workingCopy)) {
            //update the properties if changed whether build is in separate JRE
            initializeFrom(workingCopy);
        }
	}
	/* (non-Javadoc)
	 * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
	 */
	public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
	}
New to GrepCode? Check out our FAQ X