common: Generalize the BufferedBlockingQueue's concurrent test
[deliverable/tracecompass.git] / org.eclipse.tracecompass.btf.ui / src / org / eclipse / tracecompass / btf / ui / BtfEventAdapterFactory.java
1 /*******************************************************************************
2 * Copyright (c) 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 * Matthew Khouzam - Initial API and implementation
10 *******************************************************************************/
11
12 package org.eclipse.tracecompass.btf.ui;
13
14 import org.eclipse.core.runtime.IAdapterFactory;
15 import org.eclipse.tracecompass.btf.core.event.BtfEvent;
16 import org.eclipse.ui.views.properties.IPropertySource;
17
18 /**
19 * Btf Event Adaptor Factory
20 *
21 * @author Matthew Khouzam
22 */
23 public class BtfEventAdapterFactory implements IAdapterFactory {
24
25 private static final Class<?>[] PROPERTIES = new Class[] {
26 IPropertySource.class
27 };
28
29 @Override
30 public Class<?>[] getAdapterList() {
31 return PROPERTIES;
32 }
33
34 @Override
35 public Object getAdapter(Object element, Class key) {
36 if (element instanceof BtfEvent && IPropertySource.class.equals(key)) {
37 BtfEvent tmfEvent = (BtfEvent) element;
38 return new BtfEventPropertySource(tmfEvent);
39 }
40 return null;
41 }
42
43 }
This page took 0.034721 seconds and 5 git commands to generate.