Commit | Line | Data |
---|---|---|
be222f56 | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2009, 2014 Ericsson |
be222f56 PT |
3 | * |
4 | * All rights reserved. This program and the accompanying materials are | |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation | |
11 | *******************************************************************************/ | |
2bdf0193 | 12 | package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.test.stub.adaption; |
be222f56 PT |
13 | |
14 | import java.util.HashMap; | |
15 | import java.util.Map; | |
16 | ||
2bdf0193 AM |
17 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider; |
18 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent; | |
19 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.test.stub.model.EventImpl; | |
be222f56 PT |
20 | |
21 | /** | |
22 | * Time Graph Presentation Provider Stub. | |
23 | */ | |
be222f56 PT |
24 | public class TsfImplProvider extends TimeGraphPresentationProvider { |
25 | ||
d5efe032 AF |
26 | // ======================================================================== |
27 | // Methods | |
28 | // ======================================================================== | |
29 | @Override | |
30 | public int getStateTableIndex(ITimeEvent event) { | |
31 | return 0; | |
32 | } | |
be222f56 | 33 | |
d5efe032 AF |
34 | @Override |
35 | public Map<String, String> getEventHoverToolTipInfo(ITimeEvent revent) { | |
36 | Map<String, String> toolTipEventMsgs = new HashMap<>(); | |
37 | if (revent instanceof EventImpl) { | |
38 | toolTipEventMsgs.put("Test Tip1", "Test Value tip1"); | |
39 | toolTipEventMsgs.put("Test Tip2", "Test Value tip2"); | |
40 | } | |
be222f56 | 41 | |
d5efe032 AF |
42 | return toolTipEventMsgs; |
43 | } | |
be222f56 | 44 | |
d5efe032 AF |
45 | @Override |
46 | public String getEventName(ITimeEvent event) { | |
47 | String name = "Unknown"; | |
48 | if (event instanceof EventImpl) { | |
49 | EventImpl devent = (EventImpl) event; | |
50 | name = devent.getType().toString(); | |
51 | } | |
52 | return name; | |
53 | } | |
be222f56 | 54 | } |