Class PWWidget

    • Field Detail

      • propertyKey

        private final java.lang.String propertyKey
      • label

        private final java.lang.String label
      • enabler

        protected Enabler enabler
      • controls

        private final java.util.List<org.eclipse.swt.widgets.Control> controls
      • alignment

        private int alignment
      • indent

        private int indent
      • width

        private int width
      • height

        private int height
      • numberOfColumns

        protected int numberOfColumns
      • grabExcessSpace

        private boolean grabExcessSpace
      • singleWidget

        private boolean singleWidget
    • Constructor Detail

      • PWWidget

        protected PWWidget​(java.lang.String label,
                           java.lang.String propertyKey,
                           int numberOfColumns,
                           boolean singleWidget)
        Constructor
        Parameters:
        label - label associated to the widget
        propertyKey - property key binded to the widget
        numberOfColumns - number of columns taken by the widget
        singleWidget - if true, the widget is supposed to be "alone" (used for placement)
    • Method Detail

      • build

        protected abstract org.eclipse.swt.widgets.Control build​(org.eclipse.swt.widgets.Composite parent)
        Build the widget
        Parameters:
        parent - parent composite
        Returns:
        the created control
      • buildLabel

        protected void buildLabel​(org.eclipse.swt.widgets.Composite parent,
                                  int verticalAlignment)
        Build the label associated to the widget
        Parameters:
        parent - parent composite
        verticalAlignment - vertical alignment
      • check

        protected abstract void check()
        Check if the property can be binded to the widget
        Throws:
        java.lang.UnsupportedOperationException - if the property could not be binded to the widget
      • checkAndBuild

        public org.eclipse.swt.widgets.Control checkAndBuild​(org.eclipse.swt.widgets.Composite parent)
        Check if the property can be binded to the widget, then build the widget
        Parameters:
        parent - parent composite
        Returns:
        the created control
      • enableOrDisable

        public boolean enableOrDisable()
        Enable or disable the widget, depending on the associated enabler
      • getAlignment

        public int getAlignment()
        Returns:
        the alignment (GridData.BEGINNING, GridData.CENTER, GridData.END, GridData.FILL)
      • getControls

        public java.util.List<org.eclipse.swt.widgets.Control> getControls()
        Returns:
        the list of controls contained in the widget
      • isGrabExcessSpace

        public boolean isGrabExcessSpace()
        Returns:
        true if the widget should grab the excess space
      • getHeight

        public int getHeight()
        Returns:
        the height of the widget
      • getIndent

        public int getIndent()
        Returns:
        the indentation space of the widget
      • getLabel

        public java.lang.String getLabel()
        Returns:
        the label associated to the widget (may be null)
      • getNumberOfColumns

        public int getNumberOfColumns()
        Returns:
        the number of columns associated to the widget
      • getPropertyKey

        java.lang.String getPropertyKey()
        Returns:
        the propertyKey associated to the widget
      • getWidth

        public int getWidth()
        Returns:
        the width of the widget
      • isSingleWidget

        public boolean isSingleWidget()
        Returns:
        true if the widget is "alone"
      • addControl

        protected void addControl​(org.eclipse.swt.widgets.Control control)
        Adds a control to the list of control contained in the widget
        Parameters:
        control - control to add
      • setAlignment

        public PWWidget setAlignment​(int alignment)
        Parameters:
        alignment - the alignment to set (GridData.BEGINNING, GridData.CENTER, GridData.END, GridData.FILL)
        Returns:
        the widget
      • setEnabler

        public PWWidget setEnabler​(Enabler enabler)
        Parameters:
        enabler - the enabler to set
        Returns:
        the widget
      • setGrabExcessSpace

        public PWWidget setGrabExcessSpace​(boolean grabExcessSpace)
        Parameters:
        grabExcessSpace - true if you want the widget to grab the excess space
        Returns:
        the widget
      • setHeight

        public PWWidget setHeight​(int height)
        Parameters:
        height - the height to set
        Returns:
        the widget
      • setIndent

        public PWWidget setIndent​(int indent)
        Parameters:
        indent - the indentation space to set
        Returns:
        the widget
      • setWidth

        public PWWidget setWidth​(int width)
        Parameters:
        width - the width to set
        Returns:
        the widget