X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fexamples%2Forg%2Fsimantics%2Fdataboard%2Fexample%2Fold%2FTypeAdaptionExample1.java;fp=bundles%2Forg.simantics.databoard%2Fexamples%2Forg%2Fsimantics%2Fdataboard%2Fexample%2Fold%2FTypeAdaptionExample1.java;h=87ceb6447c3154e1ac568e6e3d5fabad527d97ec;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=0c9c7f528fe2f9789ecd638d8ebba9b4c4641152;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/old/TypeAdaptionExample1.java b/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/old/TypeAdaptionExample1.java index 0c9c7f528..87ceb6447 100644 --- a/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/old/TypeAdaptionExample1.java +++ b/bundles/org.simantics.databoard/examples/org/simantics/databoard/example/old/TypeAdaptionExample1.java @@ -1,31 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2010 Association for Decentralized Information Management in - * Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.databoard.example.old; - -import org.simantics.databoard.Bindings; -import org.simantics.databoard.adapter.Adapter; -import org.simantics.databoard.binding.Binding; - -public class TypeAdaptionExample1 { - - public enum Cars { Audio, BMW, Mercedes, Honda, Mazda, Toyota, Ford, Mitsubishi, Nissan, GM } - public enum JapaneseCars { Honda, Mazda, Toyota, Nissan, Mitsubishi } - - public static void main(String[] args) throws Exception { - Binding carsBinding = Bindings.getBinding( Cars.class ); - Binding japaneseCarsBinding = Bindings.getBinding( JapaneseCars.class ); - Adapter adapter = Bindings.adapterFactory.getAdapter(japaneseCarsBinding, carsBinding, true, false); - System.out.println( adapter.adapt( JapaneseCars.Honda ) ); - } - -} - +/******************************************************************************* + * Copyright (c) 2010 Association for Decentralized Information Management in + * Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.databoard.example.old; + +import org.simantics.databoard.Bindings; +import org.simantics.databoard.adapter.Adapter; +import org.simantics.databoard.binding.Binding; + +public class TypeAdaptionExample1 { + + public enum Cars { Audio, BMW, Mercedes, Honda, Mazda, Toyota, Ford, Mitsubishi, Nissan, GM } + public enum JapaneseCars { Honda, Mazda, Toyota, Nissan, Mitsubishi } + + public static void main(String[] args) throws Exception { + Binding carsBinding = Bindings.getBinding( Cars.class ); + Binding japaneseCarsBinding = Bindings.getBinding( JapaneseCars.class ); + Adapter adapter = Bindings.adapterFactory.getAdapter(japaneseCarsBinding, carsBinding, true, false); + System.out.println( adapter.adapt( JapaneseCars.Honda ) ); + } + +} +