import com.vaadin.client.ui.ui.UIConnector;
import com.vaadin.client.ui.window.WindowConnector;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Version;
import com.vaadin.shared.communication.LegacyChangeVariablesInvocation;
import com.vaadin.shared.communication.MethodInvocation;
* @return true if at least one listener has been registered on server side
* for the event identified by eventIdentifier.
* @deprecated as of Vaadin 7. Use
- * {@link ComponentState#hasEventListener(String)} instead
+ * {@link AbstractComponentState#hasEventListener(String)} instead
*/
@Deprecated
public boolean hasEventListeners(ComponentConnector paintable,
/**
* @deprecated as of Vaadin 7. Use
- * {@link ComponentState#hasEventListener(String)} instead
+ * {@link AbstractComponentState#hasEventListener(String)} instead
*/
@Deprecated
public boolean hasEventListeners(Widget widget, String eventIdentifier) {
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
/**
* An interface used by client-side widgets or paintable parts to receive
* @see com.vaadin.client.VPaintable#getState()
*/
@Override
- public ComponentState getState();
+ public AbstractComponentState getState();
/**
* Returns the widget for this {@link ComponentConnector}
import com.vaadin.client.ui.VUI;
import com.vaadin.client.ui.VWindow;
import com.vaadin.client.ui.window.WindowConnector;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;
import com.vaadin.shared.communication.SharedState;
private ServerConnector findConnectorById(ServerConnector root, String id) {
SharedState state = root.getState();
- if (state instanceof ComponentState
- && id.equals(((ComponentState) state).id)) {
+ if (state instanceof AbstractComponentState
+ && id.equals(((AbstractComponentState) state).id)) {
return root;
}
for (ServerConnector child : root.getChildren()) {
import com.vaadin.client.RenderInformation.FloatSize;
import com.vaadin.client.ui.VOverlay;
import com.vaadin.shared.ApplicationConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.communication.MethodInvocation;
import com.vaadin.shared.ui.ComponentStateUtil;
* @param state
* @return
*/
- public static FloatSize parseRelativeSize(ComponentState state) {
+ public static FloatSize parseRelativeSize(AbstractComponentState state) {
if (ComponentStateUtil.isUndefinedHeight(state)
&& ComponentStateUtil.isUndefinedWidth(state)) {
return null;
import com.vaadin.client.ui.Icon;
import com.vaadin.shared.AbstractFieldState;
import com.vaadin.shared.ComponentConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ui.ComponentStateUtil;
public class VCaption extends HTML {
}
}
- public static boolean isNeeded(ComponentState state) {
+ public static boolean isNeeded(AbstractComponentState state) {
if (state.caption != null) {
return true;
}
import com.vaadin.client.ui.datefield.PopupDateFieldConnector;
import com.vaadin.client.ui.ui.UIConnector;
import com.vaadin.shared.ComponentConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.TabIndexState;
}
@Override
- public ComponentState getState() {
- return (ComponentState) super.getState();
+ public AbstractComponentState getState() {
+ return (AbstractComponentState) super.getState();
}
@Override
* </p>
*/
protected void updateWidgetStyleNames() {
- ComponentState state = getState();
+ AbstractComponentState state = getState();
String primaryStyleName = getWidget().getStylePrimaryName();
if (state.primaryStyleName != null) {
import com.vaadin.client.VConsole;
import com.vaadin.client.ui.menubar.MenuBar;
import com.vaadin.client.ui.menubar.MenuItem;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.EventId;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.combobox.FilteringMode;
* @param componentState
* shared state of the combo box
*/
- public void updateStyleNames(UIDL uidl, ComponentState componentState) {
+ public void updateStyleNames(UIDL uidl, AbstractComponentState componentState) {
setStyleName(VFilterSelect.this.getStylePrimaryName()
+ "-suggestpopup");
menu.setStyleName(VFilterSelect.this.getStylePrimaryName()
import com.vaadin.client.StyleConstants;
import com.vaadin.client.VTooltip;
import com.vaadin.shared.ComponentConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.MarginInfo;
* @param enabled
* @return An array of stylenames
*/
- private String[] getStylesFromState(ComponentState state, boolean enabled) {
+ private String[] getStylesFromState(AbstractComponentState state, boolean enabled) {
List<String> styles = new ArrayList<String>();
if (ComponentStateUtil.hasStyles(state)) {
for (String name : state.styles) {
}
- public void updateCaption(Widget widget, ComponentState state,
+ public void updateCaption(Widget widget, AbstractComponentState state,
boolean enabled) {
final Caption c = widgetToCaption.get(widget);
if (c != null) {
setStyleName(styleName);
}
- public void updateCaption(ComponentState state, boolean enabled) {
+ public void updateCaption(AbstractComponentState state, boolean enabled) {
// Update styles as they might have changed when the caption changed
setStyles(getStylesFromState(state, enabled));
import com.vaadin.client.ui.dd.VDragEvent;
import com.vaadin.client.ui.dd.VHasDropHandler;
import com.vaadin.client.ui.dd.VTransferable;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.shared.ui.table.TableConstants;
}
/** For internal use only. May be removed or replaced in the future. */
- public void updateSelectionProperties(UIDL uidl, ComponentState state,
+ public void updateSelectionProperties(UIDL uidl, AbstractComponentState state,
boolean readOnly) {
setMultiSelectMode(uidl.hasAttribute("multiselectmode") ? uidl
.getIntAttribute("multiselectmode") : MULTISELECT_MODE_DEFAULT);
import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.VCaption;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.EventId;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.tabsheet.TabsheetBaseConstants;
}
/** For internal use only. May be removed or replaced in the future. */
- public void handleStyleNames(UIDL uidl, ComponentState state) {
+ public void handleStyleNames(UIDL uidl, AbstractComponentState state) {
// Add proper stylenames for all elements (easier to prevent unwanted
// style inheritance)
if (ComponentStateUtil.hasStyles(state)) {
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
import com.vaadin.client.ui.ManagedLayout;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
public class LayoutDependencyTree {
private class LayoutDependency {
} else {
s += "Horizontal";
}
- ComponentState state = connector.getState();
+ AbstractComponentState state = connector.getState();
s += " sizing: "
+ getSizeDefinition(direction == VERTICAL ? state.height
: state.width) + "\n";
import com.vaadin.server.Terminal;
import com.vaadin.server.VaadinSession;
import com.vaadin.shared.ComponentConstants;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.util.ReflectTools;
* @return updated component shared state
*/
@Override
- protected ComponentState getState() {
- return (ComponentState) super.getState();
+ protected AbstractComponentState getState() {
+ return (AbstractComponentState) super.getState();
}
@Override
--- /dev/null
+/*
+ * Copyright 2011 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.shared;
+
+import java.util.List;
+
+import com.vaadin.shared.communication.SharedState;
+import com.vaadin.ui.AbstractComponent;
+
+/**
+ * Default shared state implementation for {@link AbstractComponent}.
+ *
+ * State classes of components should typically extend this class.
+ *
+ * @since 7.0
+ */
+public class AbstractComponentState extends SharedState {
+ 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!
+ public String caption = null;
+ public List<String> styles = null;
+ public String id = null;
+ public String primaryStyleName = 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
+ public String errorMessage = null;
+}
+++ /dev/null
-/*
- * Copyright 2011 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.shared;
-
-import java.util.List;
-
-import com.vaadin.shared.communication.SharedState;
-
-/**
- * Default shared state implementation for UI components.
- *
- * State classes of concrete components should extend this class.
- *
- * @since 7.0
- */
-public class ComponentState extends SharedState {
- 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!
- public String caption = null;
- public List<String> styles = null;
- public String id = null;
- public String primaryStyleName = 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
- public String errorMessage = null;
-}
package com.vaadin.shared.ui;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class AbstractEmbeddedState extends ComponentState {
+public class AbstractEmbeddedState extends AbstractComponentState {
public static final String SOURCE_RESOURCE = "source";
*/
package com.vaadin.shared.ui;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class AbstractLayoutState extends ComponentState {
+public class AbstractLayoutState extends AbstractComponentState {
}
\ No newline at end of file
import java.util.ArrayList;
import java.util.List;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.communication.URLReference;
-public class AbstractMediaState extends ComponentState {
+public class AbstractMediaState extends AbstractComponentState {
public boolean showControls;
public String altText;
package com.vaadin.shared.ui;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class BrowserPopupExtensionState extends ComponentState {
+public class BrowserPopupExtensionState extends AbstractComponentState {
public String target = "_blank";
import java.util.HashSet;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.communication.SharedState;
public final class ComponentStateUtil {
// Util class is not instantiable
}
- public static final boolean isUndefinedWidth(ComponentState state) {
+ public static final boolean isUndefinedWidth(AbstractComponentState state) {
return state.width == null || "".equals(state.width);
}
- public static final boolean isUndefinedHeight(ComponentState state) {
+ public static final boolean isUndefinedHeight(AbstractComponentState state) {
return state.height == null || "".equals(state.height);
}
- public static final boolean hasDescription(ComponentState state) {
+ public static final boolean hasDescription(AbstractComponentState state) {
return state.description != null && !"".equals(state.description);
}
- public static final boolean hasStyles(ComponentState state) {
+ public static final boolean hasStyles(AbstractComponentState state) {
return state.styles != null && !state.styles.isEmpty();
}
- public static final boolean isRelativeWidth(ComponentState state) {
+ public static final boolean isRelativeWidth(AbstractComponentState state) {
return state.width != null && state.width.endsWith("%");
}
- public static final boolean isRelativeHeight(ComponentState state) {
+ public static final boolean isRelativeHeight(AbstractComponentState state) {
return state.height != null && state.height.endsWith("%");
}
import java.util.Map;
import java.util.Set;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.JavaScriptConnectorState;
-public class JavaScriptComponentState extends ComponentState implements
+public class JavaScriptComponentState extends AbstractComponentState implements
JavaScriptConnectorState {
private Set<String> callbackNames = new HashSet<String>();
*/
package com.vaadin.shared.ui;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
/**
* Interface implemented by state classes that support tab indexes.
* @since 7.0.0
*
*/
-public class TabIndexState extends ComponentState {
+public class TabIndexState extends AbstractComponentState {
/**
* The <i>tabulator index</i> of the field.
package com.vaadin.shared.ui.button;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.ui.TabIndexState;
/**
* Shared state for {@link com.vaadin.ui.Button} and
* {@link com.vaadin.ui.NativeButton}.
*
- * @see ComponentState
+ * @see AbstractComponentState
*
* @since 7.0
*/
*/
package com.vaadin.shared.ui.label;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class LabelState extends ComponentState {
+public class LabelState extends AbstractComponentState {
{
primaryStyleName = "v-label";
}
package com.vaadin.shared.ui.link;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class LinkState extends ComponentState {
+public class LinkState extends AbstractComponentState {
{
primaryStyleName = "v-link";
}
package com.vaadin.shared.ui.menubar;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class MenuBarState extends ComponentState {
+public class MenuBarState extends AbstractComponentState {
{
primaryStyleName = "v-menubar";
}
*/
package com.vaadin.shared.ui.panel;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class PanelState extends ComponentState {
+public class PanelState extends AbstractComponentState {
{
primaryStyleName = "v-panel";
}
package com.vaadin.shared.ui.popupview;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class PopupViewState extends ComponentState {
+public class PopupViewState extends AbstractComponentState {
public String html;
public boolean hideOnMouseOut;
import java.io.Serializable;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;
-public class AbstractSplitPanelState extends ComponentState {
+public class AbstractSplitPanelState extends AbstractComponentState {
public Connector firstChild = null;
public Connector secondChild = null;
public SplitterState splitterState = new SplitterState();
package com.vaadin.shared.ui.tabsheet;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class TabsheetState extends ComponentState {
+public class TabsheetState extends AbstractComponentState {
{
primaryStyleName = "v-tabsheet";
}
*/
package com.vaadin.shared.ui.ui;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class UIState extends ComponentState {
+public class UIState extends AbstractComponentState {
{
primaryStyleName = "v-ui";
}
package com.vaadin.tests.minitutorials.v7b1;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.ui.AbstractComponent;
public class Addition extends AbstractComponent {
}
}
-class AddResultState extends ComponentState {
+class AddResultState extends AbstractComponentState {
public int sum;
}
package com.vaadin.tests.widgetset.client;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.annotations.DelegateToWidget;
-public class DelegateState extends ComponentState {
+public class DelegateState extends AbstractComponentState {
@DelegateToWidget
public String value1;
package com.vaadin.tests.widgetset.client;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
/**
* State class with the same simple name as
* @version @VERSION@
* @since 7.0.0
*/
-public class LabelState extends ComponentState {
+public class LabelState extends AbstractComponentState {
private String text;
package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.Connector;
-public class ComponentInStateState extends ComponentState {
+public class ComponentInStateState extends AbstractComponentState {
public Connector otherComponent;
}
package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
-import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.AbstractComponentState;
-public class MyComponentState extends ComponentState {
+public class MyComponentState extends AbstractComponentState {
public String text;