trace/tracebuilder/com.nokia.tracebuilder.view/src/com/nokia/tracebuilder/view/CheckListSelectionDialogLabelProvider.java
changeset 10 ed1c9f64298a
equal deleted inserted replaced
9:14dc2103a631 10:ed1c9f64298a
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 * Label provider for CheckListEntry
       
    17 *
       
    18 */
       
    19 package com.nokia.tracebuilder.view;
       
    20 
       
    21 import org.eclipse.jface.viewers.LabelProvider;
       
    22 
       
    23 import com.nokia.tracebuilder.engine.CheckListDialogEntry;
       
    24 import com.nokia.tracebuilder.model.TraceObject;
       
    25 
       
    26 /**
       
    27  * Label provider for CheckListEntry
       
    28  * 
       
    29  */
       
    30 final class CheckListSelectionDialogLabelProvider extends LabelProvider {
       
    31 
       
    32 	/*
       
    33 	 * (non-Javadoc)
       
    34 	 * 
       
    35 	 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
       
    36 	 */
       
    37 	@Override
       
    38 	public String getText(Object element) {
       
    39 		String retval;
       
    40 		if (element instanceof CheckListDialogEntry) {
       
    41 			Object o = ((CheckListDialogEntry) element).getObject();
       
    42 			if (o instanceof TraceObject) {
       
    43 				retval = ((TraceObject) o).getName();
       
    44 			} else {
       
    45 				retval = o.toString();
       
    46 			}
       
    47 		} else {
       
    48 			retval = ""; //$NON-NLS-1$
       
    49 		}
       
    50 		return retval;
       
    51 	}
       
    52 }