|
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 * Base class for event list entries |
|
17 * |
|
18 */ |
|
19 package com.nokia.trace.eventview; |
|
20 |
|
21 import org.eclipse.jface.action.IMenuManager; |
|
22 |
|
23 /** |
|
24 * Base class for event list entries |
|
25 * |
|
26 */ |
|
27 public abstract class EventListEntry { |
|
28 |
|
29 /** |
|
30 * Event type |
|
31 */ |
|
32 private int type; |
|
33 |
|
34 /** |
|
35 * Event category |
|
36 */ |
|
37 private String category; |
|
38 |
|
39 /** |
|
40 * Constructor |
|
41 * |
|
42 * @param type |
|
43 * event type |
|
44 */ |
|
45 protected EventListEntry(int type) { |
|
46 this.type = type; |
|
47 } |
|
48 |
|
49 /** |
|
50 * Gets the event type |
|
51 * |
|
52 * @return event type |
|
53 */ |
|
54 public int getType() { |
|
55 return type; |
|
56 } |
|
57 |
|
58 /** |
|
59 * Gets the event category |
|
60 * |
|
61 * @return the category |
|
62 */ |
|
63 public String getCategory() { |
|
64 return category; |
|
65 } |
|
66 |
|
67 /** |
|
68 * Sets the event category |
|
69 * |
|
70 * @param category |
|
71 * the new category |
|
72 */ |
|
73 public void setCategory(String category) { |
|
74 this.category = category; |
|
75 } |
|
76 |
|
77 /** |
|
78 * Resets this entry |
|
79 */ |
|
80 protected void reset() { |
|
81 } |
|
82 |
|
83 /** |
|
84 * Gets the event description |
|
85 * |
|
86 * @return event description |
|
87 */ |
|
88 public abstract String getDescription(); |
|
89 |
|
90 /** |
|
91 * Flags which determines if this entry has source |
|
92 * |
|
93 * @return true if this entry has a source |
|
94 */ |
|
95 protected abstract boolean hasSource(); |
|
96 |
|
97 /** |
|
98 * Gets the name of source |
|
99 * |
|
100 * @return the name of source |
|
101 */ |
|
102 protected abstract String getSourceName(); |
|
103 |
|
104 /** |
|
105 * Gets the source |
|
106 * |
|
107 * @return the source |
|
108 */ |
|
109 protected abstract Object getSource(); |
|
110 |
|
111 /** |
|
112 * Flags which determines if this entry has source associated with actions |
|
113 * |
|
114 * @return true if this entry has a source which is associated to actions |
|
115 */ |
|
116 protected abstract boolean hasSourceActions(); |
|
117 |
|
118 /** |
|
119 * Adds actions to given menu |
|
120 * |
|
121 * @param manager |
|
122 * the menu manager |
|
123 */ |
|
124 protected abstract void addSourceActions(IMenuManager manager); |
|
125 |
|
126 } |