public void append(final Object object) { if (object instanceof JsMap) ((JsMap)object).toString(buffer, null); else if (object instanceof Boolean) buffer.append(((Boolean)object).toString()); else if (object instanceof JsFunction) ((JsFunction)object).toString(buffer); else if (object instanceof String[]) { buffer.append("["); boolean first = true; for (String s : (String[])object) { if (!first) buffer.append(","); buffer.append("'"); buffer.append(s); buffer.append("'"); first = false; } buffer.append("]"); } else { buffer.append(object.toString()); } }
if (onBeforeShowNotificationWanted) options.put(EventType.BEFORE_SHOW.eventName, new JsFunction("function(dateText,inst) { wicketAjaxGet('" + this.getCallbackUrl() + "&" + EventType.IDENTIFIER + "=" + EventType.BEFORE_SHOW + new JsFunction("function(dateText,inst) { wicketAjaxGet('" + this.getCallbackUrl() + "&date='+dateText" + new JsFunction("function(dateText,inst) { wicketAjaxGet('" + this.getCallbackUrl() + "&date='+dateText" + new JsFunction("function(year,month,inst) { wicketAjaxGet('" + this.getCallbackUrl() + "&year='+year" + new JsFunction("function(date) { wicketAjaxGet('" + this.getCallbackUrl() + "&date='+date" +
if (this.onDragStopNotificationWanted) { this.options.put(EventType.DRAG_END.getEventName(), new JsFunction("function() { wicketAjaxGet('" + new JsFunction("function() { wicketAjaxGet('" + this.getCallbackUrl() + "&" + EventType.IDENTIFIER + "=" + EventType.DRAG + new JsFunction("function() { wicketAjaxGet('" + this.getCallbackUrl() + "&" + EventType.IDENTIFIER + "=" + EventType.DRAG_START + builder.append(new JsFunction("\njQuery(function(){jQuery('#" + getComponent().getMarkupId() + "').attr('" + DraggablesAcceptedByDroppable.DRAG_NAME_IDENTIFIER + "', '" + this.name +
if (onResizeStartNotificationWanted) options.put(EventType.RESIZE_START.eventName, new JsFunction("function(ev,ui) { wicketAjaxGet('" + this.getCallbackUrl() + "&height='+jQuery(ui.size).attr('height')" + new JsFunction("function(ev,ui) { wicketAjaxGet('" + this.getCallbackUrl() + "&height='+jQuery(ui.size).attr('height')" + new JsFunction("function(ev,ui) { wicketAjaxGet('" + this.getCallbackUrl() + "&height='+jQuery(ui.size).attr('height')" +
if (onDeactivateNotificationWanted) options.put("deactivate", new JsFunction("function(ev,ui) { \n"+ "wicketAjaxGet('" + this.getCallbackUrl() + new JsFunction("function(ev,ui) { \n"+ "wicketAjaxGet('" + this.getCallbackUrl() + new JsFunction("function(ev,ui) { \n"+ "wicketAjaxGet('" + this.getCallbackUrl() +
if (this.onDeactivateNotificationWanted) { this.options.put("deactivate", new JsFunction("function(ev,ui) { \n" + "wicketAjaxGet('" + this.getCallbackUrl() + new JsFunction("function(ev,ui) { \n" + "wicketAjaxGet('" + this.getCallbackUrl() + new JsFunction("function(ev,ui) { \n" + "wicketAjaxGet('" + this.getCallbackUrl() +
if (onDragStopNotificationWanted) options.put(EventType.DRAG_END.getEventName(), new JsFunction("function() { wicketAjaxGet('" + this.getCallbackUrl(false) + "&" + EventType.IDENTIFIER + "=" + EventType.DRAG_END + new JsFunction("function() { wicketAjaxGet('" + this.getCallbackUrl() + "&" + EventType.IDENTIFIER + "=" + EventType.DRAG + new JsFunction("function() { wicketAjaxGet('" + this.getCallbackUrl() + "&" + EventType.IDENTIFIER + "=" + EventType.DRAG_START + builder.append(new JsFunction("\njQuery(function(){jQuery('#" + getComponent().getMarkupId() + "').attr('" + DraggablesAcceptedByDroppable.DRAG_NAME_IDENTIFIER + "', '" + name +
@Override protected JsBuilder getJsBuilder() { options.put(EventType.STOP.eventName, new JsFunction( "function(ev,ui) {" + "jQuery.handleSortStop('" + this.getCallbackUrl() + "',ui,'" + getComponent().getMarkupId() + "');" + new JsFunction( "function(ev,ui) {" + "jQuery.handleReceive('" + this.getCallbackUrl() + "',ui,'" + getComponent().getMarkupId() + "');" + new JsFunction( "function(ev,ui) {" + "jQuery.handleRemove('" + this.getCallbackUrl() + "',ui,'" + getComponent().getMarkupId() + "');" +
public void append(final Object object) { if (object instanceof JsMap) { ((JsMap) object).toString(this.buffer, null); } else if (object instanceof Boolean) { this.buffer.append(((Boolean) object).toString()); } else if (object instanceof JsFunction) { ((JsFunction) object).toString(this.buffer); } else if (object instanceof String[]) { this.buffer.append("["); boolean first = true; for (String s : (String[]) object) { if (!first) { this.buffer.append(","); } this.buffer.append("'"); this.buffer.append(s); this.buffer.append("'"); first = false; } this.buffer.append("]"); } else { this.buffer.append(object.toString()); } }
/** * Sets the <code>content</code> option of the tooltip widget like this: * <code>content:function(){return 'tooltip content';}</code>. * <p/> * Note: The <code>content</code> option has to stay in sync with the <code>items</code> option * (see <a href="http ://api.jqueryui * .com/tooltip/#option-content">http://api.jqueryui.com/tooltip/#option-content</a>). * * @param content * a {@link JsFunction} containing a JavaScript function which returns the content of * this tooltip (e.g. * <code>new JsFunction("function(){return 'tooltip content';}")</code>) * @return */ public JQueryUiTooltip setContent(JsFunction content) { this.widget.setOption("content", content.toString()); return this; }
/** * Sets the 'helper' property for this draggable with a function. Please * consult the jQuery documentation for a detailed description of this property. * DraggableHelper can be used for values of "original" and "clone", or * a custom function can be used. * * @param function * @return this object */ public DraggableBehavior setHelper(final String function) { if (function == null) { this.options.remove("helper"); } else { this.options.put("helper", new JsFunction(function)); } return this; }
/** You can restrict the {@link Component}s that can be dragged and dropped to * a {@link Component} marked with this behavior. See {@link DraggablesAcceptedByDroppable} * for more information. If the {@link DraggablesAcceptedByDroppable} is empty (i.e. it * contains no names) then the droppable does not accept any draggables. * * @param accepted the accepted * @return this object */ public DroppableBehavior setDraggablesAcceptedByDroppable(final DraggablesAcceptedByDroppable accepted) { draggablesAcceptedByDroppable = accepted; if (accepted != null) options.put("accept", new JsFunction(accepted.getJsAcceptCheckerFunctionName())); else options.remove("accept"); return this; }
/** * You can restrict the {@link Component}s that can be dragged and dropped to * a {@link Component} marked with this behavior. See {@link DraggablesAcceptedByDroppable} * for more information. If the {@link DraggablesAcceptedByDroppable} is empty (i.e. it * contains no names) then the droppable does not accept any draggables. * * @param accepted the accepted * @return this object */ public DroppableBehavior setDraggablesAcceptedByDroppable(final DraggablesAcceptedByDroppable accepted) { this.draggablesAcceptedByDroppable = accepted; if (accepted != null) { this.options.put("accept", new JsFunction(accepted.getJsAcceptCheckerFunctionName())); } else { this.options.remove("accept"); } return this; }
/** * Sets the 'helper' property for this draggable with a function. Please * consult the jQuery documentation for a detailed description of this property. * DraggableHelper can be used for values of "original" and "clone", or * a custom function can be used. * @param function * @return this object */ public DraggableBehavior setHelper(final String function) { if (function == null) options.remove("helper"); else options.put("helper", new JsFunction(function)); return this; } public DraggableBehavior setHelper(final AjaxRequestTarget target, final String function) {
/** * Sets some default options. */ private void setDefaultOptions() { setContent(new JsFunction(defaultContent)); }