Class DefaultInformationControl
- All Implemented Interfaces:
EventListener,IInformationControl,IInformationControlExtension,IInformationControlExtension3,IInformationControlExtension4,IInformationControlExtension5,DisposeListener,SWTEventListener
IInformationControl.
Displays textual information in a StyledText widget. Before
displaying, the information set to this information control is processed by an
IInformationPresenter.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn information presenter determines the style presentation of information displayed in the default information control.static interfaceAn information presenter determines the style presentation of information displayed in the default information control. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultInformationControl(Shell parent) Creates a default information control with the given shell as parent.DefaultInformationControl(Shell parent, boolean isResizeable) Creates a default information control with the given shell as parent.DefaultInformationControl(Shell parent, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter) Deprecated.As of 3.4, replaced by simpler constructorsDefaultInformationControl(Shell parentShell, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText) Deprecated.As of 3.4, replaced by simpler constructorsDefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter) Deprecated.As of 3.4, replaced byDefaultInformationControl(Shell, DefaultInformationControl.IInformationPresenter)DefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText) Deprecated.As of 3.4, replaced byDefaultInformationControl(Shell, String, DefaultInformationControl.IInformationPresenter)DefaultInformationControl(Shell parent, String statusFieldText) Creates a default information control with the given shell as parent.DefaultInformationControl(Shell parent, String statusFieldText, DefaultInformationControl.IInformationPresenter presenter) Creates a default information control with the given shell as parent.DefaultInformationControl(Shell parent, ToolBarManager toolBarManager) Creates a resizable default information control with the given shell as parent.DefaultInformationControl(Shell parent, ToolBarManager toolBarManager, DefaultInformationControl.IInformationPresenter presenter) Creates a resizable default information control with the given shell as parent.DefaultInformationControl(Shell parent, DefaultInformationControl.IInformationPresenter presenter) Creates a default information control with the given shell as parent. -
Method Summary
Modifier and TypeMethodDescriptionComputes and returns a proposal for the size of this information control depending on the information to present.Computes the trim (status text and tool bar are considered as trim).protected voidcreateContent(Composite parent) Creates the content of the popup window.Returns the rich information control creator for this information control.booleanReturns whether this information control has contents to be displayed.voidsetBackgroundColor(Color background) Sets the background color of this information control.voidsetForegroundColor(Color foreground) Sets the foreground color of this information control.voidsetInformation(String content) Sets the information to be presented by this information control.voidsetVisible(boolean visible) Controls the visibility of this information control.voidwidgetDisposed(DisposeEvent event) Deprecated.As of 3.2, no longer used and calledMethods inherited from class org.eclipse.jface.text.AbstractInformationControl
addDisposeListener, addFocusListener, computeSizeConstraints, containsControl, create, dispose, getBounds, getShell, getSizeConstraints, getToolBarManager, handleDispose, isFocusControl, isResizable, isVisible, removeDisposeListener, removeFocusListener, restoresLocation, restoresSize, setFocus, setLocation, setSize, setSizeConstraints, setStatusText
-
Constructor Details
-
DefaultInformationControl
Creates a default information control with the given shell as parent. An information presenter that can handle simple HTML is used to process the information to be displayed.- Parameters:
parent- the parent shellisResizeable-trueif the control should be resizable- Since:
- 3.4
-
DefaultInformationControl
Creates a default information control with the given shell as parent. An information presenter that can handle simple HTML is used to process the information to be displayed.- Parameters:
parent- the parent shellstatusFieldText- the text to be used in the status field ornullto hide the status field- Since:
- 3.4
-
DefaultInformationControl
public DefaultInformationControl(Shell parent, String statusFieldText, DefaultInformationControl.IInformationPresenter presenter) Creates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shellstatusFieldText- the text to be used in the status field ornullto hide the status fieldpresenter- the presenter to be used, ornullif no presenter should be used- Since:
- 3.4
-
DefaultInformationControl
Creates a resizable default information control with the given shell as parent. An information presenter that can handle simple HTML is used to process the information to be displayed.- Parameters:
parent- the parent shelltoolBarManager- the manager ornullif toolbar is not desired- Since:
- 3.4
-
DefaultInformationControl
public DefaultInformationControl(Shell parent, ToolBarManager toolBarManager, DefaultInformationControl.IInformationPresenter presenter) Creates a resizable default information control with the given shell as parent. The given information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shelltoolBarManager- the manager ornullif toolbar is not desiredpresenter- the presenter to be used, ornullif no presenter should be used- Since:
- 3.4
-
DefaultInformationControl
Creates a default information control with the given shell as parent. No information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shell
-
DefaultInformationControl
public DefaultInformationControl(Shell parent, DefaultInformationControl.IInformationPresenter presenter) Creates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shellpresenter- the presenter to be used
-
DefaultInformationControl
@Deprecated public DefaultInformationControl(Shell parent, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter) Deprecated.As of 3.4, replaced by simpler constructorsCreates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed. The given styles are applied to the created styled text widget.- Parameters:
parent- the parent shellshellStyle- the additional styles for the shellstyle- the additional styles for the styled text widgetpresenter- the presenter to be used
-
DefaultInformationControl
@Deprecated public DefaultInformationControl(Shell parentShell, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText) Deprecated.As of 3.4, replaced by simpler constructorsCreates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed. The given styles are applied to the created styled text widget.- Parameters:
parentShell- the parent shellshellStyle- the additional styles for the shellstyle- the additional styles for the styled text widgetpresenter- the presenter to be usedstatusFieldText- the text to be used in the status field ornullto hide the status field- Since:
- 3.0
-
DefaultInformationControl
@Deprecated public DefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter) Deprecated.As of 3.4, replaced byDefaultInformationControl(Shell, DefaultInformationControl.IInformationPresenter)Creates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shelltextStyles- the additional styles for the styled text widgetpresenter- the presenter to be used
-
DefaultInformationControl
@Deprecated public DefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText) Deprecated.As of 3.4, replaced byDefaultInformationControl(Shell, String, DefaultInformationControl.IInformationPresenter)Creates a default information control with the given shell as parent. The given information presenter is used to process the information to be displayed.- Parameters:
parent- the parent shelltextStyles- the additional styles for the styled text widgetpresenter- the presenter to be usedstatusFieldText- the text to be used in the status field ornullto hide the status field- Since:
- 3.0
-
-
Method Details
-
createContent
Description copied from class:AbstractInformationControlCreates the content of the popup window.Implementors will usually take over
Control.getBackground()andControl.getForeground()fromparent.Implementors must either use the dialog font or override
AbstractInformationControl.computeSizeConstraints(int, int).Implementors are expected to consider
AbstractInformationControl.isResizable(): Iftrue, they should show scrollbars if their content may exceed the size of the information control. Iffalse, they should never show scrollbars.The given
parentcomes with aFillLayout. Subclasses may set a different layout.- Specified by:
createContentin classAbstractInformationControl- Parameters:
parent- the container of the content
-
setInformation
Description copied from class:AbstractInformationControlSets the information to be presented by this information control.The default implementation does nothing. Subclasses must either override this method or implement
IInformationControlExtension2.- Specified by:
setInformationin interfaceIInformationControl- Overrides:
setInformationin classAbstractInformationControl- Parameters:
content- the information to be presented- See Also:
-
setVisible
public void setVisible(boolean visible) Description copied from interface:IInformationControlControls the visibility of this information control.Note: The information control must not grab focus when made visible.
- Specified by:
setVisiblein interfaceIInformationControl- Overrides:
setVisiblein classAbstractInformationControl- Parameters:
visible-trueif the control should be visible
-
computeSizeHint
Description copied from interface:IInformationControlComputes 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.- Specified by:
computeSizeHintin interfaceIInformationControl- Overrides:
computeSizeHintin classAbstractInformationControl- Returns:
- the computed size hint
-
computeTrim
Description copied from class:AbstractInformationControlComputes the trim (status text and tool bar are considered as trim). Subclasses can extend this method to add additional trim (e.g. scroll bars for resizable information controls).- Specified by:
computeTrimin interfaceIInformationControlExtension3- Overrides:
computeTrimin classAbstractInformationControl- Returns:
- The receiver's trim.
xandydenote the upper left corner of the trimming relative to this control's location i.e. this will most likely be negative values.widthandheightrepresent the border sizes (the sum of the horizontal and vertical trimmings, respectively). - See Also:
-
setForegroundColor
Description copied from interface:IInformationControlSets the foreground color of this information control.- Specified by:
setForegroundColorin interfaceIInformationControl- Overrides:
setForegroundColorin classAbstractInformationControl- Parameters:
foreground- the foreground color of this information control
-
setBackgroundColor
Description copied from interface:IInformationControlSets the background color of this information control.- Specified by:
setBackgroundColorin interfaceIInformationControl- Overrides:
setBackgroundColorin classAbstractInformationControl- Parameters:
background- the background color of this information control
-
hasContents
public boolean hasContents()Description copied from interface:IInformationControlExtensionReturns whether this information control has contents to be displayed.- Specified by:
hasContentsin interfaceIInformationControlExtension- Returns:
trueif there is contents to be displayed.
-
widgetDisposed
Deprecated.As of 3.2, no longer used and calledDescription copied from interface:DisposeListenerSent when the widget is disposed.- Specified by:
widgetDisposedin interfaceDisposeListener- Parameters:
event- an event containing information about the dispose- Since:
- 3.0
- See Also:
-
getInformationPresenterControlCreator
Description copied from class:AbstractInformationControlReturns the rich information control creator for this information control.The returned information control creator is used to create an enriched version of this information control, e.g. when the mouse is moved into this control and it needs to be
enrichedor when it needs to be made sticky for other reasons.The returned information control creator must create information controls that implement
IInformationControlExtension3andIInformationControlExtension2, and whoseIInformationControlExtension2.setInput(Object)accepts all inputs that are also supported by this information control.Note that automatic enriching of this information control works only if it also implements
IInformationControlExtension3.This method may be called frequently, so implementors should ensure it returns quickly, e.g. by caching the returned creator.
This default implementation returnsnull. Subclasses may override.- Specified by:
getInformationPresenterControlCreatorin interfaceIInformationControlExtension5- Overrides:
getInformationPresenterControlCreatorin classAbstractInformationControl- Returns:
- the information presenter control creator or
nullto disable enriching
-