|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.text.AbstractInformationControl
org.eclipse.jface.text.DefaultInformationControl
Default implementation of IInformationControl
.
Displays textual information in a StyledText
widget. Before displaying, the information set to this information control is
processed by an IInformationPresenter
.
Nested Class Summary | |
static interface |
DefaultInformationControl.IInformationPresenter
An information presenter determines the style presentation of information displayed in the default information control. |
static interface |
DefaultInformationControl.IInformationPresenterExtension
An information presenter determines the style presentation of information displayed in the default information control. |
Constructor Summary | |
DefaultInformationControl(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,
DefaultInformationControl.IInformationPresenter presenter)
Creates a default information control with the given shell as parent. |
|
DefaultInformationControl(Shell parent,
int textStyles,
DefaultInformationControl.IInformationPresenter presenter)
Deprecated. As of 3.4, replaced by DefaultInformationControl(Shell, DefaultInformationControl.IInformationPresenter) |
|
DefaultInformationControl(Shell parent,
int textStyles,
DefaultInformationControl.IInformationPresenter presenter,
String statusFieldText)
Deprecated. As of 3.4, replaced by DefaultInformationControl(Shell, String, DefaultInformationControl.IInformationPresenter) |
|
DefaultInformationControl(Shell parent,
int shellStyle,
int style,
DefaultInformationControl.IInformationPresenter presenter)
Deprecated. As of 3.4, replaced by simpler constructors |
|
DefaultInformationControl(Shell parentShell,
int shellStyle,
int style,
DefaultInformationControl.IInformationPresenter presenter,
String statusFieldText)
Deprecated. As of 3.4, replaced by simpler constructors |
|
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. |
Method Summary | |
Point |
computeSizeHint()
Computes and returns a proposal for the size of this information control depending on the information to present. |
Rectangle |
computeTrim()
Computes the trim (status text and tool bar are considered as trim). |
protected void |
createContent(Composite parent)
Creates the content of the popup window. |
IInformationControlCreator |
getInformationPresenterControlCreator()
Returns 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
The returned information control creator must create information controls
that implement
Note that automatic enriching of this information control works only if it also implements
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.
This default implementation returns null . |
boolean |
hasContents()
Returns whether this information control has contents to be displayed. |
void |
setBackgroundColor(Color background)
Sets the background color of this information control. |
void |
setForegroundColor(Color foreground)
Sets the foreground color of this information control. |
void |
setInformation(String content)
Sets the information to be presented by this information control. |
void |
setVisible(boolean visible)
Controls the visibility of this information control. |
void |
widgetDisposed(DisposeEvent event)
Sent when the widget is disposed. |
Methods inherited from class org.eclipse.jface.text.AbstractInformationControl |
addDisposeListener, addFocusListener, computeSizeConstraints, containsControl, create, dispose, getBounds, getShell, getSizeConstraints, getToolBarManager, isFocusControl, isResizable, isVisible, removeDisposeListener, removeFocusListener, restoresLocation, restoresSize, setFocus, setLocation, setSize, setSizeConstraints, setStatusText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultInformationControl(Shell parent, boolean isResizeable)
parent
- the parent shellisResizeable
- true
if the control should be resizablepublic DefaultInformationControl(Shell parent, String statusFieldText)
parent
- the parent shellstatusFieldText
- the text to be used in the status field or null
to hide the status fieldpublic DefaultInformationControl(Shell parent, String statusFieldText, DefaultInformationControl.IInformationPresenter presenter)
parent
- the parent shellstatusFieldText
- the text to be used in the status field or null
to hide the status fieldpresenter
- the presenter to be used, or null
if no presenter should be usedpublic DefaultInformationControl(Shell parent, ToolBarManager toolBarManager)
parent
- the parent shelltoolBarManager
- the manager or null
if toolbar is not desiredpublic DefaultInformationControl(Shell parent, ToolBarManager toolBarManager, DefaultInformationControl.IInformationPresenter presenter)
parent
- the parent shelltoolBarManager
- the manager or null
if toolbar is not desiredpresenter
- the presenter to be used, or null
if no presenter should be usedpublic DefaultInformationControl(Shell parent)
parent
- the parent shellpublic DefaultInformationControl(Shell parent, DefaultInformationControl.IInformationPresenter presenter)
parent
- the parent shellpresenter
- the presenter to be usedpublic DefaultInformationControl(Shell parent, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter)
parent
- the parent shellshellStyle
- the additional styles for the shellstyle
- the additional styles for the styled text widgetpresenter
- the presenter to be usedpublic DefaultInformationControl(Shell parentShell, int shellStyle, int style, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText)
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 or null
to hide the status fieldpublic DefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter)
DefaultInformationControl(Shell, DefaultInformationControl.IInformationPresenter)
parent
- the parent shelltextStyles
- the additional styles for the styled text widgetpresenter
- the presenter to be usedpublic DefaultInformationControl(Shell parent, int textStyles, DefaultInformationControl.IInformationPresenter presenter, String statusFieldText)
DefaultInformationControl(Shell, String, DefaultInformationControl.IInformationPresenter)
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 or null
to hide the status fieldMethod Detail |
protected void createContent(Composite parent)
AbstractInformationControl
Implementors will usually take over Control.getBackground()
and
Control.getForeground()
from parent
.
Implementors are expected to consider AbstractInformationControl.isResizable()
: If
true
, they should show scrollbars if their content may
exceed the size of the information control. If false
,
they should never show scrollbars.
The given parent
comes with a FillLayout
.
Subclasses may set a different layout.
createContent
in class AbstractInformationControl
parent
- the container of the contentpublic void setInformation(String content)
AbstractInformationControl
The default implementation does nothing. Subclasses must either override this method
or implement IInformationControlExtension2
.
setInformation
in interface IInformationControl
setInformation
in class AbstractInformationControl
content
- the information to be presentedIInformationControl.setInformation(java.lang.String)
public void setVisible(boolean visible)
IInformationControl
Note: The information control must not grab focus when made visible.
setVisible
in interface IInformationControl
setVisible
in class AbstractInformationControl
public Point computeSizeHint()
IInformationControl
computeSizeHint
in interface IInformationControl
computeSizeHint
in class AbstractInformationControl
public Rectangle computeTrim()
AbstractInformationControl
computeTrim
in interface IInformationControlExtension3
computeTrim
in class AbstractInformationControl
IInformationControlExtension3.computeTrim()
public void setForegroundColor(Color foreground)
IInformationControl
setForegroundColor
in interface IInformationControl
setForegroundColor
in class AbstractInformationControl
public void setBackgroundColor(Color background)
IInformationControl
setBackgroundColor
in interface IInformationControl
setBackgroundColor
in class AbstractInformationControl
public boolean hasContents()
IInformationControlExtension
hasContents
in interface IInformationControlExtension
true
if there is contents to be displayed.public void widgetDisposed(DisposeEvent event)
DisposeListener
widgetDisposed
in interface DisposeListener
event
- an event containing information about the disposeDisposeListener.widgetDisposed(org.eclipse.swt.events.DisposeEvent)
public IInformationControlCreator getInformationPresenterControlCreator()
AbstractInformationControl
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
enriched
or when it needs to be made sticky for other reasons.
The returned information control creator must create information controls
that implement IInformationControlExtension3
and IInformationControlExtension2
,
and whose IInformationControlExtension2.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.
getInformationPresenterControlCreator
in interface IInformationControlExtension5
getInformationPresenterControlCreator
in class AbstractInformationControl
|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.