private ServerConnector findConnectorById(ServerConnector root, String id) {
SharedState state = root.getState();
if (state instanceof ComponentState
- && id.equals(((ComponentState) state).getId())) {
+ && id.equals(((ComponentState) state).id)) {
return root;
}
for (ServerConnector child : root.getChildren()) {
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
int assignedHeight) {
assert component.isRelativeHeight();
- float percentSize = parsePercent(component.getState().getHeight());
+ float percentSize = parsePercent(component.getState().height);
int effectiveHeight = Math.round(assignedHeight * (percentSize / 100));
reportOuterHeight(component, effectiveHeight);
int assignedWidth) {
assert component.isRelativeWidth();
- float percentSize = parsePercent(component.getState().getWidth());
+ float percentSize = parsePercent(component.getState().width == null ? ""
+ : component.getState().width);
int effectiveWidth = Math.round(assignedWidth * (percentSize / 100));
reportOuterWidth(component, effectiveWidth);
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.ComponentState;
import com.vaadin.shared.communication.MethodInvocation;
+import com.vaadin.shared.ui.ComponentStateUtil;
public class Util {
* @return An escaped version of <literal>attribute</literal>.
*/
public static String escapeAttribute(String attribute) {
+ if (attribute == null) {
+ return "";
+ }
attribute = attribute.replace("\"", """);
attribute = attribute.replace("'", "'");
attribute = attribute.replace(">", ">");
* @return
*/
public static FloatSize parseRelativeSize(ComponentState state) {
- if (state.isUndefinedHeight() && state.isUndefinedWidth()) {
+ if (ComponentStateUtil.isUndefinedHeight(state)
+ && ComponentStateUtil.isUndefinedWidth(state)) {
return null;
}
- float relativeWidth = Util.parseRelativeSize(state.getWidth());
- float relativeHeight = Util.parseRelativeSize(state.getHeight());
+ float relativeWidth = Util.parseRelativeSize(state.width);
+ float relativeHeight = Util.parseRelativeSize(state.height);
FloatSize relativeSize = new FloatSize(relativeWidth, relativeHeight);
return relativeSize;
}
+
@Deprecated
public static boolean isCached(UIDL uidl) {
return uidl.getBooleanAttribute("cached");
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
placedAfterComponent = true;
String style = CLASSNAME;
- if (owner.getState().hasStyles()) {
- for (String customStyle : owner.getState().getStyles()) {
+ if (owner.getState().styles != null
+ && !owner.getState().styles.isEmpty()) {
+ for (String customStyle : owner.getState().styles) {
style += " " + CLASSNAME + "-" + customStyle;
}
}
boolean hasIcon = owner.getState().resources
.containsKey(ComponentConstants.ICON_RESOURCE);
boolean showRequired = false;
- boolean showError = owner.getState().getErrorMessage() != null;
+ boolean showError = owner.getState().errorMessage != null;
if (owner.getState() instanceof AbstractFieldState) {
AbstractFieldState abstractFieldState = (AbstractFieldState) owner
.getState();
- showError = showError && !abstractFieldState.isHideErrors();
+ showError = showError && !abstractFieldState.hideErrors;
}
if (owner instanceof AbstractFieldConnector) {
showRequired = ((AbstractFieldConnector) owner).isRequired();
icon = null;
}
- if (owner.getState().getCaption() != null) {
+ if (owner.getState().caption != null) {
// A caption text should be shown if the attribute is set
// If the caption is null the ATTRIBUTE_CAPTION should not be set to
// avoid ending up here.
}
// Update caption text
- String c = owner.getState().getCaption();
+ String c = owner.getState().caption;
// A text forces the caption to be above the component.
placedAfterComponent = false;
if (c == null || c.trim().equals("")) {
captionText = null;
}
- if (owner.getState().hasDescription() && captionText != null) {
+ if (owner.getState().description != null && captionText != null) {
addStyleDependentName("hasdescription");
} else {
removeStyleDependentName("hasdescription");
}
public static boolean isNeeded(ComponentState state) {
- if (state.getCaption() != null) {
+ if (state.caption != null) {
return true;
}
if (state.resources.containsKey(ComponentConstants.ICON_RESOURCE)) {
return true;
}
- if (state.getErrorMessage() != null) {
+ if (state.errorMessage != null) {
return true;
}
protected void dumpConnectorInfo(ApplicationConnection a) {
UIConnector root = a.getRootConnector();
log("================");
- log("Connector hierarchy for Root: " + root.getState().getCaption()
+ log("Connector hierarchy for Root: " + root.getState().caption
+ " (" + root.getConnectorId() + ")");
Set<ServerConnector> connectorsInHierarchy = new HashSet<ServerConnector>();
SimpleTree rootHierachy = dumpConnectorHierarchy(root, "",
public void onStateChanged(StateChangeEvent stateChangeEvent) {
ConnectorMap paintableMap = ConnectorMap.get(getConnection());
- if (getState().getId() != null) {
- getWidget().getElement().setId(getState().getId());
+ if (getState().id != null) {
+ getWidget().getElement().setId(getState().id);
} else {
getWidget().getElement().removeAttribute("id");
*/
if (getState() instanceof TabIndexState
&& getWidget() instanceof Focusable) {
- ((Focusable) getWidget()).setTabIndex(((TabIndexState) getState())
- .getTabIndex());
+ ((Focusable) getWidget())
+ .setTabIndex(((TabIndexState) getState()).tabIndex);
}
super.onStateChanged(stateChangeEvent);
}
private void updateComponentSize() {
- String newWidth = getState().getWidth();
- String newHeight = getState().getHeight();
+ String newWidth = getState().width == null ? "" : getState().width;
+ String newHeight = getState().height == null ? "" : getState().height;
// Parent should be updated if either dimension changed between relative
// and non-relative
@Override
public boolean isRelativeHeight() {
- return getState().getHeight().endsWith("%");
+ return getState().height != null && getState().height.endsWith("%");
}
@Override
public boolean isRelativeWidth() {
- return getState().getWidth().endsWith("%");
+ return getState().width != null && getState().width.endsWith("%");
}
@Override
public boolean isUndefinedHeight() {
- return getState().getHeight().length() == 0;
+ return getState().height == null || getState().height.length() == 0;
}
@Override
public boolean isUndefinedWidth() {
- return getState().getWidth().length() == 0;
+ return getState().width == null && getState().width.length() == 0;
}
/*
// add / remove error style name
setWidgetStyleNameWithPrefix(primaryStyleName,
ApplicationConnection.ERROR_CLASSNAME_EXT,
- null != state.getErrorMessage());
+ null != state.errorMessage);
// add additional user defined style names as class names, prefixed with
// component default class name. remove nonexistent style names.
- if (state.hasStyles()) {
+ if (state.styles != null && !state.styles.isEmpty()) {
// add new style names
List<String> newStyles = new ArrayList<String>();
- newStyles.addAll(state.getStyles());
+ newStyles.addAll(state.styles);
newStyles.removeAll(styleNames);
for (String newStyle : newStyles) {
setWidgetStyleName(newStyle, true);
true);
}
// remove nonexistent style names
- styleNames.removeAll(state.getStyles());
+ styleNames.removeAll(state.styles);
for (String oldStyle : styleNames) {
setWidgetStyleName(oldStyle, false);
setWidgetStyleNameWithPrefix(primaryStyleName + "-", oldStyle,
false);
}
styleNames.clear();
- styleNames.addAll(state.getStyles());
+ styleNames.addAll(state.styles);
} else {
// remove all old style names
for (String oldStyle : styleNames) {
@Override
@Deprecated
public boolean isReadOnly() {
- return getState().isReadOnly();
+ return getState().readOnly;
}
@Override
*/
@Override
public boolean hasEventListener(String eventIdentifier) {
- Set<String> reg = getState().getRegisteredEventListeners();
+ Set<String> reg = getState().registeredEventListeners;
return (reg != null && reg.contains(eventIdentifier));
}
*/
@Override
public TooltipInfo getTooltipInfo(Element element) {
- return new TooltipInfo(getState().getDescription(), getState()
- .getErrorMessage());
+ return new TooltipInfo(getState().description, getState().errorMessage);
}
/**
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
@Override
public boolean isEnabled() {
- if (!getState().isEnabled()) {
+ if (!getState().enabled) {
return false;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
@Override
public boolean isReadOnly() {
- return super.isReadOnly() || getState().isPropertyReadOnly();
+ return super.isReadOnly() || getState().propertyReadOnly;
}
public boolean isModified() {
- return getState().isModified();
+ return getState().modified;
}
/**
* @return true if required indicator should be shown
*/
public boolean isRequired() {
- return getState().isRequired() && !isReadOnly();
+ return getState().required && !isReadOnly();
}
@Override
public void onResize(ResizeEvent event) {
rpc.resize(event.getHeight(), event.getWidth(),
Window.getClientWidth(), Window.getClientHeight());
- if (getState().isImmediate()) {
+ if (getState().immediate) {
getConnection().sendPendingVariableChanges();
}
}
boolean firstPaint = getWidget().connection == null;
getWidget().connection = client;
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().resizeLazy = uidl.hasAttribute(UIConstants.RESIZE_LAZY);
String newTheme = uidl.getStringAttribute("theme");
if (getWidget().theme != null && !newTheme.equals(getWidget().theme)) {
// this also implicitly removes old styles
String styles = "";
styles += getWidget().getStylePrimaryName() + " ";
- if (getState().hasStyles()) {
- for (String style : getState().getStyles()) {
+ if (getState().styles != null && !getState().styles.isEmpty()) {
+ for (String style : getState().styles) {
styles += style + " ";
}
}
}
protected ComponentConnector getContent() {
- return (ComponentConnector) getState().getContent();
+ return (ComponentConnector) getState().content;
}
protected void onChildSizeChange() {
for (ComponentConnector child : getChildComponents()) {
getWrapper(child).setPosition(
- getState().getConnectorPosition(child));
+ getState().connectorToCssPosition.get(child));
}
};
addStateChangeHandler("errorMessage", new StateChangeHandler() {
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
- if (null != getState().getErrorMessage()) {
+ if (null != getState().errorMessage) {
if (getWidget().errorIndicatorElement == null) {
getWidget().errorIndicatorElement = DOM.createSpan();
getWidget().errorIndicatorElement
if (changedProperties.contains("caption")
|| changedProperties.contains("htmlContentAllowed")) {
// Set text
- if (getState().isHtmlContentAllowed()) {
- getWidget().setHtml(getState().getCaption());
+ if (getState().htmlContentAllowed) {
+ getWidget().setHtml(getState().caption);
} else {
- getWidget().setText(getState().getCaption());
+ getWidget().setText(getState().caption);
}
}
- getWidget().clickShortcut = getState().getClickShortcutKeyCode();
+ getWidget().clickShortcut = getState().clickShortcutKeyCode;
}
@Override
@Override
public void onClick(ClickEvent event) {
- if (getState().isDisableOnClick()) {
+ if (getState().disableOnClick) {
getWidget().setEnabled(false);
rpc.disableOnClick();
}
blurHandlerRegistration = EventHelper.updateBlurHandler(this,
blurHandlerRegistration);
- if (null != getState().getErrorMessage()) {
+ if (null != getState().errorMessage) {
if (getWidget().errorIndicatorElement == null) {
getWidget().errorIndicatorElement = DOM.createSpan();
getWidget().errorIndicatorElement.setInnerHTML(" ");
}
// Set text
- getWidget().setText(getState().getCaption());
- getWidget().setValue(getState().isChecked());
- getWidget().immediate = getState().isImmediate();
+ getWidget().setText(getState().caption);
+ getWidget().setValue(getState().checked);
+ getWidget().immediate = getState().immediate;
}
@Override
getWidget().filteringmode = uidl.getIntAttribute("filteringmode");
}
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().nullSelectionAllowed = uidl.hasAttribute("nullselect");
*/
public void updateStyleNames(UIDL uidl, ComponentState componentState) {
setStyleName(CLASSNAME + "-suggestpopup");
- if (componentState.hasStyles()) {
- for (String style : componentState.getStyles()) {
+ if (componentState.styles == null
+ || componentState.styles.isEmpty()) {
+ for (String style : componentState.styles) {
if (!"".equals(style)) {
addStyleDependentName(style);
}
super.onStateChanged(stateChangeEvent);
for (ComponentConnector child : getChildComponents()) {
- if (!getState().getChildCss().containsKey(child)) {
+ if (!getState().childCss.containsKey(child)) {
continue;
}
- String css = getState().getChildCss().get(child);
+ String css = getState().childCss.get(child);
Style style = child.getWidget().getElement().getStyle();
// should we remove styles also? How can we know what we have added
// as it is added directly to the child component?
// later on.
return;
}
- String templateName = getState().getTemplateName();
- String templateContents = getState().getTemplateContents();
+ String templateName = getState().templateName;
+ String templateContents = getState().templateContents;
if (templateName != null) {
// Get the HTML-template from client. Overrides templateContents
// For all contained widgets
for (ComponentConnector child : getChildComponents()) {
- String location = getState().getChildLocations().get(child);
+ String location = getState().childLocations.get(child);
try {
getWidget().setWidget(child.getWidget(), location);
} catch (final IllegalArgumentException e) {
// Save details
getWidget().client = client;
getWidget().paintableId = uidl.getId();
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().readonly = isReadOnly();
getWidget().enabled = isEnabled();
.getMapAttribute(DragAndDropWrapperConstants.HTML5_DATA_FLAVORS);
// Used to prevent wrapper from stealing tooltips when not defined
- getWidget().hasTooltip = getState().hasDescription();
+ getWidget().hasTooltip = getState().description != null;
}
}
// Set attributes
Style style = el.getStyle();
- style.setProperty("width", getState().getWidth());
- style.setProperty("height", getState().getHeight());
+ style.setProperty("width", getState().width);
+ style.setProperty("height", getState().height);
DOM.setElementProperty(el, "src",
getWidget().getSrc(uidl, client));
ComponentConnector paintable = ConnectorMap.get(client).getConnector(
this);
- String height = paintable.getState().getHeight();
- String width = paintable.getState().getWidth();
+ String height = paintable.getState().height;
+ String width = paintable.getState().width;
// Add width and height
html.append("width=\"" + Util.escapeAttribute(width) + "\" ");
super.onStateChanged(stateChangeEvent);
- getWidget().setAlternateText(getState().getAlternateText());
+ getWidget().setAlternateText(getState().alternateText);
getWidget().setSource(
getResourceUrl(AbstractEmbeddedState.SOURCE_RESOURCE));
getWidget().setName(getConnectorId());
getWidget().setSource(
getResourceUrl(AbstractEmbeddedState.SOURCE_RESOURCE));
- getWidget().setArchive(getState().getArchive());
- getWidget().setClassId(getState().getClassId());
- getWidget().setCodebase(getState().getCodebase());
- getWidget().setCodetype(getState().getCodetype());
- getWidget().setStandby(getState().getStandby());
- getWidget().setAlternateText(getState().getAlternateText());
- getWidget().setEmbedParams(getState().getEmbedParams());
+ getWidget().setArchive(getState().archive);
+ getWidget().setClassId(getState().classId);
+ getWidget().setCodebase(getState().codebase);
+ getWidget().setCodetype(getState().codetype);
+ getWidget().setStandby(getState().standby);
+ getWidget().setAlternateText(getState().alternateText);
+ getWidget().setEmbedParams(getState().embedParams);
getWidget().rebuildIfNeeded();
}
}
boolean legendEmpty = true;
- if (getState().getCaption() != null) {
- getWidget().caption.setInnerText(getState().getCaption());
+ if (getState().caption != null) {
+ getWidget().caption.setInnerText(getState().caption);
legendEmpty = false;
} else {
getWidget().caption.setInnerText("");
getWidget().removeStyleDependentName("nocaption");
}
- if (null != getState().getErrorMessage()) {
- getWidget().errorMessage
- .updateMessage(getState().getErrorMessage());
+ if (null != getState().errorMessage) {
+ getWidget().errorMessage.updateMessage(getState().errorMessage);
getWidget().errorMessage.setVisible(true);
} else {
getWidget().errorMessage.setVisible(false);
}
- if (getState().hasDescription()) {
- getWidget().desc.setInnerHTML(getState().getDescription());
+ if (getState().description != null) {
+ getWidget().desc.setInnerHTML(getState().description);
if (getWidget().desc.getParentElement() == null) {
getWidget().fieldSet.insertAfter(getWidget().desc,
getWidget().legend);
// first render footer so it will be easier to handle relative height of
// main layout
- if (getState().getFooter() != null) {
+ if (getState().footer != null) {
// render footer
- ComponentConnector newFooter = (ComponentConnector) getState()
- .getFooter();
+ ComponentConnector newFooter = (ComponentConnector) getState().footer;
Widget newFooterWidget = newFooter.getWidget();
if (getWidget().footer == null) {
getLayoutManager().addElementResizeListener(
}
}
- ComponentConnector newLayout = (ComponentConnector) getState()
- .getLayout();
+ ComponentConnector newLayout = (ComponentConnector) getState().layout;
Widget newLayoutWidget = newLayout.getWidget();
if (getWidget().lo == null) {
// Layout not rendered before
@Override
public boolean isReadOnly() {
- return super.isReadOnly() || getState().isPropertyReadOnly();
+ return super.isReadOnly() || getState().propertyReadOnly;
}
@Override
VFormLayoutTable formLayoutTable = getWidget().table;
- formLayoutTable.setMargins(new MarginInfo(getState()
- .getMarginsBitmask()));
- formLayoutTable.setSpacing(getState().isSpacing());
+ formLayoutTable.setMargins(new MarginInfo(getState().marginsBitmask));
+ formLayoutTable.setSpacing(getState().spacing);
}
// FIXME This incorrectly depends on AbstractFieldConnector
if (component instanceof AbstractFieldConnector) {
- hideErrors = ((AbstractFieldConnector) component).getState()
- .isHideErrors();
+ hideErrors = ((AbstractFieldConnector) component).getState().hideErrors;
}
- getWidget().table.updateError(component.getWidget(), component
- .getState().getErrorMessage(), hideErrors);
+ getWidget().table.updateError(component.getWidget(),
+ component.getState().errorMessage, hideErrors);
}
@Override
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
*/
private String[] getStylesFromState(ComponentState state, boolean enabled) {
List<String> styles = new ArrayList<String>();
- if (state.hasStyles()) {
- for (String name : state.getStyles()) {
+ if (state.styles != null && !state.styles.isEmpty()) {
+ for (String name : state.styles) {
styles.add(name);
}
}
}
- if (state.getCaption() != null) {
+ if (state.caption != null) {
if (captionText == null) {
captionText = DOM.createSpan();
DOM.insertChild(getElement(), captionText, icon == null ? 0
: 1);
}
- String c = state.getCaption();
+ String c = state.caption;
if (c == null) {
c = "";
} else {
// TODO should span also be removed
}
- if (state.hasDescription() && captionText != null) {
+ if (state.description != null && captionText != null) {
addStyleDependentName("hasdescription");
} else {
removeStyleDependentName("hasdescription");
return;
}
- int cols = getState().getColumns();
- int rows = getState().getRows();
+ int cols = getState().columns;
+ int rows = getState().rows;
layout.columnWidths = new int[cols];
layout.rowHeights = new int[rows];
layout.rowExpandRatioArray = uidl.getIntArrayAttribute("rowExpand");
layout.updateMarginStyleNames(new MarginInfo(getState()
- .getMarginsBitmask()));
+.marginsBitmask));
- layout.updateSpacingStyleName(getState().isSpacing());
+ layout.updateSpacingStyleName(getState().spacing);
if (needCaptionUpdate) {
needCaptionUpdate = false;
getWidget().setUrl(
getResourceUrl(AbstractEmbeddedState.SOURCE_RESOURCE));
- getWidget().setAltText(getState().getAlternateText());
+ getWidget().setAltText(getState().alternateText);
}
protected final ClickEventHandler clickEventHandler = new ClickEventHandler(
}
ComponentState state = connector.getState();
s += " sizing: "
- + getSizeDefinition(direction == VERTICAL ? state
- .getHeight() : state.getWidth()) + "\n";
+ + getSizeDefinition(direction == VERTICAL ? state.height
+ : state.width) + "\n";
if (needsLayout) {
s += "Needs layout\n";
.getIntAttribute("targetWidth") : -1;
// Set link caption
- getWidget().captionElement.setInnerText(getState().getCaption());
+ getWidget().captionElement.setInnerText(getState().caption);
// handle error
- if (null != getState().getErrorMessage()) {
+ if (null != getState().errorMessage) {
if (getWidget().errorIndicatorElement == null) {
getWidget().errorIndicatorElement = DOM.createDiv();
DOM.setElementProperty(getWidget().errorIndicatorElement,
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.client.ui.Icon;
import com.vaadin.client.ui.SimpleManagedLayout;
+import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.menubar.MenuBarConstants;
UIDL options = uidl.getChildUIDL(0);
- if (null != getState() && !getState().isUndefinedWidth()) {
+ if (null != getState()
+ && !ComponentStateUtil.isUndefinedWidth(getState())) {
UIDL moreItemUIDL = options.getChildUIDL(0);
StringBuffer itemHTML = new StringBuffer();
// this is the top-level style that also propagates to items -
// any item specific styles are set above in
// currentItem.updateFromUIDL(item, client)
- if (getState().hasStyles()) {
- for (String style : getState().getStyles()) {
+ if (getState().styles != null && !getState().styles.isEmpty()) {
+ for (String style : getState().styles) {
currentMenu.addStyleDependentName(style);
}
}
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
- getWidget().disableOnClick = getState().isDisableOnClick();
+ getWidget().disableOnClick = getState().disableOnClick;
focusHandlerRegistration = EventHelper.updateFocusHandler(this,
focusHandlerRegistration);
blurHandlerRegistration = EventHelper.updateBlurHandler(this,
blurHandlerRegistration);
// Set text
- if (getState().isHtmlContentAllowed()) {
- getWidget().setHTML(getState().getCaption());
+ if (getState().htmlContentAllowed) {
+ getWidget().setHTML(getState().caption);
} else {
- getWidget().setText(getState().getCaption());
+ getWidget().setText(getState().caption);
}
// handle error
- if (null != getState().getErrorMessage()) {
+ if (null != getState().errorMessage) {
if (getWidget().errorIndicatorElement == null) {
getWidget().errorIndicatorElement = DOM.createSpan();
getWidget().errorIndicatorElement
getWidget().disabled = !isEnabled();
getWidget().multiselect = "multi".equals(uidl
.getStringAttribute("selectmode"));
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().nullSelectionAllowed = uidl
.getBooleanAttribute("nullselect");
getWidget().nullSelectionItemAvailable = uidl
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
for (ComponentConnector child : getChildComponents()) {
VLayoutSlot slot = layout.getSlotForChild(child.getWidget());
- AlignmentInfo alignment = new AlignmentInfo(getState()
- .getChildData().get(child).getAlignmentBitmask());
+ AlignmentInfo alignment = new AlignmentInfo(
+ getState().childData.get(child).alignmentBitmask);
slot.setAlignment(alignment);
- double expandRatio = getState().getChildData().get(child)
- .getExpandRatio();
+ double expandRatio = getState().childData.get(child).expandRatio;
slot.setExpandRatio(expandRatio);
}
- layout.updateMarginStyleNames(new MarginInfo(getState()
- .getMarginsBitmask()));
- layout.updateSpacingStyleName(getState().isSpacing());
+ layout.updateMarginStyleNames(new MarginInfo(getState().marginsBitmask));
+ layout.updateSpacingStyleName(getState().spacing);
getLayoutManager().setNeedsLayout(this);
}
private String getDefinedSize(boolean isVertical) {
if (isVertical) {
- return getState().getHeight();
+ return getState().height == null ? "" : getState().height;
} else {
- return getState().getWidth();
+ return getState().width == null ? "" : getState().width;
}
}
+ "-deco");
getWidget().captionNode.setClassName(VPanel.CLASSNAME + "-caption");
boolean hasCaption = false;
- if (getState().getCaption() != null
- && !"".equals(getState().getCaption())) {
- getWidget().setCaption(getState().getCaption());
+ if (getState().caption != null && !"".equals(getState().caption)) {
+ getWidget().setCaption(getState().caption);
hasCaption = true;
} else {
getWidget().setCaption("");
String captionClass = captionBaseClass;
String contentClass = contentBaseClass;
String decoClass = decoBaseClass;
- if (getState().hasStyles()) {
- for (String style : getState().getStyles()) {
+ if (getState().styles != null && !getState().styles.isEmpty()) {
+ for (String style : getState().styles) {
captionClass += " " + captionBaseClass + "-" + style;
contentClass += " " + contentBaseClass + "-" + style;
decoClass += " " + decoBaseClass + "-" + style;
}
getWidget().setErrorIndicatorVisible(
- null != getState().getErrorMessage());
+null != getState().errorMessage);
// We may have actions attached to this panel
if (uidl.getChildCount() > 0) {
}
}
- if (getState().getScrollTop() != getWidget().scrollTop) {
+ if (getState().scrollTop != getWidget().scrollTop) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
- uidlScrollTop = getState().getScrollTop();
+ uidlScrollTop = getState().scrollTop;
}
- if (getState().getScrollLeft() != getWidget().scrollLeft) {
+ if (getState().scrollLeft != getWidget().scrollLeft) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
- uidlScrollLeft = getState().getScrollLeft();
+ uidlScrollLeft = getState().scrollLeft;
}
// And apply tab index
- getWidget().contentNode.setTabIndex(getState().getTabIndex());
+ getWidget().contentNode.setTabIndex(getState().tabIndex);
}
@Override
// showPopupOnTop(popup, hostReference);
getWidget().preparePopup(getWidget().popup);
getWidget().popup.updateFromUIDL(popupUIDL, client);
- if (getState().hasStyles()) {
+ if (getState().styles != null && !getState().styles.isEmpty()) {
final StringBuffer styleBuf = new StringBuffer();
final String primaryName = getWidget().popup
.getStylePrimaryName();
styleBuf.append(primaryName);
- for (String style : getState().getStyles()) {
+ for (String style : getState().styles) {
styleBuf.append(" ");
styleBuf.append(primaryName);
styleBuf.append("-");
}
getWidget().setReadOnly(isReadOnly());
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
int newMaxLength = uidl.hasAttribute("maxLength") ? uidl
.getIntAttribute("maxLength") : -1;
if (newMaxLength >= 0) {
super.onStateChanged(stateChangeEvent);
getWidget().setId(getConnectorId());
- getWidget().setImmediate(getState().isImmediate());
+ getWidget().setImmediate(getState().immediate);
getWidget().setDisabled(!isEnabled());
getWidget().setReadOnly(isReadOnly());
- getWidget().setOrientation(getState().getOrientation());
- getWidget().setMinValue(getState().getMinValue());
- getWidget().setMaxValue(getState().getMaxValue());
- getWidget().setResolution(getState().getResolution());
- getWidget().setValue(getState().getValue(), false);
- getWidget().setFeedbackValue(getState().getValue());
+ getWidget().setOrientation(getState().orientation);
+ getWidget().setMinValue(getState().minValue);
+ getWidget().setMaxValue(getState().maxValue);
+ getWidget().setResolution(getState().resolution);
+ getWidget().setValue(getState().value, false);
+ getWidget().setFeedbackValue(getState().value);
getWidget().buildBase();
}
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().setEnabled(isEnabled());
clickEventHandler.handleEventHandlerRegistration();
- if (getState().hasStyles()) {
- getWidget().componentStyleNames = getState().getStyles();
+ if (getState().styles != null && !getState().styles.isEmpty()) {
+ getWidget().componentStyleNames = getState().styles;
} else {
getWidget().componentStyleNames = new LinkedList<String>();
}
// Splitter updates
- SplitterState splitterState = getState().getSplitterState();
+ SplitterState splitterState = getState().splitterState;
getWidget().setStylenames();
- getWidget().minimumPosition = splitterState.getMinPosition()
- + splitterState.getMinPositionUnit();
+ getWidget().minimumPosition = splitterState.minPosition
+ + splitterState.minPositionUnit;
- getWidget().maximumPosition = splitterState.getMaxPosition()
- + splitterState.getMaxPositionUnit();
+ getWidget().maximumPosition = splitterState.maxPosition
+ + splitterState.maxPositionUnit;
- getWidget().position = splitterState.getPosition()
- + splitterState.getPositionUnit();
+ getWidget().position = splitterState.position
+ + splitterState.positionUnit;
// This is needed at least for cases like #3458 to take
// appearing/disappearing scrollbars into account.
}
private ComponentConnector getFirstChild() {
- return (ComponentConnector) getState().getFirstChild();
+ return (ComponentConnector) getState().firstChild;
}
private ComponentConnector getSecondChild() {
- return (ComponentConnector) getState().getSecondChild();
+ return (ComponentConnector) getState().secondChild;
}
@Override
}
getWidget().paintableId = uidl.getStringAttribute("id");
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
int previousTotalRows = getWidget().totalRows;
getWidget().updateTotalRows(uidl);
@Override
public boolean isReadOnly() {
- return super.isReadOnly() || getState().isPropertyReadOnly();
+ return super.isReadOnly() || getState().propertyReadOnly;
}
@Override
void handleStyleNames(UIDL uidl, ComponentState state) {
// Add proper stylenames for all elements (easier to prevent unwanted
// style inheritance)
- if (state.hasStyles()) {
- final List<String> styles = state.getStyles();
+ if (state.styles != null && !state.styles.isEmpty()) {
+ final List<String> styles = state.styles;
if (!currentStyle.equals(styles.toString())) {
currentStyle = styles.toString();
final String tabsBaseClass = TABS_CLASSNAME;
if (!isDynamicWidth()) {
ComponentConnector paintable = ConnectorMap.get(client)
.getConnector(this);
- DOM.setStyleAttribute(tabs, "width", paintable.getState()
- .getWidth());
+ DOM.setStyleAttribute(tabs, "width", paintable.getState().width);
}
// Make sure scrollerIndex is valid
getWidget().setReadOnly(isReadOnly());
- getWidget().setInputPrompt(getState().getInputPrompt());
- getWidget().setMaxLength(getState().getMaxLength());
- getWidget().setImmediate(getState().isImmediate());
+ getWidget().setInputPrompt(getState().inputPrompt);
+ getWidget().setMaxLength(getState().maxLength);
+ getWidget().setImmediate(getState().immediate);
getWidget().listenTextChangeEvents = hasEventListener("ie");
if (getWidget().listenTextChangeEvents) {
getWidget().sinkEvents(VTextField.TEXTCHANGE_EVENTS);
getWidget().attachCutEventListener(getWidget().getElement());
}
- getWidget().setColumns(getState().getColumns());
+ getWidget().setColumns(getState().columns);
- final String text = getState().getText();
+ final String text = getState().text;
/*
* We skip the text content update if field has been repainted, but text
getWidget().paintableId = uidl.getId();
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().disabled = !isEnabled();
getWidget().readonly = isReadOnly();
@Override
public boolean isReadOnly() {
- return super.isReadOnly() || getState().isPropertyReadOnly();
+ return super.isReadOnly() || getState().propertyReadOnly;
}
@Override
getWidget().submit();
return;
}
- getWidget().setImmediate(getState().isImmediate());
+ getWidget().setImmediate(getState().immediate);
getWidget().client = client;
getWidget().paintableId = uidl.getId();
getWidget().nextUploadId = uidl.getIntAttribute("nextid");
import com.vaadin.client.ui.ClickEventHandler;
import com.vaadin.client.ui.PostLayoutListener;
import com.vaadin.client.ui.ShortcutActionHandler;
-import com.vaadin.client.ui.SimpleManagedLayout;
import com.vaadin.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
+import com.vaadin.client.ui.SimpleManagedLayout;
import com.vaadin.client.ui.layout.MayScrollChildren;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
+ "_window_close");
if (isRealUpdate(uidl)) {
- if (getState().isModal() != getWidget().vaadinModality) {
+ if (getState().modal != getWidget().vaadinModality) {
getWidget().setVaadinModality(!getWidget().vaadinModality);
}
if (!getWidget().isAttached()) {
// possible centering
getWidget().show();
}
- if (getState().isResizable() != getWidget().resizable) {
- getWidget().setResizable(getState().isResizable());
+ if (getState().resizable != getWidget().resizable) {
+ getWidget().setResizable(getState().resizable);
}
- getWidget().resizeLazy = getState().isResizeLazy();
+ getWidget().resizeLazy = getState().resizeLazy;
- getWidget().setDraggable(getState().isDraggable());
+ getWidget().setDraggable(getState().draggable);
// Caption must be set before required header size is measured. If
// the caption attribute is missing the caption should be cleared.
if (getIcon() != null) {
iconURL = getIcon();
}
- getWidget().setCaption(getState().getCaption(), iconURL);
+ getWidget().setCaption(getState().caption, iconURL);
}
getWidget().visibilityChangesDisabled = true;
clickEventHandler.handleEventHandlerRegistration();
- getWidget().immediate = getState().isImmediate();
+ getWidget().immediate = getState().immediate;
getWidget().setClosable(!isReadOnly());
// Initialize the position form UIDL
- int positionx = getState().getPositionX();
- int positiony = getState().getPositionY();
+ int positionx = getState().positionX;
+ int positiony = getState().positionY;
if (positionx >= 0 || positiony >= 0) {
if (positionx < 0) {
positionx = 0;
}
// setting scrollposition must happen after children is rendered
- getWidget().contentPanel.setScrollPosition(getState().getScrollTop());
- getWidget().contentPanel.setHorizontalScrollPosition(getState()
- .getScrollLeft());
+ getWidget().contentPanel.setScrollPosition(getState().scrollTop);
+ getWidget().contentPanel
+ .setHorizontalScrollPosition(getState().scrollLeft);
// Center this window on screen if requested
// This had to be here because we might not know the content size before
// everything is painted into the window
// centered is this is unset on move/resize
- getWidget().centered = getState().isCentered();
+ getWidget().centered = getState().centered;
getWidget().setVisible(true);
// ensure window is not larger than browser window
connectorToPosition.put(c.getConnectorId(), getPosition(c)
.getCSSString());
}
- getState().setConnectorToCssPosition(connectorToPosition);
+ getState().connectorToCssPosition = connectorToPosition;
}
* @deprecated Since 7.0, replaced by
* {@link #addLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void addListener(LayoutClickListener listener) {
addLayoutClickListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void removeListener(LayoutClickListener listener) {
removeLayoutClickListener(listener);
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.server.Terminal;
import com.vaadin.shared.ComponentConstants;
import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.tools.ReflectTools;
/**
*/
@Override
public void setId(String id) {
- getState().setId(id);
+ getState().id = id;
}
/*
*/
@Override
public String getId() {
- return getState().getId();
+ return getState().id;
}
/**
@Override
public String getStyleName() {
String s = "";
- if (getState().getStyles() != null) {
- for (final Iterator<String> it = getState().getStyles().iterator(); it
+ if (getState().styles != null) {
+ for (final Iterator<String> it = getState().styles.iterator(); it
.hasNext();) {
s += it.next();
if (it.hasNext()) {
@Override
public void setStyleName(String style) {
if (style == null || "".equals(style)) {
- getState().setStyles(null);
+ getState().styles = null;
return;
}
- if (getState().getStyles() == null) {
- getState().setStyles(new ArrayList<String>());
+ if (getState().styles == null) {
+ getState().styles = new ArrayList<String>();
}
- List<String> styles = getState().getStyles();
+ List<String> styles = getState().styles;
styles.clear();
String[] styleParts = style.split(" +");
for (String part : styleParts) {
return;
}
- if (getState().getStyles() == null) {
- getState().setStyles(new ArrayList<String>());
+ if (getState().styles == null) {
+ getState().styles = new ArrayList<String>();
}
- List<String> styles = getState().getStyles();
+ List<String> styles = getState().styles;
if (!styles.contains(style)) {
styles.add(style);
}
@Override
public void removeStyleName(String style) {
- if (getState().getStyles() != null) {
+ if (getState().styles != null) {
String[] styleParts = style.split(" +");
for (String part : styleParts) {
if (part.length() > 0) {
- getState().getStyles().remove(part);
+ getState().styles.remove(part);
}
}
}
*/
@Override
public String getCaption() {
- return getState().getCaption();
+ return getState().caption;
}
/**
*/
@Override
public void setCaption(String caption) {
- getState().setCaption(caption);
+ getState().caption = caption;
}
/*
*/
@Override
public boolean isEnabled() {
- return getState().isEnabled();
+ return getState().enabled;
}
/*
*/
@Override
public void setEnabled(boolean enabled) {
- getState().setEnabled(enabled);
+ getState().enabled = enabled;
}
/*
* interface.
*/
public boolean isImmediate() {
- return getState().isImmediate();
+ return getState().immediate;
}
/**
* @see Component#isImmediate()
*/
public void setImmediate(boolean immediate) {
- getState().setImmediate(immediate);
+ getState().immediate = immediate;
}
/*
*/
@Override
public boolean isVisible() {
- return getState().isVisible();
+ return getState().visible;
}
/*
*/
@Override
public void setVisible(boolean visible) {
- if (getState().isVisible() == visible) {
+ if (getState().visible == visible) {
return;
}
- getState().setVisible(visible);
+ getState().visible = visible;
if (getParent() != null) {
// Must always repaint the parent (at least the hierarchy) when
// visibility of a child component changes.
* @return component's description <code>String</code>
*/
public String getDescription() {
- return getState().getDescription();
+ return getState().description;
}
/**
* the new description string for the component.
*/
public void setDescription(String description) {
- getState().setDescription(description);
+ getState().description = description;
}
/*
*/
@Override
public boolean isReadOnly() {
- return getState().isReadOnly();
+ return getState().readOnly;
}
/*
*/
@Override
public void setReadOnly(boolean readOnly) {
- getState().setReadOnly(readOnly);
+ getState().readOnly = readOnly;
}
/*
if (getHeight() >= 0
&& (getHeightUnits() != Unit.PERCENTAGE || ComponentSizeValidator
.parentCanDefineHeight(this))) {
- getState().setHeight("" + getCSSHeight());
+ getState().height = "" + getCSSHeight();
} else {
- getState().setHeight("");
+ getState().height = "";
}
if (getWidth() >= 0
&& (getWidthUnits() != Unit.PERCENTAGE || ComponentSizeValidator
.parentCanDefineWidth(this))) {
- getState().setWidth("" + getCSSWidth());
+ getState().width = "" + getCSSWidth();
} else {
- getState().setWidth("");
+ getState().width = "";
}
ErrorMessage error = getErrorMessage();
if (null != error) {
- getState().setErrorMessage(error.getFormattedHtmlMessage());
+ getState().errorMessage = error.getFormattedHtmlMessage();
} else {
- getState().setErrorMessage(null);
+ getState().errorMessage = null;
}
}
eventRouter.addListener(eventType, target, method);
if (needRepaint) {
- getState().addRegisteredEventListener(eventIdentifier);
+ ComponentStateUtil.addRegisteredEventListener(getState(),
+ eventIdentifier);
}
}
if (eventRouter != null) {
eventRouter.removeListener(eventType, target);
if (!eventRouter.hasListeners(eventType)) {
- getState().removeRegisteredEventListener(eventIdentifier);
+ ComponentStateUtil.removeRegisteredEventListener(getState(),
+ eventIdentifier);
}
}
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* @deprecated Since 7.0, replaced by
* {@link #addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)}
**/
+ @Override
@Deprecated
public void addListener(ComponentAttachListener listener) {
addComponentAttachListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #addComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)}
**/
+ @Override
@Deprecated
public void addListener(ComponentDetachListener listener) {
addComponentDetachListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)}
**/
+ @Override
@Deprecated
public void removeListener(ComponentAttachListener listener) {
removeComponentAttachListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)}
**/
+ @Override
@Deprecated
public void removeListener(ComponentDetachListener listener) {
removeComponentDetachListener(listener);
@Override
public void setVisible(boolean visible) {
- if (getState().isVisible() == visible) {
+ if (getState().visible == visible) {
return;
}
* content.
*/
public void setAlternateText(String altText) {
- if (altText != getState().getAlternateText()
- || (altText != null && !altText.equals(getState()
- .getAlternateText()))) {
- getState().setAlternateText(altText);
+ if (altText != getState().alternateText
+ || (altText != null && !altText
+ .equals(getState().alternateText))) {
+ getState().alternateText = altText;
requestRepaint();
}
}
* @returns Alternate text
*/
public String getAlternateText() {
- return getState().getAlternateText();
+ return getState().alternateText;
}
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
*/
@Override
public boolean isModified() {
- return getState().isModified();
+ return getState().modified;
}
private void setModified(boolean modified) {
- getState().setModified(modified);
+ getState().modified = modified;
}
/**
// Sets the new data source
dataSource = newDataSource;
- getState().setPropertyReadOnly(
- dataSource == null ? false : dataSource.isReadOnly());
+ getState().propertyReadOnly = dataSource == null ? false : dataSource
+ .isReadOnly();
// Check if the current converter is compatible.
if (newDataSource != null
* @deprecated Since 7.0, replaced by
* {@link #addValueChangeListener(com.vaadin.data.Property.ValueChangeListener)}
**/
+ @Override
@Deprecated
public void addListener(Property.ValueChangeListener listener) {
addValueChangeListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeValueChangeListener(com.vaadin.data.Property.ValueChangeListener)}
**/
+ @Override
@Deprecated
public void removeListener(Property.ValueChangeListener listener) {
removeValueChangeListener(listener);
*/
@Override
public void readOnlyStatusChange(Property.ReadOnlyStatusChangeEvent event) {
- getState().setPropertyReadOnly(event.getProperty().isReadOnly());
+ getState().propertyReadOnly = event.getProperty().isReadOnly();
}
/**
* @deprecated Since 7.0, replaced by
* {@link #addReadOnlyStatusChangeListener(com.vaadin.data.Property.ReadOnlyStatusChangeListener)}
**/
+ @Override
@Deprecated
public void addListener(Property.ReadOnlyStatusChangeListener listener) {
addReadOnlyStatusChangeListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeReadOnlyStatusChangeListener(com.vaadin.data.Property.ReadOnlyStatusChangeListener)}
**/
+ @Override
@Deprecated
public void removeListener(Property.ReadOnlyStatusChangeListener listener) {
removeReadOnlyStatusChangeListener(listener);
*/
@Override
public int getTabIndex() {
- return getState().getTabIndex();
+ return getState().tabIndex;
}
/*
*/
@Override
public void setTabIndex(int tabIndex) {
- getState().setTabIndex(tabIndex);
+ getState().tabIndex = tabIndex;
}
/**
*/
@Override
public boolean isRequired() {
- return getState().isRequired();
+ return getState().required;
}
/**
*/
@Override
public void setRequired(boolean required) {
- getState().setRequired(required);
+ getState().required = required;
}
/**
super.beforeClientResponse(initial);
// Hide the error indicator if needed
- getState().setHideErrors(shouldHideErrors());
+ getState().hideErrors = shouldHideErrors();
}
/**
}
private void componentRemoved(Component c) {
- getState().getChildData().remove(c);
+ getState().childData.remove(c);
}
private void componentAdded(Component c) {
- getState().getChildData().put(c, new ChildComponentData());
+ getState().childData.put(c, new ChildComponentData());
}
/**
@Override
public void setComponentAlignment(Component childComponent,
Alignment alignment) {
- ChildComponentData childData = getState().getChildData().get(
+ ChildComponentData childData = getState().childData.get(
childComponent);
if (childData != null) {
// Alignments are bit masks
- childData.setAlignmentBitmask(alignment.getBitMask());
+ childData.alignmentBitmask = alignment.getBitMask();
} else {
throw new IllegalArgumentException(
"Component must be added to layout before using setComponentAlignment()");
*/
@Override
public Alignment getComponentAlignment(Component childComponent) {
- ChildComponentData childData = getState().getChildData().get(
+ ChildComponentData childData = getState().childData.get(
childComponent);
if (childData == null) {
throw new IllegalArgumentException(
"The given component is not a child of this layout");
}
- return new Alignment(childData.getAlignmentBitmask());
+ return new Alignment(childData.alignmentBitmask);
}
/*
*/
@Override
public void setSpacing(boolean spacing) {
- getState().setSpacing(spacing);
+ getState().spacing = spacing;
}
/*
*/
@Override
public boolean isSpacing() {
- return getState().isSpacing();
+ return getState().spacing;
}
/**
* @param ratio
*/
public void setExpandRatio(Component component, float ratio) {
- ChildComponentData childData = getState().getChildData().get(component);
+ ChildComponentData childData = getState().childData.get(component);
if (childData == null) {
throw new IllegalArgumentException(
"The given component is not a child of this layout");
}
- childData.setExpandRatio(ratio);
+ childData.expandRatio = ratio;
}
/**
* @return expand ratio of given component, 0.0f by default.
*/
public float getExpandRatio(Component component) {
- ChildComponentData childData = getState().getChildData().get(component);
+ ChildComponentData childData = getState().childData.get(component);
if (childData == null) {
throw new IllegalArgumentException(
"The given component is not a child of this layout");
}
- return childData.getExpandRatio();
+ return childData.expandRatio;
}
@Override
* @deprecated Since 7.0, replaced by
* {@link #addLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void addListener(LayoutClickListener listener) {
addLayoutClickListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void removeListener(LayoutClickListener listener) {
removeLayoutClickListener(listener);
*/
@Override
public MarginInfo getMargin() {
- return new MarginInfo(getState().getMarginsBitmask());
+ return new MarginInfo(getState().marginsBitmask);
}
/*
*/
@Override
public void setMargin(MarginInfo marginInfo) {
- getState().setMarginsBitmask(marginInfo.getBitMask());
+ getState().marginsBitmask = marginInfo.getBitMask();
}
}
@Override
public void setSplitterPosition(float position) {
- getSplitterState().setPosition(position);
+ getSplitterState().position = position;
}
};
// detach old
removeComponent(getFirstComponent());
}
- getState().setFirstChild(c);
+ getState().firstChild = c;
if (c != null) {
super.addComponent(c);
}
// detach old
removeComponent(getSecondComponent());
}
- getState().setSecondChild(c);
+ getState().secondChild = c;
if (c != null) {
super.addComponent(c);
}
* @return the first component of this split panel
*/
public Component getFirstComponent() {
- return (Component) getState().getFirstChild();
+ return (Component) getState().firstChild;
}
/**
* @return the second component of this split panel
*/
public Component getSecondComponent() {
- return (Component) getState().getSecondChild();
+ return (Component) getState().secondChild;
}
/**
public void removeComponent(Component c) {
super.removeComponent(c);
if (c == getFirstComponent()) {
- getState().setFirstChild(null);
+ getState().firstChild = null;
} else if (c == getSecondComponent()) {
- getState().setSecondChild(null);
+ getState().secondChild = null;
}
markAsDirty();
}
pos = Math.round(pos);
}
SplitterState splitterState = getSplitterState();
- splitterState.setPosition(pos);
- splitterState.setPositionUnit(unit.getSymbol());
- splitterState.setPositionReversed(reverse);
+ splitterState.position = pos;
+ splitterState.positionUnit = unit.getSymbol();
+ splitterState.positionReversed = reverse;
posUnit = unit;
}
* @return position of the splitter
*/
public float getSplitPosition() {
- return getSplitterState().getPosition();
+ return getSplitterState().position;
}
/**
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS
*/
public void setMinSplitPosition(int pos, Unit unit) {
- setSplitPositionLimits(pos, unit, getSplitterState().getMaxPosition(),
+ setSplitPositionLimits(pos, unit, getSplitterState().maxPosition,
posMaxUnit);
}
* @return the minimum position of the splitter
*/
public float getMinSplitPosition() {
- return getSplitterState().getMinPosition();
+ return getSplitterState().minPosition;
}
/**
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS
*/
public void setMaxSplitPosition(float pos, Unit unit) {
- setSplitPositionLimits(getSplitterState().getMinPosition(), posMinUnit,
+ setSplitPositionLimits(getSplitterState().minPosition, posMinUnit,
pos, unit);
}
* @return the maximum position of the splitter
*/
public float getMaxSplitPosition() {
- return getSplitterState().getMaxPosition();
+ return getSplitterState().maxPosition;
}
/**
SplitterState state = getSplitterState();
- state.setMinPosition(minPos);
- state.setMinPositionUnit(minPosUnit.getSymbol());
+ state.minPosition = minPos;
+ state.minPositionUnit = minPosUnit.getSymbol();
posMinUnit = minPosUnit;
- state.setMaxPosition(maxPos);
- state.setMaxPositionUnit(maxPosUnit.getSymbol());
+ state.maxPosition = maxPos;
+ state.maxPositionUnit = maxPosUnit.getSymbol();
posMaxUnit = maxPosUnit;
}
* Set <code>true</code> if locked, <code>false</code> otherwise.
*/
public void setLocked(boolean locked) {
- getSplitterState().setLocked(locked);
+ getSplitterState().locked = locked;
}
/**
* @return <code>true</code> if locked, <code>false</code> otherwise.
*/
public boolean isLocked() {
- return getSplitterState().isLocked();
+ return getSplitterState().locked;
}
/**
}
private SplitterState getSplitterState() {
- return getState().getSplitterState();
+ return getState().splitterState;
}
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.event.FieldEvents.TextChangeEvent;
import com.vaadin.event.FieldEvents.TextChangeListener;
import com.vaadin.event.FieldEvents.TextChangeNotifier;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.ui.textfield.AbstractTextFieldState;
import com.vaadin.shared.ui.textfield.TextFieldConstants;
if (value == null) {
value = getNullRepresentation();
}
- getState().setText(value);
+ getState().text = value;
}
@Override
* @return the maxLength
*/
public int getMaxLength() {
- return getState().getMaxLength();
+ return getState().maxLength;
}
/**
* the maxLength to set
*/
public void setMaxLength(int maxLength) {
- getState().setMaxLength(maxLength);
+ getState().maxLength = maxLength;
}
/**
* @return the number of columns in the editor.
*/
public int getColumns() {
- return getState().getColumns();
+ return getState().columns;
}
/**
if (columns < 0) {
columns = 0;
}
- getState().setColumns(columns);
+ getState().columns = columns;
}
/**
* @return the current input prompt, or null if not enabled
*/
public String getInputPrompt() {
- return getState().getInputPrompt();
+ return getState().inputPrompt;
}
/**
* @param inputPrompt
*/
public void setInputPrompt(String inputPrompt) {
- getState().setInputPrompt(inputPrompt);
+ getState().inputPrompt = inputPrompt;
}
/* ** Text Change Events ** */
* @deprecated Since 7.0, replaced by
* {@link #addTextChangeListener(TextChangeListener)}
**/
+ @Override
@Deprecated
public void addListener(TextChangeListener listener) {
addTextChangeListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeTextChangeListener(TextChangeListener)}
**/
+ @Override
@Deprecated
public void removeListener(TextChangeListener listener) {
removeTextChangeListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #addFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void addListener(FocusListener listener) {
addFocusListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void removeListener(FocusListener listener) {
removeFocusListener(listener);
/**
* @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void addListener(BlurListener listener) {
addBlurListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void removeListener(BlurListener listener) {
removeBlurListener(listener);
/**
* @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void addListener(BlurListener listener) {
addBlurListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void removeListener(BlurListener listener) {
removeBlurListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #addFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void addListener(FocusListener listener) {
addFocusListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void removeListener(FocusListener listener) {
removeFocusListener(listener);
}
clickShortcut = new ClickShortcut(this, keyCode, modifiers);
addShortcutListener(clickShortcut);
- getState().setClickShortcutKeyCode(clickShortcut.getKeyCode());
+ getState().clickShortcutKeyCode = clickShortcut.getKeyCode();
}
/**
if (clickShortcut != null) {
removeShortcutListener(clickShortcut);
clickShortcut = null;
- getState().setClickShortcutKeyCode(0);
+ getState().clickShortcutKeyCode = 0;
}
}
* @return true if the button is disabled when clicked, false otherwise
*/
public boolean isDisableOnClick() {
- return getState().isDisableOnClick();
+ return getState().disableOnClick;
}
/**
* true to disable button when it is clicked, false otherwise
*/
public void setDisableOnClick(boolean disableOnClick) {
- getState().setDisableOnClick(disableOnClick);
+ getState().disableOnClick = disableOnClick;
}
/*
*/
@Override
public int getTabIndex() {
- return getState().getTabIndex();
+ return getState().tabIndex;
}
/*
*/
@Override
public void setTabIndex(int tabIndex) {
- getState().setTabIndex(tabIndex);
+ getState().tabIndex = tabIndex;
}
@Override
* <code>false</code> otherwise
*/
public void setHtmlContentAllowed(boolean htmlContentAllowed) {
- getState().setHtmlContentAllowed(htmlContentAllowed);
+ getState().htmlContentAllowed = htmlContentAllowed;
}
/**
* <code>false</code> otherwise
*/
public boolean isHtmlContentAllowed() {
- return getState().isHtmlContentAllowed();
+ return getState().htmlContentAllowed;
}
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
if (newValue == null) {
newValue = false;
}
- getState().setChecked(newValue);
+ getState().checked = newValue;
}
public void addBlurListener(BlurListener listener) {
@Override
public void beforeClientResponse(boolean initial) {
super.beforeClientResponse(initial);
- getState().getChildCss().clear();
+ getState().childCss.clear();
for (Iterator<Component> ci = getComponentIterator(); ci.hasNext();) {
Component child = ci.next();
String componentCssString = getCss(child);
if (componentCssString != null) {
- getState().getChildCss().put(child, componentCssString);
+ getState().childCss.put(child, componentCssString);
}
}
* @deprecated Since 7.0, replaced by
* {@link #addLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void addListener(LayoutClickListener listener) {
addLayoutClickListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeLayoutClickListener(LayoutClickListener)}
**/
+ @Override
@Deprecated
public void removeListener(LayoutClickListener listener) {
removeLayoutClickListener(listener);
import java.util.Set;
import com.vaadin.server.JsonPaintTarget;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.ui.customlayout.CustomLayoutState;
/**
removeComponent(old);
}
slots.put(location, c);
- getState().getChildLocations().put(c, location);
+ getState().childLocations.put(c, location);
c.setParent(this);
fireComponentAttachEvent(c);
}
return;
}
slots.values().remove(c);
- getState().getChildLocations().remove(c);
+ getState().childLocations.remove(c);
super.removeComponent(c);
}
} else {
slots.put(newLocation, oldComponent);
slots.put(oldLocation, newComponent);
- getState().getChildLocations().put(newComponent, oldLocation);
- getState().getChildLocations().put(oldComponent, newLocation);
+ getState().childLocations.put(newComponent, oldLocation);
+ getState().childLocations.put(oldComponent, newLocation);
}
}
/** Get the name of the template */
public String getTemplateName() {
- return getState().getTemplateName();
+ return getState().templateName;
}
/** Get the contents of the template */
public String getTemplateContents() {
- return getState().getTemplateContents();
+ return getState().templateContents;
}
/**
* @param templateName
*/
public void setTemplateName(String templateName) {
- getState().setTemplateName(templateName);
- getState().setTemplateContents(null);
+ getState().templateName = templateName;
+ getState().templateContents = null;
}
/**
* @param templateContents
*/
public void setTemplateContents(String templateContents) {
- getState().setTemplateContents(templateContents);
- getState().setTemplateName(null);
+ getState().templateContents = templateContents;
+ getState().templateName = null;
}
@Override
public void paintContent(PaintTarget target) throws PaintException {
// Workaround to make the CommunicationManager read the template file
// and send it to the client
- String templateName = getState().getTemplateName();
+ String templateName = getState().templateName;
if (templateName != null && templateName.length() != 0) {
Set<Object> usedResources = ((JsonPaintTarget) target)
.getUsedResources();
* The base path
*/
public void setCodebase(String codebase) {
- if (codebase != getState().getCodebase()
+ if (codebase != getState().codebase
|| (codebase != null && !codebase.equals(getState()
- .getCodebase()))) {
- getState().setCodebase(codebase);
+.codebase))) {
+ getState().codebase = codebase;
requestRepaint();
}
}
* the codetype to set.
*/
public void setCodetype(String codetype) {
- if (codetype != getState().getCodetype()
+ if (codetype != getState().codetype
|| (codetype != null && !codetype.equals(getState()
- .getCodetype()))) {
- getState().setCodetype(codetype);
+.codetype))) {
+ getState().codetype = codetype;
requestRepaint();
}
}
* object
*/
public void setArchive(String archive) {
- if (archive != getState().getArchive()
- || (archive != null && !archive.equals(getState().getArchive()))) {
- getState().setArchive(archive);
+ if (archive != getState().archive
+ || (archive != null && !archive.equals(getState().archive))) {
+ getState().archive = archive;
requestRepaint();
}
}
public void setStandby(String standby) {
- if (standby != getState().getStandby()
- || (standby != null && !standby.equals(getState().getStandby()))) {
- getState().setStandby(standby);
+ if (standby != getState().standby
+ || (standby != null && !standby.equals(getState().standby))) {
+ getState().standby = standby;
requestRepaint();
}
}
* the value of the parameter.
*/
public void setParameter(String name, String value) {
- if (getState().getEmbedParams() == null) {
- getState().setEmbedParams(new HashMap<String, String>());
+ if (getState().embedParams == null) {
+ getState().embedParams = new HashMap<String, String>();
}
- getState().getEmbedParams().put(name, value);
+ getState().embedParams.put(name, value);
requestRepaint();
}
* @return the Value of parameter or null if not found.
*/
public String getParameter(String name) {
- return getState().getEmbedParams() != null ? getState()
- .getEmbedParams().get(name) : null;
+ return getState().embedParams != null ? getState().embedParams
+ .get(name) : null;
}
/**
* the name of the parameter to remove.
*/
public void removeParameter(String name) {
- if (getState().getEmbedParams() == null) {
+ if (getState().embedParams == null) {
return;
}
- getState().getEmbedParams().remove(name);
+ getState().embedParams.remove(name);
requestRepaint();
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.server.AbstractErrorMessage;
import com.vaadin.server.CompositeErrorMessage;
import com.vaadin.server.ErrorMessage;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.UserError;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.ui.form.FormState;
/**
* @return the Layout of the form.
*/
public Layout getLayout() {
- return (Layout) getState().getLayout();
+ return (Layout) getState().layout;
}
/**
// Replace the previous layout
layout.setParent(this);
- getState().setLayout(layout);
+ getState().layout = layout;
}
/**
* @return layout rendered below normal form contents.
*/
public Layout getFooter() {
- return (Layout) getState().getFooter();
+ return (Layout) getState().footer;
}
/**
footer = new HorizontalLayout();
}
- getState().setFooter(footer);
+ getState().footer = footer;
footer.setParent(this);
}
import com.vaadin.event.LayoutEvents.LayoutClickEvent;
import com.vaadin.event.LayoutEvents.LayoutClickListener;
import com.vaadin.event.LayoutEvents.LayoutClickNotifier;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.LegacyPaint;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.Connector;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
}
}
- getState().setColumns(columns);
+ getState().columns = columns;
}
/**
* @return the number of columns in the grid.
*/
public int getColumns() {
- return getState().getColumns();
+ return getState().columns;
}
/**
}
}
- getState().setRows(rows);
+ getState().rows = rows;
}
/**
* @return the number of rows in the grid.
*/
public int getRows() {
- return getState().getRows();
+ return getState().rows;
}
/**
*/
@Override
public void setSpacing(boolean spacing) {
- getState().setSpacing(spacing);
+ getState().spacing = spacing;
}
/*
*/
@Override
public boolean isSpacing() {
- return getState().isSpacing();
+ return getState().spacing;
}
/**
*/
@Override
public void setMargin(MarginInfo marginInfo) {
- getState().setMarginsBitmask(marginInfo.getBitMask());
+ getState().marginsBitmask = marginInfo.getBitMask();
}
/*
*/
@Override
public MarginInfo getMargin() {
- return new MarginInfo(getState().getMarginsBitmask());
+ return new MarginInfo(getState().marginsBitmask);
}
}
import com.vaadin.event.ActionManager;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.Scrollable;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.panel.PanelServerRpc;
registerRpc(rpc);
setContent(content);
setWidth(100, Unit.PERCENTAGE);
- getState().setTabIndex(-1);
+ getState().tabIndex = -1;
}
/**
final Integer newScrollY = (Integer) variables.get("scrollTop");
if (newScrollX != null && newScrollX.intValue() != getScrollLeft()) {
// set internally, not to fire request repaint
- getState().setScrollLeft(newScrollX.intValue());
+ getState().scrollLeft = newScrollX.intValue();
}
if (newScrollY != null && newScrollY.intValue() != getScrollTop()) {
// set internally, not to fire request repaint
- getState().setScrollTop(newScrollY.intValue());
+ getState().scrollTop = newScrollY.intValue();
}
// Actions
*/
@Override
public int getScrollLeft() {
- return getState().getScrollLeft();
+ return getState().scrollLeft;
}
/*
*/
@Override
public int getScrollTop() {
- return getState().getScrollTop();
+ return getState().scrollTop;
}
/*
throw new IllegalArgumentException(
"Scroll offset must be at least 0");
}
- getState().setScrollLeft(scrollLeft);
+ getState().scrollLeft = scrollLeft;
}
/*
throw new IllegalArgumentException(
"Scroll offset must be at least 0");
}
- getState().setScrollTop(scrollTop);
+ getState().scrollTop = scrollTop;
}
/* Documented in superclass */
*/
@Override
public int getTabIndex() {
- return getState().getTabIndex();
+ return getState().tabIndex;
}
/**
*/
@Override
public void setTabIndex(int tabIndex) {
- getState().setTabIndex(tabIndex);
+ getState().tabIndex = tabIndex;
}
/**
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
*
* Example code: <code>
* class MyPlayer extends CustomComponent implements ValueChangeListener {
- *
+ *
* Label volumeIndicator = new Label();
* Slider slider;
- *
+ *
* public MyPlayer() {
* VerticalLayout vl = new VerticalLayout();
* setCompositionRoot(vl);
} catch (final ValueOutOfBoundsException e) {
// Convert to nearest bound
double out = e.getValue().doubleValue();
- if (out < getState().getMinValue()) {
- out = getState().getMinValue();
+ if (out < getState().minValue) {
+ out = getState().minValue;
}
- if (out > getState().getMaxValue()) {
- out = getState().getMaxValue();
+ if (out > getState().maxValue) {
+ out = getState().maxValue;
}
Slider.super.setValue(new Double(out), false);
}
public Slider() {
super();
registerRpc(rpc);
- super.setValue(new Double(getState().getMinValue()));
+ super.setValue(new Double(getState().minValue));
}
/**
* @return the largest value the slider can have
*/
public double getMax() {
- return getState().getMaxValue();
+ return getState().maxValue;
}
/**
* The new maximum slider value
*/
public void setMax(double max) {
- getState().setMaxValue(max);
+ getState().maxValue = max;
if (getValue() > max) {
setValue(max);
}
* @return the smallest value the slider can have
*/
public double getMin() {
- return getState().getMinValue();
+ return getState().minValue;
}
/**
* The new minimum slider value
*/
public void setMin(double min) {
- getState().setMinValue(min);
+ getState().minValue = min;
if (getValue() < min) {
setValue(min);
}
* {@link SliderOrientation#VERTICAL}
*/
public SliderOrientation getOrientation() {
- return getState().getOrientation();
+ return getState().orientation;
}
/**
* {@link SliderOrientation#VERTICAL}
*/
public void setOrientation(SliderOrientation orientation) {
- getState().setOrientation(orientation);
+ getState().orientation = orientation;
}
/**
* @return resolution
*/
public int getResolution() {
- return getState().getResolution();
+ return getState().resolution;
}
/**
throw new IllegalArgumentException(
"Cannot set a negative resolution to Slider");
}
- getState().setResolution(resolution);
+ getState().resolution = resolution;
}
/**
}
}
- getState().setValue(newValue);
+ getState().value = newValue;
super.setValue(newValue, repaintIsNotNeeded);
}
}
super.setValue(newFieldValue);
// The cast is safe if the above call returned without throwing
- getState().setValue((Double) newFieldValue);
+ getState().value = (Double) newFieldValue;
}
/**
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
if (rows < 0) {
rows = 0;
}
- getState().setRows(rows);
+ getState().rows = rows;
}
/**
* @return number of explicitly set rows.
*/
public int getRows() {
- return getState().getRows();
+ return getState().rows;
}
/**
* word-wrap mode.
*/
public void setWordwrap(boolean wordwrap) {
- getState().setWordwrap(wordwrap);
+ getState().wordwrap = wordwrap;
}
/**
* <code>false</code> if not.
*/
public boolean isWordwrap() {
- return getState().isWordwrap();
+ return getState().wordwrap;
}
}
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
import com.vaadin.server.AbstractApplicationServlet;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.Page;
+import com.vaadin.server.Page.BrowserWindowResizeEvent;
+import com.vaadin.server.Page.BrowserWindowResizeListener;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.Resource;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.server.WrappedRequest;
-import com.vaadin.server.Page.BrowserWindowResizeEvent;
-import com.vaadin.server.Page.BrowserWindowResizeListener;
import com.vaadin.server.WrappedRequest.BrowserDetails;
import com.vaadin.shared.EventId;
import com.vaadin.shared.MouseEventDetails;
@Override
public void setCaption(String caption) {
// Override to provide backwards compatibility
- getState().setCaption(caption);
+ getState().caption = caption;
getPage().setTitle(caption);
}
* @see #createDefaultLayout()
*/
public ComponentContainer getContent() {
- return (ComponentContainer) getState().getContent();
+ return (ComponentContainer) getState().content;
}
/**
content = createDefaultLayout();
}
- if (getState().getContent() != null) {
- super.removeComponent((Component) getState().getContent());
+ if (getState().content != null) {
+ super.removeComponent((Component) getState().content);
}
- getState().setContent(content);
+ getState().content = content;
if (content != null) {
super.addComponent(content);
}
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.event.ShortcutListener;
+import com.vaadin.server.LegacyComponent;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
-import com.vaadin.server.LegacyComponent;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.window.WindowServerRpc;
import com.vaadin.shared.ui.window.WindowState;
* @since 4.0.0
*/
public int getPositionX() {
- return getState().getPositionX();
+ return getState().positionX;
}
/**
* @since 4.0.0
*/
public void setPositionX(int positionX) {
- getState().setPositionX(positionX);
- getState().setCentered(false);
+ getState().positionX = positionX;
+ getState().centered = false;
}
/**
* @since 4.0.0
*/
public int getPositionY() {
- return getState().getPositionY();
+ return getState().positionY;
}
/**
* @since 4.0.0
*/
public void setPositionY(int positionY) {
- getState().setPositionY(positionY);
- getState().setCentered(false);
+ getState().positionY = positionY;
+ getState().centered = false;
}
private static final Method WINDOW_CLOSE_METHOD;
* true if modality is to be turned on
*/
public void setModal(boolean modal) {
- getState().setModal(modal);
+ getState().modal = modal;
center();
}
* @return true if this window is modal.
*/
public boolean isModal() {
- return getState().isModal();
+ return getState().modal;
}
/**
* true if resizability is to be turned on
*/
public void setResizable(boolean resizable) {
- getState().setResizable(resizable);
+ getState().resizable = resizable;
}
/**
* @return true if window is resizable by the end-user, otherwise false.
*/
public boolean isResizable() {
- return getState().isResizable();
+ return getState().resizable;
}
/**
* sizes are recalculated immediately.
*/
public boolean isResizeLazy() {
- return getState().isResizeLazy();
+ return getState().resizeLazy;
}
/**
* calculate immediately.
*/
public void setResizeLazy(boolean resizeLazy) {
- getState().setResizeLazy(resizeLazy);
+ getState().resizeLazy = resizeLazy;
}
/**
* Please refer to http://dev.vaadin.com/ticket/8971 for details.
*/
public void center() {
- getState().setCentered(true);
+ getState().centered = true;
}
/**
* true if the sub window can be dragged by the user
*/
public boolean isDraggable() {
- return getState().isDraggable();
+ return getState().draggable;
}
/**
* true if the sub window can be dragged by the user
*/
public void setDraggable(boolean draggable) {
- getState().setDraggable(draggable);
+ getState().draggable = draggable;
}
/*
* @deprecated Since 7.0, replaced by
* {@link #addFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void addListener(FocusListener listener) {
addFocusListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeFocusListener(FocusListener)}
**/
+ @Override
@Deprecated
public void removeListener(FocusListener listener) {
removeFocusListener(listener);
/**
* @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void addListener(BlurListener listener) {
addBlurListener(listener);
* @deprecated Since 7.0, replaced by
* {@link #removeBlurListener(BlurListener)}
**/
+ @Override
@Deprecated
public void removeListener(BlurListener listener) {
removeBlurListener(listener);
stringToStateMap = new HashMap<String, AbstractSplitPanelState>();
AbstractSplitPanelState s = new AbstractSplitPanelState();
AbstractSplitPanelState s2 = new AbstractSplitPanelState();
- s.setCaption("State 1");
- s.setId("foo");
- s2.setCaption("State 2");
- s2.setId("bar");
+ s.caption = "State 1";
+ s.id = "foo";
+ s2.caption = "State 2";
+ s2.id = "bar";
stringToStateMap.put("string - state 1", s);
stringToStateMap.put("String - state 2", s2);
stateToStringMap = new HashMap<AbstractSplitPanelState, String>();
AbstractSplitPanelState s = new AbstractSplitPanelState();
AbstractSplitPanelState s2 = new AbstractSplitPanelState();
- s.setCaption("State 1");
- s2.setCaption("State 2");
+ s.caption = "State 1";
+ s2.caption = "State 2";
stateToStringMap.put(s, "string - state 1");
stateToStringMap.put(s2, "String - state 2");
* @since 7.0.0
*
*/
-public class AbstractFieldState extends ComponentState implements TabIndexState {
- private boolean propertyReadOnly = false;
- private boolean hideErrors = false;
- private boolean required = false;
- private boolean modified = false;
-
- /**
- * The tab order number of this field.
- */
- private int tabIndex = 0;
-
- /**
- * Checks if the property data source for the Field is in read only mode.
- * This affects the read only state of the field itself.
- *
- * @return true if there is a property data source and it is set to read
- * only, false otherwise
- */
- public boolean isPropertyReadOnly() {
- return propertyReadOnly;
- }
-
- /**
- * Sets the read only state of the property data source.
- *
- * @param propertyReadOnly
- * true if the property data source if read only, false otherwise
- */
- public void setPropertyReadOnly(boolean propertyReadOnly) {
- this.propertyReadOnly = propertyReadOnly;
- }
-
- /**
- * Returns true if the component will hide any errors even if the error
- * message is set.
- *
- * @return true if error messages are disabled
- */
- public boolean isHideErrors() {
- return hideErrors;
- }
-
- /**
- * Sets whether the component should hide any errors even if the error
- * message is set.
- *
- * This is used e.g. on forms to hide error messages for invalid fields
- * before the first user actions.
- *
- * @param hideErrors
- * true if error messages should be hidden
- */
- public void setHideErrors(boolean hideErrors) {
- this.hideErrors = hideErrors;
- }
-
- /**
- * Is the field required. Required fields must filled by the user.
- *
- * See {@link com.vaadin.ui.AbstractField#isRequired()} for more
- * information.
- *
- * @return <code>true</code> if the field is required, otherwise
- * <code>false</code>.
- */
- public boolean isRequired() {
- return required;
- }
-
- /**
- * Sets the field required. Required fields must filled by the user.
- *
- * See {@link com.vaadin.ui.AbstractField#setRequired(boolean)} for more
- * information.
- *
- * @param required
- * Is the field required.
- */
- public void setRequired(boolean required) {
- this.required = required;
- }
-
- /**
- * Has the contents of the field been modified, i.e. has the value been
- * updated after it was read from the data source.
- *
- * @return true if the field has been modified, false otherwise
- */
- public boolean isModified() {
- return modified;
- }
-
- /**
- * Setter for the modified flag, toggled when the contents of the field is
- * modified by the user.
- *
- * @param modified
- * the new modified state
- *
- */
- public void setModified(boolean modified) {
- this.modified = modified;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.client.ComponentState#getTabIndex()
- */
- @Override
- public int getTabIndex() {
- return tabIndex;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.client.ui.TabIndexState#setTabIndex(int)
- */
- @Override
- public void setTabIndex(int tabIndex) {
- this.tabIndex = tabIndex;
- }
-
+public class AbstractFieldState extends TabIndexState {
+ public boolean propertyReadOnly = false;
+ public boolean hideErrors = false;
+ public boolean required = false;
+ public boolean modified = false;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
package com.vaadin.shared;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
* @since 7.0
*/
public class ComponentState extends SharedState {
- private String height = "";
- private String width = "";
- private boolean readOnly = false;
- private boolean immediate = false;
- private String description = "";
+ public String height = "";
+ public String width = "";
+ public boolean readOnly = false;
+ public boolean immediate = false;
+ public String description = "";
// Note: for the caption, there is a difference between null and an empty
// string!
- private String caption = null;
- private boolean visible = true;
- private List<String> styles = null;
- private String id = null;
+ public String caption = null;
+ public boolean visible = true;
+ public List<String> styles = null;
+ public String id = null;
/**
* A set of event identifiers with registered listeners.
*/
- private Set<String> registeredEventListeners = null;
+ public Set<String> registeredEventListeners = null;
// HTML formatted error message for the component
// TODO this could be an object with more information, but currently the UI
// only uses the message
- private String errorMessage = null;
+ public String errorMessage = null;
- /**
- * Returns the component height as set by the server.
- *
- * Can be relative (containing the percent sign) or absolute, or empty
- * string for undefined height.
- *
- * @return component height as defined by the server, not null
- */
- public String getHeight() {
- if (height == null) {
- return "";
- }
- return height;
- }
-
- /**
- * Sets the height of the component in the server format.
- *
- * Can be relative (containing the percent sign) or absolute, or null or
- * empty string for undefined height.
- *
- * @param height
- * component height
- */
- public void setHeight(String height) {
- this.height = height;
- }
-
- /**
- * Returns true if the component height is undefined, false if defined
- * (absolute or relative).
- *
- * @return true if component height is undefined
- */
- public boolean isUndefinedHeight() {
- return "".equals(getHeight());
- }
-
- /**
- * Returns the component width as set by the server.
- *
- * Can be relative (containing the percent sign) or absolute, or empty
- * string for undefined height.
- *
- * @return component width as defined by the server, not null
- */
- public String getWidth() {
- if (width == null) {
- return "";
- }
- return width;
- }
-
- /**
- * Sets the width of the component in the server format.
- *
- * Can be relative (containing the percent sign) or absolute, or null or
- * empty string for undefined width.
- *
- * @param width
- * component width
- */
- public void setWidth(String width) {
- this.width = width;
- }
-
- /**
- * Returns true if the component width is undefined, false if defined
- * (absolute or relative).
- *
- * @return true if component width is undefined
- */
- public boolean isUndefinedWidth() {
- return "".equals(getWidth());
- }
-
- /**
- * Returns true if the component is in read-only mode.
- *
- * @see com.vaadin.ui.Component#isReadOnly()
- *
- * @return true if the component is in read-only mode
- */
- public boolean isReadOnly() {
- return readOnly;
- }
-
- /**
- * Sets or resets the read-only mode for a component.
- *
- * @see com.vaadin.ui.Component#setReadOnly()
- *
- * @param readOnly
- * new mode for the component
- */
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- /**
- * Returns true if the component is in immediate mode.
- *
- * @see com.vaadin.server.VariableOwner#isImmediate()
- *
- * @return true if the component is in immediate mode
- */
- public boolean isImmediate() {
- return immediate;
- }
-
- /**
- * Sets or resets the immediate mode for a component.
- *
- * @see com.vaadin.server.VariableOwner#setImmediate()
- *
- * @param immediate
- * new mode for the component
- */
- public void setImmediate(boolean immediate) {
- this.immediate = immediate;
- }
-
- /**
- * Returns true if the component has user-defined styles.
- *
- * @return true if the component has user-defined styles
- */
- public boolean hasStyles() {
- return styles != null && !styles.isEmpty();
- }
-
- /**
- * Gets the description of the component (typically shown as tooltip).
- *
- * @see com.vaadin.ui.AbstractComponent#getDescription()
- *
- * @return component description (not null, can be empty string)
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the description of the component (typically shown as tooltip).
- *
- * @see com.vaadin.ui.AbstractComponent#setDescription(String)
- *
- * @param description
- * new component description (can be null)
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Returns true if the component has a description.
- *
- * @return true if the component has a description
- */
- public boolean hasDescription() {
- return getDescription() != null && !"".equals(getDescription());
- }
-
- /**
- * Gets the caption of the component (typically shown by the containing
- * layout).
- *
- * @see com.vaadin.ui.Component#getCaption()
- *
- * @return component caption - can be null (no caption) or empty string
- * (reserve space for an empty caption)
- */
- public String getCaption() {
- return caption;
- }
-
- /**
- * Sets the caption of the component (typically shown by the containing
- * layout).
- *
- * @see com.vaadin.ui.Component#setCaption(String)
- *
- * @param caption
- * new component caption - can be null (no caption) or empty
- * string (reserve space for an empty caption)
- */
- public void setCaption(String caption) {
- this.caption = caption;
- }
-
- /**
- * Returns the visibility state of the component. Note that this state is
- * related to the component only, not its parent. This might differ from
- * what {@link com.vaadin.ui.Component#isVisible()} returns as this takes
- * the hierarchy into account.
- *
- * @return The visibility state.
- */
- public boolean isVisible() {
- return visible;
- }
-
- /**
- * Sets the visibility state of the component.
- *
- * @param visible
- * The new visibility state.
- */
- public void setVisible(boolean visible) {
- this.visible = visible;
- }
-
- /**
- * Gets the style names for the component.
- *
- * @return A List of style names or null if no styles have been set.
- */
- public List<String> getStyles() {
- return styles;
- }
-
- /**
- * Sets the style names for the component.
- *
- * @param styles
- * A list containing style names
- */
- public void setStyles(List<String> styles) {
- this.styles = styles;
- }
-
- /**
- * Gets the id for the component. The id is added as DOM id for the
- * component.
- *
- * @return The id for the component or null if not set
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the id for the component. The id is added as DOM id for the
- * component.
- *
- * @param id
- * The new id for the component or null for no id
- *
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * Gets the identifiers for the event listeners that have been registered
- * for the component (using an event id)
- *
- * @return A set of event identifiers or null if no identifiers have been
- * registered
- */
- public Set<String> getRegisteredEventListeners() {
- return registeredEventListeners;
- }
-
- /**
- * Sets the identifiers for the event listeners that have been registered
- * for the component (using an event id)
- *
- * @param registeredEventListeners
- * The new set of identifiers or null if no identifiers have been
- * registered
- */
- public void setRegisteredEventListeners(Set<String> registeredEventListeners) {
- this.registeredEventListeners = registeredEventListeners;
- }
-
- /**
- * Adds an event listener id.
- *
- * @param eventListenerId
- * The event identifier to add
- */
- public void addRegisteredEventListener(String eventListenerId) {
- if (registeredEventListeners == null) {
- registeredEventListeners = new HashSet<String>();
- }
- registeredEventListeners.add(eventListenerId);
-
- }
-
- /**
- * Removes an event listener id.
- *
- * @param eventListenerId
- * The event identifier to remove
- */
- public void removeRegisteredEventListener(String eventIdentifier) {
- if (registeredEventListeners == null) {
- return;
- }
- registeredEventListeners.remove(eventIdentifier);
- if (registeredEventListeners.size() == 0) {
- registeredEventListeners = null;
- }
- }
-
- /**
- * Returns the current error message for the component.
- *
- * @return HTML formatted error message to show for the component or null if
- * none
- */
- public String getErrorMessage() {
- return errorMessage;
- }
-
- /**
- * Sets the current error message for the component.
- *
- * TODO this could use an object with more details about the error
- *
- * @param errorMessage
- * HTML formatted error message to show for the component or null
- * for none
- */
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
-}
+}
\ No newline at end of file
*/
public Map<String, URLReference> resources = new HashMap<String, URLReference>();
- private boolean enabled = true;
-
- /**
- * Returns true if the component is enabled.
- *
- * @see com.vaadin.ui.Component#isEnabled()
- *
- * @return true if the component is enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * Enables or disables the component.
- *
- * @see com.vaadin.ui.Component#setEnabled(boolean)
- *
- * @param enabled
- * new mode for the component
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
+ public boolean enabled = true;
}
public static final String SOURCE_RESOURCE = "source";
- private String alternateText;
-
- public String getAlternateText() {
- return alternateText;
- }
-
- public void setAlternateText(String alternateText) {
- this.alternateText = alternateText;
- }
-
+ public String alternateText;
}
--- /dev/null
+package com.vaadin.shared.ui;
+
+import java.util.HashSet;
+
+import com.vaadin.shared.ComponentState;
+
+public final class ComponentStateUtil {
+
+ private ComponentStateUtil() {
+ // Util class is not instantiable
+ }
+
+ public static final boolean isUndefinedWidth(ComponentState state) {
+ return state.width == null || "".equals(state.width);
+ }
+
+ public static final boolean isUndefinedHeight(ComponentState state) {
+ return state.height == null || "".equals(state.height);
+ }
+
+ /**
+ * Removes an event listener id.
+ *
+ * @param eventListenerId
+ * The event identifier to remove
+ */
+ public static final void removeRegisteredEventListener(
+ ComponentState state,
+ String eventIdentifier) {
+ if (state.registeredEventListeners == null) {
+ return;
+ }
+ state.registeredEventListeners.remove(eventIdentifier);
+ if (state.registeredEventListeners.size() == 0) {
+ state.registeredEventListeners = null;
+ }
+ }
+
+ /**
+ * Adds an event listener id.
+ *
+ * @param eventListenerId
+ * The event identifier to add
+ */
+ public static final void addRegisteredEventListener(ComponentState state,
+ String eventListenerId) {
+ if (state.registeredEventListeners == null) {
+ state.registeredEventListeners = new HashSet<String>();
+ }
+ state.registeredEventListeners.add(eventListenerId);
+ }
+}
*/
package com.vaadin.shared.ui;
+import com.vaadin.shared.ComponentState;
+
/**
* Interface implemented by state classes that support tab indexes.
*
* @since 7.0.0
*
*/
-public interface TabIndexState {
- /**
- * Gets the <i>tabulator index</i> of the field.
- *
- * @return the tab index for the Field
- */
- public int getTabIndex();
+public class TabIndexState extends ComponentState {
/**
- * Sets the <i>tabulator index</i> of the field.
- *
- * @param tabIndex
- * the tab index to set
+ * The <i>tabulator index</i> of the field.
*/
- public void setTabIndex(int tabIndex);
+ public int tabIndex = 0;
+
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import java.util.HashMap;
import java.util.Map;
-import com.vaadin.shared.Connector;
import com.vaadin.shared.ui.AbstractLayoutState;
public class AbsoluteLayoutState extends AbstractLayoutState {
// Maps each component to a position
- private Map<String, String> connectorToCssPosition = new HashMap<String, String>();
-
- public String getConnectorPosition(Connector connector) {
- return connectorToCssPosition.get(connector.getConnectorId());
- }
-
- public Map<String, String> getConnectorToCssPosition() {
- return connectorToCssPosition;
- }
-
- public void setConnectorToCssPosition(
- Map<String, String> componentToCssPosition) {
- connectorToCssPosition = componentToCssPosition;
- }
-
+ public Map<String, String> connectorToCssPosition = new HashMap<String, String>();
}
\ No newline at end of file
*
* @since 7.0
*/
-public class ButtonState extends ComponentState implements TabIndexState {
- private boolean disableOnClick = false;
- private int clickShortcutKeyCode = 0;
- /**
- * The tab order number of this field.
- */
- private int tabIndex = 0;
+public class ButtonState extends TabIndexState {
+ public boolean disableOnClick = false;
+ public int clickShortcutKeyCode = 0;
/**
* If caption should be rendered in HTML
*/
- private boolean htmlContentAllowed = false;
-
- /**
- * Checks whether the button should be disabled on the client side on next
- * click.
- *
- * @return true if the button should be disabled on click
- */
- public boolean isDisableOnClick() {
- return disableOnClick;
- }
-
- /**
- * Sets whether the button should be disabled on the client side on next
- * click.
- *
- * @param disableOnClick
- * true if the button should be disabled on click
- */
- public void setDisableOnClick(boolean disableOnClick) {
- this.disableOnClick = disableOnClick;
- }
-
- /**
- * Returns the key code for activating the button via a keyboard shortcut.
- *
- * See {@link com.vaadin.ui.Button#setClickShortcut(int, int...)} for more
- * information.
- *
- * @return key code or 0 for none
- */
- public int getClickShortcutKeyCode() {
- return clickShortcutKeyCode;
- }
-
- /**
- * Sets the key code for activating the button via a keyboard shortcut.
- *
- * See {@link com.vaadin.ui.Button#setClickShortcut(int, int...)} for more
- * information.
- *
- * @param clickShortcutKeyCode
- * key code or 0 for none
- */
- public void setClickShortcutKeyCode(int clickShortcutKeyCode) {
- this.clickShortcutKeyCode = clickShortcutKeyCode;
- }
-
- /**
- * Set whether the caption text is rendered as HTML or not. You might need
- * to retheme button to allow higher content than the original text style.
- *
- * If set to true, the captions are passed to the browser as html and the
- * developer is responsible for ensuring no harmful html is used. If set to
- * false, the content is passed to the browser as plain text.
- *
- * @param htmlContentAllowed
- * <code>true</code> if caption is rendered as HTML,
- * <code>false</code> otherwise
- */
- public void setHtmlContentAllowed(boolean htmlContentAllowed) {
- this.htmlContentAllowed = htmlContentAllowed;
- }
-
- /**
- * Return HTML rendering setting.
- *
- * @return <code>true</code> if the caption text is to be rendered as HTML,
- * <code>false</code> otherwise
- */
- public boolean isHtmlContentAllowed() {
- return htmlContentAllowed;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.client.ui.TabIndexState#getTabIndex()
- */
- @Override
- public int getTabIndex() {
- return tabIndex;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.vaadin.client.ui.TabIndexState#setTabIndex(int)
- */
- @Override
- public void setTabIndex(int tabIndex) {
- this.tabIndex = tabIndex;
- }
-
+ public boolean htmlContentAllowed = false;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.AbstractFieldState;
public class CheckBoxState extends AbstractFieldState {
- private boolean checked = false;
-
- public boolean isChecked() {
- return checked;
- }
-
- public void setChecked(boolean checked) {
- this.checked = checked;
- }
+ public boolean checked = false;
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ui.AbstractLayoutState;
public class CssLayoutState extends AbstractLayoutState {
- private Map<Connector, String> childCss = new HashMap<Connector, String>();
-
- public Map<Connector, String> getChildCss() {
- return childCss;
- }
-
- public void setChildCss(Map<Connector, String> childCss) {
- this.childCss = childCss;
- }
-
+ public Map<Connector, String> childCss = new HashMap<Connector, String>();
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ui.AbstractLayoutState;
public class CustomLayoutState extends AbstractLayoutState {
- Map<Connector, String> childLocations = new HashMap<Connector, String>();
- private String templateContents;
- private String templateName;
-
- public String getTemplateContents() {
- return templateContents;
- }
-
- public void setTemplateContents(String templateContents) {
- this.templateContents = templateContents;
- }
-
- public String getTemplateName() {
- return templateName;
- }
-
- public void setTemplateName(String templateName) {
- this.templateName = templateName;
- }
-
- public Map<Connector, String> getChildLocations() {
- return childLocations;
- }
-
- public void setChildLocations(Map<Connector, String> childLocations) {
- this.childLocations = childLocations;
- }
-
+ public Map<Connector, String> childLocations = new HashMap<Connector, String>();
+ public String templateContents;
+ public String templateName;
}
\ No newline at end of file
public class FlashState extends AbstractEmbeddedState {
- protected String classId;
+ public String classId;
- protected String codebase;
+ public String codebase;
- protected String codetype;
+ public String codetype;
- protected String archive;
+ public String archive;
- protected String standby;
+ public String standby;
- protected Map<String, String> embedParams;
-
- public String getClassId() {
- return classId;
- }
-
- public void setClassId(String classId) {
- this.classId = classId;
- }
-
- public String getCodebase() {
- return codebase;
- }
-
- public void setCodebase(String codeBase) {
- codebase = codebase;
- }
-
- public String getCodetype() {
- return codetype;
- }
-
- public void setCodetype(String codetype) {
- this.codetype = codetype;
- }
-
- public String getArchive() {
- return archive;
- }
-
- public void setArchive(String archive) {
- this.archive = archive;
- }
-
- public String getStandby() {
- return standby;
- }
-
- public void setStandby(String standby) {
- this.standby = standby;
- }
-
- public Map<String, String> getEmbedParams() {
- return embedParams;
- }
-
- public void setEmbedParams(Map<String, String> embedParams) {
- this.embedParams = embedParams;
- }
+ public Map<String, String> embedParams;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.Connector;
public class FormState extends AbstractFieldState {
- private Connector layout;
- private Connector footer;
-
- public Connector getLayout() {
- return layout;
- }
-
- public void setLayout(Connector layout) {
- this.layout = layout;
- }
-
- public Connector getFooter() {
- return footer;
- }
-
- public void setFooter(Connector footer) {
- this.footer = footer;
- }
-
+ public Connector layout;
+ public Connector footer;
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ui.AbstractLayoutState;
public class GridLayoutState extends AbstractLayoutState {
- private boolean spacing = false;
- private int rows = 0;
- private int columns = 0;
- private int marginsBitmask = 0;
-
- public boolean isSpacing() {
- return spacing;
- }
-
- public void setSpacing(boolean spacing) {
- this.spacing = spacing;
- }
-
- public int getMarginsBitmask() {
- return marginsBitmask;
- }
-
- public void setMarginsBitmask(int marginsBitmask) {
- this.marginsBitmask = marginsBitmask;
- }
-
- public int getRows() {
- return rows;
- }
-
- public void setRows(int rows) {
- this.rows = rows;
- }
-
- public int getColumns() {
- return columns;
- }
-
- public void setColumns(int cols) {
- columns = cols;
- }
-
+ public boolean spacing = false;
+ public int rows = 0;
+ public int columns = 0;
+ public int marginsBitmask = 0;
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ui.AlignmentInfo;
public class AbstractOrderedLayoutState extends AbstractLayoutState {
- private boolean spacing = false;
+ public boolean spacing = false;
- private HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>();
+ public HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>();
- private int marginsBitmask = 0;
+ public int marginsBitmask = 0;
public static class ChildComponentData implements Serializable {
- private int alignmentBitmask = AlignmentInfo.TOP_LEFT.getBitMask();
- private float expandRatio = 0.0f;
- public int getAlignmentBitmask() {
- return alignmentBitmask;
- }
+ public int alignmentBitmask = AlignmentInfo.TOP_LEFT.getBitMask();
- public void setAlignmentBitmask(int alignmentBitmask) {
- this.alignmentBitmask = alignmentBitmask;
- }
-
- public float getExpandRatio() {
- return expandRatio;
- }
-
- public void setExpandRatio(float expandRatio) {
- this.expandRatio = expandRatio;
- }
-
- }
-
- public HashMap<Connector, ChildComponentData> getChildData() {
- return childData;
- }
-
- public void setChildData(HashMap<Connector, ChildComponentData> childData) {
- this.childData = childData;
- }
-
- public boolean isSpacing() {
- return spacing;
- }
-
- public void setSpacing(boolean spacing) {
- this.spacing = spacing;
- }
-
- public int getMarginsBitmask() {
- return marginsBitmask;
- }
-
- public void setMarginsBitmask(int marginsBitmask) {
- this.marginsBitmask = marginsBitmask;
+ public float expandRatio = 0.0f;
}
-
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ComponentState;
public class PanelState extends ComponentState {
- private int tabIndex;
- private int scrollLeft, scrollTop;
-
- public int getTabIndex() {
- return tabIndex;
- }
-
- public void setTabIndex(int tabIndex) {
- this.tabIndex = tabIndex;
- }
-
- public int getScrollLeft() {
- return scrollLeft;
- }
-
- public void setScrollLeft(int scrollLeft) {
- this.scrollLeft = scrollLeft;
- }
-
- public int getScrollTop() {
- return scrollTop;
- }
-
- public void setScrollTop(int scrollTop) {
- this.scrollTop = scrollTop;
- }
-
+ public int tabIndex;
+ public int scrollLeft, scrollTop;
}
\ No newline at end of file
public class SliderState extends AbstractFieldState {
- protected double value;
+ public double value;
- protected double maxValue;
- protected double minValue;
+ public double maxValue;
+ public double minValue;
/**
* The number of fractional digits that are considered significant. Must be
* non-negative.
*/
- protected int resolution;
+ public int resolution;
- protected SliderOrientation orientation;
-
- public double getValue() {
- return value;
- }
-
- public void setValue(double value) {
- this.value = value;
- }
-
- public double getMaxValue() {
- return maxValue;
- }
-
- public void setMaxValue(double maxValue) {
- this.maxValue = maxValue;
- }
-
- public double getMinValue() {
- return minValue;
- }
-
- public void setMinValue(double minValue) {
- this.minValue = minValue;
- }
-
- public int getResolution() {
- return resolution;
- }
-
- public void setResolution(int resolution) {
- this.resolution = resolution;
- }
-
- public SliderOrientation getOrientation() {
- return orientation;
- }
-
- public void setOrientation(SliderOrientation orientation) {
- this.orientation = orientation;
- }
+ public SliderOrientation orientation;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
public class AbstractSplitPanelState extends ComponentState {
- private Connector firstChild = null;
- private Connector secondChild = null;
- private SplitterState splitterState = new SplitterState();
-
- public boolean hasFirstChild() {
- return firstChild != null;
- }
-
- public boolean hasSecondChild() {
- return secondChild != null;
- }
-
- public Connector getFirstChild() {
- return firstChild;
- }
-
- public void setFirstChild(Connector firstChild) {
- this.firstChild = firstChild;
- }
-
- public Connector getSecondChild() {
- return secondChild;
- }
-
- public void setSecondChild(Connector secondChild) {
- this.secondChild = secondChild;
- }
-
- public SplitterState getSplitterState() {
- return splitterState;
- }
-
- public void setSplitterState(SplitterState splitterState) {
- this.splitterState = splitterState;
- }
+ public Connector firstChild = null;
+ public Connector secondChild = null;
+ public SplitterState splitterState = new SplitterState();
public static class SplitterState implements Serializable {
- private float position;
- private String positionUnit;
- private float minPosition;
- private String minPositionUnit;
- private float maxPosition;
- private String maxPositionUnit;
- private boolean positionReversed = false;
- private boolean locked = false;
-
- public float getPosition() {
- return position;
- }
-
- public void setPosition(float position) {
- this.position = position;
- }
-
- public String getPositionUnit() {
- return positionUnit;
- }
-
- public void setPositionUnit(String positionUnit) {
- this.positionUnit = positionUnit;
- }
-
- public float getMinPosition() {
- return minPosition;
- }
-
- public void setMinPosition(float minPosition) {
- this.minPosition = minPosition;
- }
-
- public String getMinPositionUnit() {
- return minPositionUnit;
- }
-
- public void setMinPositionUnit(String minPositionUnit) {
- this.minPositionUnit = minPositionUnit;
- }
-
- public float getMaxPosition() {
- return maxPosition;
- }
-
- public void setMaxPosition(float maxPosition) {
- this.maxPosition = maxPosition;
- }
-
- public String getMaxPositionUnit() {
- return maxPositionUnit;
- }
-
- public void setMaxPositionUnit(String maxPositionUnit) {
- this.maxPositionUnit = maxPositionUnit;
- }
-
- public boolean isPositionReversed() {
- return positionReversed;
- }
-
+ public float position;
+ public String positionUnit;
+ public float minPosition;
+ public String minPositionUnit;
+ public float maxPosition;
+ public String maxPositionUnit;
+
@DelegateToWidget
- public void setPositionReversed(boolean positionReversed) {
- this.positionReversed = positionReversed;
- }
-
- public boolean isLocked() {
- return locked;
- }
+ public boolean positionReversed = false;
@DelegateToWidget
- public void setLocked(boolean locked) {
- this.locked = locked;
- }
-
+ public boolean locked = false;
}
}
\ No newline at end of file
/**
* Number of visible rows in the text area. The default is 5.
*/
- private int rows = 5;
+ @DelegateToWidget
+ public int rows = 5;
/**
* Tells if word-wrapping should be used in the text area.
*/
- private boolean wordwrap = true;
-
- public int getRows() {
- return rows;
- }
-
- @DelegateToWidget
- public void setRows(int rows) {
- this.rows = rows;
- }
-
- public boolean isWordwrap() {
- return wordwrap;
- }
-
@DelegateToWidget
- public void setWordwrap(boolean wordwrap) {
- this.wordwrap = wordwrap;
- }
+ public boolean wordwrap = true;
}
/**
* Maximum character count in text field.
*/
- private int maxLength = -1;
+ public int maxLength = -1;
/**
* Number of visible columns in the TextField.
*/
- private int columns = 0;
+ public int columns = 0;
/**
* The prompt to display in an empty field. Null when disabled.
*/
- private String inputPrompt = null;
+ public String inputPrompt = null;
/**
* The text in the field
*/
- private String text = null;
-
- public int getMaxLength() {
- return maxLength;
- }
-
- public void setMaxLength(int maxLength) {
- this.maxLength = maxLength;
- }
-
- public int getColumns() {
- return columns;
- }
-
- public void setColumns(int columns) {
- this.columns = columns;
- }
-
- public String getInputPrompt() {
- return inputPrompt;
- }
-
- public void setInputPrompt(String inputPrompt) {
- this.inputPrompt = inputPrompt;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
+ public String text = null;
}
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.Connector;
public class UIState extends ComponentState {
- private Connector content;
-
- public Connector getContent() {
- return content;
- }
-
- public void setContent(Connector content) {
- this.content = content;
- }
-
+ public Connector content;
}
\ No newline at end of file
-/*
+/*
* Copyright 2011 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
import com.vaadin.shared.ui.panel.PanelState;
public class WindowState extends PanelState {
- private boolean modal = false;
- private boolean resizable = true;
- private boolean resizeLazy = false;
- private boolean draggable = true;
- private boolean centered = false;;
- private int positionX = -1;
- private int positionY = -1;
-
- public boolean isModal() {
- return modal;
- }
-
- public void setModal(boolean modal) {
- this.modal = modal;
- }
-
- public boolean isResizable() {
- return resizable;
- }
-
- public void setResizable(boolean resizable) {
- this.resizable = resizable;
- }
-
- public boolean isResizeLazy() {
- return resizeLazy;
- }
-
- public void setResizeLazy(boolean resizeLazy) {
- this.resizeLazy = resizeLazy;
- }
-
- public boolean isDraggable() {
- return draggable;
- }
-
- public void setDraggable(boolean draggable) {
- this.draggable = draggable;
- }
-
- public boolean isCentered() {
- return centered;
- }
-
- public void setCentered(boolean centered) {
- this.centered = centered;
- }
-
- public int getPositionX() {
- return positionX;
- }
-
- public void setPositionX(int positionX) {
- this.positionX = positionX;
- }
-
- public int getPositionY() {
- return positionY;
- }
-
- public void setPositionY(int positionY) {
- this.positionY = positionY;
- }
-
+ public boolean modal = false;
+ public boolean resizable = true;
+ public boolean resizeLazy = false;
+ public boolean draggable = true;
+ public boolean centered = false;;
+ public int positionX = -1;
+ public int positionY = -1;
}
\ No newline at end of file