SCViewer/com.minres.scviewer.ui/src/com/minres/scviewer/ui/adapter/AdapterFactory.java

25 lines
616 B
Java
Raw Normal View History

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