Toggle among two or more function calls every other click.

@param jsScope
Scope to use
@param jsScope2
Scope to use
@param jsScopes
Additional functions
@return the jQuery code
501346
public static ChainableStatement toggle(JsScope jsScope, JsScope jsScope2, JsScope... jsScopes)
	{
		CharSequence[] args = null;

		if (jsScopes != null && jsScopes.length > 0)
		{
			args = new CharSequence[jsScopes.length + 2];
			args[0] = jsScope.render();
			args[1] = jsScope2.render();

			Integer index = 2;
			for (JsScope scope : jsScopes)
			{
				args[index] = scope.render();
				index++;
			}

			return new DefaultChainableStatement("toggle", args);
		}

		return toggle(jsScope, jsScope2);
	}
439490
private void readScope(final Element scope, final Map<String, KeyDef> keyDefs) {
        final List<Element> maps = new ArrayList<>();
        maps.add(scope);
        for (final Element child: getChildElements(scope)) {
            collectMaps(child, maps);
        }
        for (final Element map: maps) {
            readMap(map, keyDefs);
        }
    }
1334151
private void bindEvents() {
		visibilityToggle.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				if (visibilityToggle.isEnabled()) {
					layer.setMarkedAsVisible(!layer.isMarkedAsVisible());
					visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
				}
			}
		});
	}
507349
@Override
    public XValue call(Scope scope) {
        List<String> res = new LinkedList<>();
        for (Element e:scope.context()){
            if ("script".equals(e.nodeName())){
                res.add(e.data());
            }else {
                res.add(e.text());
            }
        }
        return XValue.create(res);
    }
677063
public Bindings createBindings(ScriptEngine scriptEngine, VariableScope variableScope) {
    return scriptBindingsFactory.createBindings(variableScope, scriptEngine.createBindings());
  }
478455
public void setScope(java.util.Collection<String> scope) {
        if (scope == null) {
            this.scope = null;
            return;
        }

        this.scope = new java.util.ArrayList<String>(scope);
    }
170415
function () {
/*Line 153 - 'AtomBinding.js' */                if (this.twoWays) {
/*Line 154 - 'AtomBinding.js' */                    if (this.jq) {
/*Line 155 - 'AtomBinding.js' */                        this.bindEvent(this.element, "change", "onValChanged");
/*Line 156 - 'AtomBinding.js' */                        this.bindEvent(this.element, "blur", "onValChanged");
/*Line 157 - 'AtomBinding.js' */                        if (this.events) {
/*Line 158 - 'AtomBinding.js' */                            var list = new AtomEnumerator(this.events.split(","));
/*Line 159 - 'AtomBinding.js' */                            while (list.next()) {
/*Line 160 - 'AtomBinding.js' */                                this.bindEvent(this.element, list.current(), "onValChanged");
/*Line 161 - 'AtomBinding.js' */                            }
/*Line 162 - 'AtomBinding.js' */                        }
/*Line 163 - 'AtomBinding.js' */                    } else {
/*Line 164 - 'AtomBinding.js' */                        this.bindEvent(this.control, "WatchHandler", "onPropChanged", this.key);
/*Line 165 - 'AtomBinding.js' */                    }
/*Line 166 - 'AtomBinding.js' */                }

/*Line 168 - 'AtomBinding.js' */                this.onDataChanged(this, null);

/*Line 170 - 'AtomBinding.js' */            }
94968
public static ChainableStatement dblclick(JsScope jsScope)
	{
		return new DefaultChainableStatement(MouseEvent.DBLCLICK.getEventLabel(), jsScope.render());
	}
1120167
public static ChainableStatement select(JsScope jsScope)
	{
		return new DefaultChainableStatement(StateEvent.SELECT.getEventLabel(), jsScope.render());
	}
