Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9e4170049d97efd8b4e5f0f9b452b9e1d0e80688 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*******************************************************************************
 * Copyright (c) 2009, 2013 Ericsson
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.adaption;

import java.util.HashMap;
import java.util.Map;

import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.model.EventImpl;

/**
 * Time Graph Presentation Provider Stub.
 */
public class TsfImplProvider extends TimeGraphPresentationProvider {

    // ========================================================================
    // Methods
    // ========================================================================
    @Override
    public int getStateTableIndex(ITimeEvent event) {
        return 0;
    }

    @Override
    public Map<String, String> getEventHoverToolTipInfo(ITimeEvent revent) {
        Map<String, String> toolTipEventMsgs = new HashMap<>();
        if (revent instanceof EventImpl) {
            toolTipEventMsgs.put("Test Tip1", "Test Value tip1");
            toolTipEventMsgs.put("Test Tip2", "Test Value tip2");
        }

        return toolTipEventMsgs;
    }

    @Override
    public String getEventName(ITimeEvent event) {
        String name = "Unknown";
        if (event instanceof EventImpl) {
            EventImpl devent = (EventImpl) event;
            name = devent.getType().toString();
        }
        return name;
    }
}

Back to the top