org.wicketstuff.jwicket.ui.effect.Puff Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwicket-ui-effects Show documentation
Show all versions of jwicket-ui-effects Show documentation
WicketJQuery by Stefan Lindner has been renamed to jWicket, mavenized, and migrated
to WicketStuff. This Wicketstuff version supercedes the original version which was available
at http://subversion.visionet.de/project/WicketJQuery/wiki
The newest version!
package org.wicketstuff.jwicket.ui.effect;
import org.wicketstuff.jwicket.JQueryJavascriptResourceReference;
public class Puff extends AbstractJqueryUiEffect {
private static final long serialVersionUID = 1L;
public Puff() {
super(new JQueryJavascriptResourceReference(Scale.class, "jquery.effects.scale.min.js"));
}
@Override
String getEffectName() {
return "puff";
}
private String mode = null;
/** Set the fold mode
*
* @param value the mode
* @return this object
*/
public Puff setMode(final EffectMode value) {
if (value == null)
mode = null;
else
mode = value.getMode();
return this;
}
private String percent = null;
/** Set the percentage to scale to
*
* @param value is the percentage
* @return this object
*/
public Puff setPercen(final int value) {
if (value <= 0)
percent = null;
else
percent = String.valueOf(value);
return this;
}
@Override
void appendOptions(final StringBuilder jsString) {
if (mode != null || percent != null) {
boolean firstOption = true;
jsString.append(",{");
if (mode != null) {
jsString.append("mode:'");
jsString.append(mode);
jsString.append("'");
firstOption = false;
}
if (percent != null) {
if (!firstOption)
jsString.append(",");
jsString.append("percent:");
jsString.append(percent);
}
jsString.append("}");
}
}
}