<s> from __future__ import with_statement <EOL> import Gaffer <EOL> import GafferUI <EOL> class VectorDataPlugValueWidget ( GafferUI . PlugValueWidget ) : <EOL> def __init__ ( self , plug , parenting = None ) : <EOL> self . __dataWidget = GafferUI . VectorDataWidget ( ) <EOL> GafferUI . PlugValueWidget . __init__ ( self , self . __dataWidget , plug , parenting = parenting ) <EOL> self . __dataChangedConnection = self . __dataWidget . dataChangedSignal ( ) . connect ( Gaffer . WeakMethod ( self . __dataChanged ) ) <EOL> self . _updateFromPlug ( ) <EOL> def vectorDataWidget ( self ) : <EOL> return self . __dataWidget <EOL> def setHighlighted ( self , highlighted ) : <EOL> GafferUI . PlugValueWidget . setHighlighted ( self , highlighted ) <EOL> self . vectorDataWidget ( ) . setHighlighted ( highlighted ) <EOL> def _updateFromPlug ( self ) : <EOL> plug = self . getPlug ( ) <EOL> if plug is not None : <EOL> with self . getContext ( ) : <EOL> plugValue = plug . getValue ( ) <EOL> if plugValue is None : <EOL> plugValue = plug . ValueType ( ) <EOL> self . __dataWidget . setData ( plugValue ) <EOL> dragPointer = Gaffer . Metadata . plugValue ( plug , "<STR_LIT>" ) <EOL> if dragPointer is not None : <EOL> self . __dataWidget . setDragPointer ( dragPointer ) <EOL> self . __dataWidget . setEditable ( self . _editable ( ) ) <EOL> def __dataChanged ( self , widget ) : <EOL> assert ( widget is self . __dataWidget ) <EOL> with Gaffer . UndoContext ( self . getPlug ( ) . ancestor ( Gaffer . ScriptNode ) ) : <EOL> with Gaffer . BlockedConnection ( self . _plugConnections ( ) ) : <EOL> self . getPlug ( ) . setValue ( self . __dataWidget . getData ( ) [ <NUM_LIT:0> ] ) <EOL> GafferUI . PlugValueWidget . registerType ( Gaffer . BoolVectorDataPlug , VectorDataPlugValueWidget ) <EOL> GafferUI . PlugValueWidget . registerType ( Gaffer . IntVectorDataPlug , VectorDataPlugValueWidget ) <EOL> GafferUI . PlugValueWidget . registerType ( Gaffer . FloatVectorDataPlug , VectorDataPlugValueWidget ) <EOL> GafferUI . PlugValueWidget . registerType ( Gaffer . StringVectorDataPlug , VectorDataPlugValueWidget ) <EOL> GafferUI . PlugValueWidget . registerType ( Gaffer . V3fVectorDataPlug , VectorDataPlugValueWidget ) </s>
