/** * Create an If statement * * @param aTest * {@link IJSExpression} to be tested to determine branching * @param aThen * "then" block content. May be <code>null</code>. */ public JSConditional (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen) { this (aTest); if (aThen != null) m_aThen.add (aThen); }
/** * Create an If statement * * @param aTest * {@link IJSExpression} to be tested to determine branching * @param aThen * "then" block content. May be <code>null</code>. */ public JSConditional (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen) { this (aTest); if (aThen != null) m_aThen.add (aThen); }
/** * Constructor for simple functions * * @param aBody * The body statement. May be <code>null</code>. */ public JSAnonymousFunction (@Nullable final IJSStatement aBody) { if (aBody != null) body ().add (aBody); }
/** * Constructor for simple functions * * @param aBody * The body statement. May be <code>null</code>. */ public JSAnonymousFunction (@Nullable final IJSStatement aBody) { if (aBody != null) body ().add (aBody); }
public JSAnonymousFunction (@Nullable final Iterable <? extends JSVar> aParams, @Nullable final IJSStatement aBody) { m_aParams.addAll (aParams); if (aBody != null) body ().add (aBody); }
public JSAnonymousFunction (@Nullable final JSVar aParam, @Nullable final IJSStatement aBody) { if (aParam != null) m_aParams.add (aParam); if (aBody != null) body ().add (aBody); }
public JSAnonymousFunction (@Nullable final JSVar aParam, @Nullable final IJSStatement aBody) { if (aParam != null) m_aParams.add (aParam); if (aBody != null) body ().add (aBody); }
/** * Create an If statement * * @param aTest * {@link IJSExpression} to be tested to determine branching * @param aThen * "then" block content. May be <code>null</code>. * @param aElse * "else" block content. May be <code>null</code>. */ public JSConditional (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen, @Nullable final IHasJSCode aElse) { this (aTest, aThen); if (aElse != null) _else ().add (aElse); }
/** * Create an If statement * * @param aTest * {@link IJSExpression} to be tested to determine branching * @param aThen * "then" block content. May be <code>null</code>. * @param aElse * "else" block content. May be <code>null</code>. */ public JSConditional (@Nonnull final IJSExpression aTest, @Nullable final IHasJSCode aThen, @Nullable final IHasJSCode aElse) { this (aTest, aThen); if (aElse != null) _else ().add (aElse); }
public JSAnonymousFunction (@Nullable final Iterable <? extends JSVar> aParams, @Nullable final IJSStatement aBody) { m_aParams.addAll (aParams); if (aBody != null) body ().add (aBody); }
/** * Add onDocumentReady call with a single statement * * @param aJSCodeProvider * The statement to be executed on document ready * @return The invocation object */ @Nonnull public static JQueryInvocation onDocumentReady (@Nonnull final IHasJSCode aJSCodeProvider) { final JSAnonymousFunction aAnonFunction = new JSAnonymousFunction (); aAnonFunction.body ().add (aJSCodeProvider); return jQueryDocument ().ready (aAnonFunction); }
/** * Add onDocumentReady call with a single statement * * @param aJSCodeProvider * The statement to be executed on document ready * @return The invocation object */ @Nonnull public static JQueryInvocation onDocumentReady (@Nonnull final IHasJSCode aJSCodeProvider) { final JSAnonymousFunction aAnonFunction = new JSAnonymousFunction (); aAnonFunction.body ().add (aJSCodeProvider); return jQueryDocument ().ready (aAnonFunction); }
@Override public void customizeNode (@Nonnull final IHCNode aNode, @Nonnull final EHTMLVersion eHTMLVersion, @Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aTargetNode) { if (aNode instanceof IHCElement && !(aNode instanceof IHCScript <?>)) { final JSEventMap aEventMap = ((IHCElement <?>) aNode).getEventMap (); if (aEventMap != null) for (final Map.Entry <EJSEvent, CollectingJSCodeProvider> aEntry : aEventMap.getAllEventHandler ().entrySet ()) { // "ag" for "automatically generated" final JSFunction aFunc = new JSFunction ("_photon_ag" + GlobalIDFactory.getNewIntID ()); aFunc.body ().add (aEntry.getValue ()); aTargetNode.addChild (new HCScriptInline (aFunc)); aEventMap.setHandler (aEntry.getKey (), aFunc.invoke ()); } } } }
@Override public void customizeNode (@Nonnull final IHCNode aNode, @Nonnull final EHTMLVersion eHTMLVersion, @Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aTargetNode) { if (aNode instanceof IHCElement && !(aNode instanceof IHCScript <?>)) { final JSEventMap aEventMap = ((IHCElement <?>) aNode).getEventMap (); if (aEventMap != null) for (final Map.Entry <EJSEvent, CollectingJSCodeProvider> aEntry : aEventMap.getAllEventHandler ().entrySet ()) { // "ag" for "automatically generated" final JSFunction aFunc = new JSFunction ("_photon_ag" + GlobalIDFactory.getNewIntID ()); aFunc.body ().add (aEntry.getValue ()); aTargetNode.addChild (new HCScriptInline (aFunc)); aEventMap.setHandler (aEntry.getKey (), aFunc.invoke ()); } } } }
m_aSelectionCallback.body ().add (JQuery.idRef (m_sHiddenFieldID).val (aJSDatum.ref (JSON_ID)).change ());
final JSVar aJSAppendData = aJSAppend.param ("data"); aJSAppend.body () .add (JQuery.idRef (aEntityContainer) .append (aJSAppendData.ref (PhotonUnifiedResponse.HtmlHelper.PROPERTY_HTML)));
final JSVar aJSAppendData = aJSAppend.param ("data"); aJSAppend.body () .add (JQuery.idRef (aEntityContainer) .append (aJSAppendData.ref (PhotonUnifiedResponse.HtmlHelper.PROPERTY_HTML)));
aJSDelOld.add (aOldChart.invoke ("destroy")); aJSDelOld.delete (aOldChart);