Class AttributeFieldWithEdit

  • All Implemented Interfaces:
    com.vaadin.data.HasValue<pl.edu.icm.unity.types.basic.Attribute>, com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.HasComponents, java.io.Serializable, java.lang.Iterable<com.vaadin.ui.Component>

    public class AttributeFieldWithEdit
    extends com.vaadin.ui.CustomField<pl.edu.icm.unity.types.basic.Attribute>
    Custom component displaying a simple, textual attribute and its values, additionally allowing to edit the attribute after clicking an edit button.
    Author:
    K. Benedyczak
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector

        com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.Component

        com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents

        com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
      • Nested classes/interfaces inherited from interface com.vaadin.data.HasValue

        com.vaadin.data.HasValue.ValueChangeEvent<V extends java.lang.Object>, com.vaadin.data.HasValue.ValueChangeListener<V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable

        com.vaadin.server.Sizeable.Unit
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected pl.edu.icm.unity.webui.common.attributes.AttributeHandlerRegistry attrHandlerRegistry  
      protected java.util.Collection<pl.edu.icm.unity.types.basic.AttributeType> attributeTypes  
      protected java.lang.String group  
      • Fields inherited from class com.vaadin.ui.AbstractComponent

        DESIGN_ATTR_PLAIN_TEXT
      • Fields inherited from interface com.vaadin.server.Sizeable

        SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
    • Constructor Summary

      Constructors 
      Constructor Description
      AttributeFieldWithEdit​(pl.edu.icm.unity.MessageSource msg, java.lang.String caption, pl.edu.icm.unity.webui.common.attributes.AttributeHandlerRegistry attrHandlerRegistry, java.util.Collection<pl.edu.icm.unity.types.basic.AttributeType> attributeTypes, java.lang.String group, pl.edu.icm.unity.types.basic.Attribute initial, boolean valuesRequired)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doSetValue​(pl.edu.icm.unity.types.basic.Attribute value)  
      pl.edu.icm.unity.types.basic.Attribute getAttribute()  
      pl.edu.icm.unity.types.basic.Attribute getValue()  
      protected com.vaadin.ui.Component initContent()  
      void setAttribute​(pl.edu.icm.unity.types.basic.Attribute attribute)
      Sets an attribute to be edited
      void setError​(com.vaadin.server.ErrorMessage message)  
      void setFixedType​(pl.edu.icm.unity.types.basic.AttributeType attributeType)
      After call the class will allow to edit only the selected attribute type
      • Methods inherited from class com.vaadin.ui.CustomField

        attach, focus, getContent, getState, getState, getTabIndex, iterator, setFocusDelegate, setHeight, setTabIndex, setWidth
      • Methods inherited from class com.vaadin.ui.AbstractField

        addValueChangeListener, createValueChange, getCustomAttributes, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setValue, setValue, writeDesign
      • Methods inherited from class com.vaadin.ui.AbstractComponent

        addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefined
      • Methods inherited from class com.vaadin.server.AbstractClientConnector

        addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.vaadin.server.ClientConnector

        addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
      • Methods inherited from interface com.vaadin.ui.Component

        addListener, addStyleName, addStyleNames, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesign
      • Methods inherited from interface com.vaadin.shared.Connector

        getConnectorId
      • Methods inherited from interface com.vaadin.data.HasValue

        clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface com.vaadin.server.Sizeable

        getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthFull, setWidthUndefined
    • Field Detail

      • attrHandlerRegistry

        protected pl.edu.icm.unity.webui.common.attributes.AttributeHandlerRegistry attrHandlerRegistry
      • attributeTypes

        protected java.util.Collection<pl.edu.icm.unity.types.basic.AttributeType> attributeTypes
      • group

        protected java.lang.String group
    • Constructor Detail

      • AttributeFieldWithEdit

        public AttributeFieldWithEdit​(pl.edu.icm.unity.MessageSource msg,
                                      java.lang.String caption,
                                      pl.edu.icm.unity.webui.common.attributes.AttributeHandlerRegistry attrHandlerRegistry,
                                      java.util.Collection<pl.edu.icm.unity.types.basic.AttributeType> attributeTypes,
                                      java.lang.String group,
                                      pl.edu.icm.unity.types.basic.Attribute initial,
                                      boolean valuesRequired)
    • Method Detail

      • initContent

        protected com.vaadin.ui.Component initContent()
        Specified by:
        initContent in class com.vaadin.ui.CustomField<pl.edu.icm.unity.types.basic.Attribute>
      • getAttribute

        public pl.edu.icm.unity.types.basic.Attribute getAttribute()
                                                            throws pl.edu.icm.unity.webui.common.FormValidationException
        Throws:
        pl.edu.icm.unity.webui.common.FormValidationException
      • setAttribute

        public void setAttribute​(pl.edu.icm.unity.types.basic.Attribute attribute)
        Sets an attribute to be edited
        Parameters:
        attribute -
      • setFixedType

        public void setFixedType​(pl.edu.icm.unity.types.basic.AttributeType attributeType)
        After call the class will allow to edit only the selected attribute type
        Parameters:
        attributeType -
      • setError

        public void setError​(com.vaadin.server.ErrorMessage message)
      • getValue

        public pl.edu.icm.unity.types.basic.Attribute getValue()
      • doSetValue

        protected void doSetValue​(pl.edu.icm.unity.types.basic.Attribute value)
        Specified by:
        doSetValue in class com.vaadin.ui.AbstractField<pl.edu.icm.unity.types.basic.Attribute>