Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.primefaces.component.splitbutton.SplitButton Maven / Gradle / Ivy
/*
* Generated, Do Not Modify
*/
/*
* Copyright 2009-2013 PrimeTek.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.primefaces.component.splitbutton;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.context.FacesContext;
import javax.faces.component.UINamingContainer;
import javax.el.ValueExpression;
import javax.el.MethodExpression;
import javax.faces.render.Renderer;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.event.AbortProcessingException;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import java.util.List;
import java.util.ArrayList;
import org.primefaces.util.HTML;
@ResourceDependencies({
@ResourceDependency(library="primefaces", name="primefaces.css"),
@ResourceDependency(library="primefaces", name="jquery/jquery.js"),
@ResourceDependency(library="primefaces", name="jquery/jquery-plugins.js"),
@ResourceDependency(library="primefaces", name="primefaces.js")
})
public class SplitButton extends HtmlCommandButton implements org.primefaces.component.api.AjaxSource,org.primefaces.component.api.Widget {
public static final String COMPONENT_TYPE = "org.primefaces.component.SplitButton";
public static final String COMPONENT_FAMILY = "org.primefaces.component";
private static final String DEFAULT_RENDERER = "org.primefaces.component.SplitButtonRenderer";
protected enum PropertyKeys {
widgetVar
,ajax
,async
,process
,update
,onstart
,oncomplete
,onerror
,onsuccess
,global
,icon
,iconPos
,inline
,partialSubmit
,resetValues
,ignoreAutoUpdate;
String toString;
PropertyKeys(String toString) {
this.toString = toString;
}
PropertyKeys() {}
public String toString() {
return ((this.toString != null) ? this.toString : super.toString());
}
}
public SplitButton() {
setRendererType(DEFAULT_RENDERER);
}
public String getFamily() {
return COMPONENT_FAMILY;
}
public java.lang.String getWidgetVar() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.widgetVar, null);
}
public void setWidgetVar(java.lang.String _widgetVar) {
getStateHelper().put(PropertyKeys.widgetVar, _widgetVar);
}
public boolean isAjax() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.ajax, true);
}
public void setAjax(boolean _ajax) {
getStateHelper().put(PropertyKeys.ajax, _ajax);
}
public boolean isAsync() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.async, false);
}
public void setAsync(boolean _async) {
getStateHelper().put(PropertyKeys.async, _async);
}
public java.lang.String getProcess() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.process, null);
}
public void setProcess(java.lang.String _process) {
getStateHelper().put(PropertyKeys.process, _process);
}
public java.lang.String getUpdate() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.update, null);
}
public void setUpdate(java.lang.String _update) {
getStateHelper().put(PropertyKeys.update, _update);
}
public java.lang.String getOnstart() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.onstart, null);
}
public void setOnstart(java.lang.String _onstart) {
getStateHelper().put(PropertyKeys.onstart, _onstart);
}
public java.lang.String getOncomplete() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.oncomplete, null);
}
public void setOncomplete(java.lang.String _oncomplete) {
getStateHelper().put(PropertyKeys.oncomplete, _oncomplete);
}
public java.lang.String getOnerror() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.onerror, null);
}
public void setOnerror(java.lang.String _onerror) {
getStateHelper().put(PropertyKeys.onerror, _onerror);
}
public java.lang.String getOnsuccess() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.onsuccess, null);
}
public void setOnsuccess(java.lang.String _onsuccess) {
getStateHelper().put(PropertyKeys.onsuccess, _onsuccess);
}
public boolean isGlobal() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.global, true);
}
public void setGlobal(boolean _global) {
getStateHelper().put(PropertyKeys.global, _global);
}
public java.lang.String getIcon() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.icon, null);
}
public void setIcon(java.lang.String _icon) {
getStateHelper().put(PropertyKeys.icon, _icon);
}
public java.lang.String getIconPos() {
return (java.lang.String) getStateHelper().eval(PropertyKeys.iconPos, "left");
}
public void setIconPos(java.lang.String _iconPos) {
getStateHelper().put(PropertyKeys.iconPos, _iconPos);
}
public boolean isInline() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.inline, false);
}
public void setInline(boolean _inline) {
getStateHelper().put(PropertyKeys.inline, _inline);
}
public boolean isPartialSubmit() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.partialSubmit, false);
}
public void setPartialSubmit(boolean _partialSubmit) {
getStateHelper().put(PropertyKeys.partialSubmit, _partialSubmit);
}
public boolean isResetValues() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.resetValues, false);
}
public void setResetValues(boolean _resetValues) {
getStateHelper().put(PropertyKeys.resetValues, _resetValues);
}
public boolean isIgnoreAutoUpdate() {
return (java.lang.Boolean) getStateHelper().eval(PropertyKeys.ignoreAutoUpdate, false);
}
public void setIgnoreAutoUpdate(boolean _ignoreAutoUpdate) {
getStateHelper().put(PropertyKeys.ignoreAutoUpdate, _ignoreAutoUpdate);
}
public static final String STYLE_CLASS = "ui-splitbutton ui-buttonset ui-widget";
public static final String BUTTON_TEXT_ICON_LEFT_BUTTON_CLASS = "ui-button ui-widget ui-state-default ui-corner-left ui-button-text-icon-left";
public static final String BUTTON_TEXT_ICON_RIGHT_BUTTON_CLASS = "ui-button ui-widget ui-state-default ui-corner-left ui-button-text-icon-right";
public static final String MENU_ICON_BUTTON_CLASS = "ui-splitbutton-menubutton ui-button ui-widget ui-state-default ui-corner-right ui-button-icon-only";
public final static String BUTTON_TEXT_ONLY_BUTTON_CLASS = "ui-button ui-widget ui-state-default ui-corner-left ui-button-text-only";
public final static String BUTTON_ICON_ONLY_BUTTON_CLASS = "ui-button ui-widget ui-state-default ui-corner-left ui-button-icon-only";
public String resolveStyleClass() {
String icon = getIcon();
Object value = getValue();
String styleClass = "";
if(value != null && icon == null) {
styleClass = BUTTON_TEXT_ONLY_BUTTON_CLASS;
}
else if(value != null && icon != null) {
styleClass = getIconPos().equals("left") ? BUTTON_TEXT_ICON_LEFT_BUTTON_CLASS : BUTTON_TEXT_ICON_RIGHT_BUTTON_CLASS;
}
else if(value == null && icon != null) {
styleClass = BUTTON_ICON_ONLY_BUTTON_CLASS;
}
if(isDisabled()) {
styleClass = styleClass + " ui-state-disabled";
}
return styleClass;
}
public boolean isPartialSubmitSet() {
return (getStateHelper().get(PropertyKeys.partialSubmit) != null) || (this.getValueExpression("partialSubmit") != null);
}
public boolean isResetValuesSet() {
return (getStateHelper().get(PropertyKeys.resetValues) != null) || (this.getValueExpression("resetValues") != null);
}
public boolean isAjaxified() {
return isAjax();
}
public String resolveWidgetVar() {
FacesContext context = getFacesContext();
String userWidgetVar = (String) getAttributes().get("widgetVar");
if(userWidgetVar != null)
return userWidgetVar;
else
return "widget_" + getClientId(context).replaceAll("-|" + UINamingContainer.getSeparatorChar(context), "_");
}
}