1063669
ProcScope createScope(Scope scope) {
        ProcScope created = scopes.get(scope);
        if (created == null) {
            created = new ProcScope(scope.getName());
            scopes.put(scope, created);
            created.setStrong(scope.isStrong());
            created.setIgnoreText(scope.isIgnoreText());
            if (scope.getParent() != null) {
                created.setParent(createScope(scope.getParent()));
            }
            Set<ProcCode> scopeCodes = new HashSet<ProcCode>();
            for (Code code : scope.getCodes()) {
                scopeCodes.add(createCode(code));
            }
            created.setScopeCodes(scopeCodes);
            created.setMin(scope.getMin());
            created.setMax(scope.getMax());
        }
        return created;
    }
25036
protected Object invokeJavascript(String function, Object... args) {
        Object[] jsArgs = new Object[args.length];
        for (int i = 0; i < jsArgs.length; i++) {
            if (args[i] instanceof JavascriptObject) {
                jsArgs[i] = ((JavascriptObject) args[i]).getJSObject();
            } else if (args[i] instanceof JavascriptEnum) {
                jsArgs[i] = ((JavascriptEnum) args[i]).getEnumValue();
            } else {
                jsArgs[i] = args[i];
            }
        }
        return checkUndefined(jsObject.call(function, (Object[]) jsArgs));
    }
1037224
public void addScope(IScope scope) {
        String app = scope.getName();
        // add the name to the collection (no '/' prefix)
        activeRooms.add(app);
        // check the context for a predefined websocket scope
        IContext ctx = scope.getContext();
        if (ctx != null && ctx.hasBean("webSocketScopeDefault")) {
            log.debug("WebSocket scope found in context");
            WebSocketScope wsScope = (WebSocketScope) scope.getContext().getBean("webSocketScopeDefault");
            if (wsScope != null) {
                log.trace("Default WebSocketScope has {} listeners", wsScope.getListeners().size());
            }
            // add to scopes
            scopes.put(String.format("/%s", app), wsScope);
        } else {
            log.debug("Creating a new scope");
            // add a default scope and listener if none are defined
            WebSocketScope wsScope = new WebSocketScope();
            wsScope.setScope(scope);
            wsScope.setPath(String.format("/%s", app));
            if (wsScope.getListeners().isEmpty()) {
                log.debug("adding default listener");
                wsScope.addListener(new DefaultWebSocketDataListener());
            }
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            // add to scopes
            addWebSocketScope(wsScope);
        }
    }
892066
public Object callFunctionInScope(Context cx, Scriptable scope, String functionName, Object[] args) {
		return callFunctionInScope(cx, scope, functionName, args, false);
	}
451310
public DelegationRequest<T> setScope(String scope) {
        request.addParameter(ParameterBuilder.SCOPE_KEY, scope);
        return this;
    }
1295618
public static void addToScope(Scriptable scope, InputRow inputRow, InputColumn<?>[] columns, String arrayName) {
		NativeArray values = new NativeArray(columns.length * 2);
		for (int i = 0; i < columns.length; i++) {
			InputColumn<?> column = columns[i];
			Object value = inputRow.getValue(column);

			if (value != null) {
				Class<?> dataType = column.getDataType();
				if (ReflectionUtils.isNumber(dataType)) {
					value = Context.toNumber(value);
				} else if (ReflectionUtils.isBoolean(dataType)) {
					value = Context.toBoolean(value);
				}
			}

			values.put(i, values, value);
			values.put(column.getName(), values, value);

			addToScope(scope, value, column.getName(), column.getName().toLowerCase(), column.getName().toUpperCase());
		}

		addToScope(scope, values, arrayName);
	}
47033
public IBasicScope getBasicScope(ScopeType type, String name) {
        return children.getBasicScope(type, name);
    }
676569
public ActivityImpl parseScriptTask(Element scriptTaskElement, ScopeImpl scope) {
    ActivityImpl activity = createActivityOnScope(scriptTaskElement, scope);

    ScriptTaskActivityBehavior activityBehavior = parseScriptTaskElement(scriptTaskElement);

    if (activityBehavior != null) {
      parseAsynchronousContinuationForActivity(scriptTaskElement, activity);

      activity.setActivityBehavior(activityBehavior);

      parseExecutionListenersOnScope(scriptTaskElement, activity);

      for (BpmnParseListener parseListener : parseListeners) {
        parseListener.parseScriptTask(scriptTaskElement, scope, activity);
      }
    }

    return activity;
  }