KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > datatransfer > JavacTableLabelProvider


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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  *******************************************************************************/

11 package org.eclipse.ant.internal.ui.datatransfer;
12
13 import com.ibm.icu.text.MessageFormat;
14
15 import org.eclipse.ant.internal.ui.model.AntElementNode;
16 import org.eclipse.ant.internal.ui.model.AntModelLabelProvider;
17
18 /**
19  * Ant javac task label provider for a table
20  */

21 public class JavacTableLabelProvider extends AntModelLabelProvider {
22     /* (non-Javadoc)
23      * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
24      */

25     public String JavaDoc getText(Object JavaDoc element) {
26         AntElementNode parent= ((AntElementNode)element).getParentNode();
27         if (parent == null) {
28             return ""; //$NON-NLS-1$
29
}
30         String JavaDoc targetName= super.getText(parent);
31         return MessageFormat.format(DataTransferMessages.JavacTableLabelProvider_0, new String JavaDoc[] {targetName});
32     }
33 }
34
Popular Tags