diff options
Diffstat (limited to 'compatibility-client')
4 files changed, 60 insertions, 9 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ComponentConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ComponentConnector.java new file mode 100644 index 0000000000..792c435503 --- /dev/null +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ComponentConnector.java @@ -0,0 +1,36 @@ +/* + * 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.v7.client; + +/** + * Legacy ComponentConnector with {@code isReadOnly}. + * + * @author teemusa + * + */ +public interface ComponentConnector + extends com.vaadin.client.ComponentConnector { + + /** + * Checks if the connector is read only. + * + * @deprecated This belongs in AbstractFieldConnector, see #8514 + * @return true + */ + @Deprecated + public boolean isReadOnly(); + +} diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java index 5e27f26282..62b41cf9d8 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/AbstractLegacyComponentConnector.java @@ -18,6 +18,7 @@ package com.vaadin.v7.client.ui; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.client.ui.AbstractConnector; import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.v7.client.ComponentConnector; import com.vaadin.v7.shared.AbstractLegacyComponentState; /** @@ -30,8 +31,8 @@ import com.vaadin.v7.shared.AbstractLegacyComponentState; * @deprecated only used for Vaadin 7 compatiblity components */ @Deprecated -public class AbstractLegacyComponentConnector - extends AbstractComponentConnector { +public class AbstractLegacyComponentConnector extends AbstractComponentConnector + implements ComponentConnector { // overridden to be visible to VUpload in the same package. Without making // it public in VUploadConnector @@ -44,4 +45,17 @@ public class AbstractLegacyComponentConnector public AbstractLegacyComponentState getState() { return (AbstractLegacyComponentState) super.getState(); } + + @Override + public boolean isReadOnly() { + return getState().readOnly; + } + + @Override + protected void updateWidgetStyleNames() { + super.updateWidgetStyleNames(); + + // add / remove read-only style name + setWidgetStyleName("v-readonly", isReadOnly()); + } } diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/form/FormConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/form/FormConnector.java index e3f04aaa59..595a8ac6e8 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/form/FormConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/form/FormConnector.java @@ -1,12 +1,12 @@ /* * 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 @@ -40,7 +40,8 @@ import com.vaadin.v7.ui.Form; @Connect(Form.class) public class FormConnector extends AbstractComponentContainerConnector - implements Paintable, MayScrollChildren { + implements Paintable, MayScrollChildren, + com.vaadin.v7.client.ComponentConnector { private final ElementResizeListener footerResizeListener = new ElementResizeListener() { @Override @@ -179,7 +180,7 @@ public class FormConnector extends AbstractComponentContainerConnector @Override public boolean isReadOnly() { - return super.isReadOnly() || getState().propertyReadOnly; + return getState().readOnly || getState().propertyReadOnly; } @Override diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java index b4198f52da..a589e75697 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java @@ -31,10 +31,10 @@ import com.vaadin.client.UIDL; import com.vaadin.client.VConsole; import com.vaadin.client.WidgetUtil; import com.vaadin.client.communication.StateChangeEvent; -import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.MultiSelectMode; +import com.vaadin.v7.client.ui.AbstractLegacyComponentConnector; import com.vaadin.v7.client.ui.VTree; import com.vaadin.v7.client.ui.VTree.TreeNode; import com.vaadin.v7.shared.ui.tree.TreeConstants; @@ -43,7 +43,7 @@ import com.vaadin.v7.shared.ui.tree.TreeState; import com.vaadin.v7.ui.Tree; @Connect(Tree.class) -public class TreeConnector extends AbstractComponentConnector +public class TreeConnector extends AbstractLegacyComponentConnector implements Paintable { protected final Map<TreeNode, TooltipInfo> tooltipMap = new HashMap<TreeNode, TooltipInfo>(); |