Change-Id: I6939fbc6f7aed0897f50b19f85fb62d0b8368cc7tags/8.0.0.alpha8
@@ -60,6 +60,7 @@ import com.vaadin.shared.EventId; | |||
import com.vaadin.shared.MouseEventDetails; | |||
import com.vaadin.shared.ui.ComponentStateUtil; | |||
import com.vaadin.shared.ui.TabIndexState; | |||
import com.vaadin.shared.ui.ui.UIState; | |||
public abstract class AbstractComponentConnector extends AbstractConnector | |||
implements ComponentConnector, HasErrorIndicator { | |||
@@ -437,6 +438,11 @@ public abstract class AbstractComponentConnector extends AbstractConnector | |||
// + Util.getSimpleName(getWidget()) | |||
// + " which does not implement Focusable"); | |||
} | |||
} else if (getState() instanceof UIState | |||
&& getWidget() instanceof Focusable) { | |||
// UI behaves like a component with TabIndexState | |||
((Focusable) getWidget()) | |||
.setTabIndex(((UIState) getState()).tabIndex); | |||
} | |||
Profiler.leave( | |||
"AbstractComponentConnector.onStateChanged update tab index"); |
@@ -23,6 +23,7 @@ import java.util.LinkedList; | |||
import com.vaadin.server.ComponentSizeValidator; | |||
import com.vaadin.shared.Registration; | |||
import com.vaadin.shared.ui.AbstractComponentContainerState; | |||
/** | |||
* Extension to {@link AbstractComponent} that defines the default | |||
@@ -317,4 +318,14 @@ public abstract class AbstractComponentContainer extends AbstractComponent | |||
public Iterator<Component> getComponentIterator() { | |||
return iterator(); | |||
} | |||
@Override | |||
protected AbstractComponentContainerState getState() { | |||
return (AbstractComponentContainerState) super.getState(); | |||
} | |||
@Override | |||
protected AbstractComponentContainerState getState(boolean markAsDirty) { | |||
return (AbstractComponentContainerState) super.getState(markAsDirty); | |||
} | |||
} |
@@ -25,6 +25,7 @@ import com.vaadin.server.ComponentSizeValidator; | |||
import com.vaadin.server.VaadinService; | |||
import com.vaadin.server.VaadinSession; | |||
import com.vaadin.shared.Registration; | |||
import com.vaadin.shared.ui.AbstractSingleComponentContainerState; | |||
import com.vaadin.ui.declarative.DesignContext; | |||
import com.vaadin.ui.declarative.DesignException; | |||
@@ -352,4 +353,17 @@ public abstract class AbstractSingleComponentContainer extends AbstractComponent | |||
design.appendChild(childNode); | |||
} | |||
} | |||
@Override | |||
protected AbstractSingleComponentContainerState getState() { | |||
return (AbstractSingleComponentContainerState) super.getState(); | |||
} | |||
@Override | |||
protected AbstractSingleComponentContainerState getState( | |||
boolean markAsDirty) { | |||
return (AbstractSingleComponentContainerState) super.getState( | |||
markAsDirty); | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
/* | |||
* Copyright 2000-2016 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.ui; | |||
import com.vaadin.shared.AbstractComponentState; | |||
/** | |||
* Default shared state implementation for AbstractComponentContainer. | |||
* | |||
* @since 8.0 | |||
*/ | |||
public class AbstractComponentContainerState extends AbstractComponentState { | |||
} |
@@ -15,8 +15,12 @@ | |||
*/ | |||
package com.vaadin.shared.ui; | |||
import com.vaadin.shared.AbstractComponentState; | |||
public class AbstractLayoutState extends AbstractComponentState { | |||
/** | |||
* Shared state for AbstractLayout. | |||
* | |||
* @author Vaadin Ltd | |||
* @since 7.0 | |||
*/ | |||
public class AbstractLayoutState extends AbstractComponentContainerState { | |||
} |
@@ -0,0 +1,28 @@ | |||
/* | |||
* Copyright 2000-2016 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.ui; | |||
import com.vaadin.shared.AbstractComponentState; | |||
/** | |||
* Default shared state implementation for AbstractSingleComponentContainer. | |||
* | |||
* @since 8.0 | |||
*/ | |||
public class AbstractSingleComponentContainerState | |||
extends AbstractComponentState { | |||
} |
@@ -16,11 +16,11 @@ | |||
package com.vaadin.shared.ui.loginform; | |||
import com.vaadin.shared.AbstractComponentState; | |||
import com.vaadin.shared.Connector; | |||
import com.vaadin.shared.communication.URLReference; | |||
import com.vaadin.shared.ui.AbstractSingleComponentContainerState; | |||
public class LoginFormState extends AbstractComponentState { | |||
public class LoginFormState extends AbstractSingleComponentContainerState { | |||
public Connector userNameFieldConnector; | |||
public Connector passwordFieldConnector; | |||
public Connector loginButtonConnector; |
@@ -15,10 +15,10 @@ | |||
*/ | |||
package com.vaadin.shared.ui.panel; | |||
import com.vaadin.shared.AbstractComponentState; | |||
import com.vaadin.shared.annotations.NoLayout; | |||
import com.vaadin.shared.ui.AbstractSingleComponentContainerState; | |||
public class PanelState extends AbstractComponentState { | |||
public class PanelState extends AbstractSingleComponentContainerState { | |||
{ | |||
primaryStyleName = "v-panel"; | |||
} |
@@ -17,10 +17,10 @@ package com.vaadin.shared.ui.splitpanel; | |||
import java.io.Serializable; | |||
import com.vaadin.shared.AbstractComponentState; | |||
import com.vaadin.shared.Connector; | |||
import com.vaadin.shared.ui.AbstractComponentContainerState; | |||
public class AbstractSplitPanelState extends AbstractComponentState { | |||
public class AbstractSplitPanelState extends AbstractComponentContainerState { | |||
public Connector firstChild = null; | |||
public Connector secondChild = null; | |||
public SplitterState splitterState = new SplitterState(); |
@@ -18,11 +18,11 @@ package com.vaadin.shared.ui.tabsheet; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import com.vaadin.shared.AbstractComponentState; | |||
import com.vaadin.shared.annotations.DelegateToWidget; | |||
import com.vaadin.shared.annotations.NoLayout; | |||
import com.vaadin.shared.ui.AbstractComponentContainerState; | |||
public class TabsheetState extends AbstractComponentState { | |||
public class TabsheetState extends AbstractComponentContainerState { | |||
public static final String PRIMARY_STYLE_NAME = "v-tabsheet"; | |||
{ |
@@ -21,10 +21,17 @@ import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import com.vaadin.shared.annotations.NoLayout; | |||
import com.vaadin.shared.communication.PushMode; | |||
import com.vaadin.shared.ui.TabIndexState; | |||
import com.vaadin.shared.ui.AbstractSingleComponentContainerState; | |||
public class UIState extends AbstractSingleComponentContainerState { | |||
/** | |||
* The <i>tabulator index</i> of the field. | |||
*/ | |||
@NoLayout | |||
public int tabIndex = 0; | |||
public class UIState extends TabIndexState { | |||
public TooltipConfigurationState tooltipConfiguration = new TooltipConfigurationState(); | |||
public LoadingIndicatorConfigurationState loadingIndicatorConfiguration = new LoadingIndicatorConfigurationState(); | |||
public int pollInterval = -1; |
@@ -16,10 +16,10 @@ | |||
package com.vaadin.tests.widgetset.client; | |||
import com.vaadin.shared.AbstractComponentState; | |||
import com.vaadin.shared.Connector; | |||
import com.vaadin.shared.ui.AbstractSingleComponentContainerState; | |||
public class UseStateFromHierachyChangeConnectorState | |||
extends AbstractComponentState { | |||
extends AbstractSingleComponentContainerState { | |||
public Connector child; | |||
} |