]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/ResourceVariableFactory.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / widgets / ResourceVariableFactory.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2012 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.swt.widgets;
13
14 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;
15 import org.simantics.db.ReadGraph;
16 import org.simantics.db.Resource;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.layer0.variable.Variable;
19 import org.simantics.db.layer0.variable.Variables;
20
21
22 public class ResourceVariableFactory extends ReadFactoryImpl<Resource, Variable> {
23
24         @Override
25         public Object getIdentity(Object inputContents) {
26                 return inputContents;
27         }
28         
29         @Override
30         public Variable perform(ReadGraph graph, Resource input) throws DatabaseException {
31                 
32                 return Variables.getPossibleVariable(graph, input);
33                 
34         }
35         
36 }