Class OpalItem

  • Direct Known Subclasses:
    ColumnItem, DLItem

    public abstract class OpalItem
    extends java.lang.Object
    Instances of this object are items manipulated by the widgets of the Opal Project. These items are highly customizable, you can set :
    • Background and foreground colors,
    • Font
    • Image
    • Text
    • Height
    You can also store data using the setData methods.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.eclipse.swt.graphics.Color background  
      private java.util.Map<java.lang.String,​java.lang.Object> data  
      private java.lang.Object datum  
      private org.eclipse.swt.graphics.Font font  
      private org.eclipse.swt.graphics.Color foreground  
      private int height  
      private org.eclipse.swt.graphics.Image image  
      private java.lang.String text  
    • Constructor Summary

      Constructors 
      Constructor Description
      OpalItem()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.swt.graphics.Color getBackground()  
      java.lang.Object getData()  
      java.lang.Object getData​(java.lang.String key)  
      org.eclipse.swt.graphics.Font getFont()  
      org.eclipse.swt.graphics.Color getForeground()  
      int getHeight()  
      org.eclipse.swt.graphics.Image getImage()  
      java.lang.String getText()  
      void setBackground​(org.eclipse.swt.graphics.Color background)  
      void setData​(java.lang.Object data)  
      void setData​(java.lang.String key, java.lang.Object value)
      Store a data associated to a given key in this item
      void setFont​(org.eclipse.swt.graphics.Font font)  
      void setForeground​(org.eclipse.swt.graphics.Color foreground)  
      void setHeight​(int height)  
      void setImage​(org.eclipse.swt.graphics.Image image)  
      void setText​(java.lang.String text)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        private final java.util.Map<java.lang.String,​java.lang.Object> data
      • datum

        private java.lang.Object datum
      • background

        private org.eclipse.swt.graphics.Color background
      • font

        private org.eclipse.swt.graphics.Font font
      • foreground

        private org.eclipse.swt.graphics.Color foreground
      • image

        private org.eclipse.swt.graphics.Image image
      • text

        private java.lang.String text
      • height

        private int height
    • Constructor Detail

      • OpalItem

        public OpalItem()
    • Method Detail

      • getBackground

        public org.eclipse.swt.graphics.Color getBackground()
        Returns:
        the background color of the item
      • getData

        public java.lang.Object getData()
        Returns:
        the the data stored in this item
      • getData

        public java.lang.Object getData​(java.lang.String key)
        Parameters:
        key - a key
        Returns:
        the the data stored in this item associated to this key
      • getFont

        public org.eclipse.swt.graphics.Font getFont()
        Returns:
        the font of the item
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground()
        Returns:
        the foreground color of the item
      • getHeight

        public int getHeight()
        Returns:
        the height of the item
      • getImage

        public org.eclipse.swt.graphics.Image getImage()
        Returns:
        the image stored in this item
      • getText

        public java.lang.String getText()
        Returns:
        the text stored in this item
      • setBackground

        public void setBackground​(org.eclipse.swt.graphics.Color background)
        Parameters:
        background - set the background color of this item
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
        Parameters:
        font - set the font of this item
      • setForeground

        public void setForeground​(org.eclipse.swt.graphics.Color foreground)
        Parameters:
        foreground - set the foreground color of this item
      • setHeight

        public void setHeight​(int height)
        Parameters:
        height - set the height of this item
      • setImage

        public void setImage​(org.eclipse.swt.graphics.Image image)
        Parameters:
        image - set the image of this item
      • setText

        public void setText​(java.lang.String text)
        Parameters:
        text - set the text of this item
      • setData

        public void setData​(java.lang.Object data)
        Parameters:
        data - set the data stored in this item
      • setData

        public void setData​(java.lang.String key,
                            java.lang.Object value)
        Store a data associated to a given key in this item
        Parameters:
        key - key
        value - value associated to this key