Eclipse Platform
2.0

org.eclipse.jface.text
Interface IInformationControl

All Known Implementing Classes:
DefaultInformationControl

public interface IInformationControl

Interface of a control presenting information. The information is given in textual form. It can either be the content itself or a description of the content. This specification is left to the implementers of this interface.

The information control may not grap focus when made visible using setVisible(true).

Since:
2.0

Method Summary
 void addDisposeListener(DisposeListener listener)
          Adds the given listener to the list of dispose listeners.
 void addFocusListener(FocusListener listener)
          Adds the given listener to the list of focus listeners.
 Point computeSizeHint()
          Computes and returns a proposal for the size of this information control depending on the information to present.
 void dispose()
          Disposes this information control.
 boolean isFocusControl()
          Returns whether this information control has the focus.
 void removeDisposeListener(DisposeListener listener)
          Removes the given listeners from the list of dispose listeners.
 void removeFocusListener(FocusListener listener)
          Removes the given listeners from the list of focus listeners.
 void setBackgroundColor(Color background)
          Sets the background color of this information control.
 void setFocus()
          Sets the keyboard focus to this information control.
 void setForegroundColor(Color foreground)
          Sets the foreground color of this information control.
 void setInformation(String information)
          Sets the information to be presented in this information control.
 void setLocation(Point location)
          Sets the location of this information control.
 void setSize(int width, int height)
          Sets the size of this information control.
 void setSizeConstraints(int maxWidth, int maxHeight)
          Sets the information control's size constraints.
 void setVisible(boolean visible)
          Controls the visibility of this information control.
 

Method Detail

setInformation

public void setInformation(String information)
Sets the information to be presented in this information control.

Parameters:
information - the information to be presented

setSizeConstraints

public void setSizeConstraints(int maxWidth,
                               int maxHeight)
Sets the information control's size constraints. A constraint value of -1 indicates no constraint. This method is called before computeSizeHint is called.

Parameters:
maxWidth - the maximal width of the control to present the information, or -1 for not constraint
maxHeight - the maximal height of the control to present the information, or -1 for not constraint

computeSizeHint

public 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 returns a size that exceeds them.

Returns:
the computed size hint

setVisible

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

Parameters:
visible - true if the control should be visible

setSize

public 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

public void setLocation(Point location)
Sets the location of this information control.

Parameters:
location - the location

dispose

public void dispose()
Disposes this information control.


addDisposeListener

public 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

public void removeDisposeListener(DisposeListener listener)
Removes the given listeners from the list of dispose listeners. If the listener is not registered this call has no affect.

Parameters:
listener - the listener to be removed

setForegroundColor

public void setForegroundColor(Color foreground)
Sets the foreground color of this information control.

Parameters:
foreground - the foreground color of this information control

setBackgroundColor

public void setBackgroundColor(Color background)
Sets the background color of this information control.

Parameters:
background - the background color of this information control

isFocusControl

public boolean isFocusControl()
Returns whether this information control has the focus.

Returns:
true when the information control has the focus otherwise false

setFocus

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


addFocusListener

public 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.

Parameters:
listener - the listener to be added

removeFocusListener

public void removeFocusListener(FocusListener listener)
Removes the given listeners from the list of focus listeners. If the listener is not registered this call has no affect.

Parameters:
listener - the listener to be removed

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.