|
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 * Trigger tree Text Item class |
|
17 * |
|
18 */ |
|
19 package com.nokia.traceviewer.dialog.treeitem; |
|
20 |
|
21 /** |
|
22 * Trigger tree Text Item class |
|
23 * |
|
24 */ |
|
25 public class TriggerTreeTextItem extends TriggerTreeBaseItem { |
|
26 |
|
27 /** |
|
28 * Text of the item |
|
29 */ |
|
30 private final String text; |
|
31 |
|
32 /** |
|
33 * Text to be compared |
|
34 */ |
|
35 private final String textToCompare; |
|
36 |
|
37 /** |
|
38 * Indicates if the case should match in the item |
|
39 */ |
|
40 private final boolean matchCase; |
|
41 |
|
42 /** |
|
43 * Configuration file path |
|
44 */ |
|
45 private String configurationFilePath = ""; //$NON-NLS-1$ |
|
46 |
|
47 /** |
|
48 * Configuration name |
|
49 */ |
|
50 private String configurationName = ""; //$NON-NLS-1$ |
|
51 |
|
52 /** |
|
53 * Constructor |
|
54 * |
|
55 * @param listener |
|
56 * TreeItemListener |
|
57 * @param parent |
|
58 * parent object |
|
59 * @param name |
|
60 * name of the item |
|
61 * @param rule |
|
62 * rule of the item |
|
63 * @param text |
|
64 * text of the item |
|
65 * @param matchCase |
|
66 * match case indication of the item |
|
67 * @param type |
|
68 * type of the trigger |
|
69 * @param configurationFilePath |
|
70 * configuration file path |
|
71 * @param configurationName |
|
72 * configuration name |
|
73 */ |
|
74 public TriggerTreeTextItem(TreeItemListener listener, Object parent, |
|
75 String name, Rule rule, String text, boolean matchCase, Type type, |
|
76 String configurationFilePath, String configurationName) { |
|
77 super(listener, parent, name, rule, type); |
|
78 this.text = text; |
|
79 this.matchCase = matchCase; |
|
80 this.configurationFilePath = configurationFilePath; |
|
81 this.configurationName = configurationName; |
|
82 |
|
83 // Save text to compare |
|
84 if (matchCase || text == null) { |
|
85 textToCompare = text; |
|
86 } else { |
|
87 textToCompare = text.toLowerCase(); |
|
88 } |
|
89 } |
|
90 |
|
91 /** |
|
92 * Gets match case status |
|
93 * |
|
94 * @return the matchCase |
|
95 */ |
|
96 public boolean isMatchCase() { |
|
97 return matchCase; |
|
98 } |
|
99 |
|
100 /** |
|
101 * Gets text |
|
102 * |
|
103 * @return the text |
|
104 */ |
|
105 public String getText() { |
|
106 return text; |
|
107 } |
|
108 |
|
109 /** |
|
110 * Gets text to compare |
|
111 * |
|
112 * @return the text to compare |
|
113 */ |
|
114 public String getTextToCompare() { |
|
115 return textToCompare; |
|
116 } |
|
117 |
|
118 /** |
|
119 * Gets configuration file path |
|
120 * |
|
121 * @return configuration file path |
|
122 */ |
|
123 public String getConfigurationFilePath() { |
|
124 return configurationFilePath; |
|
125 } |
|
126 |
|
127 /** |
|
128 * Gets configuration name |
|
129 * |
|
130 * @return configuration name |
|
131 */ |
|
132 public String getConfigurationName() { |
|
133 return configurationName; |
|
134 } |
|
135 } |