Interface IInformationControl

    • Method Detail

      • setSizeConstraints

        void setSizeConstraints​(int maxWidth,
                                int maxHeight)
        Sets the information control's size constraints. A constraint value of SWT.DEFAULT indicates no constraint. This method must be called before computeSizeHint() is called.

        Note: An information control which implements IInformationControlExtension3 may ignore this method or use it as hint for its very first appearance.

        Parameters:
        maxWidth - the maximal width of the control to present the information, or SWT.DEFAULT for not constraint
        maxHeight - the maximal height of the control to present the information, or SWT.DEFAULT for not constraint
      • computeSizeHint

        Point computeSizeHint()
        Computes and returns a proposal for the size of this information control depending on the information to present. The method tries to honor known size constraints but might return a size that exceeds them.
        Returns:
        the computed size hint
      • setVisible

        void setVisible​(boolean visible)
        Controls the visibility of this information control.

        Note: The information control must not grab focus when made visible.

        Parameters:
        visible - true if the control should be visible
      • setSize

        void setSize​(int width,
                     int height)
        Sets the size of this information control.
        Parameters:
        width - the width of the control
        height - the height of the control
      • setLocation

        void setLocation​(Point location)
        Sets the location of this information control.
        Parameters:
        location - the location
      • dispose

        void dispose()
        Disposes this information control.
      • addDisposeListener

        void addDisposeListener​(DisposeListener listener)
        Adds the given listener to the list of dispose listeners. If the listener is already registered it is not registered again.
        Parameters:
        listener - the listener to be added
      • removeDisposeListener

        void removeDisposeListener​(DisposeListener listener)
        Removes the given listeners from the list of dispose listeners. If the listener is not registered this call has no effect.
        Parameters:
        listener - the listener to be removed
      • setForegroundColor

        void setForegroundColor​(Color foreground)
        Sets the foreground color of this information control.
        Parameters:
        foreground - the foreground color of this information control
      • setBackgroundColor

        void setBackgroundColor​(Color background)
        Sets the background color of this information control.
        Parameters:
        background - the background color of this information control
      • isFocusControl

        boolean isFocusControl()
        Returns whether this information control (or one of its children) has the focus. The suggested implementation is like this (fShell is this information control's shell):
        return fShell.getDisplay().getActiveShell() == fShell

        Note that implementations of IInformationControlExtension5 are required to use this suggested implementation.

        Returns:
        true when the information control has the focus, otherwise false
      • setFocus

        void setFocus()
        Sets the keyboard focus to this information control.
      • addFocusListener

        void addFocusListener​(FocusListener listener)
        Adds the given listener to the list of focus listeners. If the listener is already registered it is not registered again.

        The suggested implementation is to install listeners for SWT.Activate and SWT.Deactivate on the shell and forward events to the focus listeners. Clients are encouraged to subclass AbstractInformationControl, which does this for free.

        Parameters:
        listener - the listener to be added
      • removeFocusListener

        void removeFocusListener​(FocusListener listener)
        Removes the given listeners from the list of focus listeners. If the listener is not registered this call has no effect.
        Parameters:
        listener - the listener to be removed