analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / viewers / events / TmfEventAdapterFactory.java
1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Marc-Andre Laperle - Initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.tracecompass.tmf.ui.viewers.events;
12
13 import org.eclipse.core.runtime.IAdapterFactory;
14 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
15 import org.eclipse.ui.views.properties.IPropertySource;
16
17 /**
18 * Implements basic UI support for TMF events.
19 */
20 public class TmfEventAdapterFactory implements IAdapterFactory {
21
22 private static Class<?>[] PROPERTIES = new Class[] {
23 IPropertySource.class
24 };
25
26 @Override
27 public Class<?>[] getAdapterList() {
28 return PROPERTIES;
29 }
30
31 @Override
32 public Object getAdapter(Object element, Class key) {
33 ITmfEvent tmfEvent = (ITmfEvent) element;
34 if (IPropertySource.class.equals(key)) {
35 return new TmfEventPropertySource(tmfEvent);
36 }
37 return null;
38 }
39 }
This page took 0.03681 seconds and 5 git commands to generate.