Browse Source

Add shared state for CustomComponent and DragAndDropWrapper

Change-Id: Ib640e5ea97bccffb889d3213a4f588b828fb07bf
tags/8.0.0.alpha8
Henri Sara 7 years ago
parent
commit
0fdb14f745

+ 12
- 0
server/src/main/java/com/vaadin/ui/CustomComponent.java View File

@@ -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);
}

}

+ 11
- 0
server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java View File

@@ -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);
}
}

+ 27
- 0
shared/src/main/java/com/vaadin/shared/customcomponent/CustomComponentState.java View File

@@ -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 {
}

+ 27
- 0
shared/src/main/java/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperState.java View File

@@ -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 {
}

Loading…
Cancel
Save