Helper.addOptional ( data, "engine", this.item.getScriptEngine () ); //$NON-NLS-1$ for ( final ItemReference input : this.item.getInputs () ) for ( final ItemReference command : this.item.getCommands () ) if ( this.item.getInitScript () != null ) Helper.addOptional ( data, "init", this.item.getInitScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getUpdateScript () != null ) Helper.addOptional ( data, "updateCommand", this.item.getUpdateScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getWriteCommandScript () != null ) Helper.addOptional ( data, "writeCommand", this.item.getWriteCommandScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getTimer () != null ) data.put ( "timer", "" + this.item.getTimer ().getPeriod () ); //$NON-NLS-1$ if ( this.item.getTimer ().getScript () != null ) Helper.addOptional ( data, "timerCommand", this.item.getTimer ().getScript ().getCode () ); //$NON-NLS-1$ for ( final PropertyEntry entry : this.item.getInitProperties () )
@Override public void finish ( final FinishContext context ) { super.finish ( context ); for ( final Map.Entry<MasterServer, ScriptItem> entry : this.danglingMap.entrySet () ) { final MasterServer master = entry.getKey (); final ScriptItem item = entry.getValue (); for ( final ItemReference input : item.getInputs () ) { input.setItem ( Items.replaceDanglingReference ( this.context, master, input.getItem () ) ); } for ( final ItemReference command : item.getCommands () ) { command.setItem ( Items.replaceDanglingReference ( this.context, master, command.getItem () ) ); } } } }
item.setScriptEngine ( implementation.getScriptEngine () ); item.setInitScript ( toCodeFragment ( implementation.getInitScript () ) ); item.setUpdateScript ( toCodeFragment ( implementation.getUpdateScript () ) ); item.setWriteCommandScript ( toCodeFragment ( implementation.getWriteCommandScript () ) ); if ( implementation.getTimerScript () != null ) item.setTimer ( OsgiFactory.eINSTANCE.createScriptTimer () ); item.getTimer ().setScript ( OsgiFactory.eINSTANCE.createCodeFragment () ); item.getTimer ().getScript ().setCode ( implementation.getTimerScript ().getCode () ); item.getTimer ().setPeriod ( implementation.getTimerScript ().getPeriod () ); itemRef.setName ( input.getName () ); item.getInputs ().add ( itemRef ); item.getInitProperties ().addAll ( EcoreUtil.copyAll ( this.calculationComponent.getInitProperties () ) ); itemRef.setName ( outputDef.getName () ); item.getCommands ().add ( itemRef );
/** * This returns the label styled text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getStyledText ( Object object ) { String label = ( (ScriptItem)object ).getName (); StyledString styledLabel = new StyledString (); if ( label == null || label.length () == 0 ) { styledLabel.append ( getString ( "_UI_ScriptItem_type" ), StyledString.Style.QUALIFIER_STYLER ); //$NON-NLS-1$ } else { styledLabel.append ( getString ( "_UI_ScriptItem_type" ), StyledString.Style.QUALIFIER_STYLER ).append ( " " + label ); //$NON-NLS-1$ //$NON-NLS-2$ } return styledLabel; }
final ScriptItem item = entry.getValue (); for ( final ItemReference input : item.getInputs () ) for ( final ItemReference command : item.getCommands () )
Helper.addOptional ( data, "engine", this.item.getScriptEngine () ); //$NON-NLS-1$ for ( final ItemReference input : this.item.getInputs () ) for ( final ItemReference command : this.item.getCommands () ) if ( this.item.getInitScript () != null ) Helper.addOptional ( data, "init", this.item.getInitScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getUpdateScript () != null ) Helper.addOptional ( data, "updateCommand", this.item.getUpdateScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getWriteCommandScript () != null ) Helper.addOptional ( data, "writeCommand", this.item.getWriteCommandScript ().getCode () ); //$NON-NLS-1$ if ( this.item.getTimer () != null ) data.put ( "timer", "" + this.item.getTimer ().getPeriod () ); //$NON-NLS-1$ if ( this.item.getTimer ().getScript () != null ) Helper.addOptional ( data, "timerCommand", this.item.getTimer ().getScript ().getCode () ); //$NON-NLS-1$ for ( final PropertyEntry entry : this.item.getInitProperties () )