| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.runtime.web.vaadin.databinding; |
| |
| import java.beans.PropertyChangeListener; |
| import java.lang.reflect.Method; |
| import java.util.ArrayList; |
| import java.util.Iterator; |
| |
| import org.eclipse.core.databinding.beans.BeansObservables; |
| import org.eclipse.core.databinding.beans.PojoObservables; |
| import org.eclipse.core.databinding.observable.Realm; |
| import org.eclipse.core.databinding.observable.value.IObservableValue; |
| import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableList; |
| import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableSet; |
| import org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableValue; |
| import org.eclipse.osbp.runtime.web.vaadin.databinding.values.SetToListAdapter; |
| |
| import com.vaadin.data.Buffered; |
| import com.vaadin.data.BufferedValidatable; |
| import com.vaadin.data.Container; |
| import com.vaadin.data.Item; |
| import com.vaadin.data.Property; |
| import com.vaadin.data.Validatable; |
| import com.vaadin.server.Scrollable; |
| import com.vaadin.server.Sizeable; |
| import com.vaadin.server.VaadinService; |
| import com.vaadin.ui.AbstractEmbedded; |
| import com.vaadin.ui.AbstractField; |
| import com.vaadin.ui.AbstractMedia; |
| import com.vaadin.ui.AbstractSelect; |
| import com.vaadin.ui.AbstractSplitPanel; |
| import com.vaadin.ui.AbstractTextField; |
| import com.vaadin.ui.Button; |
| import com.vaadin.ui.ComboBox; |
| import com.vaadin.ui.Component; |
| import com.vaadin.ui.Component.Focusable; |
| import com.vaadin.ui.CustomLayout; |
| import com.vaadin.ui.DateField; |
| import com.vaadin.ui.Embedded; |
| import com.vaadin.ui.Field; |
| import com.vaadin.ui.GridLayout; |
| import com.vaadin.ui.Label; |
| import com.vaadin.ui.Layout.MarginHandler; |
| import com.vaadin.ui.Layout.SpacingHandler; |
| import com.vaadin.ui.Link; |
| import com.vaadin.ui.ListSelect; |
| import com.vaadin.ui.MenuBar; |
| import com.vaadin.ui.OptionGroup; |
| import com.vaadin.ui.PopupDateField; |
| import com.vaadin.ui.PopupView; |
| import com.vaadin.ui.ProgressIndicator; |
| import com.vaadin.ui.RichTextArea; |
| import com.vaadin.ui.SingleComponentContainer; |
| import com.vaadin.ui.Slider; |
| import com.vaadin.ui.TabSheet; |
| import com.vaadin.ui.TabSheet.Tab; |
| import com.vaadin.ui.Table; |
| import com.vaadin.ui.TextArea; |
| import com.vaadin.ui.Tree; |
| import com.vaadin.ui.TreeTable; |
| import com.vaadin.ui.TwinColSelect; |
| import com.vaadin.ui.UI; |
| import com.vaadin.ui.Upload; |
| import com.vaadin.ui.Video; |
| import com.vaadin.ui.Window; |
| import com.vaadin.ui.components.colorpicker.ColorPickerGradient; |
| import com.vaadin.ui.components.colorpicker.ColorPickerGrid; |
| import com.vaadin.ui.components.colorpicker.ColorPickerHistory; |
| import com.vaadin.ui.components.colorpicker.ColorPickerSelect; |
| import com.vaadin.ui.components.colorpicker.ColorSelector; |
| |
| // TODO: Auto-generated Javadoc |
| /** |
| * A factory for creating observables for Vaadin Components. |
| */ |
| public class VaadinObservables { |
| |
| /** The realms. */ |
| private static java.util.List<UIRealm> realms = new ArrayList<UIRealm>(); |
| |
| /** |
| * Returns the realm representing the UI thread for the given display. |
| * |
| * @param ui |
| * the ui |
| * @return the realm representing the UI thread for the given display |
| */ |
| public static Realm getRealm(final UI ui) { |
| return getRealm(ui, true); |
| } |
| |
| /** |
| * Returns the realm representing the UI thread for the given display. |
| * |
| * @param ui |
| * the ui |
| * @param autoSynchronize |
| * synchronize multi vaadin ui's |
| * @return the realm representing the UI thread for the given display |
| */ |
| public static Realm getRealm(final UI ui, boolean autoSynchronize) { |
| synchronized (realms) { |
| for (Iterator<UIRealm> it = realms.iterator(); it.hasNext();) { |
| UIRealm displayRealm = it.next(); |
| if (displayRealm.ui == ui) { |
| displayRealm.makeDefault(); |
| return displayRealm; |
| } |
| } |
| UIRealm result = new UIRealm(ui, autoSynchronize); |
| realms.add(result); |
| return result; |
| } |
| } |
| |
| /** |
| * Activates the realm for the current thread. |
| * |
| * @param ui |
| * the ui |
| */ |
| public static void activateRealm(final UI ui) { |
| activateRealm(ui, true); |
| } |
| |
| /** |
| * Activates the realm for the current thread. |
| * |
| * @param ui |
| * the ui |
| * @param autoSynchronize |
| * synchronize multi vaadin ui's |
| */ |
| public static void activateRealm(final UI ui, boolean autoSynchronize) { |
| UIRealm uiRealm = (UIRealm) getRealm(ui, autoSynchronize); |
| uiRealm.makeDefault(); |
| } |
| |
| /** |
| * Returns the UI of the widget or the current UI. |
| * |
| * @param widget |
| * the widget |
| * @return the ui |
| */ |
| public static UI getUI(Component widget) { |
| UI ui = widget != null ? widget.getUI() : null; |
| return ui != null ? ui : UI.getCurrent(); |
| } |
| |
| /** |
| * Returns the property type of the given field. |
| * |
| * @param field |
| * the field |
| * @return the property type |
| */ |
| public static Class<?> getPropertyType(Field<?> field) { |
| return getProperty(field).getType(); |
| } |
| |
| /** |
| * Returns the property of the given field. |
| * |
| * @param field |
| * the field |
| * @return the property |
| */ |
| public static Property<?> getProperty(Field<?> field) { |
| Property<?> property = field.getPropertyDataSource() != null ? field |
| .getPropertyDataSource() : field; |
| return property; |
| } |
| |
| /** |
| * Returns an observable value tracking the propertyset of the given item |
| * notifier. |
| * |
| * @param notifier |
| * the notifier |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemPropertySetValue( |
| Item.PropertySetChangeNotifier notifier) { |
| return VaadinProperties.itemPropertysetValue().observe(notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking the propertyset of the given item |
| * notifier. |
| * |
| * @param notifier |
| * the notifier |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemPropertySetInfoValue( |
| Item.PropertySetChangeNotifier notifier) { |
| return VaadinProperties.itemPropertysetInfoValue().observe(notifier); |
| } |
| |
| /** |
| * Returns an observable list tracking the item set of the given item |
| * notifier. |
| * |
| * @param notifier |
| * the field |
| * @param collectionType |
| * the type contained in the collection |
| * @return the i vaadin observable list |
| */ |
| public static IVaadinObservableList observeContainerItemSetContents( |
| Container.ItemSetChangeNotifier notifier, Class<?> collectionType) { |
| return VaadinProperties.containerItemsetAsList(collectionType).observe( |
| notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking the container of the given viewer. |
| * |
| * @param viewer |
| * the viewer |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeContainerDatasource( |
| Container.Viewer viewer) { |
| return VaadinProperties.containerDatasource().observe(viewer); |
| } |
| |
| /** |
| * Returns an observable value tracking the container of the given viewer. |
| * |
| * @param viewer |
| * the viewer |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemDatasource( |
| Item.Viewer viewer) { |
| return VaadinProperties.itemDatasource().observe(viewer); |
| } |
| |
| /** |
| * Returns an observable value tracking the container of the given viewer. |
| * |
| * @param viewer |
| * the viewer |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemDatasource( |
| Property.Viewer viewer) { |
| return VaadinProperties.datasource().observe(viewer); |
| } |
| |
| /** |
| * Returns an observable value tracking the selection of the given viewer. |
| * |
| * @param notifier |
| * the notifier |
| * @param type |
| * - the type of the selection object |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSingleSelection( |
| Property.ValueChangeNotifier notifier, Class<?> type) { |
| return VaadinProperties.singleSelection(type).observe(notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking nested attribute in the selected |
| * element. |
| * <p> |
| * For instance:<br> |
| * Given a list with Bar-beans. Bar has a relation to Foo-bean by |
| * myfoo-reference.<br> |
| * Then "myFoo.name" can be used as nestedPath to observe the foo#name |
| * attribute of the selected bean in the list. |
| * <p> |
| * This implementation supports pojos and beans. EObjects are not supported. |
| * |
| * @param notifier |
| * the notifier |
| * @param type |
| * - the type of the selection object |
| * @param nestedPath |
| * - the path from the selected element to the observed value. |
| * For instance "myFoo.name". |
| * @return the i observable value |
| */ |
| public static IObservableValue observeSingleSelectionDetailValue( |
| Property.ValueChangeNotifier notifier, Class<?> type, |
| String nestedPath) { |
| IVaadinObservableValue masterObservable = VaadinProperties |
| .singleSelection(type).observe(notifier); |
| |
| if (hasPropertyChangeSupport(type)) { |
| return BeansObservables.observeDetailValue(masterObservable, type, |
| nestedPath, null); |
| } else { |
| return PojoObservables.observeDetailValue(masterObservable, |
| nestedPath, null); |
| } |
| } |
| |
| /** |
| * Returns true, if the bean has property change support. |
| * |
| * @param valueType |
| * the value type |
| * @return true, if successful |
| */ |
| private static boolean hasPropertyChangeSupport(Class<?> valueType) { |
| @SuppressWarnings("unused") |
| Method method = null; |
| try { |
| try { |
| method = valueType.getMethod("addPropertyChangeListener", |
| new Class[] { String.class, |
| PropertyChangeListener.class }); |
| return true; |
| } catch (NoSuchMethodException e) { |
| method = valueType.getMethod("addPropertyChangeListener", |
| new Class[] { PropertyChangeListener.class }); |
| return true; |
| } |
| } catch (SecurityException e) { |
| } catch (NoSuchMethodException e) { |
| } |
| return false; |
| } |
| |
| /** |
| * Returns an observable list tracking the multi selection of the given |
| * viewer. |
| * |
| * @param notifier |
| * the notifier |
| * @param collectionType |
| * the type contained in the multi selection |
| * @return the i vaadin observable list |
| */ |
| public static IVaadinObservableList observeMultiSelectionAsList( |
| Property.ValueChangeNotifier notifier, Class<?> collectionType) { |
| return new SetToListAdapter(observeMultiSelectionAsSet(notifier, |
| collectionType), notifier); |
| } |
| |
| /** |
| * Returns an observable set tracking the multi selection of the given |
| * viewer. |
| * |
| * @param notifier |
| * the notifier |
| * @param collectionType |
| * the type contained in the multi selection |
| * @return the i vaadin observable set |
| */ |
| public static IVaadinObservableSet observeMultiSelectionAsSet( |
| Property.ValueChangeNotifier notifier, Class<?> collectionType) { |
| return VaadinProperties.propertyMultiSelectionAsSet(collectionType) |
| .observe(notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking the value of the given viewer. |
| * |
| * @param notifier |
| * the notifier |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeValue( |
| Property.ValueChangeNotifier notifier) { |
| return VaadinProperties.value().observeVaadinProperty(notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking the converted value of the given |
| * field. |
| * |
| * @param field |
| * the field |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeConvertedValue( |
| AbstractField<?> field) { |
| return VaadinProperties.accessor(AbstractField.class, "convertedValue") |
| .observeVaadinProperty(field); |
| } |
| |
| /** |
| * Returns an observable value tracking the readonly state of the given |
| * notifier. |
| * |
| * @param notifier |
| * the notifier |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeReadonly( |
| Property.ReadOnlyStatusChangeNotifier notifier) { |
| return VaadinProperties.readonly().observe(notifier); |
| } |
| |
| /** |
| * Returns an observable value tracking the focus state of the given |
| * focusable. Note that isFocus() can not be returned. You can only use |
| * setFocus(). |
| * |
| * @param focusable |
| * the focusable |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeFocus(Focusable focusable) { |
| return VaadinProperties.focus().observe(focusable); |
| } |
| |
| /** |
| * Returns an observable value tracking the caption of the given component. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCaption(Component component) { |
| return VaadinProperties.accessor(Component.class, "caption").observe( |
| component); |
| } |
| |
| /** |
| * Returns an observable value tracking the enabled state of the given |
| * widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeEnabled(Component component) { |
| return VaadinProperties.accessor(Component.class, "enabled").observe( |
| component); |
| } |
| |
| /** |
| * Returns an observable value tracking the enabled state of the given |
| * widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDescription(Component component) { |
| return VaadinProperties.description().observe(component); |
| } |
| |
| /** |
| * Returns an observable value tracking the icon of the given widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeIcon(Component component) { |
| return VaadinProperties.accessor(Component.class, "icon").observe( |
| component); |
| } |
| |
| /** |
| * Returns an observable value tracking the primary style name of the given |
| * widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePrimaryStyleName( |
| Component component) { |
| return VaadinProperties.accessor(Component.class, "primaryStyleName") |
| .observe(component); |
| } |
| |
| /** |
| * Returns an observable value tracking the styleName of the given widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeStyleName(Component component) { |
| return VaadinProperties.accessor(Component.class, "styleName").observe( |
| component); |
| } |
| |
| /** |
| * Returns an observable value tracking the visible state of the given |
| * widget. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeVisible(Component component) { |
| return VaadinProperties.accessor(Component.class, "visible").observe( |
| component); |
| } |
| |
| /** |
| * Returns an observable value tracking the required state of the given |
| * widget. |
| * |
| * @param field |
| * the field |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRequired(Field<?> field) { |
| return VaadinProperties.accessor(Field.class, "required") |
| .observe(field); |
| } |
| |
| /** |
| * Returns an observable value tracking the "required error message" of the |
| * given widget. |
| * |
| * @param field |
| * the field |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRequiredError(Field<?> field) { |
| return VaadinProperties.accessor(Field.class, "requiredError").observe( |
| field); |
| } |
| |
| /** |
| * Observe alternate text. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeAlternateText( |
| AbstractEmbedded component) { |
| return VaadinProperties.accessor(AbstractEmbedded.class, |
| "alternateText").observe(component); |
| } |
| |
| /** |
| * Observe source. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSource( |
| AbstractEmbedded component) { |
| return VaadinProperties.accessor(AbstractEmbedded.class, "source") |
| .observe(component); |
| } |
| |
| /** |
| * Observe item caption mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemCaptionMode( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, |
| "itemCaptionMode").observe(component); |
| } |
| |
| /** |
| * Observe item caption property id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemCaptionPropertyId( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, |
| "itemCaptionPropertyId").observe(component); |
| } |
| |
| /** |
| * Observe item icon property id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemIconPropertyId( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, |
| "itemIconPropertyId").observe(component); |
| } |
| |
| /** |
| * Observe multi select mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMultiSelectMode( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, "multiSelect") |
| .observe(component); |
| } |
| |
| /** |
| * Observe new item handler. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNewItemHandler( |
| AbstractSelect component) { |
| return VaadinProperties |
| .accessor(AbstractSelect.class, "newItemHandler").observe( |
| component); |
| } |
| |
| /** |
| * Observe new items allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNewItemsAllowed( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, |
| "newItemsAllowed").observe(component); |
| } |
| |
| /** |
| * Observe null selection allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNullSelectionAllowed( |
| AbstractSelect component) { |
| return VaadinProperties.accessor(AbstractSelect.class, |
| "nullSelectionAllowed").observe(component); |
| } |
| |
| /** |
| * Observe buffered. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeBuffered(Buffered component) { |
| return VaadinProperties.accessor(Buffered.class, "buffered").observe( |
| component); |
| } |
| |
| /** |
| * Observe invalid committed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeInvalidCommitted( |
| BufferedValidatable component) { |
| return VaadinProperties.accessor(Buffered.class, "invalidCommitted") |
| .observe(component); |
| } |
| |
| /** |
| * Observe invalid committed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeInvalidCommitted( |
| ComboBox component) { |
| return VaadinProperties.accessor(ComboBox.class, "pageLength").observe( |
| component); |
| } |
| |
| /** |
| * Observe scroll to selected item. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollToSelectedItem( |
| ComboBox component) { |
| return VaadinProperties |
| .accessor(ComboBox.class, "scrollToSelectedItem").observe( |
| component); |
| } |
| |
| /** |
| * Observe text input allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTextInputAllowed( |
| ComboBox component) { |
| return VaadinProperties.accessor(ComboBox.class, "textInputAllowed") |
| .observe(component); |
| } |
| |
| /** |
| * Observe template contents. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTemplateContents( |
| CustomLayout component) { |
| return VaadinProperties |
| .accessor(CustomLayout.class, "templateContents").observe( |
| component); |
| } |
| |
| /** |
| * Observe template name property. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTemplateNameProperty( |
| CustomLayout component) { |
| return VaadinProperties.accessor(CustomLayout.class, |
| "templateNameProperty").observe(component); |
| } |
| |
| /** |
| * Observe date format. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDateFormat(DateField component) { |
| return VaadinProperties.accessor(DateField.class, "dateFormat") |
| .observe(component); |
| } |
| |
| /** |
| * Observe lenient. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeLenient(DateField component) { |
| return VaadinProperties.accessor(DateField.class, "lenient").observe( |
| component); |
| } |
| |
| /** |
| * Observe parse error message. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeParseErrorMessage( |
| DateField component) { |
| return VaadinProperties.accessor(DateField.class, "parseErrorMessage") |
| .observe(component); |
| } |
| |
| /** |
| * Observe resolution. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResolution(DateField component) { |
| return VaadinProperties.accessor(DateField.class, "resolution") |
| .observe(component); |
| } |
| |
| /** |
| * Observe show iso week numbers. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeShowISOWeekNumbers( |
| DateField component) { |
| return VaadinProperties.accessor(DateField.class, "showISOWeekNumbers") |
| .observe(component); |
| } |
| |
| /** |
| * Observe text field enabled. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTextFieldEnabled( |
| DateField component) { |
| return VaadinProperties.accessor(DateField.class, "textFieldEnabled") |
| .observe(component); |
| } |
| |
| /** |
| * Observe time zone. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTimeZone(DateField component) { |
| return VaadinProperties.accessor(DateField.class, "timeZone").observe( |
| component); |
| } |
| |
| /** |
| * Observe validation visible. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeValidationVisible( |
| AbstractField<?> component) { |
| return VaadinProperties.accessor(AbstractField.class, |
| "validationVisible").observe(component); |
| } |
| |
| /** |
| * Observe columns. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumns(GridLayout component) { |
| return VaadinProperties.accessor(GridLayout.class, "columns").observe( |
| component); |
| } |
| |
| /** |
| * Observe cursor x. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCursorX(GridLayout component) { |
| return VaadinProperties.accessor(GridLayout.class, "cursorX").observe( |
| component); |
| } |
| |
| /** |
| * Observe cursor y. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCursorY(GridLayout component) { |
| return VaadinProperties.accessor(GridLayout.class, "cursorY").observe( |
| component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(GridLayout component) { |
| return VaadinProperties.accessor(GridLayout.class, "rows").observe( |
| component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(ListSelect component) { |
| return VaadinProperties.accessor(ListSelect.class, "rows").observe( |
| component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(MarginHandler component) { |
| return VaadinProperties.accessor(MarginHandler.class, "marginInfo") |
| .observe(component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(OptionGroup component) { |
| return VaadinProperties.accessor(OptionGroup.class, |
| "htmlContentAllowed").observe(component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(PopupDateField component) { |
| return VaadinProperties.accessor(PopupDateField.class, "inputPrompt") |
| .observe(component); |
| } |
| |
| /** |
| * Observe text field enabled. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTextFieldEnabled( |
| PopupDateField component) { |
| return VaadinProperties.accessor(PopupDateField.class, |
| "textFieldEnabled").observe(component); |
| } |
| |
| /** |
| * Observe height. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHeight(Sizeable component) { |
| return VaadinProperties.height().observe(component); |
| } |
| |
| /** |
| * Observe width. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeWidth(Sizeable component) { |
| return VaadinProperties.width().observe(component); |
| } |
| |
| /** |
| * Observe spacing. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSpacing(SpacingHandler component) { |
| return VaadinProperties.accessor(SpacingHandler.class, "spacing") |
| .observe(component); |
| } |
| |
| /** |
| * Observe first component. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeFirstComponent( |
| AbstractSplitPanel component) { |
| return VaadinProperties.accessor(AbstractSplitPanel.class, |
| "firstComponent").observe(component); |
| } |
| |
| /** |
| * Observe locked. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeLocked( |
| AbstractSplitPanel component) { |
| return VaadinProperties.accessor(AbstractSplitPanel.class, "locked") |
| .observe(component); |
| } |
| |
| /** |
| * Observe max split position. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMaxSplitPosition( |
| AbstractSplitPanel component) { |
| return VaadinProperties.maxSplitPosition().observe(component); |
| } |
| |
| /** |
| * Observe max split position unit. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMaxSplitPositionUnit( |
| AbstractSplitPanel component) { |
| return VaadinProperties.maxSplitPositionUnit().observe(component); |
| } |
| |
| /** |
| * Observe min split position. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMinSplitPosition( |
| AbstractSplitPanel component) { |
| return VaadinProperties.minSplitPosition().observe(component); |
| } |
| |
| /** |
| * Observe min split position unit. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMinSplitPositionUnit( |
| AbstractSplitPanel component) { |
| return VaadinProperties.minSplitPositionUnit().observe(component); |
| } |
| |
| /** |
| * Observe split position. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSplitPosition( |
| AbstractSplitPanel component) { |
| return VaadinProperties.splitPosition().observe(component); |
| } |
| |
| /** |
| * Observe split position unit. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSplitPositionUnit( |
| AbstractSplitPanel component) { |
| return VaadinProperties.splitPositionUnit().observe(component); |
| } |
| |
| /** |
| * Observe secon component. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSeconComponent( |
| AbstractSplitPanel component) { |
| return VaadinProperties.accessor(AbstractSplitPanel.class, |
| "secondComponent").observe(component); |
| } |
| |
| /** |
| * Observe cache. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCache(Table component) { |
| return VaadinProperties.accessor(Table.class, "cache").observe( |
| component); |
| } |
| |
| /** |
| * Observe cell style generator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCellStyleGenerator( |
| Table component) { |
| return VaadinProperties.accessor(Table.class, "cellStyleGenerator") |
| .observe(component); |
| } |
| |
| /** |
| * Observe column alignments. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnAlignments(Table component) { |
| return VaadinProperties.accessor(Table.class, "columnAlignments") |
| .observe(component); |
| } |
| |
| /** |
| * Observe column collapsing allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnCollapsingAllowed( |
| Table component) { |
| return VaadinProperties |
| .accessor(Table.class, "columnCollapsingAllowed").observe( |
| component); |
| } |
| |
| /** |
| * Observe column header mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnHeaderMode(Table component) { |
| return VaadinProperties.accessor(Table.class, "columnHeaderMode") |
| .observe(component); |
| } |
| |
| /** |
| * Observe column headers. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnHeaders(Table component) { |
| return VaadinProperties.accessor(Table.class, "columnHeaders").observe( |
| component); |
| } |
| |
| /** |
| * Observe column icons. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnIcons(Table component) { |
| return VaadinProperties.accessor(Table.class, "columnIcons").observe( |
| component); |
| } |
| |
| /** |
| * Observe column reordering allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumnReorderingAllowed( |
| Table component) { |
| return VaadinProperties |
| .accessor(Table.class, "columnReorderingAllowed").observe( |
| component); |
| } |
| |
| /** |
| * Observe current page first item id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCurrentPageFirstItemId( |
| Table component) { |
| return VaadinProperties.accessor(Table.class, "currentPageFirstItemId") |
| .observe(component); |
| } |
| |
| /** |
| * Observe current page first item index. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCurrentPageFirstItemIndex( |
| Table component) { |
| return VaadinProperties.accessor(Table.class, |
| "currentPageFirstItemIndex").observe(component); |
| } |
| |
| /** |
| * Observe drop handler. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDropHandler(Table component) { |
| return VaadinProperties.accessor(Table.class, "dropHandler").observe( |
| component); |
| } |
| |
| /** |
| * Observe drag mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDragMode(Table component) { |
| return VaadinProperties.accessor(Table.class, "dragMode").observe( |
| component); |
| } |
| |
| /** |
| * Observe editable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeEditable(Table component) { |
| return VaadinProperties.accessor(Table.class, "editable").observe( |
| component); |
| } |
| |
| /** |
| * Observe table field factory. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTableFieldFactory( |
| Table component) { |
| return VaadinProperties.accessor(Table.class, "tableFieldFactory") |
| .observe(component); |
| } |
| |
| /** |
| * Observe footer visible. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeFooterVisible(Table component) { |
| return VaadinProperties.accessor(Table.class, "footerVisible").observe( |
| component); |
| } |
| |
| /** |
| * Observe item description generator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemDescriptionGenerator( |
| Table component) { |
| return VaadinProperties.accessor(Table.class, |
| "itemDescriptionGenerator").observe(component); |
| } |
| |
| /** |
| * Observe multi select mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMultiSelectMode(Table component) { |
| return VaadinProperties.accessor(Table.class, "multiSelectMode") |
| .observe(component); |
| } |
| |
| /** |
| * Observe row generator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRowGenerator(Table component) { |
| return VaadinProperties.accessor(Table.class, "rowGenerator").observe( |
| component); |
| } |
| |
| /** |
| * Observe row header mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRowHeaderMode(Table component) { |
| return VaadinProperties.accessor(Table.class, "rowHeaderMode").observe( |
| component); |
| } |
| |
| /** |
| * Observe selectable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSelectable(Table component) { |
| return VaadinProperties.accessor(Table.class, "selectable").observe( |
| component); |
| } |
| |
| /** |
| * Observe sort ascending. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSortAscending(Table component) { |
| return VaadinProperties.accessor(Table.class, "sortAscending").observe( |
| component); |
| } |
| |
| /** |
| * Observe sort container property id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSortContainerPropertyId( |
| Table component) { |
| return VaadinProperties |
| .accessor(Table.class, "sortContainerPropertyId").observe( |
| component); |
| } |
| |
| /** |
| * Observe sort enabled. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSortEnabled(Table component) { |
| return VaadinProperties.accessor(Table.class, "sortEnabled").observe( |
| component); |
| } |
| |
| /** |
| * Observe visible. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeVisible(Table component) { |
| return VaadinProperties.accessor(Table.class, "visible").observe( |
| component); |
| } |
| |
| /** |
| * Observe selected tab. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSelectedTab(TabSheet component) { |
| return VaadinProperties.selectedTab().observe(component); |
| } |
| |
| /** |
| * Observe tab index. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTabIndex(TabSheet component) { |
| return VaadinProperties.accessor(TabSheet.class, "tabIndex").observe( |
| component); |
| } |
| |
| /** |
| * Observe tab caption. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTabCaption(Tab component) { |
| return VaadinProperties.accessor(Tab.class, "caption").observe( |
| component); |
| } |
| |
| /** |
| * Observe tab description. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTabDescription(Tab component) { |
| return VaadinProperties.accessor(Tab.class, "description").observe( |
| component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(TextArea component) { |
| return VaadinProperties.accessor(TextArea.class, "rows").observe( |
| component); |
| } |
| |
| /** |
| * Observe word wrap. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeWordWrap(TextArea component) { |
| return VaadinProperties.accessor(TextArea.class, "wordWrap").observe( |
| component); |
| } |
| |
| /** |
| * Observe text change event mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTextChangeEventMode( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, |
| "textChangeEventMode").observe(component); |
| } |
| |
| /** |
| * Observe text change timeout. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTextChangeTimeout( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, |
| "textChangeTimeout").observe(component); |
| } |
| |
| /** |
| * Observe columns. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColumns( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, "columns") |
| .observe(component); |
| } |
| |
| /** |
| * Observe cursor position. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCursorPosition( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, |
| "cursorPosition").observe(component); |
| } |
| |
| /** |
| * Observe input prompt. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeInputPrompt( |
| AbstractTextField component) { |
| return VaadinProperties |
| .accessor(AbstractTextField.class, "inputPrompt").observe( |
| component); |
| } |
| |
| /** |
| * Observe max length. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMaxLength( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, "maxLength") |
| .observe(component); |
| } |
| |
| /** |
| * Observe null representation. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNullRepresentation( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, |
| "nullRepresentation").observe(component); |
| } |
| |
| /** |
| * Observe null setting allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNullSettingAllowed( |
| AbstractTextField component) { |
| return VaadinProperties.accessor(AbstractTextField.class, |
| "nullSettingAllowed").observe(component); |
| } |
| |
| /** |
| * Observe drag mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDragMode(Tree component) { |
| return VaadinProperties.accessor(Tree.class, "dragMode").observe( |
| component); |
| } |
| |
| /** |
| * Observe drop handler. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDropHandler(Tree component) { |
| return VaadinProperties.accessor(Tree.class, "dropHandler").observe( |
| component); |
| } |
| |
| /** |
| * Observe item description generator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemDescriptionGenerator( |
| Tree component) { |
| return VaadinProperties |
| .accessor(Tree.class, "itemDescriptionGenerator").observe( |
| component); |
| } |
| |
| /** |
| * Observe item style generator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeItemStyleGenerator( |
| Tree component) { |
| return VaadinProperties.accessor(Tree.class, "itemStyleGenerator") |
| .observe(component); |
| } |
| |
| /** |
| * Observe multi select mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMultiSelectMode(Tree component) { |
| return VaadinProperties.accessor(Tree.class, "multiSelectMode") |
| .observe(component); |
| } |
| |
| /** |
| * Observe selectable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSelectable(Tree component) { |
| return VaadinProperties.accessor(Tree.class, "selectable").observe( |
| component); |
| } |
| |
| /** |
| * Observe selectable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSelectable(TreeTable component) { |
| return VaadinProperties.accessor(TreeTable.class, "animationsEnabled") |
| .observe(component); |
| } |
| |
| /** |
| * Observe hierachy column id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHierachyColumnId( |
| TreeTable component) { |
| return VaadinProperties.accessor(TreeTable.class, "hierachyColumnId") |
| .observe(component); |
| } |
| |
| /** |
| * Observe rows. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRows(TwinColSelect component) { |
| return VaadinProperties.accessor(TwinColSelect.class, "rows").observe( |
| component); |
| } |
| |
| /** |
| * Observe left column caption. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeLeftColumnCaption( |
| TwinColSelect component) { |
| return VaadinProperties.accessor(TwinColSelect.class, |
| "leftColumnCaption").observe(component); |
| } |
| |
| /** |
| * Observe right column caption. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeRightColumnCaption( |
| TwinColSelect component) { |
| return VaadinProperties.accessor(TwinColSelect.class, |
| "rightColumnCaption").observe(component); |
| } |
| |
| /** |
| * Observe invalid allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeInvalidAllowed( |
| Validatable component) { |
| return VaadinProperties.accessor(Validatable.class, "invalidAllowed") |
| .observe(component); |
| } |
| |
| /** |
| * Observe indeterminate. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeIndeterminate( |
| ProgressIndicator component) { |
| return VaadinProperties.accessor(ProgressIndicator.class, |
| "indeterminate").observe(component); |
| } |
| |
| /** |
| * Observe polling interval. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePollingInterval( |
| ProgressIndicator component) { |
| return VaadinProperties.accessor(ProgressIndicator.class, |
| "pollingInterval").observe(component); |
| } |
| |
| /** |
| * Observe null representation. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNullRepresentation( |
| RichTextArea component) { |
| return VaadinProperties.accessor(RichTextArea.class, |
| "nullRepresentation").observe(component); |
| } |
| |
| /** |
| * Observe null setting allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNullSettingAllowed( |
| RichTextArea component) { |
| return VaadinProperties.accessor(RichTextArea.class, |
| "nullSettingAllowed").observe(component); |
| } |
| |
| /** |
| * Observe max. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMax(Slider component) { |
| return VaadinProperties.accessor(Slider.class, "max") |
| .observe(component); |
| } |
| |
| /** |
| * Observe min. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMin(Slider component) { |
| return VaadinProperties.accessor(Slider.class, "min") |
| .observe(component); |
| } |
| |
| /** |
| * Observe orientation. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeOrientation(Slider component) { |
| return VaadinProperties.accessor(Slider.class, "orientation").observe( |
| component); |
| } |
| |
| /** |
| * Observe resolution. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResolution(Slider component) { |
| return VaadinProperties.accessor(Slider.class, "resolution").observe( |
| component); |
| } |
| |
| /** |
| * Observe alt text. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeAltText(AbstractMedia component) { |
| return VaadinProperties.accessor(AbstractMedia.class, "altText") |
| .observe(component); |
| } |
| |
| /** |
| * Observe autoplay. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeAutoplay(AbstractMedia component) { |
| return VaadinProperties.accessor(AbstractMedia.class, "autoplay") |
| .observe(component); |
| } |
| |
| /** |
| * Observe html content allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHtmlContentAllowed( |
| AbstractMedia component) { |
| return VaadinProperties.accessor(AbstractMedia.class, |
| "htmlContentAllowed").observe(component); |
| } |
| |
| /** |
| * Observe muted. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMuted(AbstractMedia component) { |
| return VaadinProperties.accessor(AbstractMedia.class, "muted").observe( |
| component); |
| } |
| |
| /** |
| * Observe show controls. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeShowControls( |
| AbstractMedia component) { |
| return VaadinProperties.accessor(AbstractMedia.class, "showControls") |
| .observe(component); |
| } |
| |
| /** |
| * Observe poster. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePoster(Video component) { |
| return VaadinProperties.accessor(Video.class, "poster").observe( |
| component); |
| } |
| |
| /** |
| * Observe scroll left. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollLeft(Scrollable component) { |
| return VaadinProperties.accessor(Scrollable.class, "scrollLeft") |
| .observe(component); |
| } |
| |
| /** |
| * Observe scroll top. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollTop(Scrollable component) { |
| return VaadinProperties.accessor(Scrollable.class, "scrollTop") |
| .observe(component); |
| } |
| |
| /** |
| * Observe closable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeClosable(Window component) { |
| return VaadinProperties.accessor(Window.class, "closable").observe( |
| component); |
| } |
| |
| /** |
| * Observe scroll top. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollTop(Window component) { |
| return VaadinProperties.accessor(Window.class, "scrollTop").observe( |
| component); |
| } |
| |
| /** |
| * Observe draggable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDraggable(Window component) { |
| return VaadinProperties.accessor(Window.class, "draggable").observe( |
| component); |
| } |
| |
| /** |
| * Observe modal. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeModal(Window component) { |
| return VaadinProperties.accessor(Window.class, "modal").observe( |
| component); |
| } |
| |
| /** |
| * Observe resizeable. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResizeable(Window component) { |
| return VaadinProperties.accessor(Window.class, "resizable").observe( |
| component); |
| } |
| |
| /** |
| * Observe resize lazy. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResizeLazy(Window component) { |
| return VaadinProperties.accessor(Window.class, "resizeLazy").observe( |
| component); |
| } |
| |
| /** |
| * Observe position x. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePositionX(Window component) { |
| return VaadinProperties.accessor(Window.class, "positionX").observe( |
| component); |
| } |
| |
| /** |
| * Observe position y. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePositionY(Window component) { |
| return VaadinProperties.accessor(Window.class, "positionY").observe( |
| component); |
| } |
| |
| /** |
| * Observe color. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColor(ColorSelector component) { |
| return VaadinProperties.accessor(ColorSelector.class, "color").observe( |
| component); |
| } |
| |
| /** |
| * Observe content. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeContent( |
| SingleComponentContainer component) { |
| return VaadinProperties.accessor(SingleComponentContainer.class, |
| "content").observe(component); |
| } |
| |
| /** |
| * Observe last heartbeat timestamp. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeLastHeartbeatTimestamp( |
| UI component) { |
| return VaadinProperties.accessor(UI.class, "lastHeartbeatTimestamp") |
| .observe(component); |
| } |
| |
| /** |
| * Observe navigator. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeNavigator(UI component) { |
| return VaadinProperties.accessor(UI.class, "navigator").observe( |
| component); |
| } |
| |
| /** |
| * Observe resize lazy. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResizeLazy(UI component) { |
| return VaadinProperties.accessor(UI.class, "resizeLazy").observe( |
| component); |
| } |
| |
| /** |
| * Observe scroll left. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollLeft(UI component) { |
| return VaadinProperties.accessor(UI.class, "scrollLeft").observe( |
| component); |
| } |
| |
| /** |
| * Observe scroll top. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeScrollTop(UI component) { |
| return VaadinProperties.accessor(UI.class, "scrollTop").observe( |
| component); |
| } |
| |
| /** |
| * Observe session. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSession(UI component) { |
| return VaadinProperties.accessor(UI.class, "session") |
| .observe(component); |
| } |
| |
| /** |
| * Observe disable on click. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeDisableOnClick(Button component) { |
| return VaadinProperties.accessor(Button.class, "disableOnClick") |
| .observe(component); |
| } |
| |
| /** |
| * Observe html content allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHtmlContentAllowed( |
| Button component) { |
| return VaadinProperties.accessor(Button.class, "htmlContentAllowed") |
| .observe(component); |
| } |
| |
| /** |
| * Observe color. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColor( |
| ColorPickerGradient component) { |
| return VaadinProperties.colorColorPickerGradient().observe(component); |
| } |
| |
| /** |
| * Observe color. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColor(ColorPickerGrid component) { |
| return VaadinProperties.colorColorPickerGrid().observe(component); |
| } |
| |
| /** |
| * Observe color. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColor( |
| ColorPickerHistory component) { |
| return VaadinProperties.colorColorPickerHistory().observe(component); |
| } |
| |
| /** |
| * Observe color. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeColor( |
| ColorPickerSelect component) { |
| return VaadinProperties.colorColorPickerSelect().observe(component); |
| } |
| |
| /** |
| * Observe alternate text. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeAlternateText(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "alternateText") |
| .observe(component); |
| } |
| |
| /** |
| * Observe archive. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeArchive(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "archive").observe( |
| component); |
| } |
| |
| /** |
| * Observe class id. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeClassId(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "classId").observe( |
| component); |
| } |
| |
| /** |
| * Observe codebase. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCodebase(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "codebase").observe( |
| component); |
| } |
| |
| /** |
| * Observe codetype. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeCodetype(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "codetype").observe( |
| component); |
| } |
| |
| /** |
| * Observe mime type. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMimeType(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "mimeType").observe( |
| component); |
| } |
| |
| /** |
| * Observe source. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeSource(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "source").observe( |
| component); |
| } |
| |
| /** |
| * Observe standby. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeStandby(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "standby").observe( |
| component); |
| } |
| |
| /** |
| * Observe type. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeType(Embedded component) { |
| return VaadinProperties.accessor(Embedded.class, "type").observe( |
| component); |
| } |
| |
| /** |
| * Observe content mode. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeContentMode(Label component) { |
| return VaadinProperties.accessor(Label.class, "contentMode").observe( |
| component); |
| } |
| |
| /** |
| * Observe converter. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeConverter(Label component) { |
| return VaadinProperties.accessor(Label.class, "converter").observe( |
| component); |
| } |
| |
| /** |
| * Observe resource. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeResource(Link component) { |
| return VaadinProperties.accessor(Link.class, "resource").observe( |
| component); |
| } |
| |
| /** |
| * Observe target border. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTargetBorder(Link component) { |
| return VaadinProperties.accessor(Link.class, "targetBorder").observe( |
| component); |
| } |
| |
| /** |
| * Observe target height. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTargetHeight(Link component) { |
| return VaadinProperties.accessor(Link.class, "targetHeight").observe( |
| component); |
| } |
| |
| /** |
| * Observe target name. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTargetName(Link component) { |
| return VaadinProperties.accessor(Link.class, "targetName").observe( |
| component); |
| } |
| |
| /** |
| * Observe target width. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeTargetWidth(Link component) { |
| return VaadinProperties.accessor(Link.class, "targetWidth").observe( |
| component); |
| } |
| |
| /** |
| * Observe auto open. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeAutoOpen(MenuBar component) { |
| return VaadinProperties.accessor(MenuBar.class, "autoOpen").observe( |
| component); |
| } |
| |
| /** |
| * Observe html content allowed. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHtmlContentAllowed( |
| MenuBar component) { |
| return VaadinProperties.accessor(MenuBar.class, "htmlContentAllowed") |
| .observe(component); |
| } |
| |
| /** |
| * Observe more menu item. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeMoreMenuItem(MenuBar component) { |
| return VaadinProperties.accessor(MenuBar.class, "moreMenuItem") |
| .observe(component); |
| } |
| |
| /** |
| * Observe content. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeContent(PopupView component) { |
| return VaadinProperties.accessor(PopupView.class, "content").observe( |
| component); |
| } |
| |
| /** |
| * Observe hide on mouse out. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeHideOnMouseOut( |
| PopupView component) { |
| return VaadinProperties.accessor(PopupView.class, "hideOnMouseOut") |
| .observe(component); |
| } |
| |
| /** |
| * Observe popup visible. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observePopupVisible(PopupView component) { |
| return VaadinProperties.accessor(PopupView.class, "popupVisible") |
| .observe(component); |
| } |
| |
| /** |
| * Button clicks will send the current activation time in ms as Long-value |
| * to the receiver. So the type is long. |
| * |
| * @param button |
| * the button |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeButtonClick(Button button) { |
| return VaadinProperties.buttonClick().observe(button); |
| } |
| |
| /** |
| * Observe button caption. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeButtonCaption(Upload component) { |
| return VaadinProperties.accessor(PopupView.class, "buttonCaption") |
| .observe(component); |
| } |
| |
| /** |
| * Observe receiver. |
| * |
| * @param component |
| * the component |
| * @return the i vaadin observable value |
| */ |
| public static IVaadinObservableValue observeReceiver(Upload component) { |
| return VaadinProperties.accessor(PopupView.class, "receiver").observe( |
| component); |
| } |
| |
| /** |
| * The Class UIRealm. |
| */ |
| private static class UIRealm extends Realm { |
| |
| /** The ui. */ |
| private final UI ui; |
| |
| /** The auto synchronize. */ |
| private boolean autoSynchronize; |
| |
| /** |
| * Instantiates a new UI realm. |
| * |
| * @param ui |
| * the ui |
| * @param autoSynchronize |
| * the auto synchronize |
| */ |
| private UIRealm(UI ui, boolean autoSynchronize) { |
| this.ui = ui; |
| this.autoSynchronize = autoSynchronize; |
| setDefault(this); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.core.databinding.observable.Realm#isCurrent() |
| */ |
| @Override |
| public boolean isCurrent() { |
| return UI.getCurrent() == ui; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.core.databinding.observable.Realm#exec(java.lang.Runnable) |
| */ |
| public void exec(Runnable runnable) { |
| if (isCurrent()) { |
| ui.accessSynchronously(runnable); |
| } else { |
| asyncExec(runnable); |
| } |
| } |
| |
| /** |
| * Checks if is http thread. |
| * |
| * @return true, if is http thread |
| */ |
| private boolean isHttpThread() { |
| return VaadinService.getCurrentRequest() != null; |
| } |
| |
| /** |
| * Makes the realm to the thread default. |
| */ |
| public void makeDefault() { |
| setDefault(this); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.core.databinding.observable.Realm#asyncExec(java.lang.Runnable) |
| */ |
| @Override |
| public void asyncExec(final Runnable runnable) { |
| if(autoSynchronize){ |
| ui.access(runnable); |
| } |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.core.databinding.observable.Realm#timerExec(int, java.lang.Runnable) |
| */ |
| @Override |
| public void timerExec(int milliseconds, final Runnable runnable) { |
| throw new UnsupportedOperationException("Not a valid call!"); |
| } |
| |
| /* (non-Javadoc) |
| * @see java.lang.Object#hashCode() |
| */ |
| @Override |
| public int hashCode() { |
| return (ui == null) ? 0 : ui.hashCode(); |
| } |
| |
| /* (non-Javadoc) |
| * @see java.lang.Object#equals(java.lang.Object) |
| */ |
| @Override |
| public boolean equals(Object obj) { |
| if (this == obj) { |
| return true; |
| } |
| if (obj == null) { |
| return false; |
| } |
| if (getClass() != obj.getClass()) { |
| return false; |
| } |
| final UIRealm other = (UIRealm) obj; |
| if (ui == null) { |
| if (other.ui != null) { |
| return false; |
| } |
| } else if (!ui.equals(other.ui)) { |
| return false; |
| } |
| return true; |
| } |
| } |
| |
| } |