Commits

Jens Reimann  committed 6e15953

allow passing the realm, and minor cleanups

  • Participants
  • Parent commits e042cfe
  • Branches 1.2

Comments (0)

Files changed (4)

File org.openscada.ui.databinding.item/META-INF/MANIFEST.MF

 Bundle-ManifestVersion: 2
 Bundle-Name: openSCADA Databinding Item
 Bundle-SymbolicName: org.openscada.ui.databinding.item
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.2.0.qualifier
 Bundle-Vendor: openSCADA.org
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.openscada.ui.databinding.item;version="1.0.0";
-  uses:="org.openscada.core.connection.provider,
+Export-Package: org.openscada.ui.databinding.item;version="1.2.0";
+  uses:="org.eclipse.core.databinding.observable,
+   org.openscada.core.connection.provider,
    org.eclipse.core.databinding.observable.value,
    org.openscada.da.client,
    org.eclipse.core.databinding.conversion,

File org.openscada.ui.databinding.item/src/org/openscada/ui/databinding/item/DataItemObservableValue.java

 import java.util.Observable;
 import java.util.Observer;
 
+import org.eclipse.core.databinding.observable.Realm;
 import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
 import org.eclipse.core.databinding.observable.value.ValueDiff;
 import org.openscada.core.connection.provider.ConnectionIdTracker;
 
     public DataItemObservableValue ( final BundleContext context, final String connectionId, final String itemId )
     {
-        this ( context, connectionId, itemId, VALUE_POLICY_REPLACE_DISCONNECTED );
+        this ( context, connectionId, itemId, VALUE_POLICY_REPLACE_DISCONNECTED, null );
+    }
+    
+    public DataItemObservableValue ( final BundleContext context, final String connectionId, final String itemId, Realm realm )
+    {
+        this ( context, connectionId, itemId, VALUE_POLICY_REPLACE_DISCONNECTED, realm );
     }
 
     public DataItemObservableValue ( final BundleContext context, final String connectionId, final String itemId, final InvalidValuePolicy invalidValuePolicy )
     {
+    	this ( context, connectionId, itemId, invalidValuePolicy, null );
+    }
+    
+    public DataItemObservableValue ( final BundleContext context, final String connectionId, final String itemId, final InvalidValuePolicy invalidValuePolicy, Realm realm )
+    {
+    	super ( realm );
         this.invalidValuePolicy = invalidValuePolicy;
         this.itemId = itemId;
         final Listener listener = new Listener () {

File org.openscada.ui.databinding.item/src/org/openscada/ui/databinding/item/VariantToLongConverter.java

 
 package org.openscada.ui.databinding.item;
 
-import org.eclipse.core.databinding.conversion.IConverter;
+import org.eclipse.core.databinding.conversion.Converter;
 import org.openscada.core.Variant;
 
-public class VariantToLongConverter implements IConverter
+public class VariantToLongConverter extends Converter
 {
     private final Long defaultValue;
 
 
     public VariantToLongConverter ( final Long defaultValue )
     {
+    	super ( Variant.class, Long.class );
         this.defaultValue = defaultValue;
     }
 
     @Override
-    public Object getFromType ()
-    {
-        return Variant.class;
-    }
-
-    @Override
-    public Object getToType ()
-    {
-        return Long.class;
-    }
-
-    @Override
     public Object convert ( final Object fromObject )
     {
         return ( (Variant)fromObject ).asLong ( this.defaultValue );

File org.openscada.ui.databinding.item/src/org/openscada/ui/databinding/item/VariantToStringConverter.java

 
 package org.openscada.ui.databinding.item;
 
-import org.eclipse.core.databinding.conversion.IConverter;
+import org.eclipse.core.databinding.conversion.Converter;
 import org.openscada.core.Variant;
 
-public class VariantToStringConverter implements IConverter
+public class VariantToStringConverter extends Converter
 {
     private final String defaultValue;
 
 
     public VariantToStringConverter ( final String defaultValue )
     {
+    	super ( Variant.class, String.class );
         this.defaultValue = defaultValue;
     }
 
     @Override
-    public Object getFromType ()
-    {
-        return Variant.class;
-    }
-
-    @Override
-    public Object getToType ()
-    {
-        return String.class;
-    }
-
-    @Override
     public Object convert ( final Object fromObject )
     {
         return ( (Variant)fromObject ).asString ( this.defaultValue );