]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/ResourcePair.java
Better support for ontological profiles
[simantics/platform.git] / bundles / org.simantics.diagram.profile / src / org / simantics / diagram / profile / view / ResourcePair.java
1 package org.simantics.diagram.profile.view;
2
3 import org.eclipse.core.runtime.IAdaptable;
4 import org.simantics.db.Resource;
5 import org.simantics.utils.datastructures.map.Tuple;
6
7 public class ResourcePair extends Tuple implements IAdaptable{
8     ResourcePair(Resource first, Resource second) { super(first ,second); }
9     public Resource getFirst() { return (Resource) getField(0); }
10     public Resource getSecond() { return (Resource) getField(1); }
11         
12     @SuppressWarnings("rawtypes")
13         @Override
14         public Object getAdapter(Class adapter) {
15                 if (adapter == Resource.class) {
16                         return getSecond();
17                 }
18                 return null;
19         }
20     
21     
22 }