Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 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.model;
import  org.apache.tools.ant.Task;
import  org.apache.tools.ant.util.FileUtils;
public class AntAntNode extends AntTaskNode {
    private String fFile;
    public AntAntNode(Task taskAttributes attributes) {
        super(task);
        StringBuffer labelnew StringBuffer("ant "); //$NON-NLS-1$
        attributes.getValue(.);
        if ( != null) {
        	if (!FileUtils.isAbsolutePath()) {
        		File basedirtask.getProject().getBaseDir();
                if (basedir != null) {
                    basedir.getAbsolutePath() + . + ;
                }
        	}
            label.append();
            label.append(.);
        } else {
            File basedirtask.getProject().getBaseDir();
            if (basedir != null) {
                =basedir.getAbsolutePath();
            }
        }
        String fileName = attributes.getValue(.);
        if (fileName == null) {
            fileName"build.xml"//$NON-NLS-1$
        }
        label.append(fileName);
        if ( == null || FileUtils.isAbsolutePath(fileName)) {
            fileName;
        } else {
            +=. + fileName;
        }
        
        String more = attributes.getValue(.);
        if(more != null) {
            label.append(' ');
            label.append(more);
        }
        setBaseLabel(label.toString());
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.ant.internal.ui.model.AntElementNode#getReferencedElement(int)
     */
    public String getReferencedElement(int offset) {
        if ( != null) {
            String textToSearchgetAntModel().getText(getOffset(), offset - getOffset());
            if (textToSearch != null && textToSearch.length() != 0) {
            	String attributeString = AntEditorCompletionProcessor.getAttributeStringFromDocumentStringToPrefix(textToSearch);
            	if (..equals(attributeString)) {
            		return ;
            	}
            }
        }
        return null;
    }
New to GrepCode? Check out our FAQ X