/** * @param aAncestorSelector * Ancestor selector * @param aDescendantSelector * Descendant selector * @return <code>ancestor descendant</code> */ @Nonnull public static IJQuerySelector descendant (@Nonnull final IJQuerySelector aAncestorSelector, @Nonnull final IJQuerySelector aDescendantSelector) { ValueEnforcer.notNull (aAncestorSelector, "AncestorSelector"); ValueEnforcer.notNull (aDescendantSelector, "DescendantSelector"); return new JQuerySelector (aAncestorSelector.getExpression () .plus (" ") .plus (aDescendantSelector.getExpression ())); }
@Nonnull public String getJSCode (@Nullable final IJSWriterSettings aSettings) { return m_aExpr.getJSCode (aSettings); }
aTotal = aTotal.plus (sSuffix); aPageTotal = aPageTotal.plus (sSuffix); aBoth = aPageTotal; if (StringHelper.hasText (sBothSep)) aBoth = aBoth.plus (sBothSep); aBoth = aBoth.plus (aTotal); if (StringHelper.hasText (sBothSuffix)) aBoth = aBoth.plus (sBothSuffix); aFuncPrintSum.body ()._return (JSOp.cond (aTotal.eq (aPageTotal), aTotal, aBoth)); return aFuncPrintSum;
@Nonnull public static JSInvocation invoke (@Nonnull final IJSExpression aExpr) { return aExpr.invoke ("typeahead"); }
aOnCompete.body ()._if (aGlobalCnt.decrPrefix ().eq (0))._then ().add (aForm.invoke ("submit")); aOnClick.body ().add (aUpload.invoke ("on").arg ("complete").arg (aOnCompete));
@Nonnull public static JSInvocation invoke (@Nonnull final IJSExpression aExpr) { return aExpr.invoke ("autoNumeric"); }
aOnCompete.body ()._if (aGlobalCnt.decrPrefix ().eq (0))._then ().add (aForm.invoke ("submit")); aOnClick.body ().add (aUpload.invoke ("on").arg ("complete").arg (aOnCompete));
/** * @param aAncestorSelector * Ancestor selector * @param aDescendantSelector * Descendant selector * @return <code>ancestor descendant</code> */ @Nonnull public static IJQuerySelector descendant (@Nonnull final IJQuerySelector aAncestorSelector, @Nonnull final IJQuerySelector aDescendantSelector) { ValueEnforcer.notNull (aAncestorSelector, "AncestorSelector"); ValueEnforcer.notNull (aDescendantSelector, "DescendantSelector"); return new JQuerySelector (aAncestorSelector.getExpression () .plus (" ") .plus (aDescendantSelector.getExpression ())); }
@Nonnull public String getJSCode (@Nullable final IJSWriterSettings aSettings) { return m_aExpr.getJSCode (aSettings); }
/** * Remove all filters and redraw the data table * * @param aDTSelect * JS expression that selects 1-n datatables * @return The invocation to clear the filter. Never <code>null</code>. */ @Nonnull public static JSInvocation createClearFilterCode (@Nonnull final IJSExpression aDTSelect) { return aDTSelect.invoke ("DataTable") .invoke ("search") .arg ("") .invoke ("columns") .invoke ("search") .arg ("") .invoke ("draw"); } }
/** * @param aPrevSelector * Previous selector * @param aNextSelector * Next selector * @return <code>prev + next</code> */ @Nonnull public static IJQuerySelector nextAdjacent (@Nonnull final IJQuerySelector aPrevSelector, @Nonnull final IJQuerySelector aNextSelector) { ValueEnforcer.notNull (aPrevSelector, "PrevSelector"); ValueEnforcer.notNull (aNextSelector, "NextSelector"); return new JQuerySelector (aPrevSelector.getExpression () .plus (JSExpr.lit (" + ")) .plus (aNextSelector.getExpression ())); }
/** * Create a read only edit that contains the value of the selected file. It * can be placed anywhere in the DOM. * * @param sPlaceholder * The placeholder text to be used if no file is selected. * @return A node list with the edit and a JavaScript */ @Nonnull public HCNodeList createSelectedFileEdit (@Nullable final String sPlaceholder) { final HCEdit aEdit = new HCEdit ().setPlaceholder (sPlaceholder).setReadOnly (true); final HCScriptInline aScript = new HCScriptInline (JQuery.idRef (m_aEdit) .on ("change", new JSAnonymousFunction (JQuery.idRef (aEdit) .val (JSExpr.THIS.ref ("value"))))); return new HCNodeList ().addChildren (aEdit, aScript); } }
@Nonnull public String getJSCode (@Nullable final IJSWriterSettings aSettings) { return getAsExpression ().getJSCode (aSettings); } }
ret.param ("end"); ret.param ("display"); final JSVar aAPI = ret.body ().var ("api", JSExpr.THIS.invoke ("api"));
/** * @param aSelectors * the selectors to chaing via "," * @return <code>sel, sel, sel, ...</code> */ @Nonnull public static IJQuerySelector multiple (@Nonnull @Nonempty final IJQuerySelector... aSelectors) { final int nSize = ArrayHelper.getSize (aSelectors); if (nSize == 0) throw new IllegalArgumentException ("empty selectors"); if (ArrayHelper.containsAnyNullElement (aSelectors)) throw new IllegalArgumentException ("selectors array contains null element"); if (nSize == 1) return aSelectors[0]; // Concatenate with ',' IJSExpression ret = aSelectors[0].getExpression (); for (int i = 1; i < nSize; ++i) ret = ret.plus (',').plus (aSelectors[i].getExpression ()); return new JQuerySelector (ret); }
@Override protected void onFinalizeNodeState (@Nonnull final IHCConversionSettingsToNode aConversionSettings, @Nonnull final IHCHasChildrenMutable <?, ? super IHCNode> aTargetNode) { super.onFinalizeNodeState (aConversionSettings, aTargetNode); addClass (CBootstrapCSS.CUSTOM_FILE); final HCEditFile aEditFile = new HCEditFile (m_sName); aEditFile.addClass (CBootstrapCSS.CUSTOM_FILE_INPUT); addChild (aEditFile); final HCLabel aLabel = new HCLabel (); aLabel.setFor (aEditFile); aLabel.addClass (CBootstrapCSS.CUSTOM_FILE_LABEL); aLabel.addChild ("Choose file"); addChild (aLabel); aEditFile.addEventHandler (EJSEvent.CHANGE, false ? JSHtml.consoleLog (JSExpr.THIS.ref ("files").component0 ().ref ("name")) : JQuery.idRef (aLabel) .empty () .append (JSExpr.THIS.ref ("files").component0 ().ref ("name"))); } }
@Nonnull public String getJSCode (@Nullable final IJSWriterSettings aSettings) { return getAsExpression ().getJSCode (aSettings); } }
/** * @param aSelectors * the selectors to chaing via "," * @return <code>sel, sel, sel, ...</code> */ @Nonnull public static IJQuerySelector multiple (@Nonnull @Nonempty final IJQuerySelector... aSelectors) { final int nSize = ArrayHelper.getSize (aSelectors); if (nSize == 0) throw new IllegalArgumentException ("empty selectors"); if (ArrayHelper.containsAnyNullElement (aSelectors)) throw new IllegalArgumentException ("selectors array contains null element"); if (nSize == 1) return aSelectors[0]; // Concatenate with ',' IJSExpression ret = aSelectors[0].getExpression (); for (int i = 1; i < nSize; ++i) ret = ret.plus (',').plus (aSelectors[i].getExpression ()); return new JQuerySelector (ret); }