SCViewer/com.itjw.txviewer.ui/src/com/itjw/txviewer/ui/adapter/AdapterFactory.java

25 lines
630 B
Java
Raw Normal View History

2015-01-01 23:17:32 +01:00
package com.itjw.txviewer.ui.adapter;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.ui.views.properties.IPropertySource;
import com.itjw.txviewer.database.ITransaction;
public class AdapterFactory implements IAdapterFactory {
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType == IPropertySource.class)
return new ITransactionPropertySource((ITransaction) adaptableObject);
return null;
}
@SuppressWarnings("rawtypes")
@Override
public Class[] getAdapterList() {
return new Class[]{IPropertySource.class};
}
}