
org.primefaces.component.stack.StackBase Maven / Gradle / Ivy
/*
* The MIT License
*
* Copyright (c) 2009-2021 PrimeTek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.primefaces.component.stack;
import org.primefaces.component.api.Widget;
import org.primefaces.component.menu.AbstractMenu;
public abstract class StackBase extends AbstractMenu implements Widget {
public static final String COMPONENT_FAMILY = "org.primefaces.component";
public static final String DEFAULT_RENDERER = "org.primefaces.component.StackRenderer";
public enum PropertyKeys {
widgetVar,
model,
icon,
openSpeed,
closeSpeed,
expanded
}
public StackBase() {
setRendererType(DEFAULT_RENDERER);
}
@Override
public String getFamily() {
return COMPONENT_FAMILY;
}
public String getWidgetVar() {
return (String) getStateHelper().eval(PropertyKeys.widgetVar, null);
}
public void setWidgetVar(String widgetVar) {
getStateHelper().put(PropertyKeys.widgetVar, widgetVar);
}
@Override
public org.primefaces.model.menu.MenuModel getModel() {
return (org.primefaces.model.menu.MenuModel) getStateHelper().eval(PropertyKeys.model, null);
}
public void setModel(org.primefaces.model.menu.MenuModel model) {
getStateHelper().put(PropertyKeys.model, model);
}
public String getIcon() {
return (String) getStateHelper().eval(PropertyKeys.icon, null);
}
public void setIcon(String icon) {
getStateHelper().put(PropertyKeys.icon, icon);
}
public int getOpenSpeed() {
return (Integer) getStateHelper().eval(PropertyKeys.openSpeed, 300);
}
public void setOpenSpeed(int openSpeed) {
getStateHelper().put(PropertyKeys.openSpeed, openSpeed);
}
public int getCloseSpeed() {
return (Integer) getStateHelper().eval(PropertyKeys.closeSpeed, 300);
}
public void setCloseSpeed(int closeSpeed) {
getStateHelper().put(PropertyKeys.closeSpeed, closeSpeed);
}
public boolean isExpanded() {
return (Boolean) getStateHelper().eval(PropertyKeys.expanded, false);
}
public void setExpanded(boolean expanded) {
getStateHelper().put(PropertyKeys.expanded, expanded);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy