diff options
author | Henri Sara <hesara@vaadin.com> | 2016-11-26 09:02:53 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-11-28 07:59:37 +0000 |
commit | 0fdb14f74525592221923ab6e1980681ae1b96d7 (patch) | |
tree | c2e17bce979d21315012c1ce6595f952931a5d76 | |
parent | 051bac514c04c76c4291c106cd77dc9ea1255ac8 (diff) | |
download | vaadin-framework-0fdb14f74525592221923ab6e1980681ae1b96d7.tar.gz vaadin-framework-0fdb14f74525592221923ab6e1980681ae1b96d7.zip |
Add shared state for CustomComponent and DragAndDropWrapper
Change-Id: Ib640e5ea97bccffb889d3213a4f588b828fb07bf
4 files changed, 77 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/CustomComponent.java b/server/src/main/java/com/vaadin/ui/CustomComponent.java index ced986d6a8..67a0b4fff7 100644 --- a/server/src/main/java/com/vaadin/ui/CustomComponent.java +++ b/server/src/main/java/com/vaadin/ui/CustomComponent.java @@ -19,6 +19,8 @@ package com.vaadin.ui; import java.util.Collections; import java.util.Iterator; +import com.vaadin.shared.customcomponent.CustomComponentState; + /** * Custom component provides a simple implementation of the {@link Component} * interface to allow creating new UI components by composition of existing @@ -147,4 +149,14 @@ public class CustomComponent extends AbstractComponent return (root != null ? 1 : 0); } + @Override + protected CustomComponentState getState() { + return (CustomComponentState) super.getState(); + } + + @Override + protected CustomComponentState getState(boolean markAsDirty) { + return (CustomComponentState) super.getState(markAsDirty); + } + } diff --git a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java index 4b9a7afbfb..d2079d8609 100644 --- a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java @@ -41,6 +41,7 @@ import com.vaadin.shared.ui.dd.HorizontalDropLocation; import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperConstants; import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperServerRpc; +import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperState; import com.vaadin.ui.declarative.DesignContext; @SuppressWarnings("serial") @@ -502,4 +503,14 @@ public class DragAndDropWrapper extends CustomComponent design.appendChild(child); } } + + @Override + protected DragAndDropWrapperState getState() { + return (DragAndDropWrapperState) super.getState(); + } + + @Override + protected DragAndDropWrapperState getState(boolean markAsDirty) { + return (DragAndDropWrapperState) super.getState(markAsDirty); + } } diff --git a/shared/src/main/java/com/vaadin/shared/customcomponent/CustomComponentState.java b/shared/src/main/java/com/vaadin/shared/customcomponent/CustomComponentState.java new file mode 100644 index 0000000000..f19afc8c42 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/customcomponent/CustomComponentState.java @@ -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.customcomponent; + +import com.vaadin.shared.AbstractComponentState; + +/** + * Shared state for CustomComponent. + * + * @author Vaadin Ltd + * @since 8.0 + */ +public class CustomComponentState extends AbstractComponentState { +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperState.java b/shared/src/main/java/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperState.java new file mode 100644 index 0000000000..2c55588cc9 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperState.java @@ -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.draganddropwrapper; + +import com.vaadin.shared.customcomponent.CustomComponentState; + +/** + * Shared state for DragAndDropWrapper. + * + * @author Vaadin Ltd + * @since 8.0 + */ +public class DragAndDropWrapperState extends CustomComponentState { +} |