trace/traceviewer/com.nokia.traceviewer/src/com/nokia/traceviewer/dialog/treeitem/LineCountTreeTextItem.java
changeset 11 5b9d4d8641ce
equal deleted inserted replaced
10:ed1c9f64298a 11:5b9d4d8641ce
       
     1 /*
       
     2  * Copyright (c) 2007-2010 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  * Line count tree Text Item class
       
    17  *
       
    18  */
       
    19 package com.nokia.traceviewer.dialog.treeitem;
       
    20 
       
    21 /**
       
    22  * Line count tree Text Item class
       
    23  */
       
    24 public class LineCountTreeTextItem extends LineCountTreeBaseItem {
       
    25 
       
    26 	/**
       
    27 	 * Text of the item
       
    28 	 */
       
    29 	private final String text;
       
    30 
       
    31 	/**
       
    32 	 * Text to be compared
       
    33 	 */
       
    34 	private final String textToCompare;
       
    35 
       
    36 	/**
       
    37 	 * Indicates if the item case should match
       
    38 	 */
       
    39 	private final boolean matchCase;
       
    40 
       
    41 	/**
       
    42 	 * Constructor
       
    43 	 * 
       
    44 	 * @param listener
       
    45 	 *            TreeItemListener
       
    46 	 * @param parent
       
    47 	 *            parent object
       
    48 	 * @param name
       
    49 	 *            name of the item
       
    50 	 * @param rule
       
    51 	 *            rule of the item
       
    52 	 * @param text
       
    53 	 *            text for this item
       
    54 	 * @param matchCase
       
    55 	 *            match case boolean for this item
       
    56 	 */
       
    57 	public LineCountTreeTextItem(TreeItemListener listener, Object parent,
       
    58 			String name, Rule rule, String text, boolean matchCase) {
       
    59 		super(listener, parent, name, rule);
       
    60 		this.text = text;
       
    61 		this.matchCase = matchCase;
       
    62 
       
    63 		// Save text to compare
       
    64 		if (matchCase || text == null) {
       
    65 			textToCompare = text;
       
    66 		} else {
       
    67 			textToCompare = text.toLowerCase();
       
    68 		}
       
    69 	}
       
    70 
       
    71 	/**
       
    72 	 * Gets match case status
       
    73 	 * 
       
    74 	 * @return the matchCase
       
    75 	 */
       
    76 	public boolean isMatchCase() {
       
    77 		return matchCase;
       
    78 	}
       
    79 
       
    80 	/**
       
    81 	 * Gets text
       
    82 	 * 
       
    83 	 * @return the text
       
    84 	 */
       
    85 	public String getText() {
       
    86 		return text;
       
    87 	}
       
    88 
       
    89 	/**
       
    90 	 * Gets text to compare
       
    91 	 * 
       
    92 	 * @return the text to compare
       
    93 	 */
       
    94 	public String getTextToCompare() {
       
    95 		return textToCompare;
       
    96 	}
       
    97 }