From 05c051717401660a857ee7a314361a1735f376e6 Mon Sep 17 00:00:00 2001 From: elmot Date: Wed, 14 Sep 2016 17:48:50 +0300 Subject: Create a RadioButtonGroup that replaces the single select case of OptionGroup Change-Id: I56b0f1dfa889e2eaa3db9b0b0aac860f1bb4dea8 --- .../ui/optiongroup/RadioButtonGroupConstants.java | 30 ++++++++++++++++++ .../ui/optiongroup/RadioButtonGroupState.java | 36 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupConstants.java create mode 100644 shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupState.java (limited to 'shared') diff --git a/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupConstants.java b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupConstants.java new file mode 100644 index 0000000000..5278d211de --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupConstants.java @@ -0,0 +1,30 @@ +/* + * 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.optiongroup; + +import java.io.Serializable; + +public class RadioButtonGroupConstants implements Serializable { + public static final String JSONKEY_ITEM_DISABLED = "d"; + + public static final String JSONKEY_ITEM_ICON = "i"; + + public static final String JSONKEY_ITEM_VALUE = "v"; + + public static final String JSONKEY_ITEM_KEY = "k"; + + public static final String JSONKEY_ITEM_SELECTED = "s"; +} diff --git a/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupState.java b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupState.java new file mode 100644 index 0000000000..bdd007613c --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/optiongroup/RadioButtonGroupState.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.shared.ui.optiongroup; + +import com.vaadin.shared.AbstractFieldState; +import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.ui.AbstractSingleSelectState; + +/** + * Shared state for the RadioButtonGroup component. + * + * @author Vaadin Ltd. + * @since 8.0 + */ +public class RadioButtonGroupState extends AbstractSingleSelectState { + + { + primaryStyleName = "v-select-optiongroup"; + } + + @DelegateToWidget + public boolean htmlContentAllowed = false; +} -- cgit v1.2.3