2015-01-21 21:58:35 +01:00
|
|
|
/*******************************************************************************
|
2015-10-22 00:25:12 +02:00
|
|
|
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
2015-01-21 21:58:35 +01:00
|
|
|
* 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:
|
|
|
|
* MINRES Technologies GmbH - initial API and implementation
|
|
|
|
*******************************************************************************/
|
2015-01-09 09:16:40 +01:00
|
|
|
package com.minres.scviewer.ui.adapter;
|
|
|
|
|
|
|
|
import org.eclipse.core.runtime.IAdapterFactory;
|
|
|
|
import org.eclipse.ui.views.properties.IPropertySource;
|
|
|
|
|
|
|
|
import com.minres.scviewer.database.ITx;
|
|
|
|
|
|
|
|
public class TxAdapterFactory implements IAdapterFactory {
|
|
|
|
|
2015-10-22 00:04:28 +02:00
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
2015-01-09 09:16:40 +01:00
|
|
|
@Override
|
|
|
|
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
|
|
|
if (adapterType == IPropertySource.class)
|
|
|
|
return new ITransactionPropertySource((ITx) adaptableObject);
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-10-22 00:04:28 +02:00
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
2015-01-09 09:16:40 +01:00
|
|
|
@Override
|
|
|
|
public Class[] getAdapterList() {
|
|
|
|
return new Class[]{IPropertySource.class};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|